]> The Tcpdump Group git mirrors - libpcap/commitdiff
Patch from NetBSD, by Klaus Klein <[email protected]>, to support "vrrp"
authorguy <guy>
Wed, 21 Feb 2001 09:33:03 +0000 (09:33 +0000)
committerguy <guy>
Wed, 21 Feb 2001 09:33:03 +0000 (09:33 +0000)
as an IP protocol, like "udp", "tcp", "icmp", "pim", etc..

CREDITS
gencode.c
gencode.h
grammar.y
scanner.l

diff --git a/CREDITS b/CREDITS
index bc2507e8b2aaf10cf77cc05b544a223335938929..611892931e61ea77d35086118ab0ba49a3d3d023 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -21,6 +21,7 @@ Additional people who have contributed patches:
        Igor Khristophorov              <[email protected]>
        Jefferson Ogata                 <[email protected]>
        Juergen Schoenwaelder           <[email protected]>
+       Klaus Klein                     <[email protected]>
        Lorenzo Cavallaro               <[email protected]>
        Love Hörnquist-Ã…strand          <[email protected]>
        Monroe Williams                 <[email protected]>
index c824b61ea25303b4ad2b54df5164582c88078f58..a033a783a90a861604b834bd1ed2002559953172 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.148 2001-02-12 09:33:21 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.149 2001-02-21 09:33:04 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -1698,6 +1698,9 @@ gen_host(addr, mask, proto, dir)
        case Q_PIM:
                bpf_error("'pim' modifier applied to host");
 
+       case Q_VRRP:
+               bpf_error("'vrrp' modifier applied to host");
+
        case Q_ATALK:
                bpf_error("ATALK host filtering not implemented");
 
@@ -1800,6 +1803,9 @@ gen_host6(addr, mask, proto, dir)
        case Q_PIM:
                bpf_error("'pim' modifier applied to host");
 
+       case Q_VRRP:
+               bpf_error("'vrrp' modifier applied to host");
+
        case Q_ATALK:
                bpf_error("ATALK host filtering not implemented");
 
@@ -1963,6 +1969,14 @@ gen_proto_abbrev(proto)
 #endif
                break;
 
+#ifndef IPPROTO_VRRP
+#define IPPROTO_VRRP   112
+#endif
+
+       case Q_VRRP:
+               b1 = gen_proto(IPPROTO_VRRP, Q_IP, Q_DEFAULT);
+               break;
+
        case Q_IP:
                b1 =  gen_linktype(ETHERTYPE_IP);
                break;
@@ -2704,6 +2718,10 @@ gen_proto(v, proto, dir)
                bpf_error("'pim proto' is bogus");
                /* NOTREACHED */
 
+       case Q_VRRP:
+               bpf_error("'vrrp proto' is bogus");
+               /* NOTREACHED */
+
 #ifdef INET6
        case Q_IPV6:
                b0 = gen_linktype(ETHERTYPE_IPV6);
@@ -3254,6 +3272,7 @@ gen_load(proto, index, size)
        case Q_IGMP:
        case Q_IGRP:
        case Q_PIM:
+       case Q_VRRP:
                s = new_stmt(BPF_LDX|BPF_MSH|BPF_B);
                s->s.k = off_nl;
                sappend(s, xfer_to_a(index));
index fa76fcbfaf342cf6d3797456959f0224315d1bbd..8dfdcb6305f3e08fa48e4a97abdeaddefe898a49 100644 (file)
--- a/gencode.h
+++ b/gencode.h
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.50 2001-01-28 09:44:49 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.51 2001-02-21 09:33:05 guy Exp $ (LBL)
  */
 
 /* Address qualifiers. */
 #define Q_ESP          19
 
 #define Q_PIM          20
+#define Q_VRRP         21
 
-#define        Q_AARP          21
+#define Q_AARP         22
 
-#define Q_ISO          22
-#define Q_ESIS         23
-#define Q_ISIS         24
-#define Q_CLNP         25
+#define Q_ISO          23
+#define Q_ESIS         24
+#define Q_ISIS         25
+#define Q_CLNP         26
 
-#define Q_STP          26
+#define Q_STP          27
 
-#define Q_IPX          27
+#define Q_IPX          28
 
-#define Q_NETBEUI      28
+#define Q_NETBEUI      29
 
 /* Directional qualifiers. */
 
index 3b26e27002b7dc23e8bf28b5b5067b863f8dadd9..52281b4219ce59476a77ca922ef1b821dcd2311b 100644 (file)
--- a/grammar.y
+++ b/grammar.y
@@ -22,7 +22,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.67 2001-01-28 09:44:50 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.68 2001-02-21 09:33:05 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -106,7 +106,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  ARP RARP IP TCP UDP ICMP IGMP IGRP PIM VRRP
 %token  ATALK AARP DECNET LAT SCA MOPRC MOPDL
 %token  TK_BROADCAST TK_MULTICAST
 %token  NUM INBOUND OUTBOUND
@@ -251,6 +251,7 @@ pname:        LINK                  { $$ = Q_LINK; }
        | IGMP                  { $$ = Q_IGMP; }
        | IGRP                  { $$ = Q_IGRP; }
        | PIM                   { $$ = Q_PIM; }
+       | VRRP                  { $$ = Q_VRRP; }
        | ATALK                 { $$ = Q_ATALK; }
        | AARP                  { $$ = Q_AARP; }
        | DECNET                { $$ = Q_DECNET; }
index b6ed45accfdefa53907aa8cca4f2e9b679e519ed..4ebc199234bf24ef8d7e411d2330d4cc15e47e45 100644 (file)
--- a/scanner.l
+++ b/scanner.l
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.73 2001-01-28 09:44:50 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.74 2001-02-21 09:33:06 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -176,6 +176,7 @@ icmp                return ICMP;
 igmp           return IGMP;
 igrp           return IGRP;
 pim            return PIM;
+vrrp           return VRRP;
 
 ip6            return IPV6;
 icmp6          return ICMPV6;