FD.io VPP  v18.10-34-gcce845e
Vector Packet Processing
proxy.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>
21 
23 
24 typedef struct
25 {
26  char uri[128];
30 
31 static void
32 proxy_cb_fn (void *data, u32 data_len)
33 {
36 
37  a.api_context = pa->api_context;
38  a.app_index = pa->app_index;
39  a.uri = pa->uri;
40  vnet_connect_uri (&a);
41 }
42 
43 static void
45 {
46  if (vlib_get_thread_index () == 0)
47  {
48  vnet_connect_uri (a);
49  }
50  else
51  {
53  args.api_context = a->api_context;
54  args.app_index = a->app_index;
55  clib_memcpy (args.uri, a->uri, vec_len (a->uri));
56  vl_api_rpc_call_main_thread (proxy_cb_fn, (u8 *) & args, sizeof (args));
57  }
58 }
59 
60 static void
61 delete_proxy_session (stream_session_t * s, int is_active_open)
62 {
63  proxy_main_t *pm = &proxy_main;
64  proxy_session_t *ps = 0;
65  vnet_disconnect_args_t _a, *a = &_a;
66  stream_session_t *active_open_session = 0;
67  stream_session_t *server_session = 0;
68  uword *p;
69  u64 handle;
70 
71  handle = session_handle (s);
72 
74  if (is_active_open)
75  {
76  active_open_session = s;
77 
79  if (p == 0)
80  {
81  clib_warning ("proxy session for %s handle %lld (%llx) AWOL",
82  is_active_open ? "active open" : "server",
83  handle, handle);
84  }
85  else if (!pool_is_free_index (pm->sessions, p[0]))
86  {
87  ps = pool_elt_at_index (pm->sessions, p[0]);
88  if (ps->vpp_server_handle != ~0)
89  server_session = session_get_from_handle (ps->vpp_server_handle);
90  else
91  server_session = 0;
92  }
93  }
94  else
95  {
96  server_session = s;
97 
98  p = hash_get (pm->proxy_session_by_server_handle, handle);
99  if (p == 0)
100  {
101  clib_warning ("proxy session for %s handle %lld (%llx) AWOL",
102  is_active_open ? "active open" : "server",
103  handle, handle);
104  }
105  else if (!pool_is_free_index (pm->sessions, p[0]))
106  {
107  ps = pool_elt_at_index (pm->sessions, p[0]);
108  if (ps->vpp_active_open_handle != ~0)
109  active_open_session = session_get_from_handle
111  else
112  active_open_session = 0;
113  }
114  }
115 
116  if (ps)
117  {
118  if (CLIB_DEBUG > 0)
119  memset (ps, 0xFE, sizeof (*ps));
120  pool_put (pm->sessions, ps);
121  }
122 
124 
125  if (active_open_session)
126  {
127  a->handle = session_handle (active_open_session);
128  a->app_index = pm->active_open_app_index;
130  session_handle (active_open_session));
132  }
133 
134  if (server_session)
135  {
136  a->handle = session_handle (server_session);
137  a->app_index = pm->server_app_index;
139  session_handle (server_session));
141  }
142 }
143 
144 static int
146 {
147  proxy_main_t *pm = &proxy_main;
148 
149  s->session_state = SESSION_STATE_READY;
150 
152 
153  return 0;
154 }
155 
156 static void
158 {
159  delete_proxy_session (s, 0 /* is_active_open */ );
160 }
161 
162 static void
164 {
165  clib_warning ("Reset session %U", format_stream_session, s, 2);
166  delete_proxy_session (s, 0 /* is_active_open */ );
167 }
168 
169 static int
170 proxy_connected_callback (u32 app_index, u32 api_context,
171  stream_session_t * s, u8 is_fail)
172 {
173  clib_warning ("called...");
174  return -1;
175 }
176 
177 static int
179 {
180  clib_warning ("called...");
181  return -1;
182 }
183 
184 static int
186 {
187  u32 max_dequeue;
188  int actual_transfer __attribute__ ((unused));
189  svm_fifo_t *tx_fifo, *rx_fifo;
190  proxy_main_t *pm = &proxy_main;
191  u32 thread_index = vlib_get_thread_index ();
192  vnet_connect_args_t _a, *a = &_a;
193  proxy_session_t *ps;
194  int proxy_index;
195  uword *p;
196  svm_fifo_t *active_open_tx_fifo;
197 
198  ASSERT (s->thread_index == thread_index);
199 
202 
203  if (PREDICT_TRUE (p != 0))
204  {
206  active_open_tx_fifo = s->server_rx_fifo;
207 
208  /*
209  * Send event for active open tx fifo
210  */
211  if (svm_fifo_set_event (active_open_tx_fifo))
212  {
213  u32 ao_thread_index = active_open_tx_fifo->master_thread_index;
214  if (session_send_io_evt_to_thread_custom (active_open_tx_fifo,
215  ao_thread_index,
217  clib_warning ("failed to enqueue tx evt");
218  }
219  }
220  else
221  {
222  rx_fifo = s->server_rx_fifo;
223  tx_fifo = s->server_tx_fifo;
224 
225  ASSERT (rx_fifo->master_thread_index == thread_index);
226  ASSERT (tx_fifo->master_thread_index == thread_index);
227 
228  max_dequeue = svm_fifo_max_dequeue (s->server_rx_fifo);
229 
230  if (PREDICT_FALSE (max_dequeue == 0))
231  return 0;
232 
233  actual_transfer = svm_fifo_peek (rx_fifo, 0 /* relative_offset */ ,
234  max_dequeue, pm->rx_buf[thread_index]);
235 
236  /* $$$ your message in this space: parse url, etc. */
237 
238  memset (a, 0, sizeof (*a));
239 
241  pool_get (pm->sessions, ps);
242  memset (ps, 0, sizeof (*ps));
243  ps->server_rx_fifo = rx_fifo;
244  ps->server_tx_fifo = tx_fifo;
246 
247  proxy_index = ps - pm->sessions;
248 
250  proxy_index);
251 
253 
254  a->uri = (char *) pm->client_uri;
255  a->api_context = proxy_index;
256  a->app_index = pm->active_open_app_index;
258  }
259 
260  return 0;
261 }
262 
264  .session_accept_callback = proxy_accept_callback,
265  .session_disconnect_callback = proxy_disconnect_callback,
266  .session_connected_callback = proxy_connected_callback,
267  .add_segment_callback = proxy_add_segment_callback,
268  .builtin_app_rx_callback = proxy_rx_callback,
269  .session_reset_callback = proxy_reset_callback
270 };
271 
272 static int
274  stream_session_t * s, u8 is_fail)
275 {
276  proxy_main_t *pm = &proxy_main;
277  proxy_session_t *ps;
278  u8 thread_index = vlib_get_thread_index ();
279 
280  if (is_fail)
281  {
282  clib_warning ("connection %d failed!", opaque);
283  return 0;
284  }
285 
286  /*
287  * Setup proxy session handle.
288  */
290 
291  ps = pool_elt_at_index (pm->sessions, opaque);
293 
294  s->server_tx_fifo = ps->server_rx_fifo;
295  s->server_rx_fifo = ps->server_tx_fifo;
296 
297  /*
298  * Reset the active-open tx-fifo master indices so the active-open session
299  * will receive data, etc.
300  */
301  s->server_tx_fifo->master_session_index = s->session_index;
302  s->server_tx_fifo->master_thread_index = s->thread_index;
303 
304  /*
305  * Account for the active-open session's use of the fifos
306  * so they won't disappear until the last session which uses
307  * them disappears
308  */
309  s->server_tx_fifo->refcnt++;
310  s->server_rx_fifo->refcnt++;
311 
313  ps->vpp_active_open_handle, opaque);
314 
316 
317  /*
318  * Send event for active open tx fifo
319  */
320  ASSERT (s->thread_index == thread_index);
321  if (svm_fifo_set_event (s->server_tx_fifo))
323 
324  return 0;
325 }
326 
327 static void
329 {
330  delete_proxy_session (s, 1 /* is_active_open */ );
331 }
332 
333 static int
335 {
336  return 0;
337 }
338 
339 static void
341 {
342  delete_proxy_session (s, 1 /* is_active_open */ );
343 }
344 
345 static int
347 {
348  svm_fifo_t *proxy_tx_fifo;
349 
350  proxy_tx_fifo = s->server_rx_fifo;
351 
352  /*
353  * Send event for server tx fifo
354  */
355  if (svm_fifo_set_event (proxy_tx_fifo))
356  {
357  u8 thread_index = proxy_tx_fifo->master_thread_index;
358  return session_send_io_evt_to_thread_custom (proxy_tx_fifo,
359  thread_index,
361  }
362 
363  return 0;
364 }
365 
366 /* *INDENT-OFF* */
368  .session_reset_callback = active_open_reset_callback,
369  .session_connected_callback = active_open_connected_callback,
370  .session_accept_callback = active_open_create_callback,
371  .session_disconnect_callback = active_open_disconnect_callback,
372  .builtin_app_rx_callback = active_open_rx_callback
373 };
374 /* *INDENT-ON* */
375 
376 
377 static void
379 {
380  proxy_main_t *pm = &proxy_main;
381  api_main_t *am = &api_main;
383 
384  shmem_hdr = am->shmem_hdr;
385  pm->vl_input_queue = shmem_hdr->vl_input_queue;
386  pm->server_client_index =
387  vl_api_memclnt_create_internal ("proxy_server", pm->vl_input_queue);
389  vl_api_memclnt_create_internal ("proxy_active_open", pm->vl_input_queue);
390 }
391 
392 static int
394 {
395  proxy_main_t *pm = &proxy_main;
396  u64 options[APP_OPTIONS_N_OPTIONS];
397  vnet_app_attach_args_t _a, *a = &_a;
398  u32 segment_size = 512 << 20;
399 
400  memset (a, 0, sizeof (*a));
401  memset (options, 0, sizeof (options));
402 
403  if (pm->private_segment_size)
404  segment_size = pm->private_segment_size;
405  a->api_client_index = pm->server_client_index;
406  a->session_cb_vft = &proxy_session_cb_vft;
407  a->options = options;
408  a->options[APP_OPTIONS_SEGMENT_SIZE] = segment_size;
409  a->options[APP_OPTIONS_RX_FIFO_SIZE] = pm->fifo_size;
410  a->options[APP_OPTIONS_TX_FIFO_SIZE] = pm->fifo_size;
412  a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] =
413  pm->prealloc_fifos ? pm->prealloc_fifos : 0;
414 
415  a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
416 
417  if (vnet_application_attach (a))
418  {
419  clib_warning ("failed to attach server");
420  return -1;
421  }
422  pm->server_app_index = a->app_index;
423 
424  return 0;
425 }
426 
427 static int
429 {
430  proxy_main_t *pm = &proxy_main;
431  vnet_app_attach_args_t _a, *a = &_a;
432  u64 options[16];
433 
434  memset (a, 0, sizeof (*a));
435  memset (options, 0, sizeof (options));
436 
437  a->api_client_index = pm->active_open_client_index;
438  a->session_cb_vft = &active_open_clients;
439 
440  options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678;
441  options[APP_OPTIONS_SEGMENT_SIZE] = 512 << 20;
442  options[APP_OPTIONS_RX_FIFO_SIZE] = pm->fifo_size;
443  options[APP_OPTIONS_TX_FIFO_SIZE] = pm->fifo_size;
446  pm->prealloc_fifos ? pm->prealloc_fifos : 0;
447 
448  options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN
449  | APP_OPTIONS_FLAGS_IS_PROXY;
450 
451  a->options = options;
452 
453  if (vnet_application_attach (a))
454  return -1;
455 
456  pm->active_open_app_index = a->app_index;
457 
458  return 0;
459 }
460 
461 static int
463 {
464  proxy_main_t *pm = &proxy_main;
465  vnet_bind_args_t _a, *a = &_a;
466  memset (a, 0, sizeof (*a));
467  a->app_index = pm->server_app_index;
468  a->uri = (char *) pm->server_uri;
469  return vnet_bind_uri (a);
470 }
471 
472 static int
474 {
475  proxy_main_t *pm = &proxy_main;
477  u32 num_threads;
478  int i;
479 
480  if (pm->server_client_index == (u32) ~ 0)
482 
483  num_threads = 1 /* main thread */ + vtm->n_threads;
484  vec_validate (proxy_main.server_event_queue, num_threads - 1);
485  vec_validate (proxy_main.active_open_event_queue, num_threads - 1);
486  vec_validate (pm->rx_buf, num_threads - 1);
487 
488  for (i = 0; i < num_threads; i++)
489  vec_validate (pm->rx_buf[i], pm->rcv_buffer_size);
490 
491  if (proxy_server_attach ())
492  {
493  clib_warning ("failed to attach server app");
494  return -1;
495  }
496  if (proxy_server_listen ())
497  {
498  clib_warning ("failed to start listening");
499  return -1;
500  }
501  if (active_open_attach ())
502  {
503  clib_warning ("failed to attach active open app");
504  return -1;
505  }
506 
507  for (i = 0; i < num_threads; i++)
508  {
511 
513 
515  }
516 
517  return 0;
518 }
519 
520 static clib_error_t *
522  vlib_cli_command_t * cmd)
523 {
524  proxy_main_t *pm = &proxy_main;
525  char *default_server_uri = "tcp://0.0.0.0/23";
526  char *default_client_uri = "tcp://6.0.2.2/23";
527  int rv;
528  u64 tmp;
529 
530  pm->fifo_size = 64 << 10;
531  pm->rcv_buffer_size = 1024;
532  pm->prealloc_fifos = 0;
533  pm->private_segment_count = 0;
534  pm->private_segment_size = 0;
535  pm->server_uri = 0;
536 
538  {
539  if (unformat (input, "fifo-size %d", &pm->fifo_size))
540  pm->fifo_size <<= 10;
541  else if (unformat (input, "rcv-buf-size %d", &pm->rcv_buffer_size))
542  ;
543  else if (unformat (input, "prealloc-fifos %d", &pm->prealloc_fifos))
544  ;
545  else if (unformat (input, "private-segment-count %d",
546  &pm->private_segment_count))
547  ;
548  else if (unformat (input, "private-segment-size %U",
549  unformat_memory_size, &tmp))
550  {
551  if (tmp >= 0x100000000ULL)
552  return clib_error_return
553  (0, "private segment size %lld (%llu) too large", tmp, tmp);
554  pm->private_segment_size = tmp;
555  }
556  else if (unformat (input, "server-uri %s", &pm->server_uri))
557  ;
558  else if (unformat (input, "client-uri %s", &pm->client_uri))
559  pm->client_uri = format (0, "%s%c", pm->client_uri, 0);
560  else
561  return clib_error_return (0, "unknown input `%U'",
562  format_unformat_error, input);
563  }
564 
565  if (!pm->server_uri)
566  {
567  clib_warning ("No server-uri provided, Using default: %s",
568  default_server_uri);
569  pm->server_uri = format (0, "%s%c", default_server_uri, 0);
570  }
571  if (!pm->client_uri)
572  {
573  clib_warning ("No client-uri provided, Using default: %s",
574  default_client_uri);
575  pm->client_uri = format (0, "%s%c", default_client_uri, 0);
576  }
577 
578  vnet_session_enable_disable (vm, 1 /* turn on session and transport */ );
579 
580  rv = proxy_server_create (vm);
581  switch (rv)
582  {
583  case 0:
584  break;
585  default:
586  return clib_error_return (0, "server_create returned %d", rv);
587  }
588 
589  return 0;
590 }
591 
592 /* *INDENT-OFF* */
593 VLIB_CLI_COMMAND (proxy_create_command, static) =
594 {
595  .path = "test proxy server",
596  .short_help = "test proxy server [server-uri <tcp://ip/port>]"
597  "[client-uri <tcp://ip/port>][fifo-size <nn>][rcv-buf-size <nn>]"
598  "[prealloc-fifos <nn>][private-segment-size <mem>]"
599  "[private-segment-count <nn>]",
600  .function = proxy_server_create_command_fn,
601 };
602 /* *INDENT-ON* */
603 
604 clib_error_t *
606 {
607  proxy_main_t *pm = &proxy_main;
608  pm->server_client_index = ~0;
609  pm->active_open_client_index = ~0;
612 
613  return 0;
614 }
615 
617 
618 /*
619 * fd.io coding-style-patch-verification: ON
620 *
621 * Local Variables:
622 * eval: (c-set-style "gnu")
623 * End:
624 */
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:437
u64 vpp_active_open_handle
Definition: proxy.h:36
#define hash_set(h, key, value)
Definition: hash.h:255
u32 private_segment_count
Number of private fifo segs.
Definition: proxy.h:62
u32 vl_api_memclnt_create_internal(char *name, svm_queue_t *q)
Definition: memory_api.c:112
#define hash_unset(h, key)
Definition: hash.h:261
a
Definition: bitmap.h:538
static int proxy_add_segment_callback(u32 client_index, const ssvm_private_t *sp)
Definition: proxy.c:178
static void proxy_reset_callback(stream_session_t *s)
Definition: proxy.c:163
char uri[128]
Definition: proxy.c:26
svm_queue_t * vl_input_queue
vpe input queue
Definition: proxy.h:41
struct _vnet_connect_args vnet_connect_args_t
int vnet_bind_uri(vnet_bind_args_t *a)
#define PREDICT_TRUE(x)
Definition: clib.h:108
unsigned long u64
Definition: types.h:89
static int proxy_connected_callback(u32 app_index, u32 api_context, stream_session_t *s, u8 is_fail)
Definition: proxy.c:170
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
Definition: lock.h:98
static clib_error_t * proxy_server_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: proxy.c:521
int i
static void create_api_loopbacks(vlib_main_t *vm)
Definition: proxy.c:378
uword * proxy_session_by_server_handle
Definition: proxy.h:53
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
static stream_session_t * session_get_from_handle(session_handle_t handle)
Definition: session.h:360
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:228
unsigned char u8
Definition: types.h:56
svm_fifo_t * server_rx_fifo
Definition: proxy.h:32
struct _svm_fifo svm_fifo_t
memset(h->entries, 0, sizeof(h->entries[0])*entries)
static svm_msg_q_t * session_manager_get_vpp_event_queue(u32 thread_index)
Definition: session.h:590
u8 prealloc_fifos
Request fifo preallocation.
Definition: proxy.h:80
u32 fifo_size
Definition: proxy.h:61
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:163
struct _vnet_disconnect_args_t vnet_disconnect_args_t
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
Definition: svm_fifo.h:114
struct _stream_session_cb_vft session_cb_vft_t
static session_cb_vft_t proxy_session_cb_vft
Definition: proxy.c:263
#define clib_error_return(e, args...)
Definition: error.h:99
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
Definition: vlib_api.c:638
struct vl_shmem_hdr_ * shmem_hdr
Binary API shared-memory segment header pointer.
Definition: api_common.h:264
unsigned int u32
Definition: types.h:88
int rcv_buffer_size
Definition: proxy.h:64
u32 server_app_index
server app index
Definition: proxy.h:49
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:87
struct _vnet_app_attach_args_t vnet_app_attach_args_t
vl_shmem_hdr_t * shmem_hdr
clib_error_t * proxy_main_init(vlib_main_t *vm)
Definition: proxy.c:605
#define hash_get(h, key)
Definition: hash.h:249
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:464
proxy_session_t * sessions
Session pool, shared.
Definition: proxy.h:71
static int active_open_connected_callback(u32 app_index, u32 opaque, stream_session_t *s, u8 is_fail)
Definition: proxy.c:273
struct _unformat_input_t unformat_input_t
static void proxy_cb_fn(void *data, u32 data_len)
Definition: proxy.c:32
static session_handle_t session_handle(stream_session_t *s)
Definition: session.h:334
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:274
#define PREDICT_FALSE(x)
Definition: clib.h:107
proxy_main_t proxy_main
Definition: proxy.c:22
static int proxy_server_create(vlib_main_t *vm)
Definition: proxy.c:473
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
Definition: session.c:1461
API main structure, used by both vpp and binary API clients.
Definition: api_common.h:201
u64 vpp_server_handle
Definition: proxy.h:35
static u8 svm_fifo_set_event(svm_fifo_t *f)
Sets fifo event flag.
Definition: svm_fifo.h:157
svm_msg_q_t ** active_open_event_queue
Definition: proxy.h:44
static void active_open_reset_callback(stream_session_t *s)
Definition: proxy.c:328
#define UNFORMAT_END_OF_INPUT
Definition: format.h:144
u32 active_open_client_index
active open API client handle
Definition: proxy.h:50
static int proxy_accept_callback(stream_session_t *s)
Definition: proxy.c:145
static_always_inline uword vlib_get_thread_index(void)
Definition: threads.h:211
vlib_main_t * vm
Definition: buffer.c:294
u8 * format_stream_session(u8 *s, va_list *args)
Format stream session as per the following format.
Definition: session_cli.c:57
#define clib_warning(format, args...)
Definition: error.h:59
u32 server_client_index
server API client handle
Definition: proxy.h:48
#define clib_memcpy(a, b, c)
Definition: string.h:75
static void proxy_call_main_thread(vnet_connect_args_t *a)
Definition: proxy.c:44
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:271
u8 * server_uri
Definition: proxy.h:65
static void delete_proxy_session(stream_session_t *s, int is_active_open)
Definition: proxy.c:61
int vnet_disconnect_session(vnet_disconnect_args_t *a)
svm_queue_t * vl_input_queue
Definition: memory_shared.h:84
svm_msg_q_t ** server_event_queue
per-thread vectors
Definition: proxy.h:43
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:155
u32 active_open_app_index
active open index after attach
Definition: proxy.h:51
#define hash_create(elts, value_bytes)
Definition: hash.h:696
#define ASSERT(truth)
static int proxy_server_attach()
Definition: proxy.c:393
static int active_open_create_callback(stream_session_t *s)
Definition: proxy.c:334
static void proxy_disconnect_callback(stream_session_t *s)
Definition: proxy.c:157
uword * proxy_session_by_active_open_handle
Definition: proxy.h:54
u8 ** rx_buf
intermediate rx buffers
Definition: proxy.h:45
clib_spinlock_t sessions_lock
Definition: proxy.h:72
u32 private_segment_size
size of private fifo segs
Definition: proxy.h:63
static int active_open_attach(void)
Definition: proxy.c:428
static int proxy_rx_callback(stream_session_t *s)
Definition: proxy.c:185
svm_fifo_t * server_tx_fifo
Definition: proxy.h:33
clib_error_t * vnet_connect_uri(vnet_connect_args_t *a)
#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.
u64 uword
Definition: types.h:112
int session_send_io_evt_to_thread_custom(void *data, u32 thread_index, session_evt_type_t evt_type)
Definition: session.c:93
static void active_open_disconnect_callback(stream_session_t *s)
Definition: proxy.c:340
unformat_function_t unformat_memory_size
Definition: format.h:295
static int proxy_server_listen()
Definition: proxy.c:462
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
static int active_open_rx_callback(stream_session_t *s)
Definition: proxy.c:346
static session_cb_vft_t active_open_clients
Definition: proxy.c:367
int svm_fifo_peek(svm_fifo_t *f, u32 relative_offset, u32 max_bytes, u8 *copy_here)
Definition: svm_fifo.c:718
api_main_t api_main
Definition: api_shared.c:35
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
Definition: lock.h:82
struct _vnet_bind_args_t vnet_bind_args_t
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
u8 * client_uri
Definition: proxy.h:66
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:170