Ignore:
Timestamp:
11/05/08 16:46:04 (13 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
edb844c
Parents:
13fd6e1
Message:

Deal with PoS traces better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_legacy.c

    r8babb98 r29c8666  
    311311static libtrace_linktype_t legacypos_get_link_type(
    312312                const libtrace_packet_t *packet) {
    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)
     313        /* POS can be PPP over HDLC (DLT_PPP_SERIAL), or it can be
     314         * just straight PPP.  Sigh.
     315         *
     316         * Ref: RFC 1549
     317         *      - Perry Lorier (2008-11-04)
    322318         */
    323         return TRACE_TYPE_HDLC_POS;
     319        if (((char *)packet->payload)[0] == '\xFF'
     320                && ((char*)packet->payload)[1] == '\x03')
     321                return TRACE_TYPE_POS;
     322        else
     323                return TRACE_TYPE_PPP;
    324324}
    325325
Note: See TracChangeset for help on using the changeset viewer.