summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-01-28 11:39:27 -0800
committerFlorin Coras <fcoras@cisco.com>2021-01-28 11:39:57 -0800
commit6a6555ac34cf1c74cb3d82ae3b77232797c73b6a (patch)
treeb08e21864bb7bc6041ee4d948435e9367e73b286 /src/vcl/vppcom.c
parent096a1d599c494ad03575528a1b2d8ec139407fce (diff)
vcl: support set/get vrf attribute
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I011faa52939d44bdc90de69ad381dc1eea8c8eb3
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 184cb821e1d..cf8bb72d451 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -183,6 +183,7 @@ vcl_send_session_listen (vcl_worker_t * wrk, vcl_session_t * s)
mp->port = s->transport.lcl_port;
mp->proto = s->session_type;
mp->ckpair_index = s->ckpair_index;
+ mp->vrf = s->vrf;
if (s->flags & VCL_SESSION_F_CONNECTED)
mp->flags = TRANSPORT_CFG_F_CONNECTED;
app_send_ctrl_evt_to_vpp (mq, app_evt);
@@ -210,6 +211,7 @@ vcl_send_session_connect (vcl_worker_t * wrk, vcl_session_t * s)
mp->lcl_port = s->transport.lcl_port;
mp->proto = s->session_type;
mp->ckpair_index = s->ckpair_index;
+ mp->vrf = s->vrf;
if (s->flags & VCL_SESSION_F_CONNECTED)
mp->flags |= TRANSPORT_CFG_F_CONNECTED;
app_send_ctrl_evt_to_vpp (mq, app_evt);
@@ -3673,6 +3675,25 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
session->ckpair_index = *(uint32_t *) buffer;
break;
+ case VPPCOM_ATTR_SET_VRF:
+ if (!(buffer && buflen && (*buflen == sizeof (u32))))
+ {
+ rv = VPPCOM_EINVAL;
+ break;
+ }
+ session->vrf = *(u32 *) buffer;
+ break;
+
+ case VPPCOM_ATTR_GET_VRF:
+ if (!(buffer && buflen && (*buflen >= sizeof (u32))))
+ {
+ rv = VPPCOM_EINVAL;
+ break;
+ }
+ *(u32 *) buffer = session->vrf;
+ *buflen = sizeof (u32);
+ break;
+
default:
rv = VPPCOM_EINVAL;
break;