Changeset 29c8666
- Timestamp:
- 11/05/08 16:46:04 (14 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:
- edb844c
- Parents:
- 13fd6e1
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_legacy.c
r8babb98 r29c8666 311 311 static libtrace_linktype_t legacypos_get_link_type( 312 312 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) 322 318 */ 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; 324 324 } 325 325 -
lib/linktypes.c
r121b7e2 r29c8666 44 44 case TRACE_DLT_ATM_RFC1483: return TRACE_TYPE_LLCSNAP; 45 45 case TRACE_DLT_PPP: return TRACE_TYPE_PPP; 46 case TRACE_DLT_PPP_SERIAL: return TRACE_TYPE_POS; 46 47 /* Unhandled */ 47 48 case TRACE_DLT_NULL: /* Raw IP frame with a BSD specific … … 70 71 case TRACE_TYPE_PPP: return TRACE_DLT_PPP; 71 72 case TRACE_TYPE_HDLC_POS: return TRACE_DLT_C_HDLC; 73 /* Theres more than one type of PPP. Who knew? */ 74 case TRACE_TYPE_POS: return TRACE_DLT_PPP_SERIAL; 75 72 76 /* Below here are unsupported conversions */ 73 77 /* Dispite hints to the contrary, there is no DLT … … 84 88 case TRACE_TYPE_80211_PRISM: 85 89 /* Probably == PPP */ 86 case TRACE_TYPE_POS:87 90 /* TODO: We haven't researched these yet */ 88 91 case TRACE_TYPE_AAL5: -
lib/protocols_l2.c
raa22b5b r29c8666 223 223 224 224 if (type) { 225 *type=ntohs(chdlc->ethertype); 225 switch(ntohs(chdlc->ethertype)) { 226 case 0x0021: /* IP */ 227 *type = 0x0800; 228 break; 229 default: 230 printf("Unknown chdlc type: %04x\n",ntohs(chdlc->ethertype)); 231 *type = 0; /* Unknown */ 232 } 226 233 } 227 234 … … 307 314 { 308 315 void *l; 316 assert(linktype != -1); 309 317 switch(linktype) { 310 318 /* Packet Metadata headers, not layer2 headers */ … … 350 358 return trace_get_payload_from_chdlc(link,ethertype, 351 359 remaining); 360 case TRACE_TYPE_POS: 361 return trace_get_payload_from_chdlc(link,ethertype, 362 remaining); 352 363 /* TODO: Unsupported */ 353 case TRACE_TYPE_POS:354 364 case TRACE_TYPE_AAL5: 355 365 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.