summaryrefslogtreecommitdiff
path: root/m4/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/acinclude.m4')
-rw-r--r--m4/acinclude.m487
1 files changed, 0 insertions, 87 deletions
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index f0d8ef8..b0e1891 100644
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -26,93 +26,6 @@ AC_DEFUN([AC_LIBNET_LINUX_PROCFS],
fi])
dnl
-dnl Checks to see if this linux kernel has a working PF_PACKET
-dnl
-dnl usage:
-dnl
-dnl AC_LIBNET_CHECK_PF_PACKET
-dnl
-dnl results:
-dnl
-dnl HAVE_PACKET_SOCKET (DEFINED)
-dnl
-
-AC_DEFUN([AC_LIBNET_CHECK_PF_PACKET],
-[
- AC_MSG_CHECKING(for packet socket (PF_PACKET))
- AC_CACHE_VAL(libnet_cv_have_packet_socket,
-
- [
- cat > pf_packet-test.c << EOF
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <features.h> /* for the glibc version number */
-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
-#include <netpacket/packet.h>
-#include <net/ethernet.h> /* the L2 protocols */
-#else
-#include <asm/types.h>
-#include <linux/if_packet.h>
-#include <linux/if_ether.h> /* The L2 protocols */
-#endif
-
-#ifndef SOL_PACKET
-#define SOL_PACKET 263
-#endif /* SOL_PACKET */
-
-int
-main(int argc, char **argv)
-{
- int fd;
-
- fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
- if (fd == -1)
- {
- if (errno == EPERM)
- {
- /* user's UID != 0 */
- printf("probably");
- exit (EXIT_FAILURE);
- }
- printf("no");
- exit (EXIT_FAILURE);
- }
- printf("yes");
- exit (EXIT_SUCCESS);
-}
-EOF
- ${CC-cc} -o pf_packet-test $CFLAGS pf_packet-test.c >/dev/null 2>&1
-
- # Oopz 4.3 BSD doesn't have this. Sorry.
- if test ! -x ./pf_packet-test ; then
- libnet_cv_have_packet_socket=choked
- else
- libnet_cv_have_packet_socket=`./pf_packet-test`;
- fi
- if test $libnet_cv_have_packet_socket = choked; then
- AC_MSG_RESULT(test program compile choked... assuming no)
- elif test $libnet_cv_have_packet_socket = yes; then
- AC_MSG_RESULT(yes)
- elif test $libnet_cv_have_packet_socket = probably; then
- AC_MSG_RESULT(test program got EPERM... assuming yes)
- elif test $libnet_cv_have_packet_socket = no; then
- AC_MSG_RESULT(no)
- fi
-
- rm -f pf_packet-test* core core.pf_packet-test
-
- ])
-
- if test $libnet_cv_have_packet_socket = yes -o $libnet_cv_have_packet_socket = probably; then
- AC_DEFINE(HAVE_PACKET_SOCKET, 1,
- [Define if we're running on a Linux system with PF_PACKET sockets.])
- fi
-])
-
-dnl
dnl Looks for a previous libnet version and attempts to determine which version
dnl it is. Version 0.8 was the first version that actually knew internally
dnl what version it was.