Changeset ed636fb4
- Timestamp:
- 03/17/06 13:44:13 (16 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:
- eea0f87
- Parents:
- 5ad7ad0
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_pcap.c
r85a0d42 red636fb4 300 300 if (packet->trace->format == &pcap || 301 301 packet->trace->format == &pcapint) { 302 pcap_dump((u_char*)OUTPUT.trace.dump,(struct pcap_pkthdr *)packet->header,packet->payload); 302 pcap_dump((u_char*)OUTPUT.trace.dump, 303 (struct pcap_pkthdr *)packet->header, 304 packet->payload); 303 305 } else { 304 306 /* Leave the manual copy as it is, as it gets around … … 309 311 pcap_pkt_hdr.ts.tv_usec = ts.tv_usec; 310 312 pcap_pkt_hdr.caplen = trace_get_capture_length(packet); 311 pcap_pkt_hdr.len = trace_get_wire_length(packet); 313 /* trace_get_wire_length includes FCS, while pcap doesn't */ 314 if (trace_get_link_type(packet)==TRACE_TYPE_ETH) 315 pcap_pkt_hdr.len = trace_get_wire_length(packet)-4; 316 else 317 pcap_pkt_hdr.len = trace_get_wire_length(packet); 312 318 313 319 assert(pcap_pkt_hdr.caplen<65536); … … 409 415 pcapptr = (struct pcap_pkthdr *)packet->header; 410 416 assert(pcapptr->caplen<=65536); 417 411 418 return pcapptr->caplen; 412 419 } … … 415 422 struct pcap_pkthdr *pcapptr = 0; 416 423 pcapptr = (struct pcap_pkthdr *)packet->header; 417 return pcapptr->len; 424 if (packet->type==pcap_dlt_to_rt(DLT_EN10MB)) 425 return pcapptr->len+4; /* Include the missing FCS */ 426 else 427 return pcapptr->len; 418 428 } 419 429 -
lib/libtrace.h
r752709f red636fb4 811 811 * @note Due to the trace being a header capture, or anonymisation this may 812 812 * not be the same as the Capture Len. 813 * @note trace_getwire_length \em{includes} FCS. 813 814 */ 814 815 SIMPLE_FUNCTION
Note: See TracChangeset
for help on using the changeset viewer.