;;
dag)
+ #
+ # --with-pcap=dag is the only way to get here, and it means
+ # "DAG support but nothing else"
+ #
V_DEFS="$V_DEFS -DDAG_ONLY"
+ xxx_only=yes
;;
septel)
+ #
+ # --with-pcap=septel is the only way to get here, and it means
+ # "Septel support but nothing else"
+ #
V_DEFS="$V_DEFS -DSEPTEL_ONLY"
+ xxx_only=yes
;;
snf)
+ #
+ # --with-pcap=snf is the only way to get here, and it means
+ # "SNF support but nothing else"
+ #
V_DEFS="$V_DEFS -DSNF_ONLY"
+ xxx_only=yes
;;
null)
# User requested DAG-only libpcap, so we'd better have
# the DAG API.
want_dag=yes
+ elif test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want DAG support.
+ want_dag=no
else
#
# Use DAG API if present, otherwise don't
# User requested Septel-only libpcap, so we'd better have
# the Septel API.
want_septel=yes
+ elif test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want Septel support.
+ want_septel=no
else
#
# Use Septel API if present, otherwise don't
# User requested Sniffer-only libpcap, so we'd better have
# the Sniffer API.
want_snf=yes
+ elif test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want SNF support.
+ want_snf=no
else
#
# Use Sniffer API if present, otherwise don't
else
- #
- # Use TurboCap API if present, otherwise don't
- #
- want_turbocap=ifpresent
+ if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want TurboCap support.
+ want_turbocap=no
+ else
+ #
+ # Use TurboCap API if present, otherwise don't
+ #
+ want_turbocap=ifpresent
+ fi
fi
fi
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want USB support.
+ enable_usb=no
+fi
+
if test "x$enable_usb" != "xno" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for USB sniffing support" >&5
$as_echo_n "checking for USB sniffing support... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the platform could support netfilter sniffing" >&5
+if test "xxx_only" != yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the platform could support netfilter sniffing" >&5
$as_echo_n "checking whether the platform could support netfilter sniffing... " >&6; }
-case "$host_os" in
-linux*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ case "$host_os" in
+ linux*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- #
- # Life's too short to deal with trying to get this to compile
- # if you don't get the right types defined with
- # __KERNEL_STRICT_NAMES getting defined by some other include.
- #
- # Check whether the includes Just Work. If not, don't turn on
- # netfilter support.
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile the netfilter support" >&5
+ #
+ # Life's too short to deal with trying to get this to compile
+ # if you don't get the right types defined with
+ # __KERNEL_STRICT_NAMES getting defined by some other include.
+ #
+ # Check whether the includes Just Work. If not, don't turn on
+ # netfilter support.
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile the netfilter support" >&5
$as_echo_n "checking whether we can compile the netfilter support... " >&6; }
- if ${ac_cv_netfilter_can_compile+:} false; then :
+ if ${ac_cv_netfilter_can_compile+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_netfilter_can_compile" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_netfilter_can_compile" >&5
$as_echo "$ac_cv_netfilter_can_compile" >&6; }
- if test $ac_cv_netfilter_can_compile = yes ; then
+ if test $ac_cv_netfilter_can_compile = yes ; then
$as_echo "#define PCAP_SUPPORT_NETFILTER 1" >>confdefs.h
- NETFILTER_SRC=pcap-netfilter-linux.c
- fi
- ;;
-*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ NETFILTER_SRC=pcap-netfilter-linux.c
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- ;;
-esac
+ ;;
+ esac
+fi
fi
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want Bluetooth support.
+ enable_bluetooth=no
+fi
+
if test "x$enable_bluetooth" != "xno" ; then
case "$host_os" in
linux*)
fi
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want canusb support.
+ enable_canusb=no
+fi
+
if test "x$enable_canusb" != "xno" ; then
case "$host_os" in
linux*|uclinux*)
fi
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want CAN support.
+ enable_can=no
+fi
+
if test "x$enable_can" != "xno" ; then
case "$host_os" in
linux*)
fi
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want D-Bus support.
+ enable_dbus=no
+fi
+
if test "x$enable_dbus" != "xno"; then
if test "x$enable_dbus" = "xyes"; then
case "$host_os" in
;;
dag)
+ #
+ # --with-pcap=dag is the only way to get here, and it means
+ # "DAG support but nothing else"
+ #
V_DEFS="$V_DEFS -DDAG_ONLY"
+ xxx_only=yes
;;
septel)
+ #
+ # --with-pcap=septel is the only way to get here, and it means
+ # "Septel support but nothing else"
+ #
V_DEFS="$V_DEFS -DSEPTEL_ONLY"
+ xxx_only=yes
;;
snf)
+ #
+ # --with-pcap=snf is the only way to get here, and it means
+ # "SNF support but nothing else"
+ #
V_DEFS="$V_DEFS -DSNF_ONLY"
+ xxx_only=yes
;;
null)
# User requested DAG-only libpcap, so we'd better have
# the DAG API.
want_dag=yes
+ elif test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want DAG support.
+ want_dag=no
else
#
# Use DAG API if present, otherwise don't
# User requested Septel-only libpcap, so we'd better have
# the Septel API.
want_septel=yes
+ elif test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want Septel support.
+ want_septel=no
else
#
# Use Septel API if present, otherwise don't
# User requested Sniffer-only libpcap, so we'd better have
# the Sniffer API.
want_snf=yes
+ elif test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want SNF support.
+ want_snf=no
else
#
# Use Sniffer API if present, otherwise don't
turbocap_root=$withval
fi
],[
- #
- # Use TurboCap API if present, otherwise don't
- #
- want_turbocap=ifpresent
+ if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want TurboCap support.
+ want_turbocap=no
+ else
+ #
+ # Use TurboCap API if present, otherwise don't
+ #
+ want_turbocap=ifpresent
+ fi
])
ac_cv_lbl_turbocap_api=no
[],
[enable_usb=yes])
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want USB support.
+ enable_usb=no
+fi
+
if test "x$enable_usb" != "xno" ; then
dnl check for USB sniffing support
AC_MSG_CHECKING(for USB sniffing support)
AC_SUBST(USB_SRC)
dnl check for netfilter sniffing support
-AC_MSG_CHECKING(whether the platform could support netfilter sniffing)
-case "$host_os" in
-linux*)
- AC_MSG_RESULT(yes)
- #
- # Life's too short to deal with trying to get this to compile
- # if you don't get the right types defined with
- # __KERNEL_STRICT_NAMES getting defined by some other include.
- #
- # Check whether the includes Just Work. If not, don't turn on
- # netfilter support.
- #
- AC_MSG_CHECKING(whether we can compile the netfilter support)
- AC_CACHE_VAL(ac_cv_netfilter_can_compile,
- AC_TRY_COMPILE([
+if test "xxx_only" != yes; then
+ AC_MSG_CHECKING(whether the platform could support netfilter sniffing)
+ case "$host_os" in
+ linux*)
+ AC_MSG_RESULT(yes)
+ #
+ # Life's too short to deal with trying to get this to compile
+ # if you don't get the right types defined with
+ # __KERNEL_STRICT_NAMES getting defined by some other include.
+ #
+ # Check whether the includes Just Work. If not, don't turn on
+ # netfilter support.
+ #
+ AC_MSG_CHECKING(whether we can compile the netfilter support)
+ AC_CACHE_VAL(ac_cv_netfilter_can_compile,
+ AC_TRY_COMPILE([
AC_INCLUDES_DEFAULT
#include <sys/socket.h>
#include <netinet/in.h>
[],
ac_cv_netfilter_can_compile=yes,
ac_cv_netfilter_can_compile=no))
- AC_MSG_RESULT($ac_cv_netfilter_can_compile)
- if test $ac_cv_netfilter_can_compile = yes ; then
- AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
- [target host supports netfilter sniffing])
- NETFILTER_SRC=pcap-netfilter-linux.c
- fi
- ;;
-*)
- AC_MSG_RESULT(no)
- ;;
-esac
+ AC_MSG_RESULT($ac_cv_netfilter_can_compile)
+ if test $ac_cv_netfilter_can_compile = yes ; then
+ AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
+ [target host supports netfilter sniffing])
+ NETFILTER_SRC=pcap-netfilter-linux.c
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac
+fi
AC_SUBST(PCAP_SUPPORT_NETFILTER)
AC_SUBST(NETFILTER_SRC)
[],
[enable_bluetooth=ifsupportavailable])
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want Bluetooth support.
+ enable_bluetooth=no
+fi
+
if test "x$enable_bluetooth" != "xno" ; then
dnl check for Bluetooth sniffing support
case "$host_os" in
[],
[enable_canusb=ifsupportavailable])
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want canusb support.
+ enable_canusb=no
+fi
+
if test "x$enable_canusb" != "xno" ; then
dnl check for canusb support
case "$host_os" in
[],
[enable_can=ifsupportavailable])
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want CAN support.
+ enable_can=no
+fi
+
if test "x$enable_can" != "xno" ; then
dnl check for CAN sniffing support
case "$host_os" in
[],
[enable_dbus=ifavailable])
+if test "xxx_only" = yes; then
+ # User requested something-else-only pcap, so they don't
+ # want D-Bus support.
+ enable_dbus=no
+fi
+
if test "x$enable_dbus" != "xno"; then
if test "x$enable_dbus" = "xyes"; then
case "$host_os" in
return p->linktype;
}
+
+#ifdef DAG_ONLY
+/*
+ * This libpcap build supports only DAG cards, not regular network
+ * interfaces.
+ */
+
+/*
+ * There are no regular interfaces, just DAG interfaces.
+ */
+int
+pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
+{
+ *alldevsp = NULL;
+ return (0);
+}
+
+/*
+ * Attempts to open a regular interface fail.
+ */
+pcap_t *
+pcap_create_interface(const char *device, char *errbuf)
+{
+ pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
+ "This version of libpcap only supports DAG cards");
+ return NULL;
+}
+#endif
fprintf(errbuf, PCAP_ERRBUF_SIZE, "Non-blocking mode not supported on Septel devices");
return (-1);
}
+
+#ifdef SEPTEL_ONLY
+/*
+ * This libpcap build supports only Septel cards, not regular network
+ * interfaces.
+ */
+
+/*
+ * There are no regular interfaces, just Septel interfaces.
+ */
+int
+pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
+{
+ *alldevsp = NULL;
+ return (0);
+}
+
+/*
+ * Attempts to open a regular interface fail.
+ */
+pcap_t *
+pcap_create_interface(const char *device, char *errbuf)
+{
+ pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
+ "This version of libpcap only supports Septel cards");
+ return (NULL);
+}
+#endif
ps->snf_boardnum = boardnum;
return p;
}
+
+#ifdef SNF_ONLY
+/*
+ * This libpcap build supports only SNF cards, not regular network
+ * interfaces..
+ */
+
+/*
+ * There are no regular interfaces, just DAG interfaces.
+ */
+int
+pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
+{
+ *alldevsp = NULL;
+ return (0);
+}
+
+/*
+ * Attempts to open a regular interface fail.
+ */
+pcap_t *
+pcap_create_interface(const char *device, char *errbuf)
+{
+ pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
+ "This version of libpcap only supports SNF cards");
+ return NULL;
+}
+#endif
return (p->read_op(p, 1, p->oneshot_callback, (u_char *)&s));
}
-#if defined(DAG_ONLY)
-int
-pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
-{
- return (dag_findalldevs(alldevsp, errbuf));
-}
-
-pcap_t *
-pcap_create(const char *device, char *errbuf)
-{
- int is_ours;
- return (dag_create(device, errbuf, &is_ours));
-}
-#elif defined(SEPTEL_ONLY)
-int
-pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
-{
- return (septel_findalldevs(alldevsp, errbuf));
-}
-
-pcap_t *
-pcap_create(const char *device, char *errbuf)
-{
- int is_ours;
- return (septel_create(device, errbuf, &is_ours));
-}
-#elif defined(SNF_ONLY)
-int
-pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
-{
- return (snf_findalldevs(alldevsp, errbuf));
-}
-
-pcap_t *
-pcap_create(const char *device, char *errbuf)
-{
- int is_ours;
- return (snf_create(device, errbuf, &is_ours));
-}
-#else /* regular pcap */
struct capture_source_type {
int (*findalldevs_op)(pcap_if_t **, char *);
pcap_t *(*create_op)(const char *, char *, int *);
p->opt.device = device_str;
return (p);
}
-#endif
static void
initialize_ops(pcap_t *p)