Changeset 11c0f44
- Timestamp:
- 06/18/08 11:06:45 (13 years ago)
- 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
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libtrace.h.in
rae8ec56 r11c0f44 579 579 580 580 /** PPP header */ 581 typedef struct libtrace_pp s581 typedef struct libtrace_ppp 582 582 { 583 uint8_t addres; /**< PPP Address (0xFF - All stations) */ 584 uint8_t header; /**< PPP Control (0x03 - Unnumbered info) */ 583 /* I can't figure out where the hell these two variables come from. They're 584 * definitely not in RFC 1661 which defines PPP. Probably some weird thing 585 * relating to the lack of distinction between PPP, HDLC and CHDLC */ 586 587 /* uint8_t address; */ /**< PPP Address (0xFF - All stations) */ 588 /* uint8_t header; */ /**< PPP Control (0x03 - Unnumbered info) */ 585 589 uint16_t protocol; /**< PPP Protocol (htons(0x0021) - IPv4 */ 586 590 } PACKED libtrace_ppp_t; 591 592 /** PPPoE header */ 593 typedef struct libtrace_pppoe 594 { 595 LT_BITFIELD8 version:4; /**< Protocol version number */ 596 LT_BITFIELD8 type:4; /**< PPPoE Type */ 597 uint8_t code; /**< PPPoE Code */ 598 uint16_t session_id; /**< Session Identifier */ 599 uint16_t length; /**< Total Length of the PPP packet */ 600 } PACKED libtrace_pppoe_t; 587 601 588 602 /** 802.11 header */ -
lib/protocols.h
ra07a0ec r11c0f44 18 18 uint16_t *type, 19 19 uint32_t *remaining); 20 void *trace_get_payload_from_pppoe(void *link, uint16_t *type, 21 uint32_t *remaining); 20 22 /* l3 definitions */ 21 23 struct ports_t { -
lib/protocols_l2.c
r35782f6 r11c0f44 182 182 switch(ntohs(ppp->protocol)) { 183 183 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; 184 188 } 185 189 } … … 188 192 return (void*)((char *)ppp+sizeof(*ppp)); 189 193 } 194 195 void *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 190 210 191 211 typedef struct libtrace_chdlc_t { -
lib/protocols_l3.c
r3a87f4f r11c0f44 153 153 for(;;) { 154 154 if (!iphdr || *remaining == 0) 155 return NULL;155 break; 156 156 switch(*ethertype) { 157 157 case 0x8100: /* VLAN */ … … 167 167 iphdr,ethertype,remaining); 168 168 } 169 continue; 170 case 0x8864: /* PPPoE */ 171 iphdr = trace_get_payload_from_pppoe(iphdr, ethertype, 172 remaining); 169 173 continue; 170 174 default: -
libpacketdump/eth_34916.c
r11a7f9c r11c0f44 27 27 printf(" PPPoE: Type: %d\n",pppoe->type); 28 28 printf(" PPPoE: Code: %d\n",pppoe->code); 29 printf(" PPPoE: Session: %d\n", pppoe->session);30 printf(" PPPoE: Length: %d\n", pppoe->length);29 printf(" PPPoE: Session: %d\n",ntohs(pppoe->session)); 30 printf(" PPPoE: Length: %d\n",ntohs(pppoe->length)); 31 31 32 32 /* Meh.. pass it off to eth decoder */
Note: See TracChangeset
for help on using the changeset viewer.