summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/punt_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-05-21 06:54:54 -0700
committerOle Trøan <otroan@employees.org>2019-06-04 10:32:46 +0000
commitb538dd868665009f9a3737610177342f88e3ba80 (patch)
tree2e2a1964e56a70e7c2584668b8f32017311e834c /src/vnet/ip/punt_api.c
parent0c6ac791dde099346af1752aa92d0eb05fc2db11 (diff)
Punt: specify packets by IP protocol Type
Change-Id: I0c2d6fccd95146e52bb88ca4a6e84554d5d6b2ed Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/punt_api.c')
-rw-r--r--src/vnet/ip/punt_api.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vnet/ip/punt_api.c b/src/vnet/ip/punt_api.c
index 95fff714b46..b356886a56f 100644
--- a/src/vnet/ip/punt_api.c
+++ b/src/vnet/ip/punt_api.c
@@ -96,6 +96,18 @@ vl_api_punt_l4_decode (const vl_api_punt_l4_t * in, punt_l4_t * out)
}
static int
+vl_api_punt_ip_proto_decode (const vl_api_punt_ip_proto_t * in,
+ punt_ip_proto_t * out)
+{
+ int rv;
+
+ rv = ip_address_family_decode (in->af, &out->af);
+ rv += ip_proto_decode (in->protocol, &out->protocol);
+
+ return (rv);
+}
+
+static int
vl_api_punt_exception_decode (const vl_api_punt_exception_t * in,
punt_exception_t * out)
{
@@ -124,6 +136,9 @@ vl_api_punt_decode (const vl_api_punt_t * in, punt_reg_t * out)
case PUNT_TYPE_EXCEPTION:
return (vl_api_punt_exception_decode (&in->punt.exception,
&out->punt.exception));
+ case PUNT_TYPE_IP_PROTO:
+ return (vl_api_punt_ip_proto_decode (&in->punt.ip_proto,
+ &out->punt.ip_proto));
}
return (-1);
@@ -138,6 +153,14 @@ vl_api_punt_l4_encode (const punt_l4_t * in, vl_api_punt_l4_t * out)
}
static void
+vl_api_punt_ip_proto_encode (const punt_ip_proto_t * in,
+ vl_api_punt_ip_proto_t * out)
+{
+ out->af = ip_address_family_encode (in->af);
+ out->protocol = ip_proto_encode (in->protocol);
+}
+
+static void
vl_api_punt_exception_encode (const punt_exception_t * in,
vl_api_punt_exception_t * out)
{
@@ -154,6 +177,9 @@ vl_api_punt_encode (const punt_reg_t * in, vl_api_punt_t * out)
case PUNT_TYPE_L4:
vl_api_punt_l4_encode (&in->punt.l4, &out->punt.l4);
break;
+ case PUNT_TYPE_IP_PROTO:
+ vl_api_punt_ip_proto_encode (&in->punt.ip_proto, &out->punt.ip_proto);
+ break;
case PUNT_TYPE_EXCEPTION:
vl_api_punt_exception_encode (&in->punt.exception,
&out->punt.exception);