Changeset 4a207b8 for lib/protocols.c
- Timestamp:
- 03/23/07 16:41:03 (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:
- dbdc23f
- Parents:
- 83f2cbf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/protocols.c
reb1aab2 r4a207b8 206 206 } 207 207 208 void *trace_get_payload_from_p os(void *link,208 void *trace_get_payload_from_ppp(void *link, 209 209 uint16_t *type, uint32_t *remaining) 210 210 { 211 211 /* 64 byte capture. */ 212 libtrace_pos_t *pos = (libtrace_pos_t*)link; 213 214 if (remaining) { 215 if (*remaining < sizeof(libtrace_pos_t)) 216 return NULL; 217 *remaining-=sizeof(libtrace_pos_t); 218 } 219 220 /* This is documented by endace to be an ethertype. The ethertype 221 * however is always ntohs(0x0021), which endace in their own tools 222 * ignore and assume IP, so... 223 */ 224 /*if (type) *type = ntohs(pos->ether_type); */ 225 if (type) *type = ntohs(0x0800); 226 227 return (void*)((char *)pos+sizeof(*pos)); 212 libtrace_ppp_t *ppp = (libtrace_ppp_t*)link; 213 214 if (remaining) { 215 if (*remaining < sizeof(libtrace_ppp_t)) 216 return NULL; 217 *remaining-=sizeof(libtrace_ppp_t); 218 } 219 220 if (type) { 221 switch(ppp->protocol) { 222 case 0x0021: *type = ntohs(0x0800); 223 } 224 } 225 226 return (void*)((char *)ppp+sizeof(*ppp)); 228 227 } 229 228 … … 313 312 case TRACE_TYPE_PFLOG: 314 313 return trace_get_payload_from_pflog(link,type,remaining); 315 case TRACE_TYPE_P OS:316 return trace_get_payload_from_p os(link,type,remaining);314 case TRACE_TYPE_PPP: 315 return trace_get_payload_from_ppp(link,type,remaining); 317 316 case TRACE_TYPE_ATM: 318 317 l=trace_get_payload_from_atm(link,NULL,remaining);
Note: See TracChangeset
for help on using the changeset viewer.