]> The Tcpdump Group git mirrors - libpcap/blob - configure.in
Explain what valgrindtest does.
[libpcap] / configure.in
1 dnl
2 dnl Copyright (c) 1994, 1995, 1996, 1997
3 dnl The Regents of the University of California. All rights reserved.
4 dnl
5 dnl Process this file with autoconf to produce a configure script.
6 dnl
7
8 #
9 # See
10 #
11 # http://ftp.gnu.org/gnu/config/README
12 #
13 # for the URLs to use to fetch new versions of config.guess and
14 # config.sub.
15 #
16
17 AC_PREREQ(2.61)
18 AC_INIT(pcap.c)
19
20 AC_CANONICAL_SYSTEM
21
22 AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
23 AC_PROG_CC
24 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
25 AC_LBL_SHLIBS_INIT
26 AC_LBL_C_INLINE
27 AC_C___ATTRIBUTE__
28 if test "$ac_cv___attribute__" = "yes"; then
29 AC_C___ATTRIBUTE___UNUSED
30 AC_C___ATTRIBUTE___FORMAT
31 fi
32
33 AC_CHECK_HEADERS(sys/bitypes.h)
34
35 AC_CHECK_TYPE([int8_t], ,
36 [AC_DEFINE([int8_t], [signed char],
37 [Define to `signed char' if int8_t not defined.])],
38 [AC_INCLUDES_DEFAULT
39 #ifdef HAVE_SYS_BITYPES_H
40 #include <sys/bitypes.h>
41 #endif])
42 AC_CHECK_TYPE([u_int8_t], ,
43 [AC_DEFINE([u_int8_t], [unsigned char],
44 [Define to `unsigned char' if u_int8_t not defined.])],
45 [AC_INCLUDES_DEFAULT
46 #ifdef HAVE_SYS_BITYPES_H
47 #include <sys/bitypes.h>
48 #endif])
49 AC_CHECK_TYPE([int16_t], ,
50 [AC_DEFINE([int16_t], [short],
51 [Define to `short' if int16_t not defined.])]
52 [AC_INCLUDES_DEFAULT
53 #ifdef HAVE_SYS_BITYPES_H
54 #include <sys/bitypes.h>
55 #endif])
56 AC_CHECK_TYPE([u_int16_t], ,
57 [AC_DEFINE([u_int16_t], [unsigned short],
58 [Define to `unsigned short' if u_int16_t not defined.])],
59 [AC_INCLUDES_DEFAULT
60 #ifdef HAVE_SYS_BITYPES_H
61 #include <sys/bitypes.h>
62 #endif])
63 AC_CHECK_TYPE([int32_t], ,
64 [AC_DEFINE([int32_t], [int],
65 [Define to `int' if int32_t not defined.])],
66 [AC_INCLUDES_DEFAULT
67 #ifdef HAVE_SYS_BITYPES_H
68 #include <sys/bitypes.h>
69 #endif])
70 AC_CHECK_TYPE([u_int32_t], ,
71 [AC_DEFINE([u_int32_t], [unsigned int],
72 [Define to `unsigned int' if u_int32_t not defined.])],
73 [AC_INCLUDES_DEFAULT
74 #ifdef HAVE_SYS_BITYPES_H
75 #include <sys/bitypes.h>
76 #endif])
77 AC_CHECK_TYPE([int64_t], ,
78 [AC_DEFINE([int64_t], [long long],
79 [Define to `long long' if int64_t not defined.])],
80 [AC_INCLUDES_DEFAULT
81 #ifdef HAVE_SYS_BITYPES_H
82 #include <sys/bitypes.h>
83 #endif])
84 AC_CHECK_TYPE([u_int64_t], ,
85 [AC_DEFINE([u_int64_t], [unsigned long long],
86 [Define to `unsigned long long' if u_int64_t not defined.])],
87 [AC_INCLUDES_DEFAULT
88 #ifdef HAVE_SYS_BITYPES_H
89 #include <sys/bitypes.h>
90 #endif])
91
92 #
93 # Try to arrange for large file support.
94 #
95 AC_SYS_LARGEFILE
96 AC_FUNC_FSEEKO
97
98 dnl
99 dnl Even if <net/bpf.h> were, on all OSes that support BPF, fixed to
100 dnl include <sys/ioccom.h>, and we were to drop support for older
101 dnl releases without that fix, so that pcap-bpf.c doesn't need to
102 dnl include <sys/ioccom.h>, the test program in "AC_LBL_FIXINCLUDES"
103 dnl in "aclocal.m4" uses it, so we would still have to test for it
104 dnl and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
105 dnl "AC_LBL_FIXINCLUDES" wouldn't work on some platforms such as Solaris.
106 dnl
107 AC_CHECK_HEADERS(sys/ioccom.h sys/select.h sys/sockio.h limits.h)
108 AC_CHECK_HEADERS(linux/types.h)
109 AC_CHECK_HEADERS(linux/if_packet.h netpacket/packet.h netpacket/if_packet.h)
110 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
111 #include <sys/socket.h>
112 #include <net/if.h>])
113 if test "$ac_cv_header_net_pfvar_h" = yes; then
114 #
115 # Check for various PF actions.
116 #
117 AC_MSG_CHECKING(whether net/pfvar.h defines PF_NAT through PF_NORDR)
118 AC_TRY_COMPILE(
119 [#include <sys/types.h>
120 #include <sys/socket.h>
121 #include <net/if.h>
122 #include <net/pfvar.h>],
123 [return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR;],
124 [
125 AC_MSG_RESULT(yes)
126 AC_DEFINE(HAVE_PF_NAT_THROUGH_PF_NORDR, 1,
127 [define if net/pfvar.h defines PF_NAT through PF_NORDR])
128 ],
129 AC_MSG_RESULT(no))
130 fi
131 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
132 #include <sys/socket.h>])
133 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
134 #
135 # The simple test didn't work.
136 # Do we need to include <net/if.h> first?
137 # Unset ac_cv_header_netinet_if_ether_h so we don't
138 # treat the previous failure as a cached value and
139 # suppress the next test.
140 #
141 AC_MSG_NOTICE([Rechecking with some additional includes])
142 unset ac_cv_header_netinet_if_ether_h
143 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
144 #include <sys/socket.h>
145 #include <netinet/in.h>
146 struct mbuf;
147 struct rtentry;
148 #include <net/if.h>])
149 fi
150
151 case "$host_os" in
152 linux*|uclinux*)
153 AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,
154 [
155 #include <sys/socket.h>
156 #include <linux/if.h>
157 ])
158 ;;
159 esac
160
161 AC_LBL_FIXINCLUDES
162
163 AC_CHECK_FUNCS(strerror strlcpy)
164
165 needsnprintf=no
166 AC_CHECK_FUNCS(vsnprintf snprintf,,
167 [needsnprintf=yes])
168 if test $needsnprintf = yes; then
169 AC_LIBOBJ([snprintf])
170 fi
171
172 #
173 # Do this before checking for ether_hostton(), as it's a
174 # "gethostbyname() -ish function".
175 #
176 AC_LBL_LIBRARY_NET
177
178 #
179 # You are in a twisty little maze of UN*Xes, all different.
180 # Some might not have ether_hostton().
181 # Some might have it, but not declare it in any header file.
182 # Some might have it, but declare it in <netinet/if_ether.h>.
183 # Some might have it, but declare it in <netinet/ether.h>
184 # (And some might have it but document it as something declared in
185 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
186 #
187 # Before you is a C compiler.
188 #
189 AC_CHECK_FUNCS(ether_hostton)
190 if test "$ac_cv_func_ether_hostton" = yes; then
191 #
192 # OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
193 #
194 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
195 #
196 # Yes. Does it declare ether_hostton()?
197 #
198 AC_CHECK_DECL(ether_hostton,
199 [
200 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
201 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
202 ],,
203 [
204 #include <sys/types.h>
205 #include <sys/socket.h>
206 #include <netinet/in.h>
207 #include <arpa/inet.h>
208 struct mbuf;
209 struct rtentry;
210 #include <net/if.h>
211 #include <netinet/if_ether.h>
212 ])
213 fi
214 #
215 # Did that succeed?
216 #
217 if test "$ac_cv_have_decl_ether_hostton" != yes; then
218 #
219 # No, how about <netinet/ether.h>, as on Linux?
220 #
221 AC_CHECK_HEADERS(netinet/ether.h)
222 if test "$ac_cv_header_netinet_ether_h" = yes; then
223 #
224 # We have it - does it declare ether_hostton()?
225 # Unset ac_cv_have_decl_ether_hostton so we don't
226 # treat the previous failure as a cached value and
227 # suppress the next test.
228 #
229 unset ac_cv_have_decl_ether_hostton
230 AC_CHECK_DECL(ether_hostton,
231 [
232 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
233 [Define to 1 if netinet/ether.h declares `ether_hostton'])
234 ],,
235 [
236 #include <netinet/ether.h>
237 ])
238 fi
239 fi
240 #
241 # Is ether_hostton() declared?
242 #
243 if test "$ac_cv_have_decl_ether_hostton" != yes; then
244 #
245 # No, we'll have to declare it ourselves.
246 # Do we have "struct ether_addr"?
247 #
248 AC_CHECK_TYPES(struct ether_addr,,,
249 [
250 #include <sys/types.h>
251 #include <sys/socket.h>
252 #include <netinet/in.h>
253 #include <arpa/inet.h>
254 struct mbuf;
255 struct rtentry;
256 #include <net/if.h>
257 #include <netinet/if_ether.h>
258 ])
259 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0,
260 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
261 don't.])
262 else
263 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
264 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
265 don't.])
266 fi
267 fi
268
269 dnl to pacify those who hate protochain insn
270 AC_MSG_CHECKING(if --disable-protochain option is specified)
271 AC_ARG_ENABLE(protochain,
272 AC_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
273 case "x$enable_protochain" in
274 xyes) enable_protochain=enabled ;;
275 xno) enable_protochain=disabled ;;
276 x) enable_protochain=enabled ;;
277 esac
278
279 if test "$enable_protochain" = "disabled"; then
280 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
281 fi
282 AC_MSG_RESULT(${enable_protochain})
283
284 #
285 # SITA support is mutually exclusive with native capture support;
286 # "--with-sita" selects SITA support.
287 #
288 AC_ARG_WITH(sita,
289 AC_HELP_STRING([--with-sita],[include SITA support]),
290 [
291 if test ! "x$withval" = "xno" ; then
292 AC_DEFINE(SITA,1,[include ACN support])
293 AC_MSG_NOTICE(Enabling SITA ACN support)
294 V_PCAP=sita
295 V_FINDALLDEVS=sita
296 fi
297 ],
298 [
299 dnl
300 dnl Not all versions of test support -c (character special) but it's a
301 dnl better way of testing since the device might be protected. So we
302 dnl check in our normal order using -r and then check the for the /dev
303 dnl guys again using -c.
304 dnl
305 dnl XXX This could be done for cross-compiling, but for now it's not.
306 dnl
307 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
308 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
309 fi
310 AC_ARG_WITH(pcap,
311 AC_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
312 AC_MSG_CHECKING(packet capture type)
313 if test ! -z "$with_pcap" ; then
314 V_PCAP="$withval"
315 elif test -r /dev/bpf -o -h /dev/bpf ; then
316 #
317 # Cloning BPF device.
318 #
319 V_PCAP=bpf
320 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
321 elif test -r /dev/bpf0 ; then
322 V_PCAP=bpf
323 elif test -r /usr/include/net/pfilt.h ; then
324 V_PCAP=pf
325 elif test -r /dev/enet ; then
326 V_PCAP=enet
327 elif test -r /dev/nit ; then
328 V_PCAP=snit
329 elif test -r /usr/include/sys/net/nit.h ; then
330 V_PCAP=nit
331 elif test -r /usr/include/linux/socket.h ; then
332 V_PCAP=linux
333 elif test -r /usr/include/net/raw.h ; then
334 V_PCAP=snoop
335 elif test -r /usr/include/odmi.h ; then
336 #
337 # On AIX, the BPF devices might not yet be present - they're
338 # created the first time libpcap runs after booting.
339 # We check for odmi.h instead.
340 #
341 V_PCAP=bpf
342 elif test -c /dev/bpf0 ; then # check again in case not readable
343 V_PCAP=bpf
344 elif test -r /usr/include/sys/dlpi.h ; then
345 V_PCAP=dlpi
346 elif test -c /dev/enet ; then # check again in case not readable
347 V_PCAP=enet
348 elif test -c /dev/nit ; then # check again in case not readable
349 V_PCAP=snit
350 else
351 V_PCAP=null
352 fi
353 AC_MSG_RESULT($V_PCAP)
354
355 #
356 # Do capture-mechanism-dependent tests.
357 #
358 case "$V_PCAP" in
359 dlpi)
360 #
361 # Needed for common functions used by pcap-[dlpi,libdlpi].c
362 #
363 SSRC="dlpisubs.c"
364
365 #
366 # Checks for some header files.
367 #
368 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
369
370 #
371 # Checks to see if Solaris has the public libdlpi(3LIB) library.
372 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
373 # public libdlpi(3LIB) version. Before libdlpi was made public, a
374 # private version also existed, which did not have the same APIs.
375 # Due to a gcc bug, the default search path for 32-bit libraries does
376 # not include /lib, we add it explicitly here.
377 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
378 # Also, due to the bug above applications that link to libpcap with
379 # libdlpi will have to add "-L/lib" option to "configure".
380 #
381 saved_ldflags=$LDFLAGS
382 LDFLAGS="$LIBS -L/lib"
383 AC_CHECK_LIB(dlpi, dlpi_walk,
384 [
385 LIBS="-ldlpi $LIBS"
386 V_PCAP=libdlpi
387 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists])
388 ],
389 V_PCAP=dlpi)
390 LDFLAGS=$saved_ldflags
391
392 #
393 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
394 # versions of DLPI.
395 #
396 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
397 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
398 AC_TRY_COMPILE(
399 [
400 #include <sys/types.h>
401 #include <sys/time.h>
402 #include <sys/dlpi.h>
403 ],
404 [int i = DL_PROMISC_PHYS;],
405 ac_cv_sys_dlpi_usable=yes,
406 ac_cv_sys_dlpi_usable=no))
407 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
408 if test $ac_cv_sys_dlpi_usable = no ; then
409 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
410 fi
411
412 #
413 # Check whether we have a /dev/dlpi device or have multiple devices.
414 #
415 AC_MSG_CHECKING(for /dev/dlpi device)
416 if test -c /dev/dlpi ; then
417 AC_MSG_RESULT(yes)
418 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
419 else
420 AC_MSG_RESULT(no)
421 dir="/dev/dlpi"
422 AC_MSG_CHECKING(for $dir directory)
423 if test -d $dir ; then
424 AC_MSG_RESULT(yes)
425 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
426 else
427 AC_MSG_RESULT(no)
428 fi
429 fi
430
431 #
432 # This check is for Solaris with DLPI support for passive modes.
433 # See dlpi(7P) for more details.
434 #
435 AC_LBL_DL_PASSIVE_REQ_T
436 ;;
437
438 linux)
439 #
440 # Do we have the wireless extensions?
441 #
442 AC_CHECK_HEADERS(linux/wireless.h, [], [],
443 [
444 #include <sys/socket.h>
445 #include <linux/if.h>
446 #include <linux/types.h>
447 ])
448
449 #
450 # Do we have libnl?
451 #
452 AC_ARG_WITH(libnl,
453 AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
454 with_libnl=$withval,,)
455
456 if test x$with_libnl != xno ; then
457 have_any_nl="no"
458
459 incdir=-I/usr/include/libnl3
460 libnldir=
461 if test x$withval != x ; then
462 libnldir=-L${withval}/lib/.libs
463 incdir=-I${withval}/include
464 fi
465
466 #
467 # Try libnl 3.x first.
468 #
469 AC_CHECK_LIB(nl-3, nl_socket_alloc,
470 [
471 #
472 # Yes, we have libnl 3.x.
473 #
474 LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
475 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
476 AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
477 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
478 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
479 V_INCLS="$V_INCLS ${incdir}"
480 have_any_nl="yes"
481 ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
482
483 if test x$have_any_nl = xno ; then
484 #
485 # Try libnl 2.x
486 #
487 AC_CHECK_LIB(nl, nl_socket_alloc,
488 [
489 #
490 # Yes, we have libnl 2.x.
491 #
492 LIBS="${libnldir} -lnl-genl -lnl $LIBS"
493 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
494 AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
495 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
496 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
497 have_any_nl="yes"
498 ])
499 fi
500
501 if test x$have_any_nl = xno ; then
502 #
503 # No, we don't; do we have libnl 1.x?
504 #
505 AC_CHECK_LIB(nl, nl_handle_alloc,
506 [
507 #
508 # Yes.
509 #
510 LIBS="${libnldir} -lnl $LIBS"
511 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
512 have_any_nl="yes"
513 ])
514 fi
515
516 if test x$have_any_nl = xno ; then
517 #
518 # No, we don't have libnl at all.
519 #
520 if test x$with_libnl = xyes ; then
521 AC_MSG_ERROR([libnl support requested but libnl not found])
522 fi
523 fi
524 fi
525
526 AC_CHECK_HEADERS(linux/ethtool.h,,,
527 [
528 AC_INCLUDES_DEFAULT
529 #include <linux/types.h>
530 ])
531 AC_LBL_TPACKET_STATS
532 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
533 ;;
534
535 bpf)
536 #
537 # Check whether we have the *BSD-style ioctls.
538 #
539 AC_CHECK_HEADERS(net/if_media.h)
540
541 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
542 AC_TRY_COMPILE(
543 [#include <sys/socket.h>
544 #include <sys/ioctl.h>
545 #include <net/if.h>
546 #include <net/bpf.h>],
547 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
548 [
549 AC_MSG_RESULT(yes)
550 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
551 [define if the system supports zerocopy BPF])
552 ],
553 AC_MSG_RESULT(no))
554
555 #
556 # Check whether we have struct BPF_TIMEVAL.
557 #
558 AC_CHECK_TYPES(struct BPF_TIMEVAL,,,
559 [
560 #include <sys/types.h>
561 #include <sys/ioctl.h>
562 #ifdef HAVE_SYS_IOCCOM_H
563 #include <sys/ioccom.h>
564 #endif
565 #include <net/bpf.h>
566 ])
567 ;;
568
569 dag)
570 V_DEFS="$V_DEFS -DDAG_ONLY"
571 ;;
572
573 septel)
574 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
575 ;;
576
577 snf)
578 V_DEFS="$V_DEFS -DSNF_ONLY"
579 ;;
580
581 null)
582 AC_MSG_WARN(cannot determine packet capture interface)
583 AC_MSG_WARN((see the INSTALL doc for more info))
584 ;;
585 esac
586
587 dnl
588 dnl Now figure out how we get a list of interfaces and addresses,
589 dnl if we support capturing. Don't bother if we don't support
590 dnl capturing.
591 dnl
592 if test "$V_PCAP" = null
593 then
594 #
595 # We can't capture, so we can't open any capture
596 # devices, so we won't return any interfaces.
597 #
598 V_FINDALLDEVS=null
599 else
600 AC_CHECK_FUNC(getifaddrs,[
601 #
602 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
603 # as well, just in case some platform is really weird.
604 #
605 AC_CHECK_HEADER(ifaddrs.h,[
606 #
607 # We have the header, so we use "getifaddrs()" to
608 # get the list of interfaces.
609 #
610 V_FINDALLDEVS=getad
611 ],[
612 #
613 # We don't have the header - give up.
614 # XXX - we could also fall back on some other
615 # mechanism, but, for now, this'll catch this
616 # problem so that we can at least try to figure
617 # out something to do on systems with "getifaddrs()"
618 # but without "ifaddrs.h", if there is something
619 # we can do on those systems.
620 #
621 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
622 ])
623 ],[
624 #
625 # Well, we don't have "getifaddrs()", so we have to use
626 # some other mechanism; determine what that mechanism is.
627 #
628 # The first thing we use is the type of capture mechanism,
629 # which is somewhat of a proxy for the OS we're using.
630 #
631 case "$V_PCAP" in
632
633 dlpi|libdlpi)
634 #
635 # This might be Solaris 8 or later, with
636 # SIOCGLIFCONF, or it might be some other OS
637 # or some older version of Solaris, with
638 # just SIOCGIFCONF.
639 #
640 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
641 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
642 AC_TRY_COMPILE(
643 [#include <sys/param.h>
644 #include <sys/file.h>
645 #include <sys/ioctl.h>
646 #include <sys/socket.h>
647 #include <sys/sockio.h>],
648 [ioctl(0, SIOCGLIFCONF, (char *)0);],
649 ac_cv_lbl_have_siocglifconf=yes,
650 ac_cv_lbl_have_siocglifconf=no))
651 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
652 if test $ac_cv_lbl_have_siocglifconf = yes ; then
653 V_FINDALLDEVS=glifc
654 else
655 V_FINDALLDEVS=gifc
656 fi
657 ;;
658
659 *)
660 #
661 # Assume we just have SIOCGIFCONF.
662 # (XXX - on at least later Linux kernels, there's
663 # another mechanism, and we should be using that
664 # instead.)
665 #
666 V_FINDALLDEVS=gifc
667 ;;
668 esac])
669 fi
670 ])
671
672 AC_MSG_CHECKING(for socklen_t)
673 AC_TRY_COMPILE([
674 #include <sys/types.h>
675 #include <sys/socket.h>
676 ],
677 [ socklen_t x; ],
678 have_socklen_t=yes,
679 have_socklen_t=no)
680 if test "x$have_socklen_t" = "xyes"; then
681 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
682 fi
683 AC_MSG_RESULT($have_socklen_t)
684
685 AC_ARG_ENABLE(ipv6,
686 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@]),
687 [],
688 [enable_ipv6=ifavailable])
689 if test "$enable_ipv6" != "no"; then
690 AC_CHECK_FUNC(getaddrinfo,
691 [
692 AC_DEFINE(INET6,1,[IPv6])
693 ],
694 [
695 if test "$enable_ipv6" != "ifavailable"; then
696 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
697 fi
698 ])
699 fi
700
701 AC_MSG_CHECKING(whether to build optimizer debugging code)
702 AC_ARG_ENABLE(optimizer-dbg,
703 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
704 if test "$enable_optimizer_dbg" = "yes"; then
705 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
706 fi
707 AC_MSG_RESULT(${enable_optimizer_dbg-no})
708
709 AC_MSG_CHECKING(whether to build parser debugging code)
710 AC_ARG_ENABLE(yydebug,
711 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
712 if test "$enable_yydebug" = "yes"; then
713 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
714 fi
715 AC_MSG_RESULT(${enable_yydebug-no})
716
717 # Check for Endace DAG card support.
718 AC_ARG_WITH([dag],
719 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
720 [
721 if test "$withval" = no
722 then
723 # User doesn't want DAG support.
724 want_dag=no
725 elif test "$withval" = yes
726 then
727 # User wants DAG support but hasn't specified a directory.
728 want_dag=yes
729 else
730 # User wants DAG support and has specified a directory, so use the provided value.
731 want_dag=yes
732 dag_root=$withval
733 fi
734 ],[
735 if test "$V_PCAP" = dag; then
736 # User requested DAG-only libpcap, so we'd better have
737 # the DAG API.
738 want_dag=yes
739 else
740 #
741 # Use DAG API if present, otherwise don't
742 #
743 want_dag=ifpresent
744 fi
745 ])
746
747 AC_ARG_WITH([dag-includes],
748 AC_HELP_STRING([--with-dag-includes=IDIR],[Endace DAG include directory, if not DIR/include]),
749 [
750 # User wants DAG support and has specified a header directory, so use the provided value.
751 want_dag=yes
752 dag_include_dir=$withval
753 ],[])
754
755 AC_ARG_WITH([dag-libraries],
756 AC_HELP_STRING([--with-dag-libraries=LDIR],[Endace DAG library directory, if not DIR/lib]),
757 [
758 # User wants DAG support and has specified a library directory, so use the provided value.
759 want_dag=yes
760 dag_lib_dir=$withval
761 ],[])
762
763 ac_cv_lbl_dag_api=no
764 if test "$want_dag" != no; then
765
766 AC_MSG_CHECKING([whether we have DAG API headers])
767
768 # If necessary, set default paths for DAG API headers and libraries.
769 if test -z "$dag_root"; then
770 dag_root=/usr/local
771 fi
772
773 if test -z "$dag_include_dir"; then
774 dag_include_dir="$dag_root/include"
775 fi
776
777 if test -z "$dag_lib_dir"; then
778 dag_lib_dir="$dag_root/lib"
779 fi
780
781 if test -z "$dag_tools_dir"; then
782 dag_tools_dir="$dag_root/tools"
783 fi
784
785 if test -r $dag_include_dir/dagapi.h; then
786 ac_cv_lbl_dag_api=yes
787 fi
788
789 if test "$ac_cv_lbl_dag_api" = yes; then
790 AC_MSG_RESULT([yes ($dag_include_dir)])
791
792 V_INCLS="$V_INCLS -I$dag_include_dir"
793
794 if test $V_PCAP != dag ; then
795 SSRC="$SSRC pcap-dag.c"
796 fi
797
798 # See if we can find a general version string.
799 # Don't need to save and restore LIBS to prevent -ldag being
800 # included if there's a found-action (arg 3).
801 saved_ldflags=$LDFLAGS
802 LDFLAGS="-L$dag_lib_dir"
803 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
804 AC_CHECK_LIB([dag],[dag_get_erf_types], [
805 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
806 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
807 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
808
809 LDFLAGS=$saved_ldflags
810
811 if test "$dag_streams" = 1; then
812 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
813 LIBS="$LIBS -ldag"
814 LDFLAGS="$LDFLAGS -L$dag_lib_dir"
815
816 AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
817 if test "$ac_dag_have_vdag" = 1; then
818 AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
819 LIBS="$LIBS -lpthread"
820 fi
821 fi
822
823 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
824 else
825 AC_MSG_RESULT(no)
826
827 if test "$V_PCAP" = dag; then
828 # User requested "dag" capture type but we couldn't
829 # find the DAG API support.
830 AC_MSG_ERROR([DAG support requested with --with-pcap=dag, but the DAG headers weren't found at $dag_include_dir: make sure the DAG support is installed, specify a different path or paths if necessary, or don't request DAG support])
831 fi
832
833 if test "$want_dag" = yes; then
834 # User wanted DAG support but we couldn't find it.
835 AC_MSG_ERROR([DAG support requested with --with-dag, but the DAG headers weren't found at $dag_include_dir: make sure the DAG support is installed, specify a different path or paths if necessary, or don't request DAG support])
836 fi
837 fi
838 fi
839
840 AC_ARG_WITH(septel,
841 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
842 [
843 if test "$withval" = no
844 then
845 want_septel=no
846 elif test "$withval" = yes
847 then
848 want_septel=yes
849 septel_root=
850 else
851 want_septel=yes
852 septel_root=$withval
853 fi
854 ],[
855 if test "$V_PCAP" = septel; then
856 # User requested Septel-only libpcap, so we'd better have
857 # the Septel API.
858 want_septel=yes
859 else
860 #
861 # Use Septel API if present, otherwise don't
862 #
863 want_septel=ifpresent
864 fi
865 ])
866
867 ac_cv_lbl_septel_api=no
868 if test "$with_septel" != no; then
869
870 AC_MSG_CHECKING([whether we have Septel API headers])
871
872 # If necessary, set default paths for Septel API headers and libraries.
873 if test -z "$septel_root"; then
874 septel_root=$srcdir/../septel
875 fi
876
877 septel_tools_dir="$septel_root"
878 septel_include_dir="$septel_root/INC"
879
880 if test -r "$septel_include_dir/msg.h"; then
881 ac_cv_lbl_septel_api=yes
882 fi
883
884 if test "$ac_cv_lbl_septel_api" = yes; then
885 AC_MSG_RESULT([yes ($septel_include_dir)])
886
887 V_INCLS="$V_INCLS -I$septel_include_dir"
888 ADDLOBJS="$ADDLOBJS $septel_tools_dir/asciibin.o $septel_tools_dir/bit2byte.o $septel_tools_dir/confirm.o $septel_tools_dir/fmtmsg.o $septel_tools_dir/gct_unix.o $septel_tools_dir/hqueue.o $septel_tools_dir/ident.o $septel_tools_dir/mem.o $septel_tools_dir/pack.o $septel_tools_dir/parse.o $septel_tools_dir/pool.o $septel_tools_dir/sdlsig.o $septel_tools_dir/strtonum.o $septel_tools_dir/timer.o $septel_tools_dir/trace.o"
889 ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $septel_tools_dir/asciibin.o $septel_tools_dir/bit2byte.o $septel_tools_dir/confirm.o $septel_tools_dir/fmtmsg.o $septel_tools_dir/gct_unix.o $septel_tools_dir/hqueue.o $septel_tools_dir/ident.o $septel_tools_dir/mem.o $septel_tools_dir/pack.o $septel_tools_dir/parse.o $septel_tools_dir/pool.o $septel_tools_dir/sdlsig.o $septel_tools_dir/strtonum.o $septel_tools_dir/timer.o $septel_tools_dir/trace.o"
890
891 if test "$V_PCAP" != septel ; then
892 SSRC="$SSRC pcap-septel.c"
893 fi
894
895 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have the Septel API])
896 else
897 AC_MSG_RESULT(no)
898
899 if test "$V_PCAP" = septel; then
900 # User requested "septel" capture type but
901 # we couldn't find the Septel API support.
902 AC_MSG_ERROR([Septel support requested with --with-pcap=septel, but the Septel headers weren't found at $septel_include_dir: make sure the Septel support is installed, specify a different path or paths if necessary, or don't request Septel support])
903 fi
904
905 if test "$want_septel" = yes; then
906 # User wanted Septel support but we couldn't find it.
907 AC_MSG_ERROR([Septel support requested with --with-septel, but the Septel headers weren't found at $septel_include_dir: make sure the Septel support is installed, specify a different path or paths if necessary, or don't request Septel support])
908 fi
909 fi
910 fi
911
912 # Check for Myricom SNF support.
913 AC_ARG_WITH([snf],
914 AC_HELP_STRING([--with-snf@<:@=DIR@:>@],[include Myricom SNF support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
915 [
916 if test "$withval" = no
917 then
918 # User explicitly doesn't want SNF
919 want_snf=no
920 elif test "$withval" = yes
921 then
922 # User wants SNF support but hasn't specified a directory.
923 want_snf=yes
924 else
925 # User wants SNF support with a specified directory.
926 want_snf=yes
927 snf_root=$withval
928 fi
929 ],[
930 if test "$V_PCAP" = snf; then
931 # User requested Sniffer-only libpcap, so we'd better have
932 # the Sniffer API.
933 want_snf=yes
934 else
935 #
936 # Use Sniffer API if present, otherwise don't
937 #
938 want_snf=ifpresent
939 fi
940 ])
941
942 AC_ARG_WITH([snf-includes],
943 AC_HELP_STRING([--with-snf-includes=IDIR],[Myricom SNF include directory, if not DIR/include]),
944 [
945 # User wants SNF with specific header directory
946 want_snf=yes
947 snf_include_dir=$withval
948 ],[])
949
950 AC_ARG_WITH([snf-libraries],
951 AC_HELP_STRING([--with-snf-libraries=LDIR],[Myricom SNF library directory, if not DIR/lib]),
952 [
953 # User wants SNF with specific lib directory
954 want_snf=yes
955 snf_lib_dir=$withval
956 ],[])
957
958 ac_cv_lbl_snf_api=no
959 if test "$with_snf" != no; then
960
961 AC_MSG_CHECKING(whether we have Myricom Sniffer API)
962
963 # If necessary, set default paths for Sniffer headers and libraries.
964 if test -z "$snf_root"; then
965 snf_root=/opt/snf
966 fi
967
968 if test -z "$snf_include_dir"; then
969 snf_include_dir="$snf_root/include"
970 fi
971
972 if test -z "$snf_lib_dir"; then
973 snf_lib_dir="$snf_root/lib"
974 fi
975
976 if test -f "$snf_include_dir/snf.h"; then
977 # We found a header; make sure we can link with the library
978 saved_ldflags=$LDFLAGS
979 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
980 AC_CHECK_LIB([snf], [snf_init], [ac_cv_lbl_snf_api="yes"])
981 LDFLAGS="$saved_ldflags"
982 if test "$ac_cv_lbl_snf_api" = no; then
983 AC_MSG_ERROR(SNF API cannot correctly be linked; check config.log)
984 fi
985 fi
986
987 if test "$ac_cv_lbl_snf_api" = yes; then
988 AC_MSG_RESULT([yes ($snf_root)])
989
990 V_INCLS="$V_INCLS -I$snf_include_dir"
991 LIBS="$LIBS -lsnf"
992 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
993
994 if test "$V_PCAP" != snf ; then
995 SSRC="$SSRC pcap-snf.c"
996 fi
997
998 AC_DEFINE(HAVE_SNF_API, 1, [define if you have the Myricom SNF API])
999 else
1000 AC_MSG_RESULT(no)
1001
1002 if test "$want_snf" = yes; then
1003 # User requested "snf" capture type but
1004 # we couldn't find the Sniffer API support.
1005 AC_MSG_ERROR([Myricom Sniffer support requested with --with-pcap=snf, but the Sniffer headers weren't found at $snf_include_dir: make sure the Sniffer support is installed, specify a different path or paths if necessary, or don't request Sniffer support])
1006 fi
1007
1008 if test "$want_snf" = yes; then
1009 AC_MSG_ERROR([Myricom Sniffer support requested with --with-snf, but the Sniffer headers weren't found at $snf_include_dir: make sure the Sniffer support is installed, specify a different path or paths if necessary, or don't request Sniffer support])
1010 fi
1011 fi
1012 fi
1013
1014 # Check for Riverbed TurboCap support.
1015 AC_ARG_WITH([turbocap],
1016 AC_HELP_STRING([--with-turbocap@<:@=DIR@:>@],[include Riverbed TurboCap support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1017 [
1018 if test "$withval" = no
1019 then
1020 # User explicitly doesn't want TurboCap
1021 want_turbocap=no
1022 elif test "$withval" = yes
1023 then
1024 # User wants TurboCap support but hasn't specified a directory.
1025 want_turbocap=yes
1026 else
1027 # User wants TurboCap support with a specified directory.
1028 want_turbocap=yes
1029 turbocap_root=$withval
1030 fi
1031 ],[
1032 #
1033 # Use TurboCap API if present, otherwise don't
1034 #
1035 want_turbocap=ifpresent
1036 ])
1037
1038 ac_cv_lbl_turbocap_api=no
1039 if test "$want_turbocap" != no; then
1040
1041 AC_MSG_CHECKING(whether TurboCap is supported)
1042
1043 save_CFLAGS="$CFLAGS"
1044 save_LIBS="$LIBS"
1045 if test ! -z "$turbocap_root"; then
1046 TURBOCAP_CFLAGS="-I$turbocap_root/include"
1047 TURBOCAP_LIBS="-L$turbocap_root/lib"
1048 CFLAGS="$CFLAGS $TURBOCAP_CFLAGS"
1049 fi
1050
1051 AC_TRY_COMPILE(
1052 [
1053 #include <TcApi.h>
1054 ],
1055 [
1056 TC_INSTANCE a; TC_PORT b; TC_BOARD c;
1057 TC_INSTANCE i;
1058 (void)TcInstanceCreateByName("foo", &i);
1059 ],
1060 ac_cv_lbl_turbocap_api=yes)
1061
1062 CFLAGS="$save_CFLAGS"
1063 if test $ac_cv_lbl_turbocap_api = yes; then
1064 AC_MSG_RESULT(yes)
1065
1066 SSRC="$SSRC pcap-tc.c"
1067 V_INCLS="$V_INCLS $TURBOCAP_CFLAGS"
1068 LIBS="$LIBS $TURBOCAP_LIBS -lTcApi -lpthread -lstdc++"
1069
1070 AC_DEFINE(HAVE_TC_API, 1, [define if you have the TurboCap API])
1071 else
1072 AC_MSG_RESULT(no)
1073
1074 if test "$want_turbocap" = yes; then
1075 # User wanted Turbo support but we couldn't find it.
1076 AC_MSG_ERROR([TurboCap support requested with --with-turbocap, but the TurboCap headers weren't found: make sure the TurboCap support is installed or don't request TurboCap support])
1077 fi
1078 fi
1079 fi
1080
1081 #
1082 # Look for {f}lex.
1083 #
1084 AC_PROG_LEX
1085 if test "$LEX" = ":"; then
1086 AC_MSG_ERROR([Neither flex nor lex was found.])
1087 fi
1088
1089 #
1090 # Make sure {f}lex supports the -P, --header-file, and --nounput flags
1091 # and supports processing our scanner.l.
1092 #
1093 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
1094 if $LEX -P pcap_ --header-file=/dev/null --nounput -t $srcdir/scanner.l > /dev/null 2>&1; then
1095 tcpdump_cv_capable_lex=yes
1096 else
1097 tcpdump_cv_capable_lex=insufficient
1098 fi)
1099 if test $tcpdump_cv_capable_lex = insufficient ; then
1100 AC_MSG_ERROR([$LEX is insufficient to compile libpcap.
1101 libpcap requires Flex 2.5.31 or later, or a compatible version of lex.])
1102 fi
1103
1104 #
1105 # Look for yacc/bison/byacc.
1106 #
1107 AC_PROG_YACC
1108
1109 #
1110 # Make sure it supports the -p flag and supports processing our
1111 # grammar.y.
1112 #
1113 AC_CACHE_CHECK([for capable yacc/bison], tcpdump_cv_capable_yacc,
1114 if $YACC -p pcap_ -o /dev/null $srcdir/grammar.y >/dev/null 2>&1; then
1115 tcpdump_cv_capable_yacc=yes
1116 else
1117 tcpdump_cv_capable_yacc=insufficient
1118 fi)
1119 if test $tcpdump_cv_capable_yacc = insufficient ; then
1120 AC_MSG_ERROR([$YACC is insufficient to compile libpcap.
1121 libpcap requires Bison, Berkeley YACC, or another YACC compatible with them.])
1122 fi
1123
1124 #
1125 # Assume, by default, no support for shared libraries and V7/BSD convention
1126 # for man pages (file formats in section 5, miscellaneous info in section 7).
1127 # Individual cases can override this.
1128 #
1129 DYEXT="none"
1130 MAN_FILE_FORMATS=5
1131 MAN_MISC_INFO=7
1132 case "$host_os" in
1133
1134 aix*)
1135 dnl Workaround to enable certain features
1136 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
1137
1138 #
1139 # AIX makes it fun to build shared and static libraries,
1140 # because they're *both* ".a" archive libraries. We
1141 # build the static library for the benefit of the traditional
1142 # scheme of building libpcap and tcpdump in subdirectories of
1143 # the same directory, with tcpdump statically linked with the
1144 # libpcap in question, but we also build a shared library as
1145 # "libpcap.shareda" and install *it*, rather than the static
1146 # library, as "libpcap.a".
1147 #
1148 DYEXT="shareda"
1149
1150 case "$V_PCAP" in
1151
1152 dlpi)
1153 #
1154 # If we're using DLPI, applications will need to
1155 # use /lib/pse.exp if present, as we use the
1156 # STREAMS routines.
1157 #
1158 pseexe="/lib/pse.exp"
1159 AC_MSG_CHECKING(for $pseexe)
1160 if test -f $pseexe ; then
1161 AC_MSG_RESULT(yes)
1162 LIBS="-I:$pseexe"
1163 fi
1164 ;;
1165
1166 bpf)
1167 #
1168 # If we're using BPF, we need "-lodm" and "-lcfg", as
1169 # we use them to load the BPF module.
1170 #
1171 LIBS="-lodm -lcfg"
1172 ;;
1173 esac
1174 ;;
1175
1176 darwin*)
1177 DYEXT="dylib"
1178 V_CCOPT="$V_CCOPT -fno-common"
1179 AC_ARG_ENABLE(universal,
1180 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
1181 if test "$enable_universal" != "no"; then
1182 case "$host_os" in
1183
1184 darwin[0-7].*)
1185 #
1186 # Pre-Tiger. Build only for 32-bit PowerPC; no
1187 # need for any special compiler or linker flags.
1188 #
1189 ;;
1190
1191 darwin8.[0123]*)
1192 #
1193 # Tiger, prior to Intel support. Build for 32-bit
1194 # PowerPC and 64-bit PowerPC, with 32-bit PowerPC
1195 # first. (I'm guessing that's what Apple does.)
1196 #
1197 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64"
1198 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64"
1199 ;;
1200
1201 darwin8.[456]*)
1202 #
1203 # Tiger, subsequent to Intel support but prior to
1204 # x86-64 support. Build for 32-bit PowerPC, 64-bit
1205 # PowerPC, and x86, with 32-bit PowerPC first.
1206 # (I'm guessing that's what Apple does.)
1207 #
1208 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386"
1209 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386"
1210 ;;
1211
1212 darwin8.*)
1213 #
1214 # All other Tiger, so subsequent to x86-64
1215 # support. Build for 32-bit PowerPC, 64-bit
1216 # PowerPC, x86, and x86-64, and with 32-bit PowerPC
1217 # first. (I'm guessing that's what Apple does.)
1218 #
1219 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1220 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1221 ;;
1222
1223 darwin9.*)
1224 #
1225 # Leopard. Build for 32-bit PowerPC, 64-bit
1226 # PowerPC, x86, and x86-64, with 32-bit PowerPC
1227 # first. (That's what Apple does.)
1228 #
1229 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1230 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1231 ;;
1232
1233 darwin10.*)
1234 #
1235 # Snow Leopard. Build for x86-64, x86, and
1236 # 32-bit PowerPC, with x86-64 first. (That's
1237 # what Apple does, even though Snow Leopard
1238 # doesn't run on PPC, so PPC libpcap runs under
1239 # Rosetta, and Rosetta doesn't support BPF
1240 # ioctls, so PPC programs can't do live
1241 # captures.)
1242 #
1243 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386 -arch ppc"
1244 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386 -arch ppc"
1245 ;;
1246
1247 darwin*)
1248 #
1249 # Post-Snow Leopard. Build for x86-64 and
1250 # x86, with x86-64 first. (That's probably what
1251 # Apple does, given that Rosetta is gone.)
1252 # XXX - update if and when Apple drops support
1253 # for 32-bit x86 code.
1254 #
1255 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
1256 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
1257 ;;
1258 esac
1259 fi
1260 ;;
1261
1262 hpux9*)
1263 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
1264
1265 #
1266 # Use System V conventions for man pages.
1267 #
1268 MAN_FILE_FORMATS=4
1269 MAN_MISC_INFO=5
1270 ;;
1271
1272 hpux10.0*)
1273
1274 #
1275 # Use System V conventions for man pages.
1276 #
1277 MAN_FILE_FORMATS=4
1278 MAN_MISC_INFO=5
1279 ;;
1280
1281 hpux10.1*)
1282
1283 #
1284 # Use System V conventions for man pages.
1285 #
1286 MAN_FILE_FORMATS=4
1287 MAN_MISC_INFO=5
1288 ;;
1289
1290 hpux*)
1291 dnl HPUX 10.20 and above is similar to HPUX 9, but
1292 dnl not the same....
1293 dnl
1294 dnl XXX - DYEXT should be set to "sl" if this is building
1295 dnl for 32-bit PA-RISC, but should be left as "so" for
1296 dnl 64-bit PA-RISC or, I suspect, IA-64.
1297 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
1298 if test "`uname -m`" = "ia64"; then
1299 DYEXT="so"
1300 else
1301 DYEXT="sl"
1302 fi
1303
1304 #
1305 # "-b" builds a shared library; "+h" sets the soname.
1306 #
1307 SHLIB_OPT="-b"
1308 SONAME_OPT="+h"
1309
1310 #
1311 # Use System V conventions for man pages.
1312 #
1313 MAN_FILE_FORMATS=4
1314 MAN_MISC_INFO=5
1315 ;;
1316
1317 irix*)
1318 #
1319 # Use System V conventions for man pages.
1320 #
1321 MAN_FILE_FORMATS=4
1322 MAN_MISC_INFO=5
1323 ;;
1324
1325 linux*|freebsd*|netbsd*|openbsd*|dragonfly*|kfreebsd*|gnu*)
1326 DYEXT="so"
1327
1328 #
1329 # Compiler assumed to be GCC; run-time linker may require a -R
1330 # flag.
1331 #
1332 if test "$libdir" != "/usr/lib"; then
1333 V_RFLAGS=-Wl,-R$libdir
1334 fi
1335 ;;
1336
1337 osf*)
1338 DYEXT="so"
1339
1340 #
1341 # Use System V conventions for man pages.
1342 #
1343 MAN_FILE_FORMATS=4
1344 MAN_MISC_INFO=5
1345 ;;
1346
1347 sinix*)
1348 AC_MSG_CHECKING(if SINIX compiler defines sinix)
1349 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
1350 AC_TRY_COMPILE(
1351 [],
1352 [int i = sinix;],
1353 ac_cv_cc_sinix_defined=yes,
1354 ac_cv_cc_sinix_defined=no))
1355 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
1356 if test $ac_cv_cc_sinix_defined = no ; then
1357 AC_DEFINE(sinix,1,[on sinix])
1358 fi
1359 ;;
1360
1361 solaris*)
1362 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
1363
1364 DYEXT="so"
1365 #
1366 # Use System V conventions for man pages.
1367 #
1368 MAN_FILE_FORMATS=4
1369 MAN_MISC_INFO=5
1370 ;;
1371 esac
1372
1373 AC_ARG_ENABLE(shared,
1374 AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
1375 test "x$enable_shared" = "xno" && DYEXT="none"
1376
1377 AC_PROG_RANLIB
1378 AC_CHECK_TOOL([AR], [ar])
1379
1380 AC_PROG_LN_S
1381 AC_SUBST(LN_S)
1382
1383 AC_LBL_DEVEL(V_CCOPT)
1384
1385 AC_LBL_SOCKADDR_SA_LEN
1386
1387 AC_LBL_SOCKADDR_STORAGE
1388
1389 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
1390
1391 AC_LBL_UNALIGNED_ACCESS
1392
1393 #
1394 # Makefile.in includes rules to generate version.h, so we assume
1395 # that it will be generated if autoconf is used.
1396 #
1397 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1398
1399 rm -f net
1400 ln -s ${srcdir}/bpf/net net
1401
1402 AC_SUBST(V_CCOPT)
1403 AC_SUBST(V_DEFS)
1404 AC_SUBST(V_FINDALLDEVS)
1405 AC_SUBST(V_INCLS)
1406 AC_SUBST(V_LEX)
1407 AC_SUBST(V_PCAP)
1408 AC_SUBST(V_SHLIB_CMD)
1409 AC_SUBST(V_SHLIB_OPT)
1410 AC_SUBST(V_SONAME_OPT)
1411 AC_SUBST(V_RPATH_OPT)
1412 AC_SUBST(V_YACC)
1413 AC_SUBST(ADDLOBJS)
1414 AC_SUBST(ADDLARCHIVEOBJS)
1415 AC_SUBST(SSRC)
1416 AC_SUBST(DYEXT)
1417 AC_SUBST(MAN_FILE_FORMATS)
1418 AC_SUBST(MAN_MISC_INFO)
1419
1420 AC_ARG_ENABLE([usb],
1421 [AC_HELP_STRING([--enable-usb],[enable nusb support @<:@default=yes, if support available@:>@])],
1422 [],
1423 [enable_usb=yes])
1424
1425 if test "x$enable_usb" != "xno" ; then
1426 dnl check for USB sniffing support
1427 AC_MSG_CHECKING(for USB sniffing support)
1428 case "$host_os" in
1429 linux*)
1430 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1431 USB_SRC=pcap-usb-linux.c
1432 AC_MSG_RESULT(yes)
1433 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1434 if test $? -ne 0 ; then
1435 ac_usb_dev_name="usbmon"
1436 fi
1437 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1438 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1439 #
1440 # Do we have a version of <linux/compiler.h> available?
1441 # If so, we might need it for <linux/usbdevice_fs.h>.
1442 #
1443 AC_CHECK_HEADERS(linux/compiler.h)
1444 if test "$ac_cv_header_linux_compiler_h" = yes; then
1445 #
1446 # Yes - include it when testing for <linux/usbdevice_fs.h>.
1447 #
1448 AC_CHECK_HEADERS(linux/usbdevice_fs.h,,,[#include <linux/compiler.h>])
1449 else
1450 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
1451 fi
1452 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
1453 #
1454 # OK, does it define bRequestType? Older versions of the kernel
1455 # define fields with names like "requesttype, "request", and
1456 # "value", rather than "bRequestType", "bRequest", and
1457 # "wValue".
1458 #
1459 AC_MSG_CHECKING(if usbdevfs_ctrltransfer struct has bRequestType member)
1460 AC_CACHE_VAL(ac_cv_usbdevfs_ctrltransfer_has_bRequestType,
1461 AC_TRY_COMPILE([
1462 AC_INCLUDES_DEFAULT
1463 #ifdef HAVE_SYS_BITYPES_H
1464 #include <sys/bitypes.h>
1465 #endif
1466 #ifdef HAVE_LINUX_COMPILER_H
1467 #include <linux/compiler.h>
1468 #endif
1469 #include <linux/usbdevice_fs.h>],
1470 [u_int i = sizeof(((struct usbdevfs_ctrltransfer *)0)->bRequestType)],
1471 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=yes,
1472 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=no))
1473 AC_MSG_RESULT($ac_cv_usbdevfs_ctrltransfer_has_bRequestType)
1474 if test $ac_cv_usbdevfs_ctrltransfer_has_bRequestType = yes ; then
1475 AC_DEFINE(HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE,1,
1476 [if struct usbdevfs_ctrltransfer has bRequestType])
1477 fi
1478 fi
1479 ;;
1480 *)
1481 AC_MSG_RESULT(no)
1482 ;;
1483 esac
1484 fi
1485 AC_SUBST(PCAP_SUPPORT_USB)
1486 AC_SUBST(USB_SRC)
1487
1488 dnl check for netfilter sniffing support
1489 AC_MSG_CHECKING(whether the platform could support netfilter sniffing)
1490 case "$host_os" in
1491 linux*)
1492 AC_MSG_RESULT(yes)
1493 #
1494 # Life's too short to deal with trying to get this to compile
1495 # if you don't get the right types defined with
1496 # __KERNEL_STRICT_NAMES getting defined by some other include.
1497 #
1498 # Check whether the includes Just Work. If not, don't turn on
1499 # netfilter support.
1500 #
1501 AC_MSG_CHECKING(whether we can compile the netfilter support)
1502 AC_CACHE_VAL(ac_cv_netfilter_can_compile,
1503 AC_TRY_COMPILE([
1504 AC_INCLUDES_DEFAULT
1505 #include <sys/socket.h>
1506 #include <netinet/in.h>
1507 #include <linux/types.h>
1508
1509 #include <linux/netlink.h>
1510 #include <linux/netfilter.h>
1511 #include <linux/netfilter/nfnetlink.h>
1512 #include <linux/netfilter/nfnetlink_log.h>
1513 #include <linux/netfilter/nfnetlink_queue.h>],
1514 [],
1515 ac_cv_netfilter_can_compile=yes,
1516 ac_cv_netfilter_can_compile=no))
1517 AC_MSG_RESULT($ac_cv_netfilter_can_compile)
1518 if test $ac_cv_netfilter_can_compile = yes ; then
1519 AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
1520 [target host supports netfilter sniffing])
1521 NETFILTER_SRC=pcap-netfilter-linux.c
1522 fi
1523 ;;
1524 *)
1525 AC_MSG_RESULT(no)
1526 ;;
1527 esac
1528 AC_SUBST(PCAP_SUPPORT_NETFILTER)
1529 AC_SUBST(NETFILTER_SRC)
1530
1531 AC_ARG_ENABLE([bluetooth],
1532 [AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
1533 [],
1534 [enable_bluetooth=ifsupportavailable])
1535
1536 if test "x$enable_bluetooth" != "xno" ; then
1537 dnl check for Bluetooth sniffing support
1538 case "$host_os" in
1539 linux*)
1540 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1541 [
1542 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1543 BT_SRC=pcap-bt-linux.c
1544 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1545
1546 #
1547 # OK, does struct sockaddr_hci have an hci_channel
1548 # member?
1549 #
1550 AC_MSG_CHECKING(if struct sockaddr_hci has hci_channel member)
1551 AC_CACHE_VAL(ac_cv_lbl_sockaddr_hci_has_hci_channel,
1552 AC_TRY_COMPILE(
1553 [
1554 #include <bluetooth/bluetooth.h>
1555 #include <bluetooth/hci.h>
1556 ],
1557 [u_int i = sizeof(((struct sockaddr_hci *)0)->hci_channel)],
1558 ac_cv_lbl_sockaddr_hci_has_hci_channel=yes,
1559 ac_cv_lbl_sockaddr_hci_has_hci_channel=no))
1560 AC_MSG_RESULT($ac_cv_lbl_sockaddr_hci_has_hci_channel)
1561 if test $ac_cv_lbl_sockaddr_hci_has_hci_channel = yes ; then
1562 AC_DEFINE(SOCKADDR_HCI_HAS_HCI_CHANNEL,,
1563 [if struct sockaddr_hci has hci_channel member])
1564
1565 #
1566 # OK, is HCI_CHANNEL_MONITOR defined?
1567 #
1568 AC_MSG_CHECKING(if HCI_CHANNEL_MONITOR is defined)
1569 AC_CACHE_VAL(ac_cv_lbl_hci_channel_monitor_is_defined,
1570 AC_TRY_COMPILE(
1571 [
1572 #include <bluetooth/bluetooth.h>
1573 #include <bluetooth/hci.h>
1574 ],
1575 [u_int i = HCI_CHANNEL_MONITOR],
1576 ac_cv_lbl_hci_channel_monitor_is_defined=yes,
1577 ac_cv_lbl_hci_channel_monitor_is_defined=no))
1578 AC_MSG_RESULT($ac_cv_lbl_hci_channel_monitor_is_defined)
1579 if test $ac_cv_lbl_hci_channel_monitor_is_defined = yes ; then
1580 AC_DEFINE(PCAP_SUPPORT_BT_MONITOR,,
1581 [target host supports Bluetooth Monitor])
1582 BT_MONITOR_SRC=pcap-bt-monitor-linux.c
1583 fi
1584 fi
1585 ac_lbl_bluetooth_available=yes
1586 ],
1587 ac_lbl_bluetooth_available=no
1588 )
1589 if test "x$ac_lbl_bluetooth_available" == "xno" ; then
1590 if test "x$enable_bluetooth" = "xyes" ; then
1591 AC_MSG_ERROR(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1592 else
1593 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1594 fi
1595 fi
1596 ;;
1597 *)
1598 if test "x$enable_bluetooth" = "xyes" ; then
1599 AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
1600 else
1601 AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
1602 fi
1603 ;;
1604 esac
1605 AC_SUBST(PCAP_SUPPORT_BT)
1606 AC_SUBST(BT_SRC)
1607 AC_SUBST(BT_MONITOR_SRC)
1608 fi
1609
1610 AC_ARG_ENABLE([canusb],
1611 [AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
1612 [],
1613 [enable_canusb=ifsupportavailable])
1614
1615 if test "x$enable_canusb" != "xno" ; then
1616 dnl check for canusb support
1617 case "$host_os" in
1618 linux*|uclinux*)
1619 AC_CHECK_HEADER(libusb-1.0/libusb.h,
1620 [
1621 AC_CHECK_LIB(usb-1.0, libusb_init,
1622 [
1623 AC_DEFINE(PCAP_SUPPORT_CANUSB, 1, [target host supports canusb])
1624 CANUSB_SRC=pcap-canusb-linux.c
1625 LIBS="-lusb-1.0 -lpthread $LIBS"
1626 ac_lbl_has_libusb=yes
1627 ],
1628 ac_lbl_has_libusb=no,
1629 -lpthread
1630 )
1631 ],
1632 ac_lbl_has_libusb=no
1633 )
1634 if test "x$ac_lbl_has_libusb" = "xyes" ; then
1635 AC_MSG_NOTICE(canusb sniffing is supported)
1636 else
1637 if test "x$enable_canusb" = "xyes" ; then
1638 AC_MSG_ERROR(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1639 else
1640 AC_MSG_NOTICE(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1641 fi
1642 fi
1643 ;;
1644 *)
1645 if test "x$enable_canusb" = "xyes" ; then
1646 AC_MSG_ERROR(no canusb support implemented for $host_os)
1647 else
1648 AC_MSG_NOTICE(no canusb support implemented for $host_os)
1649 fi
1650 ;;
1651 esac
1652 AC_SUBST(PCAP_SUPPORT_CANUSB)
1653 AC_SUBST(CANUSB_SRC)
1654 fi
1655
1656 AC_ARG_ENABLE([can],
1657 [AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])],
1658 [],
1659 [enable_can=ifsupportavailable])
1660
1661 if test "x$enable_can" != "xno" ; then
1662 dnl check for CAN sniffing support
1663 case "$host_os" in
1664 linux*)
1665 AC_CHECK_HEADER(linux/can.h,
1666 [
1667 AC_DEFINE(PCAP_SUPPORT_CAN, 1, [target host supports CAN sniffing])
1668 CAN_SRC=pcap-can-linux.c
1669 AC_MSG_NOTICE(CAN sniffing is supported)
1670 ],
1671 [
1672 if test "x$enable_can" = "xyes" ; then
1673 AC_MSG_ERROR(CAN sniffing is not supported)
1674 else
1675 AC_MSG_NOTICE(CAN sniffing is not supported)
1676 fi
1677 ],
1678 [#include <sys/socket.h>]
1679 )
1680 ;;
1681 *)
1682 if test "x$enable_can" = "xyes" ; then
1683 AC_MSG_ERROR(no CAN sniffing support implemented for $host_os)
1684 else
1685 AC_MSG_NOTICE(no CAN sniffing support implemented for $host_os)
1686 fi
1687 ;;
1688 esac
1689 AC_SUBST(PCAP_SUPPORT_CAN)
1690 AC_SUBST(CAN_SRC)
1691 fi
1692
1693 AC_ARG_ENABLE([dbus],
1694 [AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
1695 [],
1696 [enable_dbus=ifavailable])
1697
1698 if test "x$enable_dbus" != "xno"; then
1699 if test "x$enable_dbus" = "xyes"; then
1700 case "$host_os" in
1701
1702 darwin*)
1703 #
1704 # We don't support D-Bus sniffing on OS X; see
1705 #
1706 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1707 #
1708 # The user requested it, so fail.
1709 #
1710 AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on OS X])
1711 esac
1712 else
1713 case "$host_os" in
1714
1715 darwin*)
1716 #
1717 # We don't support D-Bus sniffing on OS X; see
1718 #
1719 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1720 #
1721 # The user dind't explicitly request it, so just
1722 # silently refuse to enable it.
1723 #
1724 enable_dbus="no"
1725 ;;
1726 esac
1727 fi
1728 fi
1729
1730 if test "x$enable_dbus" != "xno"; then
1731 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
1732 if test "x$PKGCONFIG" != "xno"; then
1733 AC_MSG_CHECKING([for D-Bus])
1734 if "$PKGCONFIG" dbus-1; then
1735 AC_MSG_RESULT([yes])
1736 DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
1737 DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
1738 save_CFLAGS="$CFLAGS"
1739 save_LIBS="$LIBS"
1740 CFLAGS="$CFLAGS $DBUS_CFLAGS"
1741 LIBS="$LIBS $DBUS_LIBS"
1742 AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
1743 AC_TRY_LINK(
1744 [#include <string.h>
1745
1746 #include <time.h>
1747 #include <sys/time.h>
1748
1749 #include <dbus/dbus.h>],
1750 [return dbus_connection_read_write(NULL, 0);],
1751 [
1752 AC_MSG_RESULT([yes])
1753 AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
1754 DBUS_SRC=pcap-dbus.c
1755 V_INCLS="$V_INCLS $DBUS_CFLAGS"
1756 ],
1757 [
1758 AC_MSG_RESULT([no])
1759 if test "x$enable_dbus" = "xyes"; then
1760 AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
1761 fi
1762 LIBS="$save_LIBS"
1763 ])
1764 CFLAGS="$save_CFLAGS"
1765 else
1766 AC_MSG_RESULT([no])
1767 if test "x$enable_dbus" = "xyes"; then
1768 AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
1769 fi
1770 fi
1771 fi
1772 AC_SUBST(PCAP_SUPPORT_DBUS)
1773 AC_SUBST(DBUS_SRC)
1774 fi
1775
1776 dnl check for hardware timestamp support
1777 case "$host_os" in
1778 linux*)
1779 AC_CHECK_HEADERS([linux/net_tstamp.h])
1780 ;;
1781 *)
1782 AC_MSG_NOTICE(no hardware timestamp support implemented for $host_os)
1783 ;;
1784 esac
1785
1786 dnl The packet ring capture facility of Linux, described in
1787 dnl Documentation/networking/packet_mmap.txt, is not 32/64-bit compatible before
1788 dnl version 2.6.27. A 32-bit kernel requires a 32-bit userland, and likewise for
1789 dnl 64-bit. The effect of this is that a 32-bit libpcap binary will not run
1790 dnl correctly on a 64-bit kernel (the binary will use the wrong offsets into a
1791 dnl kernel struct). This problem was solved in Linux 2.6.27. Use
1792 dnl --disable-packet-ring whenever a 32-bit application must run on a 64-bit
1793 dnl target host, and either the build host or the target host run Linux 2.6.26
1794 dnl or earlier.
1795 AC_ARG_ENABLE([packet-ring],
1796 [AC_HELP_STRING([--enable-packet-ring],[enable Linux packet ring support @<:@default=yes@:>@])],
1797 ,enable_packet_ring=yes)
1798
1799 if test "x$enable_packet_ring" != "xno" ; then
1800 AC_DEFINE(PCAP_SUPPORT_PACKET_RING, 1, [use Linux packet ring capture if available])
1801 AC_SUBST(PCAP_SUPPORT_PACKET_RING)
1802 fi
1803
1804 AC_PROG_INSTALL
1805
1806 AC_CONFIG_HEADER(config.h)
1807
1808 AC_OUTPUT_COMMANDS([if test -f .devel; then
1809 echo timestamp > stamp-h
1810 cat Makefile-devel-adds >> Makefile
1811 make depend
1812 fi])
1813 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1814 pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap
1815 pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap
1816 pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap
1817 pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap
1818 pcap_open_offline.3pcap pcap_set_tstamp_precision.3pcap
1819 pcap_set_tstamp_type.3pcap)
1820 exit 0