Changeset 341c38f
- Timestamp:
- 08/25/15 14:48:04 (6 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
- 03aca91
- Parents:
- 54cf135 (diff), 84cdb05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 18 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
INSTALL
r0ae5feb rc24de65 3 3 * >=libpcap-0.8 4 4 * flex and bison 5 6 Strongly recommended: 7 * zlib-dev (for reading and writing compressed traces) 5 * libwandio (get it from http://research.wand.net.nz/software/libwandio.php) 8 6 9 7 Optional: -
Makefile.am
ra2ce0a6 r3a333e2 1 1 LIBPACKETDUMP_DIR = libpacketdump 2 2 TOOLS_DIR = tools 3 WANDIO_DIR=libwandio 4 SUBDIRS = $(WANDIO_DIR) lib $(LIBPACKETDUMP_DIR) $(TOOLS_DIR) docs examples 3 SUBDIRS = lib $(LIBPACKETDUMP_DIR) $(TOOLS_DIR) docs examples 5 4 6 5 ACLOCAL_AMFLAGS = -I m4 -
configure.in
r4007dbb r341c38f 41 41 examples/stats/Makefile examples/tutorial/Makefile examples/parallel/Makefile 42 42 docs/libtrace.doxygen 43 lib/libtrace.h libwandio/Makefile libwandio/tools/wandiocat/Makefile43 lib/libtrace.h 44 44 ]) 45 45 … … 100 100 101 101 LIBPKTDUMP_LIBS="-ltrace " 102 ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib wandio -L\$(abs_top_srcdir)/lib"103 LIBTRACE_LIBS=" -lwandio"102 ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib" 103 LIBTRACE_LIBS="" 104 104 TOOLS_LIBS="" 105 LIBWANDIO_LIBS=""106 105 107 106 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1" … … 201 200 # Checking for libgdc 202 201 AC_CHECK_HEADER(gdc.h,AC_DEFINE(HAVE_LIBGDC,1,[has gdc.h])) 202 203 # Check for libwandio (no longer bundled with libtrace) 204 AC_CHECK_LIB(wandio,wandio_create,wandiofound=1,wandiofound=0) 205 if test "$wandiofound" = 0; then 206 AC_MSG_ERROR(libwandio is required to compile libtrace. If you have installed it in a non-standard location please use LDFLAGS to specify the location of the library. WANDIO can be obtained from http://research.wand.net.nz/software/libwandio.php) 207 else 208 LIBTRACE_LIBS="$LIBTRACE_LIBS -lwandio" 209 TOOLS_LIBS="$TOOLS_LIBS -lwandio" 210 AC_DEFINE([HAVE_LIBWANDIO],1,[compile with libwandio support]) 211 fi 203 212 204 213 # Check for libpcap … … 449 458 450 459 if test "$have_pthread" = 1; then 451 LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lpthread"452 460 AC_DEFINE(HAVE_LIBPTHREAD, 1, [Set to 1 if pthreads are supported]) 453 461 fi … … 551 559 with_ncurses=no] 552 560 ) 553 554 AC_ARG_WITH([bzip2],555 AC_HELP_STRING([--with-bzip2], [build with support for bzip2 compressed files]))556 557 AS_IF([test "x$with_bzip2" != "xno"],558 [559 AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no)560 ], [have_bzip=no])561 562 AS_IF([test "x$have_bzip" = "xyes"], [563 if test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" != "none required"; then564 LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lbz2"565 fi566 with_bzip2=yes567 AC_DEFINE(HAVE_LIBBZ2, 1, "Compiled with bzip2 support")],568 569 [AS_IF([test "x$with_bzip2" = "xyes"],570 [AC_MSG_ERROR([bzip2 requested but not found])])571 AC_DEFINE(HAVE_LIBBZ2, 0, "Compiled with bzip2 support")572 with_bzip2=no]573 )574 575 AC_ARG_WITH([zlib],576 AC_HELP_STRING([--with-zlib], [build with support for zlib compressed files]))577 578 AS_IF([test "x$with_zlib" != "xno"],579 [580 AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no)581 ], [have_zlib=no])582 583 AS_IF([test "x$have_zlib" = "xyes"], [584 if test "$ac_cv_lib_z_deflate" != "none required"; then585 LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lz"586 fi587 AC_DEFINE(HAVE_LIBZ, 1, "Compiled with zlib support")588 with_zlib=yes],589 590 591 [AS_IF([test "x$with_zlib" = "xyes"],592 [AC_MSG_ERROR([zlib requested but not found])])593 AC_DEFINE(HAVE_LIBZ, 0, "Compiled with zlib support")594 with_zlib=no]595 )596 597 AC_ARG_WITH([lzo],598 AC_HELP_STRING([--with-lzo], [build with support for writing lzo compressed files]))599 600 AS_IF([test "x$with_lzo" != "xno"],601 [602 AC_CHECK_LIB(lzo2, lzo1x_1_compress, have_lzo=yes, have_lzo=no)603 ], [have_lzo=no])604 605 AS_IF([test "x$have_lzo" = "xyes"], [606 if test "$ac_cv_lib_lzo2_lzo1x_1_compress" != "none required"; then607 LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llzo2"608 fi609 AC_DEFINE(HAVE_LIBLZO2, 1, "Compiled with lzo2 support")610 with_lzo=yes],611 612 613 [AS_IF([test "x$with_lzo" = "xyes"],614 [AC_MSG_ERROR([lzo requested but not found])])615 AC_DEFINE(HAVE_LIBLZO2, 0, "Compiled with lzo2 support")616 with_lzo=no]617 )618 619 AC_ARG_WITH([lzma],620 AC_HELP_STRING([--with-lzma], [build with support for lzma compressed files]))621 622 AS_IF([test "x$with_lzma" != "xno"],623 [624 AC_CHECK_HEADER(lzma.h, have_lzma=yes, have_lzma=no)625 ], [have_lzma=no])626 627 AS_IF([test "x$have_lzma" = "xyes"], [628 if test "$ac_cv_lib_lzma_code" != "none required"; then629 LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llzma"630 fi631 AC_DEFINE(HAVE_LIBLZMA, 1, "Compiled with lzma support")632 with_lzma=yes],633 634 635 [AS_IF([test "x$with_lzma" = "xyes"],636 [AC_MSG_ERROR([lzma requested but not found])])637 AC_DEFINE(HAVE_LIBLZMA, 0, "Compiled with lzma support")638 with_lzma=no]639 )640 561 641 562 # Define automake conditionals for use in our Makefile.am files … … 649 570 AM_CONDITIONAL([HAVE_LLVM], [test "x$JIT" != "xno" ]) 650 571 AM_CONDITIONAL([HAVE_NCURSES], [test "x$with_ncurses" != "xno"]) 651 AM_CONDITIONAL([HAVE_BZLIB], [test "x$with_bzip2" != "xno"])652 AM_CONDITIONAL([HAVE_ZLIB], [test "x$with_zlib" != "xno"])653 AM_CONDITIONAL([HAVE_LZO], [ test "x$with_lzo" != "xno"])654 AM_CONDITIONAL([HAVE_LZMA], [ test "x$with_lzma" != "xno"])655 572 656 573 # Check for miscellaneous programs … … 662 579 AC_SUBST([LIBTRACE_LIBS]) 663 580 AC_SUBST([LIBPKTDUMP_LIBS]) 664 AC_SUBST([LIBWANDIO_LIBS])665 581 AC_SUBST([TOOLS_LIBS]) 666 582 #AC_SUBST([ADD_LIBS]) … … 704 620 fi 705 621 706 reportopt "Compiled with compressed trace (zlib) support" $with_zlib707 reportopt "Compiled with compressed trace (bz2) support" $with_bzip2708 reportopt "Compiled with compressed trace (lzo write only) support" $with_lzo709 reportopt "Compiled with compressed trace (lzma) support" $with_lzma710 622 if test x"$libtrace_dag" = xtrue; then 711 623 if test "$libtrace_dag_version" = 24; then -
examples/Makefile.examples
rfdb5e98 r3a333e2 1 AM_CFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" \ 2 -I"$(top_srcdir)/libwandio" 3 AM_CXXFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" \ 4 -I"$(top_srcdir)/libwandio" 5 1 AM_CFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" 2 AM_CXXFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" 6 3 AM_LDFLAGS=-L"$(top_srcdir)/lib" -L"$(top_srcdir)/libpacketdump" \ 7 - L"$(top_srcdir)/libwandio" -ltrace -lwandio4 -ltrace -lwandio -
lib/Makefile.am
r7c95027 r341c38f 69 69 endif 70 70 71 AM_CPPFLAGS= @ADD_INCLS@ -I../libwandio71 AM_CPPFLAGS= @ADD_INCLS@ 72 72 libtrace_la_LIBADD = @LIBTRACE_LIBS@ @LTLIBOBJS@ $(DPDKLIBS) 73 73 libtrace_la_LDFLAGS=-version-info @LIBTRACE_MAJOR@:@LIBTRACE_MINOR@:@LIBTRACE_MID@ @ADD_LDFLAGS@ -
lib/format_dag25.c
r6b98325 r341c38f 299 299 300 300 dag_close(dev->fd); 301 if (dev->dev_name)302 free(dev->dev_name);303 301 free(dev); 304 302 } -
lib/format_erf.c
r5ab626a r341c38f 49 49 #include <string.h> 50 50 #include <stdlib.h> 51 51 52 52 53 #ifdef WIN32 … … 135 136 if (packet->trace->format->type==TRACE_FORMAT_ERF) { 136 137 dag_record_t *erfptr = (dag_record_t *)packet->header; 137 switch( erfptr->type) {138 switch((erfptr->type & 0x7f)) { 138 139 case TYPE_ETH: 139 140 case TYPE_DSM_COLOR_ETH: … … 152 153 int erf_get_framing_length(const libtrace_packet_t *packet) 153 154 { 154 return dag_record_size + erf_get_padding(packet); 155 uint16_t extsize = 0; 156 dag_record_t *erfptr = NULL; 157 uint64_t *exthdr = NULL; 158 159 erfptr = (dag_record_t *)packet->header; 160 if ((erfptr->type & 0x80) == 0x80) { 161 /* Extension headers are present */ 162 exthdr = (uint64_t *)((char *)packet->header + dag_record_size); 163 extsize += 8; 164 165 while (*exthdr < (1UL << 31)) { 166 extsize += 8; 167 exthdr ++; 168 assert(extsize <= ntohs(erfptr->rlen)); 169 } 170 } 171 172 173 return dag_record_size + extsize + erf_get_padding(packet); 155 174 } 156 175 … … 186 205 } 187 206 /* Is this a proper typed packet */ 188 if ( erf->type> TYPE_AAL2) {207 if ((erf->type & 0x7f) > TYPE_AAL2) { 189 208 return 0; 190 209 } … … 448 467 449 468 /* Check for loss */ 450 if ( erfptr->type== TYPE_DSM_COLOR_ETH) {469 if ((erfptr->type & 0x7f) == TYPE_DSM_COLOR_ETH) { 451 470 /* No idea how we get this yet */ 452 471 … … 505 524 506 525 /* Unknown/corrupt */ 507 if ((( dag_record_t *)packet->buffer)->type>= TYPE_RAW_LINK) {526 if ((((dag_record_t *)packet->buffer)->type & 0x7f) >= TYPE_RAW_LINK) { 508 527 trace_set_err(libtrace, TRACE_ERR_BAD_PACKET, 509 528 "Corrupt or Unknown ERF type"); … … 684 703 dag_record_t *erfptr = 0; 685 704 erfptr = (dag_record_t *)packet->header; 686 if (erfptr->type != TYPE_LEGACY) 687 return erf_type_to_libtrace(erfptr->type); 705 uint8_t type = (erfptr->type & 0x7f); 706 if (type != TYPE_LEGACY) { 707 /* The top-most bit is now used to indicate the presence of 708 * extension headers :/ */ 709 return erf_type_to_libtrace(type); 710 } 688 711 else { 689 712 /* Sigh, lets start wildly guessing */ -
lib/libtrace.h.in
r652d720 r341c38f 1873 1873 void *trace_get_link(const libtrace_packet_t *packet); 1874 1874 1875 /** Strips layer 2.5 headers from a given packet. 1876 * @param packet The packet to strip headers from. 1877 * 1878 * @return The packet with the requested headers removed (if they were 1879 * present). 1880 * 1881 * This function is intended for removing those pesky layer 2.5 headers 1882 * that are not supported by other packet analysis applications, e.g. VLAN 1883 * and MPLS headers. If successful, the resulting packet will be a simple 1884 * Ethernet-IP-Transport packet that just about anything should be able to 1885 * parse without difficulty. 1886 * 1887 * If this function encounters a layer 2 or 2.5 header that it does not 1888 * support, stripping will cease and the packet returning will be stripped 1889 * up to but not including the unsupported header. 1890 * 1891 * New in libtrace 4.0.0 1892 * 1893 * @note This function only supports stripping headers from Ethernet packets 1894 * for now. Passing in packets of other link types will simply result in 1895 * the original packet being returned unmodified. 1896 * 1897 */ 1898 DLLEXPORT libtrace_packet_t *trace_strip_packet(libtrace_packet_t *packet); 1899 1875 1900 /** Get a pointer to the IPv4 header (if any) for a given packet 1876 1901 * @param packet The packet to get the IPv4 header for -
lib/protocols_l2.c
rf7bcbfb r84cdb05 37 37 #include <assert.h> 38 38 #include <stdlib.h> 39 #include <string.h> 39 40 40 41 … … 97 98 98 99 return (void*)((char *)ethernet + sizeof(*vlanhdr)); 100 101 } 102 103 libtrace_packet_t *trace_strip_packet(libtrace_packet_t *packet) { 104 105 libtrace_ether_t *ethernet; 106 libtrace_linktype_t linktype; 107 uint16_t ethertype; 108 uint32_t remaining; 109 char *nextpayload; 110 uint16_t finalethertype = 0; 111 uint16_t caplen, removed = 0; 112 char *dest; 113 uint8_t done = 0; 114 uint32_t oldrem; 115 116 /* For now, this will just work for Ethernet packets. */ 117 ethernet = (libtrace_ether_t *)trace_get_layer2(packet, 118 &linktype, &remaining); 119 120 if (linktype != TRACE_TYPE_ETH) { 121 return packet; 122 } 123 124 /* No headers to strip, return the original packet */ 125 if (ethernet->ether_type == TRACE_ETHERTYPE_IP || 126 ethernet->ether_type == TRACE_ETHERTYPE_IPV6) { 127 return packet; 128 } 129 130 if (remaining <= sizeof(libtrace_ether_t)) 131 return packet; 132 133 caplen = trace_get_capture_length(packet); 134 ethertype = ntohs(ethernet->ether_type); 135 dest = ((char *)ethernet) + sizeof(libtrace_ether_t); 136 nextpayload = dest; 137 remaining -= sizeof(libtrace_ether_t); 138 139 /* I'd normally use trace_get_layer3 here, but it works out faster 140 * to do it this way (mostly less function call overhead). 141 * 142 * XXX This approach is going to just strip everything between the 143 * Ethernet and IP headers -- is there a use case where someone 144 * might want to selectively strip headers? 145 */ 146 while (!done) { 147 148 if (nextpayload == NULL || remaining == 0) 149 break; 150 151 oldrem = remaining; 152 switch (ethertype) { 153 154 case TRACE_ETHERTYPE_8021Q: 155 nextpayload = (char *)trace_get_payload_from_vlan( 156 nextpayload, 157 ðertype, &remaining); 158 removed += (oldrem - remaining); 159 break; 160 161 case TRACE_ETHERTYPE_MPLS: 162 nextpayload = (char *)trace_get_payload_from_mpls( 163 nextpayload, 164 ðertype, &remaining); 165 removed += (oldrem - remaining); 166 break; 167 case TRACE_ETHERTYPE_PPP_SES: 168 nextpayload = (char *)trace_get_payload_from_pppoe( 169 nextpayload, 170 ðertype, &remaining); 171 removed += (oldrem - remaining); 172 break; 173 174 case TRACE_ETHERTYPE_IP: 175 case TRACE_ETHERTYPE_IPV6: 176 default: 177 if (finalethertype == 0) 178 finalethertype = ethertype; 179 done = true; 180 break; 181 } 182 } 183 184 if (nextpayload != NULL) { 185 186 ethernet->ether_type = ntohs(finalethertype); 187 trace_set_capture_length(packet, caplen - removed); 188 memmove(nextpayload - (dest - (char *)packet->payload), 189 packet->payload, 190 (dest - (char *)packet->payload)); 191 packet->payload = nextpayload - (dest - (char *)packet->payload); 192 packet->l2_header = NULL; 193 } 194 195 return packet; 99 196 100 197 } -
lib/protocols_l3.c
r7baa948 r0277ab8 245 245 } 246 246 247 link = trace_get_layer2(packet,&linktype,remaining); 247 if (packet->l2_header) { 248 link = packet->l2_header; 249 linktype = packet->link_type; 250 *remaining = packet->l2_remaining; 251 } else { 252 link = trace_get_layer2(packet,&linktype,remaining); 253 } 248 254 iphdr = trace_get_payload_from_layer2( 249 255 link, -
libpacketdump/Makefile.am
rbd119b3 r3a333e2 172 172 dist_plugin_DATA = $(TXT_PROTOCOLS) 173 173 174 AM_CPPFLAGS= @ADD_INCLS@ -I../lib -I../libwandio174 AM_CPPFLAGS= @ADD_INCLS@ -I../lib 175 175 176 176 # NOTE: You CANNOT add @LEXLIBS@ here, as they are statically compiled -
tools/Makefile.tools
rfdb5e98 r3a333e2 1 1 2 2 3 AM_CFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" \ 4 -I"$(top_srcdir)/libwandio" 5 AM_CXXFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" \ 6 -I"$(top_srcdir)/libwandio" 7 3 AM_CFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" 4 AM_CXXFLAGS=-I"$(top_srcdir)/lib" -I"$(top_srcdir)/libpacketdump" 8 5 AM_LDFLAGS=-L"$(top_srcdir)/lib" -L"$(top_srcdir)/libpacketdump" \ 9 -L"$(top_srcdir)/libwandio" -ltrace -lwandio@TOOLS_LIBS@6 -ltrace @TOOLS_LIBS@ -
tools/traceanon/traceanon.1
r17f954f r8b12caf 8 8 [ \-p prefix | \-\^\-prefix=prefix ] 9 9 [ \-c key | \-\^\-cryptopan=key ] 10 [ \-f key-file | \-\^\-keyfile=file ] 10 [ \-F key-file | \-\^\-keyfile=file ] 11 [ \-f expr | \-\^\-filter=expr ] 11 12 [ \-z level | \-\^\-compress-level=level ] 12 13 [ \-Z method | \-\^\-compress-type=method ] … … 59 60 .TP 60 61 .PD 0 61 .BI \- f62 .BI \-F 62 63 .TP 63 64 .PD … … 67 68 long. A suitable method of generating a key is by using the command dd to read 68 69 from /dev/urandom. 70 71 .TP 72 .PD 0 73 .BI \-f 74 .TP 75 .PD 76 .BI \-\^\-filter=expr 77 Discard all packets that do not match the BPF expression specified in 'expr'. 78 Filtering is applied *before* any anonymisation occurs, so IP address filters 79 will attempt to match against the original unencrypted addresses. 69 80 70 81 -
tools/traceanon/traceanon.c
r17f954f r4a5678c 9 9 #include <string.h> 10 10 #include <time.h> 11 #include <signal.h> 11 12 #include "ipenc.h" 12 13 13 14 14 static void usage(char *argv0) … … 20 20 "-c --cryptopan=key Encrypt the addresses with the cryptopan\n" 21 21 " prefix preserving\n" 22 "-f --keyfile=file A file containing the cryptopan key\n" 22 "-F --keyfile=file A file containing the cryptopan key\n" 23 "-f --filter=expr Discard all packets that do not match the\n" 24 " provided BPF expression\n" 23 25 "-p --prefix=C.I.D.R/bits Substitute the prefix of the address\n" 24 26 "-H --libtrace-help Print libtrace runtime documentation\n" 25 27 "-z --compress-level Compress the output trace at the specified level\n" 26 "-Z --compress-type Compress the output trace using the specified "28 "-Z --compress-type Compress the output trace using the specified\n" 27 29 " compression algorithm\n" 28 30 ,argv0); 29 31 exit(1); 32 } 33 34 volatile int done=0; 35 36 static void cleanup_signal(int sig) 37 { 38 (void)sig; 39 done=1; 40 trace_interrupt(); 30 41 } 31 42 … … 116 127 struct libtrace_packet_t *packet = trace_create_packet(); 117 128 struct libtrace_out_t *writer = 0; 129 struct libtrace_filter_t *filter = NULL; 118 130 bool enc_source = false; 119 131 bool enc_dest = false; 120 132 char *output = 0; 121 133 int level = -1; 134 char *filterstring = NULL; 122 135 char *compress_type_str=NULL; 123 136 trace_option_compresstype_t compress_type = TRACE_OPTION_COMPRESSTYPE_NONE; 124 137 struct sigaction sigact; 125 138 126 139 if (argc<2) 127 140 usage(argv[0]); 141 142 sigact.sa_handler = cleanup_signal; 143 sigemptyset(&sigact.sa_mask); 144 sigact.sa_flags = SA_RESTART; 145 146 signal(SIGINT,&cleanup_signal); 147 signal(SIGTERM,&cleanup_signal); 128 148 129 149 while (1) { … … 133 153 { "encrypt-dest", 0, 0, 'd' }, 134 154 { "cryptopan", 1, 0, 'c' }, 135 { "cryptopan-file", 1, 0, 'f' }, 155 { "cryptopan-file", 1, 0, 'F' }, 156 { "filter", 1, 0, 'f' }, 136 157 { "prefix", 1, 0, 'p' }, 137 158 { "compress-level", 1, 0, 'z' }, … … 152 173 case 's': enc_source=true; break; 153 174 case 'd': enc_dest =true; break; 175 case 'f': filterstring = optarg; break; 154 176 case 'c': 155 177 if (key!=NULL) { … … 160 182 enc_type = ENC_CRYPTOPAN; 161 183 break; 162 case ' f':184 case 'F': 163 185 if(key != NULL) { 164 186 fprintf(stderr,"You can only have one encryption type and one key\n"); … … 230 252 231 253 254 if (filterstring) { 255 filter = trace_create_filter(filterstring); 256 } 257 232 258 enc_init(enc_type,key); 233 259 … … 279 305 } 280 306 307 if (filter && trace_config(trace, TRACE_OPTION_FILTER, filter) == -1) { 308 trace_perror(trace, "Configuring input filter"); 309 trace_destroy_output(writer); 310 trace_destroy(trace); 311 return 1; 312 } 313 281 314 if (trace_start(trace)==-1) { 282 315 trace_perror(trace,"trace_start"); … … 298 331 int psize; 299 332 psize = trace_read_packet(trace, packet); 300 if (psize == 0) { 301 break; 302 } 303 if (psize < 0) { 304 trace_perror(trace,"read_packet"); 333 if (psize <= 0) { 305 334 break; 306 335 } … … 334 363 break; 335 364 } 336 } 365 366 if (done) 367 break; 368 } 369 if (trace_is_err(trace)) { 370 trace_perror(trace,"read_packet"); 371 } 372 373 if (filter) 374 trace_destroy_filter(filter); 375 337 376 trace_destroy_packet(packet); 338 377 trace_destroy(trace);
Note: See TracChangeset
for help on using the changeset viewer.