summaryrefslogtreecommitdiffstats
path: root/contrib/libpcap/grammar.y
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libpcap/grammar.y')
-rw-r--r--contrib/libpcap/grammar.y35
1 files changed, 30 insertions, 5 deletions
diff --git a/contrib/libpcap/grammar.y b/contrib/libpcap/grammar.y
index 6bc9157..104056f 100644
--- a/contrib/libpcap/grammar.y
+++ b/contrib/libpcap/grammar.y
@@ -22,7 +22,7 @@
*/
#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,20 +102,21 @@ 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 IPV6 ICMPV6 AH ESP
%type <s> ID
%type <e> EID
-%type <s> HID
+%type <s> HID HID6
%type <i> NUM
%left OR AND
@@ -167,6 +168,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; }
;
@@ -189,6 +208,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; }
@@ -229,12 +249,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; }
;
other: pqual TK_BROADCAST { $$ = gen_broadcast($1); }
| pqual TK_MULTICAST { $$ = gen_multicast($1); }
OpenPOWER on IntegriCloud