FD.io VPP  v21.06
Vector Packet Processing
vpp_echo_bapi.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <stdio.h>
17 #include <signal.h>
18 
20 
21 /*
22  *
23  * Binary API Messages
24  *
25  */
26 
27 void
29 {
31  bmp = vl_msg_api_alloc (sizeof (*bmp));
32  clib_memset (bmp, 0, sizeof (*bmp));
33 
34  bmp->_vl_msg_id = ntohs (VL_API_APP_ATTACH);
35  bmp->client_index = em->my_client_index;
36  bmp->context = ntohl (0xfeedface);
37  bmp->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_ACCEPT_REDIRECT;
38  bmp->options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_ADD_SEGMENT;
42  bmp->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = 128 << 20;
43  bmp->options[APP_OPTIONS_SEGMENT_SIZE] = 256 << 20;
45  if (em->appns_id)
46  {
50  }
51  vl_msg_api_send_shmem (em->vl_input_queue, (u8 *) & bmp);
52 }
53 
54 void
56 {
58  bmp = vl_msg_api_alloc (sizeof (*bmp));
59  clib_memset (bmp, 0, sizeof (*bmp));
60 
61  bmp->_vl_msg_id = ntohs (VL_API_APPLICATION_DETACH);
62  bmp->client_index = em->my_client_index;
63  bmp->context = ntohl (0xfeedface);
64 
65  vl_msg_api_send_shmem (em->vl_input_queue, (u8 *) & bmp);
66 }
67 
68 void
70 {
71  u32 cert_len = test_srv_crt_rsa_len;
74 
75  bmp = vl_msg_api_alloc (sizeof (*bmp) + cert_len + key_len);
76  clib_memset (bmp, 0, sizeof (*bmp) + cert_len + key_len);
77 
78  bmp->_vl_msg_id = ntohs (VL_API_APP_ADD_CERT_KEY_PAIR);
79  bmp->client_index = em->my_client_index;
80  bmp->context = ntohl (0xfeedface);
81  bmp->cert_len = clib_host_to_net_u16 (cert_len);
82  bmp->certkey_len = clib_host_to_net_u16 (key_len + cert_len);
83  clib_memcpy_fast (bmp->certkey, test_srv_crt_rsa, cert_len);
84  clib_memcpy_fast (bmp->certkey + cert_len, test_srv_key_rsa, key_len);
85 
86  vl_msg_api_send_shmem (em->vl_input_queue, (u8 *) & bmp);
87 }
88 
89 void
91 {
93  bmp = vl_msg_api_alloc (sizeof (*bmp));
94  clib_memset (bmp, 0, sizeof (*bmp));
95 
96  bmp->_vl_msg_id = ntohs (VL_API_APP_DEL_CERT_KEY_PAIR);
97  bmp->client_index = em->my_client_index;
98  bmp->context = ntohl (0xfeedface);
99  bmp->index = clib_host_to_net_u32 (em->ckpair_index);
100  vl_msg_api_send_shmem (em->vl_input_queue, (u8 *) & bmp);
101 }
102 
103 static u8
105 {
106  return proto == TRANSPORT_PROTO_TLS || proto == TRANSPORT_PROTO_DTLS ||
107  proto == TRANSPORT_PROTO_QUIC;
108 }
109 
110 static void
112 {
115 
116  c = echo_segment_alloc_chunk (ECHO_MQ_SEG_HANDLE, 0, sizeof (cfg), offset);
117  if (!c)
118  return;
119 
120  memset (&cfg, 0, sizeof (cfg));
122  cfg.len = sizeof (cfg);
123  cfg.crypto.ckpair_index = em->ckpair_index;
125  clib_memcpy_fast (c->data, &cfg, cfg.len);
126 }
127 
128 void
129 echo_send_listen (echo_main_t * em, ip46_address_t * ip)
130 {
131  app_session_evt_t _app_evt, *app_evt = &_app_evt;
133  svm_msg_q_t *mq = em->ctrl_mq;
134 
136  mp = (session_listen_msg_t *) app_evt->evt->data;
137  memset (mp, 0, sizeof (*mp));
138  mp->client_index = em->my_client_index;
139  mp->context = ntohl (0xfeedface);
140  mp->wrk_index = 0;
141  mp->is_ip4 = em->uri_elts.is_ip4;
142  clib_memcpy_fast (&mp->ip, ip, sizeof (mp->ip));
143  mp->port = em->uri_elts.port;
144  mp->proto = em->uri_elts.transport_proto;
147  app_send_ctrl_evt_to_vpp (mq, app_evt);
148 }
149 
150 void
152 {
153  app_session_evt_t _app_evt, *app_evt = &_app_evt;
155  svm_msg_q_t *mq = em->ctrl_mq;
156 
158  mp = (session_unlisten_msg_t *) app_evt->evt->data;
159  memset (mp, 0, sizeof (*mp));
160  mp->client_index = em->my_client_index;
161  mp->wrk_index = 0;
162  mp->handle = s->vpp_session_handle;
163  mp->context = 0;
164  app_send_ctrl_evt_to_vpp (mq, app_evt);
165 }
166 
167 void
168 echo_send_connect (echo_main_t * em, void *args)
169 {
170  app_session_evt_t _app_evt, *app_evt = &_app_evt;
173  svm_msg_q_t *mq = em->ctrl_mq;
174 
176  while (em->max_sim_connects <= 0)
177  ;
178 
180  mp = (session_connect_msg_t *) app_evt->evt->data;
181  memset (mp, 0, sizeof (*mp));
182  mp->client_index = em->my_client_index;
183  mp->context = ntohl (a->context);
184  mp->wrk_index = 0;
185  mp->is_ip4 = em->uri_elts.is_ip4;
186  clib_memcpy_fast (&mp->ip, &a->ip, sizeof (mp->ip));
187  clib_memcpy_fast (&mp->lcl_ip, &a->lcl_ip, sizeof (mp->ip));
188  mp->port = em->uri_elts.port;
189  mp->proto = em->uri_elts.transport_proto;
193  mp->flags = em->connect_flag;
194  app_send_ctrl_evt_to_vpp (mq, app_evt);
195 }
196 
197 void
199 {
200  echo_session_t *s;
201  app_session_evt_t _app_evt, *app_evt = &_app_evt;
203  svm_msg_q_t *mq = em->ctrl_mq;
205 
207  mp = (session_disconnect_msg_t *) app_evt->evt->data;
208  memset (mp, 0, sizeof (*mp));
209  mp->client_index = em->my_client_index;
210  mp->handle = a->session_handle;
211  app_send_ctrl_evt_to_vpp (mq, app_evt);
212 
213  if (!(s = echo_get_session_from_handle (em, mp->handle)))
214  return;
216 }
217 
218 /*
219  *
220  * Helpers
221  *
222  */
223 
224 int
226  int fd)
227 {
228  fifo_segment_create_args_t _a, *a = &_a;
229  echo_main_t *em = &echo_main;
231  int rv;
232 
233  clib_memset (a, 0, sizeof (*a));
234  a->segment_name = (char *) name;
235  a->segment_type = type;
236 
237  if (type == SSVM_SEGMENT_MEMFD)
238  a->memfd_fd = fd;
239 
240  sm = &em->segment_main;
241 
242  if ((rv = fifo_segment_attach (sm, a)))
243  return rv;
244 
246  hash_set (em->shared_segment_handles, segment_handle,
247  a->new_segment_indices[0]);
249 
251  return 0;
252 }
253 
254 u32
255 echo_segment_lookup (u64 segment_handle)
256 {
257  echo_main_t *em = &echo_main;
258  uword *segment_idxp;
259 
260  ECHO_LOG (3, "Check if segment mapped 0x%lx...", segment_handle);
261 
263  segment_idxp = hash_get (em->shared_segment_handles, segment_handle);
265  if (!segment_idxp)
266  return ~0;
267 
268  ECHO_LOG (2, "Segment not mapped (0x%lx)", segment_handle);
269  return ((u32) *segment_idxp);
270 }
271 
272 void
273 echo_segment_detach (u64 segment_handle)
274 {
275  echo_main_t *em = &echo_main;
277 
278  u32 segment_index = echo_segment_lookup (segment_handle);
279  if (segment_index == (u32) ~0)
280  return;
281 
282  sm = &em->segment_main;
283 
285  fifo_segment_delete (sm, fifo_segment_get_segment (sm, segment_index));
286  hash_unset (em->shared_segment_handles, segment_handle);
288 }
289 
290 int
291 echo_attach_session (uword segment_handle, uword rxf_offset, uword txf_offset,
292  uword mq_offset, echo_session_t *s)
293 {
294  echo_main_t *em = &echo_main;
295  u32 fs_index, eqs_index;
296  fifo_segment_t *fs;
297 
298  fs_index = echo_segment_lookup (segment_handle);
299  if (fs_index == (u32) ~0)
300  {
301  ECHO_LOG (0, "ERROR: segment for session %u is not mounted!",
302  s->session_index);
303  return -1;
304  }
305 
306  if (mq_offset != (uword) ~0)
307  {
309  ASSERT (eqs_index != (u32) ~0);
310  }
311 
313 
314  fs = fifo_segment_get_segment (&em->segment_main, fs_index);
315  s->rx_fifo = fifo_segment_alloc_fifo_w_offset (fs, rxf_offset);
316  s->tx_fifo = fifo_segment_alloc_fifo_w_offset (fs, txf_offset);
317  s->rx_fifo->segment_index = fs_index;
318  s->tx_fifo->segment_index = fs_index;
319  s->rx_fifo->shr->client_session_index = s->session_index;
320  s->tx_fifo->shr->client_session_index = s->session_index;
321 
322  if (mq_offset != (uword) ~0)
323  {
324  fs = fifo_segment_get_segment (&em->segment_main, eqs_index);
325  s->vpp_evt_q = fifo_segment_msg_q_attach (fs, mq_offset,
326  s->rx_fifo->shr->slice_index);
327  }
328 
330 
331  return 0;
332 }
333 
334 int
335 echo_segment_attach_mq (uword segment_handle, uword mq_offset, u32 mq_index,
336  svm_msg_q_t **mq)
337 {
338  echo_main_t *em = &echo_main;
339  fifo_segment_t *fs;
340  u32 fs_index;
341 
342  fs_index = echo_segment_lookup (segment_handle);
343  if (fs_index == (u32) ~0)
344  {
345  ECHO_LOG (0, "ERROR: mq segment %lx for is not attached!",
346  segment_handle);
347  return -1;
348  }
349 
351 
352  fs = fifo_segment_get_segment (&em->segment_main, fs_index);
353  *mq = fifo_segment_msg_q_attach (fs, mq_offset, mq_index);
354 
356 
357  return 0;
358 }
359 
361 echo_segment_alloc_chunk (uword segment_handle, u32 slice_index, u32 size,
362  uword *offset)
363 {
364  echo_main_t *em = &echo_main;
366  fifo_segment_t *fs;
367  u32 fs_index;
368 
369  fs_index = echo_segment_lookup (segment_handle);
370  if (fs_index == (u32) ~0)
371  {
372  ECHO_LOG (0, "ERROR: mq segment %lx for is not attached!",
373  segment_handle);
374  return 0;
375  }
376 
378 
379  fs = fifo_segment_get_segment (&em->segment_main, fs_index);
380  c = fifo_segment_alloc_chunk_w_slice (fs, slice_index, size);
381  *offset = fifo_segment_chunk_offset (fs, c);
382 
384 
385  return c;
386 }
387 
388 /*
389  *
390  * Binary API callbacks
391  *
392  */
393 
394 static void
397 {
398  echo_main_t *em = &echo_main;
399  if (mp->retval)
400  {
401  ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY,
402  "Adding cert and key returned %d",
403  clib_net_to_host_u32 (mp->retval));
404  return;
405  }
406  /* No concurrency here, only bapi thread writes */
407  if (em->state != STATE_ATTACHED_NO_CERT)
408  {
409  ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY, "Wrong state");
410  return;
411  }
412  em->ckpair_index = clib_net_to_host_u32 (mp->index);
413  em->state = STATE_ATTACHED;
414 }
415 
416 static void
418  (vl_api_app_del_cert_key_pair_reply_t * mp)
419 {
420  echo_main_t *em = &echo_main;
421  if (mp->retval)
422  {
423  ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_DEL_REPLY,
424  "Delete cert and key returned %d",
425  clib_net_to_host_u32 (mp->retval));
426  return;
427  }
429 }
430 
431 static void
433 {
434  echo_main_t *em = &echo_main;
435  int *fds = 0, i, rv;
436  u32 n_fds = 0;
437  u64 segment_handle;
438  char *segment_name = 0;
439 
440  segment_handle = clib_net_to_host_u64 (mp->segment_handle);
441  ECHO_LOG (2, "Attached returned app %u", htons (mp->app_index));
442 
443  if (mp->retval)
444  {
445  ECHO_FAIL (ECHO_FAIL_VL_API_APP_ATTACH, "attach failed: %U",
446  format_api_error, clib_net_to_host_u32 (mp->retval));
447  return;
448  }
449 
450  if (!mp->app_mq)
451  {
452  ECHO_FAIL (ECHO_FAIL_VL_API_NULL_APP_MQ, "NULL app_mq");
453  return;
454  }
455 
456  if (mp->n_fds)
457  {
458  vec_validate (fds, mp->n_fds);
459  if (vl_socket_client_recv_fd_msg (fds, mp->n_fds, 5))
460  {
461  ECHO_FAIL (ECHO_FAIL_VL_API_RECV_FD_MSG,
462  "vl_socket_client_recv_fd_msg failed");
463  goto failed;
464  }
465 
466  if (mp->fd_flags & SESSION_FD_F_VPP_MQ_SEGMENT)
468  fds[n_fds++]))
469  {
470  ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
471  "svm_fifo_segment_attach failed on SSVM_SEGMENT_MEMFD");
472  goto failed;
473  }
475  mp->vpp_ctrl_mq_thread, &em->ctrl_mq);
476 
477  if (mp->fd_flags & SESSION_FD_F_MEMFD_SEGMENT)
478  {
479  segment_name = vl_api_from_api_to_new_c_string (&mp->segment_name);
480  rv = echo_segment_attach (segment_handle, segment_name,
481  SSVM_SEGMENT_MEMFD, fds[n_fds++]);
482  if (rv != 0)
483  {
484  ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
485  "svm_fifo_segment_attach ('%s') "
486  "failed on SSVM_SEGMENT_MEMFD", segment_name);
487  vec_free (segment_name);
488  goto failed;
489  }
490  vec_free (segment_name);
491  }
492  echo_segment_attach_mq (segment_handle, mp->app_mq, 0, &em->app_mq);
493 
494  if (mp->fd_flags & SESSION_FD_F_MQ_EVENTFD)
495  svm_msg_q_set_eventfd (em->app_mq, fds[n_fds++]);
496 
497  vec_free (fds);
498  }
499  else
500  {
501  segment_name = vl_api_from_api_to_new_c_string (&mp->segment_name);
502  rv = echo_segment_attach (segment_handle, segment_name, SSVM_SEGMENT_SHM,
503  -1);
504  if (rv != 0)
505  {
506  ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
507  "svm_fifo_segment_attach ('%s') "
508  "failed on SSVM_SEGMENT_SHM", segment_name);
509  vec_free (segment_name);
510  goto failed;
511  }
512  vec_free (segment_name);
513  }
514  ECHO_LOG (2, "Mapped segment 0x%lx", segment_handle);
515 
517  return;
518 failed:
519  for (i = clib_max (n_fds - 1, 0); i < vec_len (fds); i++)
520  close (fds[i]);
521  vec_free (fds);
522 }
523 
524 static void
525 vl_api_application_detach_reply_t_handler (vl_api_application_detach_reply_t *
526  mp)
527 {
528  if (mp->retval)
529  {
530  ECHO_FAIL (ECHO_FAIL_VL_API_DETACH_REPLY,
531  "app detach returned with err: %d", mp->retval);
532  return;
533  }
535 }
536 
537 #define foreach_quic_echo_msg \
538 _(APP_ATTACH_REPLY, app_attach_reply) \
539 _(APPLICATION_DETACH_REPLY, application_detach_reply) \
540 _(APP_ADD_CERT_KEY_PAIR_REPLY, app_add_cert_key_pair_reply) \
541 _(APP_DEL_CERT_KEY_PAIR_REPLY, app_del_cert_key_pair_reply)
542 
543 void
545 {
546 #define _(N,n) \
547  vl_msg_api_set_handlers(VL_API_##N, #n, \
548  vl_api_##n##_t_handler, \
549  vl_noop_handler, \
550  vl_api_##n##_t_endian, \
551  vl_api_##n##_t_print, \
552  sizeof(vl_api_##n##_t), 1);
554 #undef _
555 }
556 
557 /*
558  * fd.io coding-style-patch-verification: ON
559  *
560  * Local Variables:
561  * eval: (c-set-style "gnu")
562  * End:
563  */
svm_msg_q_t * ctrl_mq
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:524
string namespace_id[]
Definition: session.api:41
#define hash_set(h, key, value)
Definition: hash.h:255
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
Definition: lock.h:121
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
Definition: lock.h:82
static void vl_api_app_add_cert_key_pair_reply_t_handler(vl_api_app_add_cert_key_pair_reply_t *mp)
Add certificate and key.
Definition: session.api:103
#define hash_unset(h, key)
Definition: hash.h:261
a
Definition: bitmap.h:544
int echo_segment_attach_mq(uword segment_handle, uword mq_offset, u32 mq_index, svm_msg_q_t **mq)
#define ntohs(x)
Definition: af_xdp.bpf.c:29
svm_msg_q_t * fifo_segment_msg_q_attach(fifo_segment_t *fs, uword offset, u32 mq_index)
Attach message queue at fifo segment offset.
void echo_send_del_cert_key(echo_main_t *em)
Definition: vpp_echo_bapi.c:90
svm_queue_t * vl_input_queue
unsigned long u64
Definition: types.h:89
ip46_address_t ip
void fifo_segment_delete(fifo_segment_main_t *sm, fifo_segment_t *s)
Definition: fifo_segment.c:420
static u8 * format_api_error(u8 *s, va_list *args)
Definition: api_main.c:12
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
struct echo_main_t::@681 uri_elts
void echo_send_add_cert_key(echo_main_t *em)
Definition: vpp_echo_bapi.c:69
void svm_msg_q_set_eventfd(svm_msg_q_t *mq, int fd)
Set event fd for queue.
u16 key_len
Definition: ikev2_types.api:95
echo_main_t echo_main
Definition: vpp_echo.c:24
ip46_address_t lcl_ip
svm_fifo_t * fifo_segment_alloc_fifo_w_offset(fifo_segment_t *fs, uword offset)
Definition: fifo_segment.c:891
volatile connection_state_t state
string name[64]
Definition: fib.api:25
uword fifo_segment_chunk_offset(fifo_segment_t *fs, svm_fifo_chunk_t *c)
transport_endpt_crypto_cfg_t crypto
volatile int max_sim_connects
void * vl_msg_api_alloc(int nbytes)
unsigned char u8
Definition: types.h:56
foreach_app_session_field u64 vpp_session_handle
unsigned int u32
Definition: types.h:88
fifo_segment_t * fifo_segment_get_segment(fifo_segment_main_t *sm, u32 segment_index)
Definition: fifo_segment.c:435
enum ssvm_segment_type_ ssvm_segment_type_t
static void app_alloc_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt, u8 evt_type)
void echo_send_attach(echo_main_t *em)
Definition: vpp_echo_bapi.c:28
Application attach reply.
Definition: session.api:59
static const u32 test_srv_key_rsa_len
Definition: tls_test.h:77
void echo_send_unbind(echo_main_t *em, echo_session_t *s)
clib_spinlock_t segment_handles_lock
void echo_send_disconnect_session(echo_main_t *em, void *args)
#define ECHO_FAIL(fail, _fmt, _args...)
static void vl_api_app_del_cert_key_pair_reply_t_handler(vl_api_app_del_cert_key_pair_reply_t *mp)
int __clib_unused rv
Definition: application.c:491
void vl_msg_api_send_shmem(svm_queue_t *q, u8 *elem)
char * segment_name
segment name
Definition: fifo_segment.h:89
vl_api_fib_path_type_t type
Definition: fib_types.api:123
int fifo_segment_attach(fifo_segment_main_t *sm, fifo_segment_create_args_t *a)
Attach as slave to a fifo segment.
Definition: fifo_segment.c:381
#define hash_get(h, key)
Definition: hash.h:249
int echo_segment_attach(u64 segment_handle, char *name, ssvm_segment_type_t type, int fd)
vl_api_ip_proto_t proto
Definition: acl_types.api:51
static u8 echo_transport_needs_crypto(transport_proto_t proto)
u32 size
Definition: vhost_user.h:125
void echo_api_hookup(echo_main_t *em)
#define ECHO_MQ_SEG_HANDLE
static void vl_api_application_detach_reply_t_handler(vl_api_application_detach_reply_t *mp)
static const char test_srv_crt_rsa[]
Definition: tls_test.h:23
fifo_segment_main_t segment_main
svm_msg_q_t * app_mq
static void echo_msg_add_crypto_ext_config(echo_main_t *em, uword *offset)
#define clib_atomic_sub_fetch(a, b)
Definition: atomics.h:31
static void app_send_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt)
Add certificate and key.
Definition: session.api:90
clib_error_t * vl_socket_client_recv_fd_msg(int fds[], int n_fds, u32 wait)
svmdb_client_t * c
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:261
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:395
svm_fifo_chunk_t * echo_segment_alloc_chunk(uword segment_handle, u32 slice_index, u32 size, uword *offset)
#define foreach_quic_echo_msg
uword * shared_segment_handles
#define ECHO_LOG(lvl, _fmt, _args...)
char * vl_api_from_api_to_new_c_string(vl_api_string_t *astr)
Definition: api_shared.c:1218
static void vl_api_app_attach_reply_t_handler(vl_api_app_attach_reply_t *mp)
int memfd_fd
fd for memfd segments
Definition: fifo_segment.h:88
static const char test_srv_key_rsa[]
Definition: tls_test.h:49
#define ASSERT(truth)
Application detach from session layer.
Definition: session.api:77
u32 echo_segment_lookup(u64 segment_handle)
u8 data[0]
start of chunk data
Definition: fifo_types.h:45
enum _transport_proto transport_proto_t
description security check failed
Definition: map.api:373
echo_session_t * echo_get_session_from_handle(echo_main_t *em, u64 handle)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
svm_fifo_chunk_t * fifo_segment_alloc_chunk_w_slice(fifo_segment_t *fs, u32 slice_index, u32 chunk_size)
#define clib_max(x, y)
Definition: clib.h:335
ssvm_segment_type_t segment_type
type of segment requested
Definition: fifo_segment.h:86
void echo_send_detach(echo_main_t *em)
Definition: vpp_echo_bapi.c:55
template key/value backing page structure
Definition: bihash_doc.h:44
vl_api_address_t ip
Definition: l2.api:558
void(* sent_disconnect_cb)(echo_session_t *s)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u64 uword
Definition: types.h:112
void echo_segment_detach(u64 segment_handle)
echo_proto_cb_vft_t * proto_cb_vft
void echo_send_listen(echo_main_t *em, ip46_address_t *ip)
int echo_attach_session(uword segment_handle, uword rxf_offset, uword txf_offset, uword mq_offset, echo_session_t *s)
void echo_send_connect(echo_main_t *em, void *args)
Application attach to session layer.
Definition: session.api:37
Delete certificate and key.
Definition: session.api:114
int vl_api_vec_to_api_string(const u8 *vec, vl_api_string_t *str)
Definition: api_shared.c:1175
static const u32 test_srv_crt_rsa_len
Definition: tls_test.h:47
u32 * new_segment_indices
return vec of new seg indices
Definition: fifo_segment.h:90