Changeset 1371

Show
Ignore:
Timestamp:
14/10/08 16:07:22 (3 months ago)
Author:
perry
Message:

Change detection of lagacypos traces to HDLC.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/format_legacy.c

    r1341 r1371  
    311311static libtrace_linktype_t legacypos_get_link_type( 
    312312                const libtrace_packet_t *packet) { 
    313         /* Is this a cisco hdlc frame? */ 
    314         if ((((uint8_t*)packet->payload)[0] == 0x0F /* Unicast */ 
    315                 || ((uint8_t*)packet->payload)[0] == 0x8F /* Multicast */) 
    316                 && ((uint8_t*)packet->payload)[1] == 0x00 /* control == 0x00 */ 
    317            ) 
    318                 return TRACE_TYPE_HDLC_POS; 
    319         return TRACE_TYPE_PPP; 
     313        /* This code used to look for (0x0F|0x8F 0x00) frames 
     314         * and return TRACE_TYPE_HDLC_POS, otherwise return PPP. 
     315         * However the PPP frames were being decoded using HDLC_POS semantics 
     316         * so when we fixed PPP, this all broke.  I've changed this to always 
     317         * assume HDLC_POS.  If we ever find a trace that does raw PPP over 
     318         * HDLC_POS then this should be changed to detect that it's PPP and  
     319         * do the right thing.  I suspect this is due to an original confusion 
     320         * as to how exactly POS works. 
     321         *  -- Perry Lorier (2008-10-14) 
     322         */ 
     323        return TRACE_TYPE_HDLC_POS; 
    320324} 
    321325