Changeset 11c0f44 for lib/protocols_l2.c


Ignore:
Timestamp:
06/18/08 11:06:45 (13 years ago)
Author:
Shane Alcock <salcock@…>
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:
41c254d
Parents:
c5f3398
Message:
  • Added support for skipping past PPPoE headers when calling trace_get_layer3
  • Fixed byte order issues in the libpacketdump PPPoE decoder
  • Fixed PPP header definition to match the RFC definition
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_l2.c

    r35782f6 r11c0f44  
    182182                switch(ntohs(ppp->protocol)) {
    183183                        case 0x0021: *type = 0x0800; break;
     184                        /* If it isn't IP, then it is probably PPP control and
     185                         * I can't imagine anyone caring about that too much
     186                         */
     187                        default: *type = 0; break;
    184188                }
    185189        }
     
    188192        return (void*)((char *)ppp+sizeof(*ppp));
    189193}
     194
     195void *trace_get_payload_from_pppoe(void *link, uint16_t *type,
     196                uint32_t *remaining) {
     197        if (remaining) {
     198                if (*remaining <= sizeof(libtrace_pppoe_t)) {
     199                        *remaining = 0;
     200                        return NULL;
     201                }
     202                *remaining -= sizeof(libtrace_pppoe_t);
     203        }
     204       
     205        /* PPPoE is always followed by PPP */
     206        return trace_get_payload_from_ppp(link + sizeof(libtrace_pppoe_t),
     207                        type, remaining);
     208}
     209       
    190210
    191211typedef struct libtrace_chdlc_t {
Note: See TracChangeset for help on using the changeset viewer.