Changeset afaf6e8 for test/test-convert.c
- Timestamp:
- 10/24/12 13:40:06 (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:
- 0a8eb88
- Parents:
- 64d4398
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/test-convert.c
r10cf089 rafaf6e8 90 90 if (!strcmp(type, "tsh")) 91 91 return "tsh:traces/10_packets.tsh.gz"; 92 if (!strcmp(type, "sll1")) 93 return "pcapfile:traces/sll.pcap.gz"; 94 if (!strcmp(type, "sll2")) 95 return "pcapfile:traces/100_sll.pcap"; 92 96 return "unknown"; 93 97 } … … 105 109 return "duck:traces/100_packets.out.duck"; 106 110 return "unknown"; 111 } 112 113 114 static int length_changed(libtrace_packet_t *packet, 115 libtrace_packet_t *packet2) { 116 117 uint16_t cap_len_1 = trace_get_capture_length(packet); 118 uint16_t cap_len_2 = trace_get_capture_length(packet2); 119 uint16_t wlen_1 = trace_get_wire_length(packet); 120 uint16_t wlen_2 = trace_get_wire_length(packet2); 121 122 /* Special case where we demoted a packet */ 123 if (trace_get_link_type(packet) == TRACE_TYPE_LINUX_SLL && 124 trace_get_link_type(packet2) != TRACE_TYPE_LINUX_SLL) { 125 126 if (cap_len_2 != cap_len_1 - sizeof(libtrace_sll_header_t)) 127 return true; 128 } else { 129 130 if (cap_len_1 != cap_len_2 && cap_len_2 != wlen_2) 131 return true; 132 } 133 134 if (wlen_1 != wlen_2) 135 return true; 136 137 return false; 138 107 139 } 108 140 … … 195 227 } 196 228 /* The capture length might be snapped down to the wire length */ 197 if ( 198 (( trace_get_capture_length(packet) != trace_get_capture_length(packet2) 199 && trace_get_capture_length(packet2) != trace_get_wire_length(packet2))) 200 || (trace_get_wire_length(packet) != trace_get_wire_length(packet2))) { 229 if (length_changed(packet, packet2)) { 201 230 printf("\t%s\t%s\n", 202 231 trace1name,
Note: See TracChangeset
for help on using the changeset viewer.