summaryrefslogtreecommitdiff
path: root/lib/libpcap/gencode.h
diff options
context:
space:
mode:
authoritojun <itojun@NetBSD.org>1999-07-02 10:05:22 +0000
committeritojun <itojun@NetBSD.org>1999-07-02 10:05:22 +0000
commitc6f88a42f468b45ffa052d50fe70acc86b98a5c4 (patch)
treeb02c54482a4b6d0989d999d980eb279c963419a8 /lib/libpcap/gencode.h
parent22b07aaafdf84686043596c4264b6d011a67b19d (diff)
support IPv6 address and IPv6 protocols.
"tcp" will match both IPv4 TCP and IPv6 TCP. "ip6" will match IPv6. you can chase header chain by using "protochain" instead of "proto" (but bpf code is not optimizable in this case) commit to tcpdump will follow. I've sent this fix to LBL guys to get no response. I wonder why it was.
Diffstat (limited to 'lib/libpcap/gencode.h')
-rw-r--r--lib/libpcap/gencode.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/libpcap/gencode.h b/lib/libpcap/gencode.h
index 23487021ca9..dbe45cd908d 100644
--- a/lib/libpcap/gencode.h
+++ b/lib/libpcap/gencode.h
@@ -1,4 +1,4 @@
-/* $NetBSD: gencode.h,v 1.5 1997/10/03 15:53:06 christos Exp $ */
+/* $NetBSD: gencode.h,v 1.6 1999/07/02 10:05:22 itojun Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
@@ -33,6 +33,7 @@
#define Q_PORT 3
#define Q_GATEWAY 4
#define Q_PROTO 5
+#define Q_PROTOCHAIN 6
/* Protocol qualifiers. */
@@ -54,6 +55,14 @@
#define Q_MOPRC 14
#define Q_MOPDL 15
+
+#define Q_IPV6 16
+#define Q_ICMPV6 17
+#define Q_AH 18
+#define Q_ESP 19
+
+#define Q_PIM 20
+
/* Directional qualifiers. */
#define Q_SRC 1
@@ -64,8 +73,12 @@
#define Q_DEFAULT 0
#define Q_UNDEF 255
+struct slist;
+
struct stmt {
int code;
+ struct slist *jt; /*only for relative jump in block*/
+ struct slist *jf; /*only for relative jump in block*/
bpf_int32 k;
};
@@ -149,9 +162,14 @@ void gen_and(struct block *, struct block *);
void gen_or(struct block *, struct block *);
void gen_not(struct block *);
+struct stmt *gen_joinsp __P((struct stmt **, int));
+struct block *gen_protochain __P((int, int, int));
struct block *gen_scode(const char *, struct qual);
struct block *gen_ecode(const u_char *, struct qual);
struct block *gen_mcode(const char *, const char *, int, struct qual);
+#ifdef INET6
+struct block *gen_mcode6(const char *, const char *, int, struct qual);
+#endif
struct block *gen_ncode(const char *, bpf_u_int32, struct qual);
struct block *gen_proto_abbrev(int);
struct block *gen_relation(int, struct arth *, struct arth *, int);
@@ -179,3 +197,5 @@ void sappend(struct slist *, struct slist *);
/* XXX */
#define JT(b) ((b)->et.succ)
#define JF(b) ((b)->ef.succ)
+
+extern int no_optimize;