Changeset 9cc1266 for lib/protocols_transport.c
- Timestamp:
- 02/22/11 10:01:08 (10 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:
- e4e94c38
- Parents:
- ae76c14
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/protocols_transport.c
r3038cd2 r9cc1266 68 68 size_t len = 0; 69 69 70 71 70 /* Just use the cached length if we can */ 71 if (packet->payload_length != -1) 72 return packet->payload_length; 73 74 /* Set to zero so that we can return early without having to 75 * worry about forgetting to update the cached value */ 76 ((libtrace_packet_t *)packet)->payload_length = 0; 72 77 layer = trace_get_layer3(packet, ðertype, &rem); 73 74 78 if (!layer) 75 79 return 0; … … 122 126 } 123 127 128 129 ((libtrace_packet_t *)packet)->payload_length = len; 124 130 return len; 125 131 … … 139 145 140 146 if (!remaining) remaining=&dummy_remaining; 147 148 if (packet->l4_header) { 149 void *link; 150 libtrace_linktype_t linktype; 151 link = trace_get_packet_buffer(packet, &linktype, remaining); 152 if (!link) 153 return NULL; 154 *proto = packet->transport_proto; 155 *remaining -= (packet->l4_header - link); 156 return packet->l4_header; 157 } 141 158 142 159 transport = trace_get_layer3(packet,ðertype,remaining); … … 154 171 (libtrace_ip6_t*)transport, proto,remaining); 155 172 } 156 return transport;173 break; 157 174 case TRACE_ETHERTYPE_IPV6: /* IPv6 */ 158 returntrace_get_payload_from_ip6(175 transport = trace_get_payload_from_ip6( 159 176 (libtrace_ip6_t*)transport, proto, remaining); 177 break; 178 default: 179 *proto = 0; 180 transport = NULL; 181 break; 160 182 161 183 } 162 184 163 *proto=0; 164 return NULL; 185 ((libtrace_packet_t *)packet)->transport_proto = *proto; 186 ((libtrace_packet_t *)packet)->l4_header = transport; 187 188 189 return transport; 165 190 } 166 191
Note: See TracChangeset
for help on using the changeset viewer.