aboutsummaryrefslogtreecommitdiffstats
path: root/grammar.y
diff options
context:
space:
mode:
authorguy <guy>2000-10-22 04:15:55 +0000
committerguy <guy>2000-10-22 04:15:55 +0000
commit98a503e84307f830f1d42a33b701869f5e2ce4fb (patch)
tree01516208b7e01f70238514d0f464bfa20d8382a3 /grammar.y
parent62518217343f5859819e14d6b35041a4b190d301 (diff)
Improved VLAN support, from Peter Jeremy - "vlan" filtering keyword,
letting you filter based on the VLAN to which a packet belongs, and an improvement to the printing of VLAN packets (adding an extra space to separate the VLAN priority and flags from the next stuff printed).
Diffstat (limited to 'grammar.y')
-rw-r--r--grammar.y14
1 files changed, 5 insertions, 9 deletions
diff --git a/grammar.y b/grammar.y
index fc8d6e5..9932f42 100644
--- a/grammar.y
+++ b/grammar.y
@@ -22,7 +22,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.60 2000-09-23 07:26:28 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.61 2000-10-22 04:15:56 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -116,6 +116,7 @@ pcap_parse()
%token LSH RSH
%token LEN
%token IPV6 ICMPV6 AH ESP
+%token VLAN
%type <s> ID
%type <e> EID
@@ -162,14 +163,7 @@ nid: ID { $$.b = gen_scode($1, $$.q = $<blk>0.q); }
| HID {
/* Decide how to parse HID based on proto */
$$.q = $<blk>0.q;
- switch ($$.q.proto) {
- case Q_DECNET:
- $$.b = gen_ncode($1, 0, $$.q);
- break;
- default:
- $$.b = gen_ncode($1, 0, $$.q);
- break;
- }
+ $$.b = gen_ncode($1, 0, $$.q);
}
| HID6 '/' NUM {
#ifdef INET6
@@ -271,6 +265,8 @@ other: pqual TK_BROADCAST { $$ = gen_broadcast($1); }
| BYTE NUM byteop NUM { $$ = gen_byteop($3, $2, $4); }
| INBOUND { $$ = gen_inbound(0); }
| OUTBOUND { $$ = gen_inbound(1); }
+ | VLAN pnum { $$ = gen_vlan($2); }
+ | VLAN { $$ = gen_vlan(-1); }
;
relop: '>' { $$ = BPF_JGT; }
| GEQ { $$ = BPF_JGE; }