diff options
author | fenner <fenner@FreeBSD.org> | 2001-04-03 04:32:48 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2001-04-03 04:32:48 +0000 |
commit | d32fa93f24ce5894c091b4ef4250282b79b0c97a (patch) | |
tree | 00b0f42b64d9b575c61aa73d86663036cce36d6d /contrib/libpcap/grammar.y | |
parent | 5ccd472c6889df29bc50ce8be4693073dc13e49c (diff) | |
download | FreeBSD-src-d32fa93f24ce5894c091b4ef4250282b79b0c97a.zip FreeBSD-src-d32fa93f24ce5894c091b4ef4250282b79b0c97a.tar.gz |
Merge libpcap 0.6.2
Diffstat (limited to 'contrib/libpcap/grammar.y')
-rw-r--r-- | contrib/libpcap/grammar.y | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/contrib/libpcap/grammar.y b/contrib/libpcap/grammar.y index cc4797f..a73208e 100644 --- a/contrib/libpcap/grammar.y +++ b/contrib/libpcap/grammar.y @@ -23,12 +23,17 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.57 1999/10/19 15:18:30 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.64 2000/10/28 10:18:40 guy Exp $ (LBL)"; +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" #endif #include <sys/types.h> #include <sys/time.h> #include <sys/socket.h> +#include <stdlib.h> #if __STDC__ struct mbuf; @@ -38,7 +43,6 @@ struct rtentry; #include <net/if.h> #include <netinet/in.h> -#include <net/ethernet.h> #include <stdio.h> @@ -47,7 +51,6 @@ struct rtentry; #include "gencode.h" #include <pcap-namedb.h> -#include "gnuc.h" #ifdef HAVE_OS_PROTO_H #include "os-proto.h" #endif @@ -105,7 +108,7 @@ pcap_parse() %token DST SRC HOST GATEWAY %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 ATALK AARP DECNET LAT SCA MOPRC MOPDL %token TK_BROADCAST TK_MULTICAST %token NUM INBOUND OUTBOUND %token LINK @@ -113,8 +116,9 @@ pcap_parse() %token ID EID HID HID6 %token LSH RSH %token LEN -%token ISO ESIS ISIS %token IPV6 ICMPV6 AH ESP +%token VLAN +%token ISO ESIS ISIS CLNP %type <s> ID %type <e> EID @@ -161,14 +165,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 @@ -253,6 +250,7 @@ pname: LINK { $$ = Q_LINK; } | IGRP { $$ = Q_IGRP; } | PIM { $$ = Q_PIM; } | ATALK { $$ = Q_ATALK; } + | AARP { $$ = Q_AARP; } | DECNET { $$ = Q_DECNET; } | LAT { $$ = Q_LAT; } | SCA { $$ = Q_SCA; } @@ -265,6 +263,7 @@ pname: LINK { $$ = Q_LINK; } | ISO { $$ = Q_ISO; } | ESIS { $$ = Q_ESIS; } | ISIS { $$ = Q_ISIS; } + | CLNP { $$ = Q_CLNP; } ; other: pqual TK_BROADCAST { $$ = gen_broadcast($1); } | pqual TK_MULTICAST { $$ = gen_multicast($1); } @@ -273,6 +272,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; } |