Changeset 808a478
- Timestamp:
- 04/21/05 09:54:40 (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:
- 4b30586
- Parents:
- 7bb7dda
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rbe02abd r808a478 30 30 31 31 - Version 2.0.16 32 * Ported to OpenBSD 32 33 * Fixed a bug in the event api where it would die instantly 33 34 for offline traces. -
Makefile.am
r6a4997b r808a478 1 SUBDIRS= replacelib1 SUBDIRS=lib 2 2 EXTRA_DIST=examples docs 3 3 … … 9 9 $(RM) -rf autom4te.cache/ 10 10 11 docs: 12 doxygen libtrace.doxygen 13 -
configure.in
r48a6c51 r808a478 4 4 AM_INIT_AUTOMAKE(libtrace,2.0.16) 5 5 6 AC_CONFIG_FILES([Makefile replace/Makefilelib/Makefile])6 AC_CONFIG_FILES([Makefile lib/Makefile]) 7 7 dnl GNU C library 8 8 dnl AC_GNU_SOURCE … … 20 20 AC_HEADER_STDC 21 21 dnl AC_CHECK_HEADERS(errno.h stdlib.h stdio.h assert.h string.h netinet/in.h assert.h errno.h fcntl.h net/ethernet.h netdb.h pcap.h stdio.h stdlib.h string.h sys/stat.h sys/types.h sys/socket.h sys/un.h unistd.h time.h sys/ioctl.h net/bpf.h pcap.h zlib.h pcap-bpf.h) 22 AC_CHECK_HEADERS(pcap.h pcap-bpf.h net/bpf.h zlib.h sys/limits.h stddef.h inttypes.h limits.h dagapi.h ) 22 AC_CHECK_HEADERS(pcap.h pcap-int.h pcap-bpf.h net/bpf.h zlib.h sys/limits.h stddef.h inttypes.h limits.h dagapi.h net/ethernet.h ) 23 24 AC_CHECK_HEADERS(netinet/in.h) 25 26 AC_CHECK_HEADER(net/if.h, 27 AC_DEFINE(HAVE_NET_IF_H,1,[We have net/if.h]), [], 28 [#include <sys/types.h> 29 #include <sys/socket.h> 30 ]) 31 32 33 AC_CHECK_HEADER(netinet/if_ether.h, 34 AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[We have netinet/if_ether.h]), [], 35 [ 36 #include <sys/types.h> 37 #include <sys/socket.h> 38 #include <netinet/in.h> 39 #include <net/if.h> 40 ]) 41 42 AC_CHECK_HEADER(net/if_arp.h, 43 AC_DEFINE(HAVE_NET_IF_ARP_H,1,[We have net/if_arp.h]), [], 44 [ 45 #include <sys/types.h> 46 #include <sys/socket.h> 47 #include <netinet/in.h> 48 #include <net/if.h> 49 ]) 50 23 51 24 52 # Checking for the right bpf header to include … … 42 70 43 71 72 # *BSD doesn't have strndup. Currently provide our own. 44 73 AC_REPLACE_FUNCS(strndup) 74 75 # Earlier versions of pcap don't have pcap_open_dead. EG: the one OpenBSD 76 # ships with. Even Debian Woody is more up to date. 77 AC_CHECK_LIB(pcap,pcap_open_dead,[],[AC_REPLACE_FUNCS([pcap_open_dead])]) 78 45 79 46 80 # Checks for typedefs, structures, and compiler characteristics. … … 149 183 150 184 if test x"$ac_cv_use_pcap" != xno; then 151 ADD_LIBS="$ADD_LIBS -l$ac_cv_use_pcap" 152 ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path" 153 185 ADD_LIBS="$ADD_LIBS -l$ac_cv_use_pcap" 186 154 187 pcap_lib_file="${ac_cv_use_pcap_path}/lib${ac_cv_use_pcap}.so" 155 if test ! -r "$ac_cv_use_pcap_path" -o ! -r "$pcap_lib_file"; then 156 AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.]) 157 AC_MSG_ERROR([Exiting]); 158 fi 188 189 # if the library is in /usr/lib, then just use 190 # AC_CHECK_LIB. 191 if test x"${ac_cv_use_pcap_path}" != x"/usr/lib"; then 192 AC_CHECK_LIB(${ac_cv_use_pcap},pcap_open_live, 193 have_libpcap=yes, 194 have_libpcap=no) 195 196 if test x"${have_libpcap}" != xno; then 197 AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.]) 198 AC_MSG_ERROR([Exiting]); 199 fi 200 else 201 ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path" 202 # if it's not in /usr/lib/, check manually. This isn't nice, 203 # and will probably break. 204 if test ! -r "$ac_cv_use_pcap_path" -o ! -r "$pcap_lib_file"; then 205 AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.]) 206 AC_MSG_ERROR([Exiting]); 207 fi 208 fi 159 209 AC_DEFINE(HAVE_PCAP,1,[Conditional for building PCAP support]) 160 210 else … … 176 226 177 227 if test "$ac_cv_use_zlib" != no; then 178 ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib" 228 ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib" 229 230 zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so" 231 232 # if the library is in /usr/lib/, then just use AC_CHECK_LIB 233 if test x"${ac_cv_use_zlib_path}" != x"/usr/lib"; then 234 AC_CHECK_LIB(${ac_cv_use_zlib}, gzopen, 235 have_libzlib=yes, 236 have_libzlib=no) 237 if test x"{have_libzlib}" != xno; then 238 AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.]) 239 AC_MSG_ERROR([Exiting]); 240 fi 241 else 179 242 ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path" 180 181 zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so" 182 183 if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then184 AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])185 AC_MSG_ERROR([Exiting]);243 # if it's not in /usr/lib/, check manually. This isn't nice 244 # and will probably break. 245 if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then 246 AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.]) 247 AC_MSG_ERROR([Exiting]); 248 fi 186 249 fi 187 188 250 AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support]) 189 251 else -
lib/Makefile.am
r3cfa94a r808a478 4 4 #libtrace_la_SOURCES = trace.c fifo.c fifo.h common.h dagapi.c dagopts.c 5 5 #else 6 libtrace_la_SOURCES = trace.c fifo.c fifo.h common.h 6 libtrace_la_SOURCES = trace.c fifo.c fifo.h common.h 7 7 #endif 8 8 libtrace_la_CFLAGS = @ADD_INCLS@ 9 libtrace_la_LIBADD = @ADD_LIBS@ $(top_builddir)/replace/libreplace.a9 libtrace_la_LIBADD = @ADD_LIBS@ @LTLIBOBJS@ 10 10 libtrace_la_LDFLAGS=-version-info 2:16:0 @ADD_LDFLAGS@ 11 11 -
lib/trace.c
r7bb7dda r808a478 64 64 #include <sys/mman.h> 65 65 #include <unistd.h> 66 #include <net/ethernet.h> 66 67 #ifdef HAVE_NET_IF_ARP_H 68 # include <net/if_arp.h> 69 #endif 70 71 #ifdef HAVE_NET_IF_H 72 # include <net/if.h> 73 #endif 74 75 #ifdef HAVE_NETINET_IN_H 76 # include <netinet/in.h> 77 #endif 78 79 #ifdef HAVE_NET_ETHERNET_H 80 # include <net/ethernet.h> 81 #endif 82 83 #ifdef HAVE_NETINET_IF_ETHER_H 84 # include <netinet/if_ether.h> 85 #endif 86 67 87 #include <time.h> 68 88 #include <sys/ioctl.h> … … 93 113 #if HAVE_PCAP_H 94 114 # include <pcap.h> 115 # ifdef HAVE_PCAP_INT_H 116 # include <pcap-int.h> 117 # endif 95 118 #endif 96 119 … … 894 917 assert(0); 895 918 } 896 return ethptr;919 return (void *)ethptr; 897 920 } 898 921 … … 1222 1245 case PCAP: 1223 1246 pcapptr = (struct pcap_pkthdr *)packet->buffer; 1224 tv = pcapptr->ts; 1247 // ick. FIXME 1248 tv.tv_sec = pcapptr->ts.tv_sec; 1249 tv.tv_usec = pcapptr->ts.tv_usec; 1225 1250 break; 1226 1251 #endif … … 1616 1641 switch (trace_get_link_type(packet)) { 1617 1642 case TRACE_TYPE_ETH: 1618 pcap = pcap_open_dead(DLT_EN10MB, 1500);1643 pcap = (pcap_t *)pcap_open_dead(DLT_EN10MB, 1500); 1619 1644 break; 1645 #ifdef DLT_LINUX_SLL 1620 1646 case TRACE_TYPE_LINUX_SLL: 1621 1647 pcap = pcap_open_dead(DLT_LINUX_SLL, 1500); 1622 1648 break; 1649 #endif 1623 1650 default: 1624 1651 printf("only works for ETH and LINUX_SLL (ppp) at the moment\n");
Note: See TracChangeset
for help on using the changeset viewer.