vcl session: refactor passing of crypto context
[vpp.git] / src / vcl / vcl_private.c
index 721416b..464061c 100644 (file)
@@ -315,6 +315,21 @@ vcl_session_write_ready (vcl_session_t * s)
     }
 }
 
+int
+vcl_session_alloc_ext_cfg (vcl_session_t *s,
+                          transport_endpt_ext_cfg_type_t type)
+{
+  if (s->ext_config)
+    return -1;
+
+  s->ext_config = clib_mem_alloc (sizeof (transport_endpt_ext_cfg_t));
+  clib_memset (s->ext_config, 0, sizeof (*s->ext_config));
+  s->ext_config->len = sizeof (*s->ext_config);
+  s->ext_config->type = type;
+
+  return 0;
+}
+
 int
 vcl_segment_attach (u64 segment_handle, char *name, ssvm_segment_type_t type,
                    int fd)