summaryrefslogtreecommitdiffstats
path: root/contrib/libpcap/grammar.y
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2000-01-30 00:43:38 +0000
committerfenner <fenner@FreeBSD.org>2000-01-30 00:43:38 +0000
commit787eaee1ab20ef667522f74c0de780af3da9ee19 (patch)
tree3d97dbb185f58043dc42b43fc1544771c223280c /contrib/libpcap/grammar.y
parentcd005a95696048ba76613daaa83178e68751c681 (diff)
downloadFreeBSD-src-787eaee1ab20ef667522f74c0de780af3da9ee19.zip
FreeBSD-src-787eaee1ab20ef667522f74c0de780af3da9ee19.tar.gz
Merge libpcap 0.5
Diffstat (limited to 'contrib/libpcap/grammar.y')
-rw-r--r--contrib/libpcap/grammar.y36
1 files changed, 31 insertions, 5 deletions
diff --git a/contrib/libpcap/grammar.y b/contrib/libpcap/grammar.y
index 0803c6d..cc4797f 100644
--- a/contrib/libpcap/grammar.y
+++ b/contrib/libpcap/grammar.y
@@ -19,10 +19,11 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
+ * $FreeBSD$
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: grammar.y,v 1.56 96/11/02 21:54:55 leres Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.57 1999/10/19 15:18:30 itojun Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -102,21 +103,22 @@ pcap_parse()
%type <rblk> other
%token DST SRC HOST GATEWAY
-%token NET MASK PORT LESS GREATER PROTO BYTE
-%token ARP RARP IP TCP UDP ICMP IGMP IGRP
+%token NET MASK PORT LESS GREATER PROTO PROTOCHAIN BYTE
+%token ARP RARP IP TCP UDP ICMP IGMP IGRP PIM
%token ATALK DECNET LAT SCA MOPRC MOPDL
%token TK_BROADCAST TK_MULTICAST
%token NUM INBOUND OUTBOUND
%token LINK
%token GEQ LEQ NEQ
-%token ID EID HID
+%token ID EID HID HID6
%token LSH RSH
%token LEN
%token ISO ESIS ISIS
+%token IPV6 ICMPV6 AH ESP
%type <s> ID
%type <e> EID
-%type <s> HID
+%type <s> HID HID6
%type <i> NUM
%left OR AND
@@ -168,6 +170,24 @@ nid: ID { $$.b = gen_scode($1, $$.q = $<blk>0.q); }
break;
}
}
+ | HID6 '/' NUM {
+#ifdef INET6
+ $$.b = gen_mcode6($1, NULL, $3,
+ $$.q = $<blk>0.q);
+#else
+ bpf_error("'ip6addr/prefixlen' not supported "
+ "in this configuration");
+#endif /*INET6*/
+ }
+ | HID6 {
+#ifdef INET6
+ $$.b = gen_mcode6($1, 0, 128,
+ $$.q = $<blk>0.q);
+#else
+ bpf_error("'ip6addr' not supported "
+ "in this configuration");
+#endif /*INET6*/
+ }
| EID { $$.b = gen_ecode($1, $$.q = $<blk>0.q); }
| not id { gen_not($2.b); $$ = $2; }
;
@@ -190,6 +210,7 @@ head: pqual dqual aqual { QSET($$.q, $1, $2, $3); }
| pqual dqual { QSET($$.q, $1, $2, Q_DEFAULT); }
| pqual aqual { QSET($$.q, $1, Q_DEFAULT, $2); }
| pqual PROTO { QSET($$.q, $1, Q_DEFAULT, Q_PROTO); }
+ | pqual PROTOCHAIN { QSET($$.q, $1, Q_DEFAULT, Q_PROTOCHAIN); }
| pqual ndaqual { QSET($$.q, $1, Q_DEFAULT, $2); }
;
rterm: head id { $$ = $2; }
@@ -230,12 +251,17 @@ pname: LINK { $$ = Q_LINK; }
| ICMP { $$ = Q_ICMP; }
| IGMP { $$ = Q_IGMP; }
| IGRP { $$ = Q_IGRP; }
+ | PIM { $$ = Q_PIM; }
| ATALK { $$ = Q_ATALK; }
| DECNET { $$ = Q_DECNET; }
| LAT { $$ = Q_LAT; }
| SCA { $$ = Q_SCA; }
| MOPDL { $$ = Q_MOPDL; }
| MOPRC { $$ = Q_MOPRC; }
+ | IPV6 { $$ = Q_IPV6; }
+ | ICMPV6 { $$ = Q_ICMPV6; }
+ | AH { $$ = Q_AH; }
+ | ESP { $$ = Q_ESP; }
| ISO { $$ = Q_ISO; }
| ESIS { $$ = Q_ESIS; }
| ISIS { $$ = Q_ISIS; }
OpenPOWER on IntegriCloud