FD.io VPP  v18.11-rc0-18-g2a3fb1a
Vector Packet Processing
echo_server.c
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2015-2017 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 <vnet/vnet.h>
17 #include <vlibmemory/api.h>
20 
21 typedef struct
22 {
23  /*
24  * Server app parameters
25  */
27  svm_queue_t *vl_input_queue; /**< Sever's event queue */
28 
29  u32 app_index; /**< Server app index */
30  u32 my_client_index; /**< API client handle */
31  u32 node_index; /**< process node index for evnt scheduling */
32 
33  /*
34  * Config params
35  */
36  u8 no_echo; /**< Don't echo traffic */
37  u32 fifo_size; /**< Fifo size */
38  u32 rcv_buffer_size; /**< Rcv buffer size */
39  u32 prealloc_fifos; /**< Preallocate fifos */
40  u32 private_segment_count; /**< Number of private segments */
41  u32 private_segment_size; /**< Size of private segments */
42  char *server_uri; /**< Server URI */
43  u32 tls_engine; /**< TLS engine: mbedtls/openssl */
44  u8 is_dgram; /**< set if transport is dgram */
45  /*
46  * Test state
47  */
48  u8 **rx_buf; /**< Per-thread RX buffer */
51 
54 
56 
57 int
59 {
61 
62  esm->vpp_queue[s->thread_index] =
63  session_manager_get_vpp_event_queue (s->thread_index);
64  s->session_state = SESSION_STATE_READY;
65  esm->byte_index = 0;
66  ASSERT (vec_len (esm->rx_retries) > s->thread_index);
67  vec_validate (esm->rx_retries[s->thread_index], s->session_index);
68  esm->rx_retries[s->thread_index][s->session_index] = 0;
69  return 0;
70 }
71 
72 void
74 {
76  vnet_disconnect_args_t _a, *a = &_a;
77 
78  a->handle = session_handle (s);
79  a->app_index = esm->app_index;
81 }
82 
83 void
85 {
86  clib_warning ("Reset session %U", format_stream_session, s, 2);
88 }
89 
90 int
92  stream_session_t * s, u8 is_fail)
93 {
94  clib_warning ("called...");
95  return -1;
96 }
97 
98 int
100 {
101  /* New heaps may be added */
102  return 0;
103 }
104 
105 int
107 {
108  clib_warning ("called...");
109  return -1;
110 }
111 
112 void
113 test_bytes (echo_server_main_t * esm, int actual_transfer)
114 {
115  int i;
116  u32 my_thread_id = vlib_get_thread_index ();
117 
118  for (i = 0; i < actual_transfer; i++)
119  {
120  if (esm->rx_buf[my_thread_id][i] != ((esm->byte_index + i) & 0xff))
121  {
122  clib_warning ("at %lld expected %d got %d", esm->byte_index + i,
123  (esm->byte_index + i) & 0xff,
124  esm->rx_buf[my_thread_id][i]);
125  }
126  }
127  esm->byte_index += actual_transfer;
128 }
129 
130 /*
131  * If no-echo, just drop the data and be done with it.
132  */
133 int
135 {
136  svm_fifo_t *rx_fifo = s->server_rx_fifo;
137  svm_fifo_dequeue_drop (rx_fifo, svm_fifo_max_dequeue (rx_fifo));
138  return 0;
139 }
140 
141 int
143 {
144  u32 n_written, max_dequeue, max_enqueue, max_transfer;
145  int actual_transfer;
146  svm_fifo_t *tx_fifo, *rx_fifo;
148  u32 thread_index = vlib_get_thread_index ();
150 
151  ASSERT (s->thread_index == thread_index);
152 
153  rx_fifo = s->server_rx_fifo;
154  tx_fifo = s->server_tx_fifo;
155 
156  ASSERT (rx_fifo->master_thread_index == thread_index);
157  ASSERT (tx_fifo->master_thread_index == thread_index);
158 
159  max_enqueue = svm_fifo_max_enqueue (tx_fifo);
160  if (!esm->is_dgram)
161  {
162  max_dequeue = svm_fifo_max_dequeue (rx_fifo);
163  }
164  else
165  {
167  svm_fifo_peek (rx_fifo, 0, sizeof (ph), (u8 *) & ph);
168  max_dequeue = ph.data_length - ph.data_offset;
169  if (!esm->vpp_queue[s->thread_index])
170  {
171  svm_msg_q_t *mq;
172  mq = session_manager_get_vpp_event_queue (s->thread_index);
173  esm->vpp_queue[s->thread_index] = mq;
174  }
175  max_enqueue -= sizeof (session_dgram_hdr_t);
176  }
177 
178  if (PREDICT_FALSE (max_dequeue == 0))
179  return 0;
180 
181  /* Number of bytes we're going to copy */
182  max_transfer = clib_min (max_dequeue, max_enqueue);
183 
184  /* No space in tx fifo */
185  if (PREDICT_FALSE (max_transfer == 0))
186  {
187  /* XXX timeout for session that are stuck */
188 
189  rx_event:
190  /* Program self-tap to retry */
191  if (svm_fifo_set_event (rx_fifo))
192  {
194  clib_warning ("failed to enqueue self-tap");
195 
196  vec_validate (esm->rx_retries[s->thread_index], s->session_index);
197  if (esm->rx_retries[thread_index][s->session_index] == 500000)
198  {
199  clib_warning ("session stuck: %U", format_stream_session, s, 2);
200  }
201  if (esm->rx_retries[thread_index][s->session_index] < 500001)
202  esm->rx_retries[thread_index][s->session_index]++;
203  }
204 
205  return 0;
206  }
207 
208  vec_validate (esm->rx_buf[thread_index], max_transfer);
209  if (!esm->is_dgram)
210  {
211  actual_transfer = app_recv_stream_raw (rx_fifo,
212  esm->rx_buf[thread_index],
213  max_transfer,
214  0 /* don't clear event */ );
215  }
216  else
217  {
218  actual_transfer = app_recv_dgram_raw (rx_fifo,
219  esm->rx_buf[thread_index],
220  max_transfer, &at,
221  0 /* don't clear event */ );
222  }
223  ASSERT (actual_transfer == max_transfer);
224  /* test_bytes (esm, actual_transfer); */
225 
226  /*
227  * Echo back
228  */
229 
230  if (!esm->is_dgram)
231  {
232  n_written = app_send_stream_raw (tx_fifo,
233  esm->vpp_queue[thread_index],
234  esm->rx_buf[thread_index],
235  actual_transfer, 0);
236  }
237  else
238  {
239  n_written = app_send_dgram_raw (tx_fifo, &at,
240  esm->vpp_queue[s->thread_index],
241  esm->rx_buf[thread_index],
242  actual_transfer, 0);
243  }
244 
245  if (n_written != max_transfer)
246  clib_warning ("short trout! written %u read %u", n_written, max_transfer);
247 
248  if (PREDICT_FALSE (svm_fifo_max_dequeue (rx_fifo)))
249  goto rx_event;
250 
251  return 0;
252 }
253 
255  .session_accept_callback = echo_server_session_accept_callback,
256  .session_disconnect_callback = echo_server_session_disconnect_callback,
257  .session_connected_callback = echo_server_session_connected_callback,
258  .add_segment_callback = echo_server_add_segment_callback,
259  .builtin_app_rx_callback = echo_server_rx_callback,
260  .session_reset_callback = echo_server_session_reset_callback
261 };
262 
263 /* Abuse VPP's input queue */
264 static int
266 {
268  api_main_t *am = &api_main;
270 
271  shmem_hdr = am->shmem_hdr;
272  esm->vl_input_queue = shmem_hdr->vl_input_queue;
273  esm->my_client_index = vl_api_memclnt_create_internal ("echo_server",
274  esm->vl_input_queue);
275  return 0;
276 }
277 
278 static int
279 echo_server_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret)
280 {
281  vnet_app_add_tls_cert_args_t _a_cert, *a_cert = &_a_cert;
282  vnet_app_add_tls_key_args_t _a_key, *a_key = &_a_key;
284  vnet_app_attach_args_t _a, *a = &_a;
285  u64 options[APP_OPTIONS_N_OPTIONS];
286  u32 segment_size = 512 << 20;
287 
288  memset (a, 0, sizeof (*a));
289  memset (options, 0, sizeof (options));
290 
291  if (esm->no_echo)
292  echo_server_session_cb_vft.builtin_app_rx_callback =
294  else
295  echo_server_session_cb_vft.builtin_app_rx_callback =
297 
298  if (esm->private_segment_size)
299  segment_size = esm->private_segment_size;
300 
301  a->api_client_index = esm->my_client_index;
302  a->session_cb_vft = &echo_server_session_cb_vft;
303  a->options = options;
304  a->options[APP_OPTIONS_SEGMENT_SIZE] = segment_size;
305  a->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = segment_size;
306  a->options[APP_OPTIONS_RX_FIFO_SIZE] = esm->fifo_size;
307  a->options[APP_OPTIONS_TX_FIFO_SIZE] = esm->fifo_size;
309  a->options[APP_OPTIONS_TLS_ENGINE] = esm->tls_engine;
310  a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] =
311  esm->prealloc_fifos ? esm->prealloc_fifos : 1;
312 
313  a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
314  if (appns_id)
315  {
316  a->namespace_id = appns_id;
317  a->options[APP_OPTIONS_FLAGS] |= appns_flags;
318  a->options[APP_OPTIONS_NAMESPACE_SECRET] = appns_secret;
319  }
320 
321  if (vnet_application_attach (a))
322  {
323  clib_warning ("failed to attach server");
324  return -1;
325  }
326  esm->app_index = a->app_index;
327 
328  memset (a_cert, 0, sizeof (*a_cert));
329  a_cert->app_index = a->app_index;
330  vec_validate (a_cert->cert, test_srv_crt_rsa_len);
332  vnet_app_add_tls_cert (a_cert);
333 
334  memset (a_key, 0, sizeof (*a_key));
335  a_key->app_index = a->app_index;
336  vec_validate (a_key->key, test_srv_key_rsa_len);
338  vnet_app_add_tls_key (a_key);
339  return 0;
340 }
341 
342 static int
344 {
346  vnet_app_detach_args_t _da, *da = &_da;
347  int rv;
348 
349  da->app_index = esm->app_index;
350  rv = vnet_application_detach (da);
351  esm->app_index = ~0;
352  return rv;
353 }
354 
355 static int
357 {
359  vnet_bind_args_t _a, *a = &_a;
360  memset (a, 0, sizeof (*a));
361  a->app_index = esm->app_index;
362  a->uri = esm->server_uri;
363  return vnet_bind_uri (a);
364 }
365 
366 static int
367 echo_server_create (vlib_main_t * vm, u8 * appns_id, u64 appns_flags,
368  u64 appns_secret)
369 {
372  u32 num_threads;
373  int i;
374 
375  if (esm->my_client_index == (u32) ~ 0)
376  {
377  if (create_api_loopback (vm))
378  {
379  clib_warning ("failed to create api loopback");
380  return -1;
381  }
382  }
383 
384  num_threads = 1 /* main thread */ + vtm->n_threads;
385  vec_validate (echo_server_main.vpp_queue, num_threads - 1);
386  vec_validate (esm->rx_buf, num_threads - 1);
387  vec_validate (esm->rx_retries, num_threads - 1);
388  for (i = 0; i < vec_len (esm->rx_retries); i++)
389  vec_validate (esm->rx_retries[i],
390  pool_elts (session_manager_main.sessions[i]));
392  for (i = 0; i < num_threads; i++)
393  vec_validate (esm->rx_buf[i], esm->rcv_buffer_size);
394 
395  if (echo_server_attach (appns_id, appns_flags, appns_secret))
396  {
397  clib_warning ("failed to attach server");
398  return -1;
399  }
400  if (echo_server_listen ())
401  {
402  clib_warning ("failed to start listening");
403  if (echo_server_detach ())
404  clib_warning ("failed to detach");
405  return -1;
406  }
407  return 0;
408 }
409 
410 static clib_error_t *
412  vlib_cli_command_t * cmd)
413 {
415  u8 server_uri_set = 0, *appns_id = 0;
416  u64 tmp, appns_flags = 0, appns_secret = 0;
417  char *default_uri = "tcp://0.0.0.0/1234";
418  int rv, is_stop = 0;
419 
420  esm->no_echo = 0;
421  esm->fifo_size = 64 << 10;
422  esm->rcv_buffer_size = 128 << 10;
423  esm->prealloc_fifos = 0;
424  esm->private_segment_count = 0;
425  esm->private_segment_size = 0;
427  esm->is_dgram = 0;
428  vec_free (esm->server_uri);
429 
431  {
432  if (unformat (input, "uri %s", &esm->server_uri))
433  server_uri_set = 1;
434  else if (unformat (input, "no-echo"))
435  esm->no_echo = 1;
436  else if (unformat (input, "fifo-size %d", &esm->fifo_size))
437  esm->fifo_size <<= 10;
438  else if (unformat (input, "rcv-buf-size %d", &esm->rcv_buffer_size))
439  ;
440  else if (unformat (input, "prealloc-fifos %d", &esm->prealloc_fifos))
441  ;
442  else if (unformat (input, "private-segment-count %d",
443  &esm->private_segment_count))
444  ;
445  else if (unformat (input, "private-segment-size %U",
446  unformat_memory_size, &tmp))
447  {
448  if (tmp >= 0x100000000ULL)
449  return clib_error_return
450  (0, "private segment size %lld (%llu) too large", tmp, tmp);
451  esm->private_segment_size = tmp;
452  }
453  else if (unformat (input, "appns %_%v%_", &appns_id))
454  ;
455  else if (unformat (input, "all-scope"))
456  appns_flags |= (APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE
457  | APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE);
458  else if (unformat (input, "local-scope"))
459  appns_flags |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
460  else if (unformat (input, "global-scope"))
461  appns_flags |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
462  else if (unformat (input, "secret %lu", &appns_secret))
463  ;
464  else if (unformat (input, "stop"))
465  is_stop = 1;
466  else if (unformat (input, "tls-engine %d", &esm->tls_engine))
467  ;
468  else
469  return clib_error_return (0, "failed: unknown input `%U'",
470  format_unformat_error, input);
471  }
472 
473  if (is_stop)
474  {
475  if (esm->app_index == (u32) ~ 0)
476  {
477  clib_warning ("server not running");
478  return clib_error_return (0, "failed: server not running");
479  }
480  rv = echo_server_detach ();
481  if (rv)
482  {
483  clib_warning ("failed: detach");
484  return clib_error_return (0, "failed: server detach %d", rv);
485  }
486  return 0;
487  }
488 
489  vnet_session_enable_disable (vm, 1 /* turn on TCP, etc. */ );
490 
491  if (!server_uri_set)
492  {
493  clib_warning ("No uri provided! Using default: %s", default_uri);
494  esm->server_uri = (char *) format (0, "%s%c", default_uri, 0);
495  }
496  if (esm->server_uri[0] == 'u' && esm->server_uri[3] != 'c')
497  esm->is_dgram = 1;
498 
499  rv = echo_server_create (vm, appns_id, appns_flags, appns_secret);
500  vec_free (appns_id);
501  if (rv)
502  {
503  vec_free (esm->server_uri);
504  return clib_error_return (0, "failed: server_create returned %d", rv);
505  }
506 
507  return 0;
508 }
509 
510 /* *INDENT-OFF* */
511 VLIB_CLI_COMMAND (echo_server_create_command, static) =
512 {
513  .path = "test echo server",
514  .short_help = "test echo server proto <proto> [no echo][fifo-size <mbytes>]"
515  "[rcv-buf-size <bytes>][prealloc-fifos <count>]"
516  "[private-segment-count <count>][private-segment-size <bytes[m|g]>]"
517  "[uri <tcp://ip/port>]",
518  .function = echo_server_create_command_fn,
519 };
520 /* *INDENT-ON* */
521 
522 clib_error_t *
524 {
526  esm->my_client_index = ~0;
527  return 0;
528 }
529 
531 
532 /*
533 * fd.io coding-style-patch-verification: ON
534 *
535 * Local Variables:
536 * eval: (c-set-style "gnu")
537 * End:
538 */
static int echo_server_listen()
Definition: echo_server.c:356
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:437
#define clib_min(x, y)
Definition: clib.h:289
int echo_server_rx_callback(stream_session_t *s)
Definition: echo_server.c:142
u32 vl_api_memclnt_create_internal(char *name, svm_queue_t *q)
Definition: memory_api.c:112
a
Definition: bitmap.h:538
const u32 test_srv_crt_rsa_len
void echo_server_session_reset_callback(stream_session_t *s)
Definition: echo_server.c:84
static int app_send_dgram_raw(svm_fifo_t *f, app_session_transport_t *at, svm_msg_q_t *vpp_evt_q, u8 *data, u32 len, u8 noblock)
int vnet_bind_uri(vnet_bind_args_t *a)
static int app_recv_dgram_raw(svm_fifo_t *f, u8 *buf, u32 len, app_session_transport_t *at, u8 clear_evt)
const u32 test_srv_key_rsa_len
u8 no_echo
Don&#39;t echo traffic.
Definition: echo_server.c:36
unsigned long u64
Definition: types.h:89
session_manager_main_t session_manager_main
Definition: session.c:27
u32 fifo_size
Fifo size.
Definition: echo_server.c:37
u32 private_segment_size
Size of private segments.
Definition: echo_server.c:41
static int echo_server_detach(void)
Definition: echo_server.c:343
int i
static u32 svm_fifo_max_enqueue(svm_fifo_t *f)
Definition: svm_fifo.h:117
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
struct _vnet_application_add_tls_cert_args_t vnet_app_add_tls_cert_args_t
int echo_server_session_connected_callback(u32 app_index, u32 api_context, stream_session_t *s, u8 is_fail)
Definition: echo_server.c:91
u32 tls_engine
TLS engine: mbedtls/openssl.
Definition: echo_server.c:43
clib_error_t * vnet_app_add_tls_cert(vnet_app_add_tls_cert_args_t *a)
Definition: application.c:1368
unsigned char u8
Definition: types.h:56
u32 my_client_index
API client handle.
Definition: echo_server.c:30
struct _svm_fifo svm_fifo_t
int echo_server_builtin_server_rx_callback_no_echo(stream_session_t *s)
Definition: echo_server.c:134
svm_msg_q_t ** vpp_queue
Definition: echo_server.c:26
static svm_msg_q_t * session_manager_get_vpp_event_queue(u32 thread_index)
Definition: session.h:575
u32 prealloc_fifos
Preallocate fifos.
Definition: echo_server.c:39
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:156
struct _vnet_disconnect_args_t vnet_disconnect_args_t
svm_queue_t * vl_input_queue
Sever&#39;s event queue.
Definition: echo_server.c:27
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
Definition: svm_fifo.h:105
struct _stream_session_cb_vft session_cb_vft_t
#define clib_error_return(e, args...)
Definition: error.h:99
struct vl_shmem_hdr_ * shmem_hdr
Binary API shared-memory segment header pointer.
Definition: api_common.h:264
void stream_session_cleanup(stream_session_t *s)
Cleanup transport and session state.
Definition: session.c:1150
unsigned int u32
Definition: types.h:88
struct _stream_session_t stream_session_t
int session_send_io_evt_to_thread(svm_fifo_t *f, session_evt_type_t evt_type)
Definition: session.c:86
static int echo_server_attach(u8 *appns_id, u64 appns_flags, u64 appns_secret)
Definition: echo_server.c:279
echo_server_main_t echo_server_main
Definition: echo_server.c:55
struct _vnet_app_attach_args_t vnet_app_attach_args_t
vl_shmem_hdr_t * shmem_hdr
clib_error_t * vnet_app_add_tls_key(vnet_app_add_tls_key_args_t *a)
Definition: application.c:1380
static int app_send_stream_raw(svm_fifo_t *f, svm_msg_q_t *vpp_evt_q, u8 *data, u32 len, u8 noblock)
struct _unformat_input_t unformat_input_t
static session_handle_t session_handle(stream_session_t *s)
Definition: session.h:329
#define PREDICT_FALSE(x)
Definition: clib.h:105
const char test_srv_crt_rsa[]
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
Definition: session.c:1481
static clib_error_t * echo_server_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: echo_server.c:411
u32 app_index
Server app index.
Definition: echo_server.c:29
API main structure, used by both vpp and binary API clients.
Definition: api_common.h:201
void test_bytes(echo_server_main_t *esm, int actual_transfer)
Definition: echo_server.c:113
void echo_server_session_disconnect_callback(stream_session_t *s)
Definition: echo_server.c:73
static u8 svm_fifo_set_event(svm_fifo_t *f)
Sets fifo event flag.
Definition: svm_fifo.h:140
#define UNFORMAT_END_OF_INPUT
Definition: format.h:144
static_always_inline uword vlib_get_thread_index(void)
Definition: threads.h:221
clib_error_t * echo_server_main_init(vlib_main_t *vm)
Definition: echo_server.c:523
vlib_main_t * vm
Definition: buffer.c:294
static int create_api_loopback(vlib_main_t *vm)
Definition: echo_server.c:265
u8 * format_stream_session(u8 *s, va_list *args)
Format stream session as per the following format.
Definition: session_cli.c:55
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:339
#define clib_warning(format, args...)
Definition: error.h:59
#define clib_memcpy(a, b, c)
Definition: string.h:75
int echo_server_session_accept_callback(stream_session_t *s)
Definition: echo_server.c:58
int vnet_disconnect_session(vnet_disconnect_args_t *a)
u32 node_index
process node index for evnt scheduling
Definition: echo_server.c:31
svm_queue_t * vl_input_queue
Definition: memory_shared.h:84
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
#define ASSERT(truth)
int echo_server_redirect_connect_callback(u32 client_index, void *mp)
Definition: echo_server.c:106
struct _vnet_application_add_tls_key_args_t vnet_app_add_tls_key_args_t
struct _vnet_app_detach_args_t vnet_app_detach_args_t
#define clib_max(x, y)
Definition: clib.h:282
int svm_fifo_dequeue_drop(svm_fifo_t *f, u32 max_bytes)
Definition: svm_fifo.c:792
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
u8 ** rx_buf
Per-thread RX buffer.
Definition: echo_server.c:48
char * server_uri
Server URI.
Definition: echo_server.c:42
static int app_recv_stream_raw(svm_fifo_t *f, u8 *buf, u32 len, u8 clear_evt)
u32 private_segment_count
Number of private segments.
Definition: echo_server.c:40
struct _svm_queue svm_queue_t
unformat_function_t unformat_memory_size
Definition: format.h:295
u8 is_dgram
set if transport is dgram
Definition: echo_server.c:44
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
static vlib_thread_main_t * vlib_get_thread_main()
Definition: global_funcs.h:32
u32 rcv_buffer_size
Rcv buffer size.
Definition: echo_server.c:38
int echo_server_add_segment_callback(u32 client_index, const ssvm_private_t *sp)
Definition: echo_server.c:99
static int echo_server_create(vlib_main_t *vm, u8 *appns_id, u64 appns_flags, u64 appns_secret)
Definition: echo_server.c:367
int svm_fifo_peek(svm_fifo_t *f, u32 relative_offset, u32 max_bytes, u8 *copy_here)
Definition: svm_fifo.c:776
api_main_t api_main
Definition: api_shared.c:35
int vnet_application_detach(vnet_app_detach_args_t *a)
Detach application from vpp.
struct _vnet_bind_args_t vnet_bind_args_t
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
static session_cb_vft_t echo_server_session_cb_vft
Definition: echo_server.c:254
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:170
const char test_srv_key_rsa[]
vlib_main_t * vlib_main
Definition: echo_server.c:52
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:128