Changes in / [d3b6b91:12e6a39]
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_helper.c
r74ecbc7 r8b49230 263 263 { 264 264 iow_t *io = NULL; 265 266 if (level < 0 || level > 9) { 267 trace_set_err_out(trace, TRACE_ERR_UNSUPPORTED_COMPRESS, 268 "Compression level %d is invalid, must be between 0 and 9 inclusive", 269 level); 270 return NULL; 271 } 272 273 if (compress_type < 0 || 274 compress_type >= TRACE_OPTION_COMPRESSTYPE_LAST) { 275 trace_set_err_out(trace, TRACE_ERR_UNSUPPORTED_COMPRESS, 276 "Invalid compression type %d", compress_type); 277 return NULL; 278 } 265 assert(level<10); 266 assert(level>=0); 279 267 280 268 io = wandio_wcreate(trace->uridata, compress_type, level, fileflag); -
lib/format_linux.c
rd1af45d r7a529a9 1020 1020 struct pollfd pollset; 1021 1021 int ret; 1022 unsigned int snaplen;1023 1022 1024 1023 ring_release_frame(libtrace, packet); … … 1049 1048 1050 1049 packet->buffer = header; 1051 1052 /* If a snaplen was configured, automatically truncate the packet to1053 * the desired length.1054 */1055 snaplen=LIBTRACE_MIN(1056 (int)LIBTRACE_PACKET_BUFSIZE-(int)sizeof(*header),1057 (int)FORMAT(libtrace->format_data)->snaplen);1058 1059 TO_TP_HDR(packet->buffer)->tp_snaplen = LIBTRACE_MIN((unsigned int)snaplen, TO_TP_HDR(packet->buffer)->tp_len);1060 1050 1061 1051 /* Move to next buffer */ -
lib/libtrace.h.in
r74ecbc7 rf7bcbfb 1210 1210 TRACE_OPTION_COMPRESSTYPE_ZLIB = 1, /**< GZip Compression */ 1211 1211 TRACE_OPTION_COMPRESSTYPE_BZ2 = 2, /**< BZip2 Compression */ 1212 TRACE_OPTION_COMPRESSTYPE_LZO = 3, /**< LZO Compression */ 1213 TRACE_OPTION_COMPRESSTYPE_LAST 1212 TRACE_OPTION_COMPRESSTYPE_LZO = 3 /**< LZO Compression */ 1214 1213 } trace_option_compresstype_t; 1215 1214 -
test/do-tests.sh
r5692bc4 r47e927a 77 77 78 78 echo \* Testing time conversions 79 echo \* ERF 80 do_test ./test-time erf 81 echo \* pcapfile 82 do_test ./test-time pcapfile 83 echo \* pcapfilens 84 do_test ./test-time pcapfilens 85 echo \* legacyatm 86 do_test ./test-time legacyatm 87 echo \* legacypos 88 do_test ./test-time legacypos 89 echo \* legacyeth 90 do_test ./test-time legacyeth 91 echo \* pcap 92 do_test ./test-time pcap 93 echo \* rawerf 94 do_test ./test-time rawerf 95 echo \* tsh 96 do_test ./test-time tsh 79 do_test ./test-time 97 80 98 81 echo \* Testing directions -
test/test-time.c
r6a38a7e rd5a27e8 51 51 struct libtrace_t *trace; 52 52 53 const char *lookup_uri(const char *type) {54 if (strchr(type,':'))55 return type;56 if (!strcmp(type,"erf"))57 return "erf:traces/100_packets.erf";58 if (!strcmp(type,"rawerf"))59 return "rawerf:traces/100_packets.erf";60 if (!strcmp(type,"pcap"))61 return "pcap:traces/100_packets.pcap";62 if (!strcmp(type,"wtf"))63 return "wtf:traces/wed.wtf";64 if (!strcmp(type,"rtclient"))65 return "rtclient:chasm";66 if (!strcmp(type,"pcapfile"))67 return "pcapfile:traces/100_packets.pcap";68 if (!strcmp(type,"pcapfilens"))69 return "pcapfile:traces/100_packetsns.pcap";70 if (!strcmp(type, "duck"))71 return "duck:traces/100_packets.duck";72 if (!strcmp(type, "legacyatm"))73 return "legacyatm:traces/legacyatm.gz";74 if (!strcmp(type, "legacypos"))75 return "legacypos:traces/legacypos.gz";76 if (!strcmp(type, "legacyeth"))77 return "legacyeth:traces/legacyeth.gz";78 if (!strcmp(type, "tsh"))79 return "tsh:traces/10_packets.tsh.gz";80 return type;81 }82 83 53 void iferr(libtrace_t *trace) 84 54 { … … 91 61 92 62 int main(int argc, char *argv[]) { 93 char *uri = lookup_uri(argv[1]);63 char *uri = "erf:traces/100_packets.erf"; 94 64 int psize = 0; 95 65 int error = 0; … … 106 76 for (;;) { 107 77 double ts; 108 double tsdiff;109 78 struct timeval tv; 110 79 if ((psize = trace_read_packet(trace, packet)) <0) { … … 119 88 tv=trace_get_timeval(packet); 120 89 ts=trace_get_seconds(packet); 121 tsdiff = (tv.tv_sec+tv.tv_usec/1000000.0)-ts; 122 assert(tsdiff > -0.001 && tsdiff < 0.001); 123 90 assert((tv.tv_sec+tv.tv_usec/1000000.0)-ts<.000001); 124 91 } 125 92 trace_destroy_packet(packet);
Note: See TracChangeset
for help on using the changeset viewer.