summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-05-01 16:01:40 -0700
committerFlorin Coras <fcoras@cisco.com>2021-05-01 16:25:18 -0700
commit87f63898b4ad54c081e8aaeb35e465b2fe23b9b3 (patch)
tree0781a5e2a1723fc0a714ab74e422ee362f627e00 /src/vcl/vppcom.c
parentf89bbbe300dad7bc479db535e7822199f98aca30 (diff)
vcl: attr api to set endpt ext config
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I06cd3721c1b534e9449bf96760c02ca30628c21e
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 5e37dcfef39..96a207b741f 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3697,7 +3697,8 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
}
if (!session->ext_config)
{
- vcl_session_alloc_ext_cfg (session, TRANSPORT_ENDPT_EXT_CFG_CRYPTO);
+ vcl_session_alloc_ext_cfg (session, TRANSPORT_ENDPT_EXT_CFG_CRYPTO,
+ sizeof (transport_endpt_ext_cfg_t));
}
else if (session->ext_config->type != TRANSPORT_ENDPT_EXT_CFG_CRYPTO)
{
@@ -3744,6 +3745,23 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
*buflen);
break;
+ case VPPCOM_ATTR_SET_ENDPT_EXT_CFG:
+ if (!(buffer && buflen && (*buflen > 0)))
+ {
+ rv = VPPCOM_EINVAL;
+ break;
+ }
+ if (session->ext_config)
+ {
+ rv = VPPCOM_EINVAL;
+ break;
+ }
+ vcl_session_alloc_ext_cfg (session, TRANSPORT_ENDPT_EXT_CFG_NONE,
+ *buflen + sizeof (u32));
+ clib_memcpy (session->ext_config->data, buffer, *buflen);
+ session->ext_config->len = *buflen;
+ break;
+
default:
rv = VPPCOM_EINVAL;
break;