Changeset e5c2bc4
- Timestamp:
- 06/27/06 12:41:26 (15 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:
- 496864e
- Parents:
- 9461526
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r9b8c7ad re5c2bc4 2 2 LIBPACKETDUMP_DIR = libpacketdump 3 3 endif 4 if LIBTRACE_TOOLS5 4 TOOLS_DIR = tools 6 endif7 5 SUBDIRS = lib docs $(LIBPACKETDUMP_DIR) $(TOOLS_DIR) 8 6 -
configure.in
r01b2922 re5c2bc4 33 33 AC_PROG_CXX 34 34 AC_PROG_INSTALL 35 #AC_LIBTOOL_DLOPEN36 35 AC_PROG_LIBTOOL 37 36 AC_PROG_YACC … … 69 68 70 69 AC_CHECK_HEADERS(netinet/in.h) 71 AC_CHECK_HEADER(netpacket/packet.h, 72 libtrace_netpacket_packet_h=true 73 AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[We have netpacket/packet.h]), 74 [libtrace_netpacket_packet_h=false]) 75 70 AC_CHECK_HEADERS(netpacket/packet.h,[ 71 libtrace_netpacket_packet_h=true 72 AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[has net]) 73 ]) 76 74 AC_CHECK_HEADER(net/if.h, 77 AC_DEFINE(HAVE_NET_IF_H,1,[We have net/if.h]), [], 78 [#include <sys/types.h> 79 #include <sys/socket.h> 80 ]) 81 75 AC_DEFINE(HAVE_NET_IF_H,1,[has net/if.h header]),,[ 76 #include <sys/types.h> 77 #include <sys/socket.h> 78 ]) 82 79 83 80 AC_CHECK_HEADER(netinet/ether.h, 84 AC_DEFINE(HAVE_NETINET_ETHER_H,1,[We have netinet/ether.h] 85 ), [], 86 [ 81 AC_DEFINE(HAVE_NETINET_ETHER_H,1,[has netinet/ether.h header]),,[ 87 82 #include <sys/types.h> 88 83 #include <sys/socket.h> … … 92 87 93 88 AC_CHECK_HEADER(netinet/if_ether.h, 94 AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[We have netinet/if_ether.h]), [], 95 [ 89 AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[has netinet/if_ether.h]),,[ 96 90 #include <sys/types.h> 97 91 #include <sys/socket.h> … … 100 94 ]) 101 95 102 AC_CHECK_HEADER(net/if_arp.h, 103 AC_DEFINE(HAVE_NET_IF_ARP_H,1,[We have net/if_arp.h]), [], 104 [ 96 AC_CHECK_HEADER(net/if_arp.h, 97 AC_DEFINE(HAVE_NET_IF_ARP_H,1,[has net/if_arp.h]),,[ 105 98 #include <sys/types.h> 106 99 #include <sys/socket.h> … … 109 102 ]) 110 103 111 112 104 # Checking for the right bpf header to include 113 AC_MSG_CHECKING([where the bpf headers are kept]) 114 echo "" 115 bpfh=no 116 AC_CHECK_HEADER(pcap-bpf.h, 117 [AC_DEFINE([HAVE_PCAP_BPF_H]) bpfh=pcap-bpf.h]) 118 if test $bpfh = no; then 119 AC_CHECK_HEADER(net/bpf.h, 120 [AC_DEFINE([HAVE_NET_BPF_H]) bpfh=net/bpf.h]) 121 fi 122 123 if test $bpfh = no; then 124 AC_MSG_RESULT([No BPF headers, compiling without support for BPF filters]) 125 AC_DEFINE(HAVE_BPF,0,[Conditional for building bpf support]) 126 libtrace_bpf=false 127 else 128 AC_MSG_RESULT([Using $bpfh]) 129 AC_DEFINE(HAVE_BPF,1,[Conditional for building bpf support]) 130 libtrace_bpf=true 131 fi 132 133 134 AC_CHECK_HEADER(gdc.h, 135 [AC_DEFINE(HAVE_GDC_H,1,[Conditional for building with libGDC support]) libtrace_gdc=true], 136 [AC_DEFINE(HAVE_GDC_H,0,[Conditional for building with libGDC support]) libtrace_gdc=false]) 105 AC_CHECK_HEADER(pcap-bpf.h) 106 AC_CHECK_HEADER(net/bpf.h) 107 AC_CHECK_HEADER(gdc.h) 137 108 138 109 # Check to see if we have libdl - *BSD has built-in libdl 139 AC_CHECK_LIB(dl, dlopen, libtrace_dl=true, libtrace_dl=false) 140 if test "$libtrace_dl" = true; then 141 AC_DEFINE(HAVE_LIBDL,1,[Conditional for building with dynamic library support]) 142 ADD_LIBS="$ADD_LIBS -ldl" 143 else 144 AC_DEFINE(HAVE_LIBDL,0,[Conditional for building with dynamic library support]) 145 fi 146 147 148 # Check to see if we have libpcap 149 AC_CHECK_LIB(pcap,pcap_open_live, 150 libtrace_pcap=true, 151 libtrace_pcap=false) 152 153 if test "$libtrace_pcap" = true; then 154 AC_DEFINE(HAVE_PCAP,1,[Conditional for building PCAP support]) 155 ADD_LIBS="$ADD_LIBS -lpcap" 156 else 157 AC_DEFINE(HAVE_PCAP,0,[Conditional for building PCAP support]) 158 fi 159 160 # Only test for these functions if we have PCAP installed 161 if test "$libtrace_pcap" = true; then 162 # Earlier versions of pcap don't have pcap_open_dead. EG: the one 163 # OpenBSD ships with. Even Debian Woody is more up to date. 164 AC_CHECK_LIB(pcap,pcap_open_dead, 165 have_pcap_open_dead=true, 166 have_pcap_open_dead=false) 167 168 if test "$have_pcap_open_dead" = false; then 169 AC_REPLACE_FUNCS(pcap_open_dead) 170 fi 171 172 # Versions of libpcap earlier than 0.8 don't have pcap_dump_flush or 173 # pcap_next_ex 174 AC_CHECK_LIB(pcap,pcap_dump_flush, 175 have_pcap_dump_flush=true, 176 have_pcap_dump_flush=false) 177 178 if test "$have_pcap_dump_flush" = false; then 179 AC_REPLACE_FUNCS(pcap_dump_flush) 180 fi 181 182 AC_CHECK_LIB(pcap,pcap_next_ex, 183 have_pcap_next_ex=true, 184 have_pcap_next_ex=false) 185 186 if test "$have_pcap_next_ex" = false; then 187 AC_REPLACE_FUNCS(pcap_next_ex) 188 fi 189 190 AC_CHECK_LIB(pcap,pcap_inject, 191 AC_DEFINE(HAVE_PCAP_INJECT,1,[pcap has pcap_inject]), 192 have_pcap_inject=false) 193 194 AC_CHECK_LIB(pcap,pcap_sendpacket, 195 AC_DEFINE(HAVE_PCAP_SENDPACKET,1,[pcap has pcap_sendpacket]), 196 have_pcap_sendpacket=false) 197 198 AC_CHECK_LIB(pcap,pcap_setnonblock, 199 AC_DEFINE(HAVE_PCAP_SETNONBLOCK,1,[pcap has pcap_setnonblock]), 200 have_pcap_setnonblock=false) 201 fi 202 110 AC_CHECK_LIB(dl, dlopen) 111 # check pcap 112 AC_CHECK_LIB(pcap,pcap_open_live) 113 AC_REPLACE_FUNCS(pcap_open_dead) 114 AC_REPLACE_FUNCS(pcap_dump_flush) 115 AC_REPLACE_FUNCS(pcap_next_ex) 116 AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock) 203 117 204 118 # configure time options for man pages … … 215 129 ) 216 130 217 # configure time option for building libpacketdump 218 # libpacketdump needs a C++ compiler to build, so we should do some tests 219 # at this point to see if one is installed 220 libtrace_libpacketdump=true 221 AC_ARG_ENABLE(libpacketdump, 222 AC_HELP_STRING([--disable-libpacketdump], 223 [disable building of libpacketdump (enabled by default). libpacketdump needs a c++ compiler to build] ), 224 [ 225 if test "$enableval" = no -o "$enableval" = false 226 then 227 libtrace_libpacketdump=false 228 else 229 libtrace_libpacketdump=true 230 fi 231 ], 232 [ 233 libtrace_libpacketdump=true 234 ]) 235 236 if test "$libtrace_libpacketdump" = true; then 237 AC_LANG_PUSH(C++) 238 AC_MSG_CHECKING([if we can compile C++ ]) 239 AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 240 [[ 241 #include <iostream> 242 ]])], 243 [AC_DEFINE(HAVE_CXX,1,[define to test for presence of a working C++ compiler]) libtrace_cxx=true], 244 [AC_DEFINE(HAVE_CXX,0,[define to test for presence of a working C++ compiler]) libtrace_cxx=false]) 245 246 AC_MSG_RESULT($libtrace_cxx) 247 AC_LANG_POP(C++) 248 249 if test "$libtrace_cxx" = false; then 250 AC_MSG_ERROR([libpacketdump requested, but no C++ compiler found. Build with --disable-libpacketdump if you wish to continue anyway ]) 251 fi 252 fi 253 254 # configure time option for building the libtrace tools 255 # one of the tools requires libpacketdump, so won't build if libpacketdump 256 # hasn't also been built 257 libtrace_tools=true 258 AC_ARG_ENABLE(tools, 259 AC_HELP_STRING([--disable-tools], 260 [disable building of the tools contained in the tools/ directory]), 261 [ 262 if test "$enableval" = no -o "$enableval" = false 263 then 264 libtrace_tools=false 265 else 266 libtrace_tools=true 267 fi 268 269 ], 270 [ 271 libtrace_tools=true 272 ]) 131 AC_PROG_CXX 273 132 274 133 # configure time options for use of DAG cards … … 346 205 fi 347 206 AC_MSG_RESULT($libtrace_dag2_4) 348 else349 AC_DEFINE(HAVE_DAG,0,[conditional for building with DAG support])350 207 fi 351 208 352 353 354 355 356 AC_ARG_WITH([zlib], 357 AC_HELP_STRING([--with-zlib], 358 [name of zlib library (default is z)]), 359 [ac_cv_use_zlib=$withval], 360 [ac_cv_use_zlib=z]) 361 362 AC_ARG_WITH([zlib-path], 363 AC_HELP_STRING([--with-zlib-path], 364 [location of zlib library (default is /usr/lib)]), 365 [ac_cv_use_zlib_path=$withval], 366 [ac_cv_use_zlib_path=/usr/lib]) 367 368 libtrace_zlib=false 369 if test "$ac_cv_use_zlib" != no; then 370 371 zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so" 372 373 # if the library is in /usr/lib/, then just use AC_CHECK_LIB 374 if test x"${ac_cv_use_zlib_path}" == x"/usr/lib"; then 375 AC_CHECK_LIB(${ac_cv_use_zlib}, gzopen, 376 libtrace_zlib=true, 377 libtrace_zlib=false) 378 else 379 ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path" 380 # if it's not in /usr/lib/, check manually. This isn't nice 381 # and will probably break. 382 if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then 383 AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.]) 384 AC_MSG_ERROR([Exiting]); 385 else 386 libtrace_zlib=true 387 fi 388 fi 389 fi 390 391 if test $libtrace_zlib = true; then 392 ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib" 393 AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support]) 394 else 395 AC_DEFINE(HAVE_ZLIB,0,[Conditional for building zlib support]) 396 fi 209 AC_CHECK_LIB(z, gzopen) 397 210 398 211 AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true]) … … 402 215 AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true]) 403 216 AM_CONDITIONAL([LIBPACKETDUMP], [test "$libtrace_libpacketdump" = true]) 404 AM_CONDITIONAL([LIBTRACE_TOOLS], [test "$libtrace_tools" = true])405 217 AM_CONDITIONAL([LIBGDC], [test "$libtrace_gdc" = true]) 406 218 … … 448 260 reportopt "Building man pages/documentation" $libtrace_doxygen 449 261 reportopt "Building libpacketdump" $libtrace_libpacketdump 450 reportopt "Building tools/ directory" $libtrace_tools 451 262 -
lib/format_erf.c
r362c5f2 re5c2bc4 44 44 #include <stdlib.h> 45 45 46 #if HAVE_DAG46 #ifdef HAVE_DAG 47 47 #include <sys/mman.h> 48 48 #endif … … 66 66 static struct libtrace_format_t erf; 67 67 static struct libtrace_format_t rtclient; 68 #if HAVE_DAG68 #ifdef HAVE_DAG 69 69 static struct libtrace_format_t dag; 70 70 #endif … … 76 76 #define INPUT DATA(libtrace)->input 77 77 #define OUTPUT DATAOUT(libtrace)->output 78 #if HAVE_DAG78 #ifdef HAVE_DAG 79 79 #define DAG DATA(libtrace)->dag 80 80 #define DUCK DATA(libtrace)->duck … … 100 100 } seek; 101 101 102 #if HAVE_DAG102 #ifdef HAVE_DAG 103 103 struct { 104 104 uint32_t last_duck; … … 464 464 #ifdef HAVE_DAG 465 465 static int dag_pause_input(libtrace_t *libtrace) { 466 #if DAG_VERSION_2_4466 #ifdef DAG_VERSION_2_4 467 467 dag_stop(INPUT.fd); 468 468 #else … … 510 510 } 511 511 512 #if HAVE_DAG513 #if DAG_VERSION_2_4512 #ifdef HAVE_DAG 513 #ifdef DAG_VERSION_2_4 514 514 static int dag_get_duckinfo(libtrace_t *libtrace, 515 515 libtrace_packet_t *packet) { … … 667 667 668 668 static int dag_start_input(libtrace_t *libtrace) { 669 #if DAG_VERSION_2_4669 #ifdef DAG_VERSION_2_4 670 670 if(dag_start(INPUT.fd) < 0) { 671 671 trace_set_err(libtrace,errno,"Cannot start DAG %s", … … 922 922 923 923 if (packet->trace->format == &erf 924 #if HAVE_DAG924 #ifdef HAVE_DAG 925 925 || packet->trace->format == &dag 926 926 #endif … … 1057 1057 #endif 1058 1058 1059 #if HAVE_DAG1059 #ifdef HAVE_DAG 1060 1060 static void dag_help() { 1061 1061 printf("dag format module: $Revision$\n"); -
lib/format_helper.c
re2aebe7 re5c2bc4 196 196 assert(level<10); 197 197 assert(level>=0); 198 #if HAVE_ZLIB198 #ifdef HAVE_ZLIB 199 199 sprintf(filemode,"wb%d",level); 200 200 #else -
lib/format_legacy.c
re6d963c re5c2bc4 64 64 65 65 #define INPUT DATA(libtrace)->input 66 #if HAVE_DAG67 #define DAG DATA(libtrace)->dag68 #endif69 66 70 67 struct legacy_format_data_t { -
lib/format_pcap.c
rf875681 re5c2bc4 42 42 #include <errno.h> 43 43 44 #if HAVE_PCAP_BPF_H 45 # include <pcap-bpf.h> 46 #else 47 # ifdef HAVE_NET_BPF_H 48 # include <net/bpf.h> 49 # endif 50 #endif 51 52 #if HAVE_PCAP_H 44 #ifdef HAVE_PCAP_H 53 45 # include <pcap.h> 54 46 # ifdef HAVE_PCAP_INT_H … … 57 49 #endif 58 50 59 #if HAVE_PCAP51 #ifdef HAVE_LIBPCAP 60 52 static struct libtrace_format_t pcap; 61 53 static struct libtrace_format_t pcapint; … … 368 360 libtrace->uridata,65536,0,0,NULL); 369 361 } 370 #if HAVE_PCAP_INJECT362 #ifdef HAVE_PCAP_INJECT 371 363 err=pcap_inject(OUTPUT.trace.pcap, 372 364 packet->payload, … … 375 367 err=-1; 376 368 #else 377 #if HAVE_PCAP_SENDPACKET369 #ifdef HAVE_PCAP_SENDPACKET 378 370 err=pcap_sendpacket(OUTPUT.trace.pcap, 379 371 packet->payload, -
lib/format_wag.c
r6fb4dbf re5c2bc4 161 161 void *value) { 162 162 switch(option) { 163 #if HAVE_ZLIB163 #ifdef HAVE_ZLIB 164 164 case TRACE_OPTION_OUTPUT_COMPRESS: 165 165 OPTIONS.zlib.level = *(int*)value; -
lib/libtrace_int.h
re2d5893 re5c2bc4 63 63 #include "rt_protocol.h" 64 64 65 #if HAVE_PCAP_BPF_H65 #ifdef HAVE_PCAP_BPF_H 66 66 # include <pcap-bpf.h> 67 # define HAVE_BPF 1 67 68 #else 68 69 # ifdef HAVE_NET_BPF_H 69 70 # include <net/bpf.h> 71 # define HAVE_BPF 1 70 72 # endif 71 73 #endif 72 74 73 #if HAVE_PCAP_H75 #ifdef HAVE_PCAP_H 74 76 # include <pcap.h> 75 77 # ifdef HAVE_PCAP_INT_H … … 78 80 #endif 79 81 80 #if HAVE_ZLIB_H82 #ifdef HAVE_ZLIB_H 81 83 # include <zlib.h> 82 84 #endif … … 359 361 bool demote_packet(libtrace_packet_t *packet); 360 362 361 #if HAVE_BPF363 #ifdef HAVE_BPF 362 364 /* A type encapsulating a bpf filter 363 365 * This type covers the compiled bpf filter, as well as the original filter … … 370 372 char * filterstring; 371 373 }; 374 #else 375 struct libtrace_filter_t {}; 372 376 #endif 373 377 -
lib/libtraceio.h
re2d5893 re5c2bc4 5 5 #define LIBTRACEIO_H 1 6 6 #include "config.h" 7 #if HAVE_ZLIB7 #ifdef HAVE_ZLIB 8 8 #include <zlib.h> 9 9 #else -
lib/linktypes.c
r0ff6ddf re5c2bc4 1 1 #include "libtrace.h" 2 2 #include "config.h" 3 #ifdef HAVE_PCAP4 #include <pcap.h>5 #endif6 3 7 4 #include "rt_protocol.h" -
lib/malloc.c
re7bc155 re5c2bc4 1 #if HAVE_CONFIG_H1 #ifdef HAVE_CONFIG_H 2 2 # include <config.h> 3 3 #endif -
lib/pcap_dump_flush.c
r77285d9 re5c2bc4 4 4 #include <stdio.h> 5 5 #include <pcap.h> 6 #if HAVE_PCAP_INT_H6 #ifdef HAVE_PCAP_INT_H 7 7 # include <pcap-int.h> 8 8 #else -
lib/pcap_next_ex.c
r77285d9 re5c2bc4 4 4 #include <stdio.h> 5 5 #include <pcap.h> 6 #if HAVE_PCAP_INT_H6 #ifdef HAVE_PCAP_INT_H 7 7 # include <pcap-int.h> 8 8 #else -
lib/pcap_open_dead.c
rf2f47a7 re5c2bc4 4 4 #include <stdio.h> 5 5 #include <pcap.h> 6 #if HAVE_PCAP_INT_H6 #ifdef HAVE_PCAP_INT_H 7 7 # include <pcap-int.h> 8 8 #else -
lib/realloc.c
r8afe034 re5c2bc4 1 #if HAVE_CONFIG_H1 #ifdef HAVE_CONFIG_H 2 2 # include <config.h> 3 3 #endif -
lib/trace.c
rc5ebbaa re5c2bc4 88 88 #include "parse_cmd.h" 89 89 90 #if HAVE_PCAP_BPF_H90 #ifdef HAVE_PCAP_BPF_H 91 91 # include <pcap-bpf.h> 92 92 #else … … 95 95 # endif 96 96 #endif 97 97 98 98 99 #include "libtrace_int.h" … … 227 228 linuxnative_constructor(); 228 229 #endif 229 #ifdef HAVE_ PCAP230 #ifdef HAVE_LIBPCAP 230 231 pcap_constructor(); 231 232 #endif … … 922 923 */ 923 924 DLLEXPORT libtrace_filter_t *trace_create_filter(const char *filterstring) { 924 #if HAVE_BPF925 #ifdef HAVE_BPF 925 926 libtrace_filter_t *filter = (libtrace_filter_t*) 926 927 malloc(sizeof(libtrace_filter_t)); … … 936 937 DLLEXPORT void trace_destroy_filter(libtrace_filter_t *filter) 937 938 { 938 #if HAVE_BPF939 #ifdef HAVE_BPF 939 940 free(filter->filterstring); 940 941 if (filter->flag) … … 953 954 int trace_bpf_compile(libtrace_filter_t *filter, 954 955 const libtrace_packet_t *packet ) { 955 #if HAVE_BPF956 #ifdef HAVE_BPF 956 957 void *linkptr = 0; 957 958 assert(filter); … … 1003 1004 DLLEXPORT int trace_apply_filter(libtrace_filter_t *filter, 1004 1005 const libtrace_packet_t *packet) { 1005 #if HAVE_BPF1006 #ifdef HAVE_BPF 1006 1007 void *linkptr = 0; 1007 1008 int clen = 0; -
swig/Makefile
r6f34090 re5c2bc4 1 CFLAGS=-g -Wall -I/usr/include/python2. 1-I../include -I /usr/lib/perl/5.6.1/CORE/1 CFLAGS=-g -Wall -I/usr/include/python2.3 -I../include -I /usr/lib/perl/5.6.1/CORE/ 2 2 LDDIRS=-L../lib 3 3 LDLIBS=-ltrace -lpcap -lz -
tools/Makefile.am
r0837e57 re5c2bc4 4 4 endif 5 5 6 if LIBTRACE_TOOLS7 6 SUBDIRS=traceanon tracemerge tracesplit $(TRACEDUMP_DIR) tracertstats tracestats 8 7 SUBDIRS+=tracereport 9 else10 SUBDIRS=11 endif12 8 13 9 all-hook:
Note: See TracChangeset
for help on using the changeset viewer.