Permalink
Browse files

IPv6 packet filtering code.

./configure --enable-ipv6 (requires getaddrinfo(3) and getnameinfo(3)).

TODO: make it work even without getaddrinfo(3) or getnameinfo(3)
(or, tcpdump/configure.in should provide alternative version by
AC_REPLACE_FUNCS)
TODO: make IPv6 filtering code work by default
TODO: make "protochain" friendly with optimization
  • Loading branch information...
1 parent db0e314 commit 7fe3c1111adb85e0c50edc054340341b9ccd6c5b itojun committed Oct 19, 1999
Showing with 1,310 additions and 150 deletions.
  1. +2 −2 Makefile.in
  2. +2 −2 aclocal.m4
  3. +19 −4 bpf/net/bpf.h
  4. +215 −106 configure
  5. +18 −5 configure.in
  6. +824 −16 gencode.c
  7. +19 −1 gencode.h
  8. +30 −5 grammar.y
  9. +29 −1 nametoaddr.c
  10. +87 −1 optimize.c
  11. +26 −2 pcap-bpf.c
  12. +2 −2 pcap-int.h
  13. +5 −1 pcap-namedb.h
  14. +3 −1 ppp.h
  15. +29 −1 scanner.l
View
@@ -17,7 +17,7 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.73 1999-10-10 01:47:05 mcr Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.74 1999-10-19 15:18:28 itojun Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -65,7 +65,7 @@ YACC = @V_YACC@
# problem if you don't own the file but can write to the directory.
.c.o:
@rm -f $@
- $(CC) $(CFLAGS) -c $<
+ $(CC) $(CFLAGS) -c $(srcdir)/$*.c
PSRC = pcap-@V_PCAP@.c
CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
View
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/libpcap/aclocal.m4,v 1.64 1999-10-10 01:47:05 mcr Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/libpcap/aclocal.m4,v 1.65 1999-10-19 15:18:28 itojun Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved.
@@ -51,7 +51,7 @@ AC_DEFUN(AC_LBL_C_INIT,
$1="-O"
$2=""
if test "${srcdir}" != "." ; then
- $2="-I\$(srcdir)"
+ $2="-I\$\(srcdir\)"
fi
if test "${CFLAGS+set}" = set; then
LBL_CFLAGS="$CFLAGS"
View
@@ -37,7 +37,7 @@
*
* @(#)bpf.h 7.1 (Berkeley) 5/7/91
*
- * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.36 1999-10-07 23:46:41 mcr Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.37 1999-10-19 15:18:31 itojun Exp $ (LBL)
*/
#ifndef BPF_MAJOR_VERSION
@@ -52,7 +52,11 @@ typedef u_int bpf_u_int32;
* Alignment macros. BPF_WORDALIGN rounds up to the next
* even multiple of BPF_ALIGNMENT.
*/
+#ifndef __NetBSD__
#define BPF_ALIGNMENT sizeof(bpf_int32)
+#else
+#define BPF_ALIGNMENT sizeof(long)
+#endif
#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
#define BPF_MAXINSNS 512
@@ -168,10 +172,21 @@ struct bpf_hdr {
#define DLT_SLIP 8 /* Serial Line IP */
#define DLT_PPP 9 /* Point-to-point Protocol */
#define DLT_FDDI 10 /* FDDI */
+#ifdef __FreeBSD__
+#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
+#endif
+#ifdef __OpenBSD__
#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
-#define DLT_RAW 12 /* raw IP */
-#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
-#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
+#define DLT_LOOP 12 /* loopback */
+#endif
+/* offset to avoid collision with BSD/OS values */
+#ifndef DLT_ATM_RFC1483
+#define DLT_ATM_RFC1483 100 /* LLC/SNAP encapsulated atm */
+#endif
+#define DLT_RAW 101 /* raw IP */
+#define DLT_SLIP_BSDOS 102 /* BSD/OS Serial Line IP */
+#define DLT_PPP_BSDOS 103 /* BSD/OS Point-to-point Protocol */
+#define DLT_CHDLC 104 /* Cisco HDLC */
/*
* The instruction encondings.
Oops, something went wrong.

0 comments on commit 7fe3c11

Please sign in to comment.