]> The Tcpdump Group git mirrors - libpcap/blobdiff - gencode.c
Add support for CARP.
[libpcap] / gencode.c
index 7281d40f74c3a14a9c218b142204fd27fbabc28b..cb6a12cc6008fa5465dbc16a47962c62aa81a85a 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -4666,6 +4666,9 @@ gen_host(addr, mask, proto, dir, type)
        case Q_VRRP:
                bpf_error("'vrrp' modifier applied to %s", typestr);
 
+       case Q_CARP:
+               bpf_error("'carp' modifier applied to %s", typestr);
+
        case Q_ATALK:
                bpf_error("ATALK host filtering not implemented");
 
@@ -4785,6 +4788,9 @@ gen_host6(addr, mask, proto, dir, type)
        case Q_VRRP:
                bpf_error("'vrrp' modifier applied to %s", typestr);
 
+       case Q_CARP:
+               bpf_error("'carp' modifier applied to %s", typestr);
+
        case Q_ATALK:
                bpf_error("ATALK host filtering not implemented");
 
@@ -5000,6 +5006,14 @@ gen_proto_abbrev(proto)
                b1 = gen_proto(IPPROTO_VRRP, Q_IP, Q_DEFAULT);
                break;
 
+#ifndef IPPROTO_CARP
+#define IPPROTO_CARP   112
+#endif
+
+       case Q_CARP:
+               b1 = gen_proto(IPPROTO_CARP, Q_IP, Q_DEFAULT);
+               break;
+
        case Q_IP:
                b1 =  gen_linktype(ETHERTYPE_IP);
                break;
@@ -6164,6 +6178,10 @@ gen_proto(v, proto, dir)
                bpf_error("'vrrp proto' is bogus");
                /* NOTREACHED */
 
+       case Q_CARP:
+               bpf_error("'carp proto' is bogus");
+               /* NOTREACHED */
+
 #ifdef INET6
        case Q_IPV6:
                b0 = gen_linktype(ETHERTYPE_IPV6);
@@ -7033,6 +7051,7 @@ gen_load(proto, inst, size)
        case Q_IGRP:
        case Q_PIM:
        case Q_VRRP:
+       case Q_CARP:
                /*
                 * The offset is relative to the beginning of
                 * the transport-layer header.