Changeset 530cef6
- Timestamp:
- 10/24/08 09:58:02 (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:
- 4ba74cc
- Parents:
- 8babb98
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libtrace.h.in
r11c0f44 r530cef6 1219 1219 1220 1220 /** Skips over any 802.1q headers, if present. 1221 * @param ethernet A pointer to the payload following an ethernet header 1222 * -usually the result of calling trace_get_payload_from_link 1221 * @param vlan A pointer to the vlan header 1223 1222 * @param[in,out] type The ethernet type, replaced with the vlan ether type 1224 1223 * @param[in,out] remaining Updated with the number of bytes remaining 1225 1224 * 1226 1225 * @return a pointer to the header beyond the vlan header, if present. 1227 * Otherwise, returns the ethernet payload that was passed in1226 * Otherwise, returns NULL 1228 1227 * 1229 1228 * Remaining may be NULL. If Remaining is not NULL it must point to the number … … 1235 1234 * 1236 1235 */ 1237 DLLEXPORT void *trace_get_ vlan_payload_from_ethernet_payload(1238 void * ethernet_payload, uint16_t *type, uint32_t *remaining);1236 DLLEXPORT void *trace_get_payload_from_vlan( 1237 void *vlan, uint16_t *type, uint32_t *remaining); 1239 1238 1240 1239 /** Skips over any MPLS headers, if present. 1241 * @param ethernet_payload A pointer to the payload following an ethernet 1242 * header - usually the result of calling trace_get_payload_from_link 1240 * @param mpls A pointer to the mpls header 1243 1241 * @param[in,out] type The ethernet type, replaced by the ether type of the 1244 1242 * following header - 0x0000 if an Ethernet header is deemed to be next … … 1261 1259 * 1262 1260 */ 1263 DLLEXPORT void *trace_get_ mpls_payload_from_ethernet_payload(1264 void * ethernet_payload, uint16_t *type, uint32_t *remaining);1261 DLLEXPORT void *trace_get_payload_from_mpls( 1262 void *mpls, uint16_t *type, uint32_t *remaining); 1265 1263 1266 1264 /** Gets a pointer to the payload given a pointer to a tcp header -
lib/protocols_l2.c
r11c0f44 r530cef6 31 31 * type is input/output 32 32 */ 33 void *trace_get_ vlan_payload_from_ethernet_payload(void *ethernet, uint16_t *type,33 void *trace_get_payload_from_vlan(void *ethernet, uint16_t *type, 34 34 uint32_t *remaining) 35 35 { … … 50 50 51 51 return (void*)((char *)ethernet + sizeof(*vlanhdr)); 52 } 53 54 return ethernet; 52 } else 53 return NULL; 54 55 55 } 56 56 … … 59 59 * return a type of 0x0000. 60 60 */ 61 void *trace_get_ mpls_payload_from_ethernet_payload(void *ethernet,62 uint 16_t *type, uint32_t *remaining)61 void *trace_get_payload_from_mpls(void *ethernet, uint16_t *type, 62 uint32_t *remaining) 63 63 { 64 64 assert(type != NULL); -
lib/protocols_l3.c
r11c0f44 r530cef6 49 49 void *trans_ptr = 0; 50 50 51 if ((ntohs(ipptr->ip_off) & SW_IP_OFFMASK) != 0) { 51 if (ipptr == NULL) 52 return NULL; 53 54 if ((ntohs(ipptr->ip_off) & SW_IP_OFFMASK) != 0) { 52 55 if (remaining) 53 56 *remaining = 0; … … 76 79 uint8_t nxt = ipptr->nxt; 77 80 81 if (ipptr == NULL) 82 return NULL; 83 78 84 if (remaining) { 79 85 if (*remaining<sizeof(libtrace_ip6_t)) { … … 156 162 switch(*ethertype) { 157 163 case 0x8100: /* VLAN */ 158 iphdr=trace_get_ vlan_payload_from_ethernet_payload(164 iphdr=trace_get_payload_from_vlan( 159 165 iphdr,ethertype,remaining); 160 166 continue; 161 167 case 0x8847: /* MPLS */ 162 iphdr=trace_get_ mpls_payload_from_ethernet_payload(168 iphdr=trace_get_payload_from_mpls( 163 169 iphdr,ethertype,remaining); 164 170
Note: See TracChangeset
for help on using the changeset viewer.