FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
application_interface.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-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 #ifndef __included_uri_h__
16 #define __included_uri_h__
17 
18 #include <vlibmemory/api.h>
19 #include <svm/message_queue.h>
21 #include <vnet/tls/tls_test.h>
22 #include <svm/fifo_segment.h>
23 
24 typedef struct certificate_
25 {
26  u32 *app_interests; /* vec of application index asking for deletion cb */
27  u32 cert_key_index; /* index in cert & key pool */
28  u8 *key;
29  u8 *cert;
31 
32 typedef struct session_cb_vft_
33 {
34  /** Notify server of new segment */
35  int (*add_segment_callback) (u32 app_wrk_index, u64 segment_handle);
36 
37  /** Notify server of new segment */
38  int (*del_segment_callback) (u32 app_wrk_index, u64 segment_handle);
39 
40  /** Notify server of newly accepted session */
41  int (*session_accept_callback) (session_t * new_session);
42 
43  /** Connection request callback */
44  int (*session_connected_callback) (u32 app_wrk_index, u32 opaque,
45  session_t * s, session_error_t code);
46 
47  /** Notify app that session is closing */
49 
50  /** Notify app that transport is closed */
52 
53  /** Notify app that session or transport are about to be removed */
55 
56  /** Notify app that half open state was cleaned up (optional) */
58 
59  /** Notify app that session was reset */
61 
62  /** Notify app that session pool migration happened */
64 
65  /** Direct RX callback for built-in application */
66  int (*builtin_app_rx_callback) (session_t * session);
67 
68  /** Direct TX callback for built-in application */
69  int (*builtin_app_tx_callback) (session_t * session);
70 
71  /** Cert and key pair delete notification */
73 
74  /** Delegate fifo-tuning-logic to application */
76  session_ft_action_t act, u32 bytes);
77 
79 
80 #define foreach_app_init_args \
81  _(u32, api_client_index) \
82  _(u8 *, name) \
83  _(u64 *, options) \
84  _(u8 *, namespace_id) \
85  _(session_cb_vft_t *, session_cb_vft) \
86  _(u32, app_index) \
87  _(u8, use_sock_api) \
88 
89 typedef struct _vnet_app_attach_args_t
90 {
91 #define _(_type, _name) _type _name;
93 #undef _
94  ssvm_private_t * segment;
95  svm_msg_q_t *app_evt_q;
96  u64 segment_handle;
98 
99 typedef struct _vnet_app_detach_args_t
100 {
101  u32 app_index;
102  u32 api_client_index;
104 
105 typedef struct _vnet_bind_args_t
106 {
107  union
108  {
109  session_endpoint_cfg_t sep_ext;
110  session_endpoint_t sep;
111  char *uri;
112  };
113 
114  u32 app_index;
115  u32 wrk_map_index;
116 
117  /*
118  * Results
119  */
120  u64 handle;
122 
123 typedef struct _vnet_unlisten_args_t
124 {
125  union
126  {
127  char *uri;
128  u64 handle; /**< Session handle */
129  };
130  u32 app_index; /**< Owning application index */
131  u32 wrk_map_index; /**< App's local pool worker index */
133 
134 typedef struct _vnet_connect_args
135 {
136  union
137  {
138  session_endpoint_cfg_t sep_ext;
139  session_endpoint_t sep;
140  char *uri;
141  };
142  u32 app_index;
143  u32 wrk_map_index;
144  u32 api_context;
145 
146  /* Resulting session, or half-open session, if connect successful */
147  session_handle_t sh;
149 
150 typedef struct _vnet_shutdown_args_t
151 {
152  session_handle_t handle;
153  u32 app_index;
155 
156 typedef struct _vnet_disconnect_args_t
157 {
158  session_handle_t handle;
159  u32 app_index;
161 
162 typedef struct _vnet_application_add_tls_cert_args_t
163 {
164  u32 app_index;
165  u8 *cert;
167 
168 typedef struct _vnet_application_add_tls_key_args_t
169 {
170  u32 app_index;
171  u8 *key;
173 
175 {
183 
184 typedef struct _vnet_app_add_cert_key_pair_args_
185 {
186  u8 *cert;
187  u8 *key;
188  u32 cert_len;
189  u32 key_len;
190  u32 index;
192 
193 typedef struct crypto_ctx_
194 {
195  u32 ctx_index; /**< index in crypto context pool */
196  u32 n_subscribers; /**< refcount of sessions using said context */
197  u32 ckpair_index; /**< certificate & key */
199  void *data; /**< protocol specific data */
201 
202 /* Application attach options */
203 typedef enum
204 {
225 
226 #define foreach_app_options_flags \
227  _ (ACCEPT_REDIRECT, "Use FIFO with redirects") \
228  _ (ADD_SEGMENT, "Add segment and signal app if needed") \
229  _ (IS_BUILTIN, "Application is builtin") \
230  _ (IS_TRANSPORT_APP, "Application is a transport proto") \
231  _ (IS_PROXY, "Application is proxying") \
232  _ (USE_GLOBAL_SCOPE, "App can use global session scope") \
233  _ (USE_LOCAL_SCOPE, "App can use local session scope") \
234  _ (EVT_MQ_USE_EVENTFD, "Use eventfds for signaling") \
235  _ (MEMFD_FOR_BUILTIN, "Use memfd for builtin app segs")
236 
237 typedef enum _app_options
238 {
239 #define _(sym, str) APP_OPTIONS_##sym,
241 #undef _
242 } app_options_t;
243 
244 typedef enum _app_options_flags
245 {
246 #define _(sym, str) APP_OPTIONS_FLAGS_##sym = 1 << APP_OPTIONS_##sym,
248 #undef _
250 
251 #define foreach_fd_type \
252  _(VPP_MQ_SEGMENT, "Fd for vpp's event mq segment") \
253  _(MEMFD_SEGMENT, "Fd for memfd segment") \
254  _(MQ_EVENTFD, "Event fd used by message queue") \
255  _(VPP_MQ_EVENTFD, "Event fd used by vpp's message queue") \
256 
257 typedef enum session_fd_type_
258 {
259 #define _(sym, str) SESSION_FD_##sym,
261 #undef _
264 
265 typedef enum session_fd_flag_
266 {
267 #define _(sym, str) SESSION_FD_F_##sym = 1 << SESSION_FD_##sym,
269 #undef _
271 
272 int parse_uri (char *uri, session_endpoint_cfg_t * sep);
276 
284 
287 /** Ask for app cb on pair deletion */
289 
291 {
292  ip46_address_t rmt_ip; /**< remote ip */
293  ip46_address_t lcl_ip; /**< local ip */
294  u16 rmt_port; /**< remote port (network order) */
295  u16 lcl_port; /**< local port (network order) */
296  u8 is_ip4; /**< set if uses ip4 networking */
298 
299 #define foreach_app_session_field \
300  _(svm_fifo_t, *rx_fifo) /**< rx fifo */ \
301  _(svm_fifo_t, *tx_fifo) /**< tx fifo */ \
302  _(session_type_t, session_type) /**< session type */ \
303  _(volatile u8, session_state) /**< session state */ \
304  _(u32, session_index) /**< index in owning pool */ \
305  _(app_session_transport_t, transport) /**< transport info */ \
306  _(svm_msg_q_t, *vpp_evt_q) /**< vpp event queue */ \
307  _(u8, is_dgram) /**< flag for dgram mode */ \
308 
309 typedef struct
310 {
311 #define _(type, name) type name;
313 #undef _
314 } app_session_t;
315 
316 typedef struct session_listen_msg_
317 {
319  u32 context; /* Not needed but keeping it for compatibility with bapi */
325  ip46_address_t ip;
328 } __clib_packed session_listen_msg_t;
329 
331  "msg too large");
332 
333 typedef struct session_listen_uri_msg_
334 {
337  u8 uri[56];
338 } __clib_packed session_listen_uri_msg_t;
339 
341  "msg too large");
342 
343 typedef struct session_bound_msg_
344 {
345  u32 context;
349  u8 lcl_ip[16];
356 } __clib_packed session_bound_msg_t;
357 
358 typedef struct session_unlisten_msg_
359 {
364 } __clib_packed session_unlisten_msg_t;
365 
366 typedef struct session_unlisten_reply_msg_
367 {
368  u32 context;
372 
373 typedef struct session_accepted_msg_
374 {
375  u32 context;
386 } __clib_packed session_accepted_msg_t;
387 
388 typedef struct session_accepted_reply_msg_
389 {
390  u32 context;
394 
395 typedef struct session_connect_msg_
396 {
405  ip46_address_t ip;
406  ip46_address_t lcl_ip;
412 } __clib_packed session_connect_msg_t;
413 
415  "msg too large");
416 
417 typedef struct session_connect_uri_msg_
418 {
421  u8 uri[56];
423 
425  SESSION_CTRL_MSG_MAX_SIZE, "msg too large");
426 
427 typedef struct session_connected_msg_
428 {
429  u32 context;
441 } __clib_packed session_connected_msg_t;
442 
443 typedef struct session_shutdown_msg_
444 {
448 } __clib_packed session_shutdown_msg_t;
449 
450 typedef struct session_disconnect_msg_
451 {
455 } __clib_packed session_disconnect_msg_t;
456 
457 typedef struct session_disconnected_msg_
458 {
463 
464 typedef struct session_disconnected_reply_msg_
465 {
466  u32 context;
470 
471 typedef struct session_reset_msg_
472 {
476 } __clib_packed session_reset_msg_t;
477 
478 typedef struct session_reset_reply_msg_
479 {
480  u32 context;
484 
485 typedef struct session_req_worker_update_msg_
486 {
489 
490 /* NOTE: using u16 for wrk indices because message needs to fit in 18B */
491 typedef struct session_worker_update_msg_
492 {
498 
500 {
501  u64 handle;
506 
507 typedef struct session_app_detach_msg_
508 {
512 
513 typedef struct app_map_another_segment_msg_
514 {
522 
523 typedef struct app_unmap_segment_msg_
524 {
529 
530 typedef struct session_migrate_msg_
531 {
537 } __clib_packed session_migrated_msg_t;
538 
539 typedef struct session_cleanup_msg_
540 {
543 } __clib_packed session_cleanup_msg_t;
544 
545 typedef struct session_app_wrk_rpc_msg_
546 {
547  u32 client_index; /**< app client index */
548  u32 wrk_index; /**< dst worker index */
549  u8 data[64]; /**< rpc data */
551 
552 typedef struct session_transport_attr_msg_
553 {
559 
561 {
562  i32 retval;
567 
568 typedef struct app_session_event_
569 {
571  session_event_t *evt;
572 } __clib_packed app_session_evt_t;
573 
574 static inline void
576  u8 evt_type)
577 {
580  SVM_Q_WAIT, &app_evt->msg);
581  app_evt->evt = svm_msg_q_msg_data (mq, &app_evt->msg);
582  clib_memset (app_evt->evt, 0, sizeof (*app_evt->evt));
583  app_evt->evt->event_type = evt_type;
584 }
585 
586 static inline void
588 {
589  svm_msg_q_add_and_unlock (mq, &app_evt->msg);
590 }
591 
592 /**
593  * Send fifo io event to vpp worker thread
594  *
595  * Because there may be multiple writers to one of vpp's queues, this
596  * protects message allocation and enqueueing.
597  *
598  * @param mq vpp message queue
599  * @param f fifo for which the event is sent
600  * @param evt_type type of event
601  * @param noblock flag to indicate is request is blocking or not
602  * @return 0 if success, negative integer otherwise
603  */
604 static inline int
605 app_send_io_evt_to_vpp (svm_msg_q_t * mq, u32 session_index, u8 evt_type,
606  u8 noblock)
607 {
608  session_event_t *evt;
609  svm_msg_q_msg_t msg;
610 
611  if (noblock)
612  {
613  if (svm_msg_q_try_lock (mq))
614  return -1;
616  || svm_msg_q_is_full (mq)))
617  {
618  svm_msg_q_unlock (mq);
619  return -2;
620  }
622  evt = (session_event_t *) svm_msg_q_msg_data (mq, &msg);
623  evt->session_index = session_index;
624  evt->event_type = evt_type;
625  svm_msg_q_add_and_unlock (mq, &msg);
626  return 0;
627  }
628  else
629  {
630  svm_msg_q_lock (mq);
632  || svm_msg_q_is_full (mq))
633  svm_msg_q_wait_prod (mq);
635  evt = (session_event_t *) svm_msg_q_msg_data (mq, &msg);
636  evt->session_index = session_index;
637  evt->event_type = evt_type;
638  svm_msg_q_add_and_unlock (mq, &msg);
639  return 0;
640  }
641 }
642 
643 always_inline int
645  svm_msg_q_t * vpp_evt_q, u8 * data, u32 len, u8 evt_type,
646  u8 do_evt, u8 noblock)
647 {
649  int rv;
650 
651  if (svm_fifo_max_enqueue_prod (f) < (sizeof (session_dgram_hdr_t) + len))
652  return 0;
653 
654  hdr.data_length = len;
655  hdr.data_offset = 0;
656  clib_memcpy_fast (&hdr.rmt_ip, &at->rmt_ip, sizeof (ip46_address_t));
657  hdr.is_ip4 = at->is_ip4;
658  hdr.rmt_port = at->rmt_port;
659  clib_memcpy_fast (&hdr.lcl_ip, &at->lcl_ip, sizeof (ip46_address_t));
660  hdr.lcl_port = at->lcl_port;
661 
662  /* *INDENT-OFF* */
663  svm_fifo_seg_t segs[2] = {{ (u8 *) &hdr, sizeof (hdr) }, { data, len }};
664  /* *INDENT-ON* */
665 
666  rv = svm_fifo_enqueue_segments (f, segs, 2, 0 /* allow partial */ );
667  if (PREDICT_FALSE (rv < 0))
668  return 0;
669 
670  if (do_evt)
671  {
672  if (svm_fifo_set_event (f))
673  app_send_io_evt_to_vpp (vpp_evt_q, f->shr->master_session_index,
674  evt_type, noblock);
675  }
676  return len;
677 }
678 
679 always_inline int
680 app_send_dgram (app_session_t * s, u8 * data, u32 len, u8 noblock)
681 {
682  return app_send_dgram_raw (s->tx_fifo, &s->transport, s->vpp_evt_q, data,
683  len, SESSION_IO_EVT_TX, 1 /* do_evt */ ,
684  noblock);
685 }
686 
687 always_inline int
689  u32 len, u8 evt_type, u8 do_evt, u8 noblock)
690 {
691  int rv;
692 
693  rv = svm_fifo_enqueue (f, len, data);
694  if (do_evt)
695  {
696  if (rv > 0 && svm_fifo_set_event (f))
697  app_send_io_evt_to_vpp (vpp_evt_q, f->shr->master_session_index,
698  evt_type, noblock);
699  }
700  return rv;
701 }
702 
703 always_inline int
704 app_send_stream (app_session_t * s, u8 * data, u32 len, u8 noblock)
705 {
706  return app_send_stream_raw (s->tx_fifo, s->vpp_evt_q, data, len,
707  SESSION_IO_EVT_TX, 1 /* do_evt */ , noblock);
708 }
709 
710 always_inline int
711 app_send (app_session_t * s, u8 * data, u32 len, u8 noblock)
712 {
713  if (s->is_dgram)
714  return app_send_dgram (s, data, len, noblock);
715  return app_send_stream (s, data, len, noblock);
716 }
717 
718 always_inline int
720  app_session_transport_t * at, u8 clear_evt, u8 peek)
721 {
723  u32 max_deq;
724  int rv;
725 
726  max_deq = svm_fifo_max_dequeue_cons (f);
727  if (max_deq <= sizeof (session_dgram_hdr_t))
728  {
729  if (clear_evt)
731  return 0;
732  }
733 
734  if (clear_evt)
736 
737  svm_fifo_peek (f, 0, sizeof (ph), (u8 *) & ph);
738  ASSERT (ph.data_length >= ph.data_offset);
739 
740  /* Check if we have the full dgram */
741  if (max_deq < (ph.data_length + SESSION_CONN_HDR_LEN)
742  && len >= ph.data_length)
743  return 0;
744 
745  svm_fifo_peek (f, sizeof (ph), sizeof (*at), (u8 *) at);
746  len = clib_min (len, ph.data_length - ph.data_offset);
747  rv = svm_fifo_peek (f, ph.data_offset + SESSION_CONN_HDR_LEN, len, buf);
748  if (peek)
749  return rv;
750 
751  /* Discards data that did not fit in buffer */
753 
754  return rv;
755 }
756 
757 always_inline int
759 {
760  return app_recv_dgram_raw (s->rx_fifo, buf, len, &s->transport, 1, 0);
761 }
762 
763 always_inline int
764 app_recv_stream_raw (svm_fifo_t * f, u8 * buf, u32 len, u8 clear_evt, u8 peek)
765 {
766  if (clear_evt)
768 
769  if (peek)
770  return svm_fifo_peek (f, 0, len, buf);
771 
772  return svm_fifo_dequeue (f, len, buf);
773 }
774 
775 always_inline int
777 {
778  return app_recv_stream_raw (s->rx_fifo, buf, len, 1, 0);
779 }
780 
781 always_inline int
783 {
784  if (s->is_dgram)
785  return app_recv_dgram (s, data, len);
786  return app_recv_stream (s, data, len);
787 }
788 
789 /* *INDENT-OFF* */
790 static char *session_error_str[] = {
791 #define _(sym, str) str,
793 #undef _
794 };
795 /* *INDENT-ON* */
796 
797 static inline u8 *
798 format_session_error (u8 * s, va_list * args)
799 {
800  session_error_t error = va_arg (*args, session_error_t);
801  if (-error >= 0 && -error < SESSION_N_ERRORS)
802  s = format (s, "%s", session_error_str[-error]);
803  else
804  s = format (s, "invalid session err %u", -error);
805  return s;
806 }
807 
808 /*
809  * Socket API messages
810  */
811 
812 typedef enum app_sapi_msg_type
813 {
822 } __clib_packed app_sapi_msg_type_e;
823 
824 typedef struct app_sapi_attach_msg_
825 {
826  u8 name[64];
828 } __clib_packed app_sapi_attach_msg_t;
829 
831  sizeof (((app_sapi_attach_msg_t *) 0)->options),
832  "Out of options, fix message definition");
833 
834 typedef struct app_sapi_attach_reply_msg_
835 {
836  i32 retval;
846 
847 typedef struct app_sapi_worker_add_del_msg_
848 {
849  u32 app_index;
853 
855 {
856  i32 retval;
865 
866 typedef struct app_sapi_cert_key_add_del_msg_
867 {
868  u32 context;
874 
876 {
877  u32 context;
881 
882 typedef struct app_sapi_msg_
883 {
885  union
886  {
893  };
894 } __clib_packed app_sapi_msg_t;
895 
896 static inline void
899 {
901  u32 cfg_size;
902 
903  cfg_size = sizeof (transport_endpt_ext_cfg_t);
904  cfg = clib_mem_alloc (cfg_size);
905  clib_memset (cfg, 0, cfg_size);
906  cfg->type = type;
907  sep_ext->ext_cfg = cfg;
908 }
909 
910 #endif /* __included_uri_h__ */
911 
912 /*
913  * fd.io coding-style-patch-verification: ON
914  *
915  * Local Variables:
916  * eval: (c-set-style "gnu")
917  * End:
918  */
session_accepted_msg_::rmt
transport_endpoint_t rmt
Definition: application_interface.h:385
session_worker_update_reply_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:505
session_connect_msg_::context
u32 context
Definition: application_interface.h:399
session_connected_msg_::context
u32 context
Definition: application_interface.h:430
app_session_t
Definition: application_interface.h:310
svm_fifo_set_event
static u8 svm_fifo_set_event(svm_fifo_t *f)
Set fifo event flag.
Definition: svm_fifo.h:733
crypto_ctx_::data
void * data
protocol specific data
Definition: application_interface.h:199
session_migrate_msg_
Definition: application_interface.h:531
session_reset_msg_::handle
u64 handle
Definition: application_interface.h:476
session_accepted_msg_::context
u32 context
Definition: application_interface.h:376
APP_SAPI_MSG_TYPE_ATTACH_REPLY
@ APP_SAPI_MSG_TYPE_ATTACH_REPLY
Definition: application_interface.h:817
crypto_engine_type_t
enum crypto_engine_type_ crypto_engine_type_t
crypto_context_t
struct crypto_ctx_ crypto_context_t
api.h
session_error_t
enum session_error_ session_error_t
session_dgram_header_::data_length
u32 data_length
Definition: session_types.h:439
session_app_detach_msg_
Definition: application_interface.h:508
app_sapi_cert_key_add_del_reply_msg_
Definition: application_interface.h:876
CRYPTO_ENGINE_PICOTLS
@ CRYPTO_ENGINE_PICOTLS
Definition: application_interface.h:180
session_error_str
static char * session_error_str[]
Definition: application_interface.h:791
app_sapi_attach_msg_::options
u64 options[18]
Definition: application_interface.h:828
vnet_connect_uri
int vnet_connect_uri(vnet_connect_args_t *a)
Definition: application_interface.c:149
session_worker_update_reply_msg_::tx_fifo
uword tx_fifo
Definition: application_interface.h:504
app_sapi_attach_reply_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:841
certificate_
Definition: application_interface.h:24
session_unlisten_msg_
Definition: application_interface.h:359
CRYPTO_ENGINE_VPP
@ CRYPTO_ENGINE_VPP
Definition: application_interface.h:179
session_types.h
session_dgram_header_
Definition: session_types.h:437
SESSION_CTRL_MSG_MAX_SIZE
#define SESSION_CTRL_MSG_MAX_SIZE
Definition: session_types.h:24
app_session_transport_t
struct app_session_transport_ app_session_transport_t
session_connected_msg_::server_rx_fifo
uword server_rx_fifo
Definition: application_interface.h:433
app_options_t
enum _app_options app_options_t
app_sapi_worker_add_del_reply_msg_::api_client_handle
u32 api_client_handle
Definition: application_interface.h:861
APP_OPTIONS_RX_FIFO_SIZE
@ APP_OPTIONS_RX_FIFO_SIZE
Definition: application_interface.h:210
session_unlisten_msg_::wrk_index
u32 wrk_index
Definition: application_interface.h:363
app_send_stream_raw
static int app_send_stream_raw(svm_fifo_t *f, svm_msg_q_t *vpp_evt_q, u8 *data, u32 len, u8 evt_type, u8 do_evt, u8 noblock)
Definition: application_interface.h:689
session_worker_update_reply_msg_::handle
u64 handle
Definition: application_interface.h:502
svm_fifo_unset_event
static void svm_fifo_unset_event(svm_fifo_t *f)
Unset fifo event flag.
Definition: svm_fifo.h:746
SESSION_MQ_IO_EVT_RING
@ SESSION_MQ_IO_EVT_RING
Definition: session_types.h:401
app_sapi_attach_reply_msg_::api_client_handle
u32 api_client_handle
Definition: application_interface.h:842
tls_test.h
APP_OPTIONS_HIGH_WATERMARK
@ APP_OPTIONS_HIGH_WATERMARK
Definition: application_interface.h:220
session_bound_msg_::handle
u64 handle
Definition: application_interface.h:347
svm_msg_q_add_and_unlock
void svm_msg_q_add_and_unlock(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Producer enqueue one message to queue with mutex held.
Definition: message_queue.c:394
session_listen_uri_msg_::client_index
u32 client_index
Definition: application_interface.h:336
APP_SAPI_MSG_TYPE_ADD_DEL_WORKER
@ APP_SAPI_MSG_TYPE_ADD_DEL_WORKER
Definition: application_interface.h:818
app_unmap_segment_msg_::context
u32 context
Definition: application_interface.h:527
app_session_transport_
Definition: application_interface.h:290
vnet_listen
int vnet_listen(vnet_listen_args_t *a)
Definition: application.c:1294
svm_msg_q_alloc_msg_w_ring
svm_msg_q_msg_t svm_msg_q_alloc_msg_w_ring(svm_msg_q_t *mq, u32 ring_index)
Allocate message buffer on ring.
Definition: message_queue.c:221
session_connect_msg_::lcl_port
u16 lcl_port
Definition: application_interface.h:403
f
vlib_frame_t * f
Definition: interface_output.c:1098
svm_msg_q_try_lock
static int svm_msg_q_try_lock(svm_msg_q_t *mq)
Try locking message queue.
Definition: message_queue.h:353
app_sapi_msg_::worker_add_del_reply
app_sapi_worker_add_del_reply_msg_t worker_add_del_reply
Definition: application_interface.h:891
session_req_worker_update_msg_
Definition: application_interface.h:486
session_accepted_reply_msg_t
struct session_accepted_reply_msg_ session_accepted_reply_msg_t
session_shutdown_msg_::handle
session_handle_t handle
Definition: application_interface.h:448
app_recv_dgram
static int app_recv_dgram(app_session_t *s, u8 *buf, u32 len)
Definition: application_interface.h:759
svm_msg_q_msg_data
void * svm_msg_q_msg_data(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Get data for message in queue.
Definition: message_queue.c:287
app_map_another_segment_msg_
Definition: application_interface.h:514
app_map_another_segment_msg_::context
u32 context
Definition: application_interface.h:517
session_bound_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:355
svm_fifo_peek
int svm_fifo_peek(svm_fifo_t *f, u32 offset, u32 len, u8 *dst)
Peek data from fifo.
Definition: svm_fifo.c:1141
app_send_stream
static int app_send_stream(app_session_t *s, u8 *data, u32 len, u8 noblock)
Definition: application_interface.h:705
session_accepted_msg_::server_rx_fifo
uword server_rx_fifo
Definition: application_interface.h:379
session_listen_msg_::proto
u8 proto
Definition: application_interface.h:324
session_cb_vft_::builtin_app_rx_callback
int(* builtin_app_rx_callback)(session_t *session)
Direct RX callback for built-in application.
Definition: application_interface.h:66
session_
Definition: session_types.h:175
CRYPTO_ENGINE_OPENSSL
@ CRYPTO_ENGINE_OPENSSL
Definition: application_interface.h:177
session_endpoint_cfg_t
struct _session_endpoint_cfg session_endpoint_cfg_t
app_sapi_worker_add_del_msg_::wrk_index
u32 wrk_index
Definition: application_interface.h:851
session_bound_msg_::rx_fifo
uword rx_fifo
Definition: application_interface.h:352
app_recv_stream_raw
static int app_recv_stream_raw(svm_fifo_t *f, u8 *buf, u32 len, u8 clear_evt, u8 peek)
Definition: application_interface.h:765
session_listen_msg_
Definition: application_interface.h:317
session_connected_msg_::vpp_event_queue_address
uword vpp_event_queue_address
Definition: application_interface.h:439
session_handle_t
u64 session_handle_t
Definition: session_types.h:111
app_unmap_segment_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:528
crypto_engine_type_
crypto_engine_type_
Definition: application_interface.h:174
app_session_transport_::rmt_ip
ip46_address_t rmt_ip
remote ip
Definition: application_interface.h:292
session_connected_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:435
session_connect_msg_::ckpair_index
u32 ckpair_index
Definition: application_interface.h:409
transport_endpt_ext_cfg_::type
u16 type
Definition: transport_types.h:282
app_sapi_worker_add_del_msg_::app_index
u32 app_index
Definition: application_interface.h:850
session_reset_reply_msg_
Definition: application_interface.h:479
u16
unsigned short u16
Definition: types.h:57
session_worker_update_msg_
Definition: application_interface.h:492
session_req_worker_update_msg_::session_handle
u64 session_handle
Definition: application_interface.h:488
app_sapi_attach_reply_msg_::n_fds
u8 n_fds
Definition: application_interface.h:844
svm_msg_q_lock
static int svm_msg_q_lock(svm_msg_q_t *mq)
Lock, or block trying, the message queue.
Definition: message_queue.h:372
svm_msg_q_msg_t
Definition: message_queue.h:93
app_send_io_evt_to_vpp
static int app_send_io_evt_to_vpp(svm_msg_q_t *mq, u32 session_index, u8 evt_type, u8 noblock)
Send fifo io event to vpp worker thread.
Definition: application_interface.h:606
message_queue.h
Unidirectional shared-memory multi-ring message queue.
app_recv_dgram_raw
static int app_recv_dgram_raw(svm_fifo_t *f, u8 *buf, u32 len, app_session_transport_t *at, u8 clear_evt, u8 peek)
Definition: application_interface.h:720
session_accepted_reply_msg_::handle
u64 handle
Definition: application_interface.h:393
session_disconnected_reply_msg_t
struct session_disconnected_reply_msg_ session_disconnected_reply_msg_t
session_transport_attr_reply_msg_::handle
session_handle_t handle
Definition: application_interface.h:564
session_reset_msg_t
struct session_reset_msg_ session_reset_msg_t
app_sapi_worker_add_del_reply_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:860
session_connected_msg_
Definition: application_interface.h:428
certificate_::key
u8 * key
Definition: application_interface.h:28
app_sapi_worker_add_del_reply_msg_::app_event_queue_address
u64 app_event_queue_address
Definition: application_interface.h:859
session_unlisten_msg_::client_index
u32 client_index
Definition: application_interface.h:361
app_sapi_attach_msg_
Definition: application_interface.h:825
app_sapi_attach_reply_msg_::app_mq
u64 app_mq
Definition: application_interface.h:839
session_cleanup_msg_::handle
session_handle_t handle
Definition: application_interface.h:542
vnet_unlisten_args_t
struct _vnet_unlisten_args_t vnet_unlisten_args_t
session_disconnected_msg_::handle
u64 handle
Definition: application_interface.h:462
crypto_ctx_::n_subscribers
u32 n_subscribers
refcount of sessions using said context
Definition: application_interface.h:196
certificate_::app_interests
u32 * app_interests
Definition: application_interface.h:26
APP_OPTIONS_SEGMENT_SIZE
@ APP_OPTIONS_SEGMENT_SIZE
Definition: application_interface.h:207
app_sapi_cert_key_add_del_reply_msg_::index
u32 index
Definition: application_interface.h:880
vnet_app_add_cert_key_interest
int vnet_app_add_cert_key_interest(u32 index, u32 app_index)
Ask for app cb on pair deletion.
Definition: application.c:2049
session_bound_msg_::lcl_port
u16 lcl_port
Definition: application_interface.h:351
session_worker_update_reply_msg_t
struct session_worker_update_reply_msg_ session_worker_update_reply_msg_t
session_reset_reply_msg_t
struct session_reset_reply_msg_ session_reset_reply_msg_t
vnet_app_detach_args_t
struct _vnet_app_detach_args_t vnet_app_detach_args_t
app_sapi_cert_key_add_del_msg_
Definition: application_interface.h:867
app_sapi_cert_key_add_del_msg_::context
u32 context
Definition: application_interface.h:869
session_unlisten_reply_msg_::handle
u64 handle
Definition: application_interface.h:370
session_unlisten_msg_t
struct session_unlisten_msg_ session_unlisten_msg_t
session_transport_attr_reply_msg_::is_get
u8 is_get
Definition: application_interface.h:566
session_bound_msg_::tx_fifo
uword tx_fifo
Definition: application_interface.h:353
session_listen_msg_::vrf
u32 vrf
Definition: application_interface.h:322
clib_memcpy_fast
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
vnet_app_del_cert_key_pair
int vnet_app_del_cert_key_pair(u32 index)
Definition: application.c:2060
app_sapi_cert_key_add_del_reply_msg_t
struct app_sapi_cert_key_add_del_reply_msg_ app_sapi_cert_key_add_del_reply_msg_t
APP_OPTIONS_NAMESPACE_SECRET
@ APP_OPTIONS_NAMESPACE_SECRET
Definition: application_interface.h:215
session_connect_msg_::is_ip4
u8 is_ip4
Definition: application_interface.h:405
app_sapi_worker_add_del_reply_msg_::n_fds
u8 n_fds
Definition: application_interface.h:862
APP_OPTIONS_N_OPTIONS
@ APP_OPTIONS_N_OPTIONS
Definition: application_interface.h:223
session_fd_flag_
session_fd_flag_
Definition: application_interface.h:265
session_connect_uri_msg_::uri
u8 uri[56]
Definition: application_interface.h:422
app_send_ctrl_evt_to_vpp
static void app_send_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt)
Definition: application_interface.h:588
app_recv
static int app_recv(app_session_t *s, u8 *data, u32 len)
Definition: application_interface.h:783
session_worker_update_reply_msg_
Definition: application_interface.h:500
session_listen_msg_t
struct session_listen_msg_ session_listen_msg_t
error
Definition: cJSON.c:88
APP_OPTIONS_PROXY_TRANSPORT
@ APP_OPTIONS_PROXY_TRANSPORT
Definition: application_interface.h:216
SESSION_CONN_HDR_LEN
#define SESSION_CONN_HDR_LEN
Definition: session_types.h:449
vnet_shutdown_args_t
struct _vnet_shutdown_args_t vnet_shutdown_args_t
ph
pool_header_t * ph(void *p)
GDB callable function: ph - call pool_header - get pool header.
Definition: gdb_funcs.c:78
key
typedef key
Definition: ipsec_types.api:91
i32
signed int i32
Definition: types.h:77
session_disconnected_msg_::client_index
u32 client_index
Definition: application_interface.h:460
session_cb_vft_::session_accept_callback
int(* session_accept_callback)(session_t *new_session)
Notify server of newly accepted session.
Definition: application_interface.h:41
app_session_transport_::lcl_port
u16 lcl_port
local port (network order)
Definition: application_interface.h:295
session_listen_msg_::context
u32 context
Definition: application_interface.h:320
session_shutdown_msg_
Definition: application_interface.h:444
app_sapi_msg_type_e
enum app_sapi_msg_type app_sapi_msg_type_e
svm_fifo_t
struct _svm_fifo svm_fifo_t
session_cb_vft_::session_cleanup_callback
void(* session_cleanup_callback)(session_t *s, session_cleanup_ntf_t ntf)
Notify app that session or transport are about to be removed.
Definition: application_interface.h:54
session_connected_msg_::handle
u64 handle
Definition: application_interface.h:432
session_worker_update_reply_msg_::rx_fifo
uword rx_fifo
Definition: application_interface.h:503
session_disconnect_msg_
Definition: application_interface.h:451
svm_msg_q_wait_prod
int svm_msg_q_wait_prod(svm_msg_q_t *mq)
Wait for message queue event as producer.
Definition: message_queue.c:543
session_bound_msg_::lcl_ip
u8 lcl_ip[16]
Definition: application_interface.h:350
APP_SAPI_MSG_TYPE_ADD_DEL_CERT_KEY_REPLY
@ APP_SAPI_MSG_TYPE_ADD_DEL_CERT_KEY_REPLY
Definition: application_interface.h:822
session_cb_vft_
Definition: application_interface.h:32
svm_fifo_seg_
Definition: svm_fifo.h:52
APP_SAPI_MSG_TYPE_ADD_DEL_CERT_KEY
@ APP_SAPI_MSG_TYPE_ADD_DEL_CERT_KEY
Definition: application_interface.h:821
session_ft_action_t
enum session_ft_action_ session_ft_action_t
app_unmap_segment_msg_::client_index
u32 client_index
Definition: application_interface.h:526
app_map_another_segment_msg_::fd_flags
u8 fd_flags
Definition: application_interface.h:518
vnet_application_attach
int vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
Definition: application.c:1142
CRYPTO_ENGINE_MBEDTLS
@ CRYPTO_ENGINE_MBEDTLS
Definition: application_interface.h:178
session_dgram_header_::lcl_port
u16 lcl_port
Definition: session_types.h:444
session_endpoint_alloc_ext_cfg
static void session_endpoint_alloc_ext_cfg(session_endpoint_cfg_t *sep_ext, transport_endpt_ext_cfg_type_t type)
Definition: application_interface.h:898
session_disconnect_msg_::handle
session_handle_t handle
Definition: application_interface.h:455
len
u8 len
Definition: ip_types.api:103
svm_msg_q_is_full
static u8 svm_msg_q_is_full(svm_msg_q_t *mq)
Check if message queue is full.
Definition: message_queue.h:319
app_sapi_attach_msg_t
struct app_sapi_attach_msg_ app_sapi_attach_msg_t
transport_endpt_ext_cfg_
Definition: transport_types.h:280
vnet_disconnect_args_t
struct _vnet_disconnect_args_t vnet_disconnect_args_t
session_connected_msg_::mq_index
u32 mq_index
Definition: application_interface.h:441
vnet_app_add_cert_key_pair
int vnet_app_add_cert_key_pair(vnet_app_add_cert_key_pair_args_t *a)
Definition: application.c:2037
session_listen_uri_msg_
Definition: application_interface.h:334
session_reset_reply_msg_::retval
i32 retval
Definition: application_interface.h:482
session_worker_update_msg_::req_wrk_index
u16 req_wrk_index
Definition: application_interface.h:496
app_session_event_::evt
session_event_t * evt
Definition: application_interface.h:572
session_accepted_reply_msg_
Definition: application_interface.h:389
app_sapi_worker_add_del_reply_msg_t
struct app_sapi_worker_add_del_reply_msg_ app_sapi_worker_add_del_reply_msg_t
session_transport_attr_msg_::is_get
u8 is_get
Definition: application_interface.h:558
svm_fifo_dequeue
int svm_fifo_dequeue(svm_fifo_t *f, u32 len, u8 *dst)
Dequeue data from fifo.
Definition: svm_fifo.c:1105
session_transport_attr_msg_t
struct session_transport_attr_msg_ session_transport_attr_msg_t
session_disconnected_reply_msg_::context
u32 context
Definition: application_interface.h:467
session_app_wrk_rpc_msg_
Definition: application_interface.h:546
vnet_bind_uri
int vnet_bind_uri(vnet_listen_args_t *)
Definition: application_interface.c:110
session_worker_update_msg_::wrk_index
u16 wrk_index
Definition: application_interface.h:495
session_shutdown_msg_t
struct session_shutdown_msg_ session_shutdown_msg_t
session_connect_msg_::ext_config
uword ext_config
Definition: application_interface.h:412
session_connect_msg_::client_index
u32 client_index
Definition: application_interface.h:398
session_migrate_msg_::new_handle
session_handle_t new_handle
Definition: application_interface.h:535
session_fd_type_
session_fd_type_
Definition: application_interface.h:257
session_app_detach_msg_::context
u32 context
Definition: application_interface.h:511
app_sapi_cert_key_add_del_msg_::certkey_len
u16 certkey_len
Definition: application_interface.h:872
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
session_migrate_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:536
session_shutdown_msg_::client_index
u32 client_index
Definition: application_interface.h:446
session_accepted_msg_::handle
u64 handle
Definition: application_interface.h:378
session_disconnect_msg_t
struct session_disconnect_msg_ session_disconnect_msg_t
vnet_listen_args_t
struct _vnet_bind_args_t vnet_listen_args_t
session_connect_uri_msg_::client_index
u32 client_index
Definition: application_interface.h:420
APP_OPTIONS_TLS_ENGINE
@ APP_OPTIONS_TLS_ENGINE
Definition: application_interface.h:218
session_app_detach_msg_::client_index
u32 client_index
Definition: application_interface.h:510
session_cb_vft_t
struct session_cb_vft_ session_cb_vft_t
session_accepted_reply_msg_::retval
i32 retval
Definition: application_interface.h:392
app_sapi_worker_add_del_reply_msg_::fd_flags
u8 fd_flags
Definition: application_interface.h:863
app_send
static int app_send(app_session_t *s, u8 *data, u32 len, u8 noblock)
Definition: application_interface.h:712
session_connect_msg_::lcl_ip
ip46_address_t lcl_ip
Definition: application_interface.h:407
app_session_transport_::lcl_ip
ip46_address_t lcl_ip
local ip
Definition: application_interface.h:293
session_app_del_segment_msg_t
struct app_unmap_segment_msg_ session_app_del_segment_msg_t
app_cert_key_pair_t
struct certificate_ app_cert_key_pair_t
vnet_application_detach
int vnet_application_detach(vnet_app_detach_args_t *a)
Detach application from vpp.
Definition: application.c:1216
transport_endpt_attr_
Definition: transport_types.h:256
uword
u64 uword
Definition: types.h:112
session_transport_attr_msg_::handle
session_handle_t handle
Definition: application_interface.h:556
svm_fifo_enqueue_segments
int svm_fifo_enqueue_segments(svm_fifo_t *f, const svm_fifo_seg_t segs[], u32 n_segs, u8 allow_partial)
Enqueue array of svm_fifo_seg_t in order.
Definition: svm_fifo.c:972
session_cb_vft_::session_disconnect_callback
void(* session_disconnect_callback)(session_t *s)
Notify app that session is closing.
Definition: application_interface.h:48
app_recv_stream
static int app_recv_stream(app_session_t *s, u8 *buf, u32 len)
Definition: application_interface.h:777
session_app_wrk_rpc_msg_::data
u8 data[64]
rpc data
Definition: application_interface.h:550
session_connected_msg_::ct_tx_fifo
uword ct_tx_fifo
Definition: application_interface.h:437
session_disconnected_reply_msg_::retval
i32 retval
Definition: application_interface.h:468
session_cb_vft_::session_migrate_callback
void(* session_migrate_callback)(session_t *s, session_handle_t new_sh)
Notify app that session pool migration happened.
Definition: application_interface.h:63
session_transport_attr_msg_
Definition: application_interface.h:553
app_sapi_worker_add_del_reply_msg_
Definition: application_interface.h:855
app_sapi_attach_reply_msg_t
struct app_sapi_attach_reply_msg_ app_sapi_attach_reply_msg_t
session_transport_attr_msg_::attr
transport_endpt_attr_t attr
Definition: application_interface.h:557
session_connected_msg_t
struct session_connected_msg_ session_connected_msg_t
app_sapi_worker_add_del_msg_::is_add
u8 is_add
Definition: application_interface.h:852
session_app_wrk_rpc_msg_::client_index
u32 client_index
app client index
Definition: application_interface.h:548
session_connect_msg_::flags
u8 flags
Definition: application_interface.h:411
session_disconnected_reply_msg_::handle
u64 handle
Definition: application_interface.h:469
svm_fifo_dequeue_drop
int svm_fifo_dequeue_drop(svm_fifo_t *f, u32 len)
Dequeue and drop bytes from fifo.
Definition: svm_fifo.c:1168
app_sapi_attach_msg_::name
u8 name[64]
Definition: application_interface.h:827
app_session_event_::msg
svm_msg_q_msg_t msg
Definition: application_interface.h:571
session_accepted_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:381
app_sapi_worker_add_del_msg_t
struct app_sapi_worker_add_del_msg_ app_sapi_worker_add_del_msg_t
svm_fifo_enqueue
int svm_fifo_enqueue(svm_fifo_t *f, u32 len, const u8 *src)
Enqueue data to fifo.
Definition: svm_fifo.c:847
vnet_disconnect_session
int vnet_disconnect_session(vnet_disconnect_args_t *a)
Definition: application.c:1439
session_dgram_header_::data_offset
u32 data_offset
Definition: session_types.h:440
session_disconnect_msg_::context
u32 context
Definition: application_interface.h:454
session_bound_msg_::retval
i32 retval
Definition: application_interface.h:348
session_reset_msg_::context
u32 context
Definition: application_interface.h:475
session_connect_uri_msg_t
struct session_connect_uri_msg_ session_connect_uri_msg_t
session_cb_vft_::session_reset_callback
void(* session_reset_callback)(session_t *s)
Notify app that session was reset.
Definition: application_interface.h:60
session_unlisten_reply_msg_::retval
i32 retval
Definition: application_interface.h:371
session_app_wrk_rpc_msg_t
struct session_app_wrk_rpc_msg_ session_app_wrk_rpc_msg_t
SESSION_IO_EVT_TX
@ SESSION_IO_EVT_TX
Definition: session_types.h:329
session_listen_msg_::client_index
u32 client_index
Definition: application_interface.h:319
APP_OPTIONS_ACCEPT_COOKIE
@ APP_OPTIONS_ACCEPT_COOKIE
Definition: application_interface.h:217
app_send_dgram_raw
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 evt_type, u8 do_evt, u8 noblock)
Definition: application_interface.h:645
app_alloc_ctrl_evt_to_vpp
static void app_alloc_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt, u8 evt_type)
Definition: application_interface.h:576
session_listen_uri_msg_::uri
u8 uri[56]
Definition: application_interface.h:338
app_sapi_cert_key_add_del_msg_t
struct app_sapi_cert_key_add_del_msg_ app_sapi_cert_key_add_del_msg_t
app_sapi_cert_key_add_del_reply_msg_::context
u32 context
Definition: application_interface.h:878
session_cleanup_msg_t
struct session_cleanup_msg_ session_cleanup_msg_t
clib_min
#define clib_min(x, y)
Definition: clib.h:342
session_bound_msg_::mq_index
u32 mq_index
Definition: application_interface.h:356
app_send_dgram
static int app_send_dgram(app_session_t *s, u8 *data, u32 len, u8 noblock)
Definition: application_interface.h:681
foreach_app_init_args
#define foreach_app_init_args
Definition: application_interface.h:80
app_sapi_msg_::attach_reply
app_sapi_attach_reply_msg_t attach_reply
Definition: application_interface.h:889
session_reset_msg_::client_index
u32 client_index
Definition: application_interface.h:474
app_sapi_msg_::worker_add_del
app_sapi_worker_add_del_msg_t worker_add_del
Definition: application_interface.h:890
svm_msg_q_
Definition: message_queue.h:72
session_reset_reply_msg_::handle
u64 handle
Definition: application_interface.h:483
session_listen_msg_::flags
u8 flags
Definition: application_interface.h:327
vnet_app_add_cert_key_pair_args_t
struct _vnet_app_add_cert_key_pair_args_ vnet_app_add_cert_key_pair_args_t
session_connect_msg_::crypto_engine
u8 crypto_engine
Definition: application_interface.h:410
SESSION_N_FD_TYPE
@ SESSION_N_FD_TYPE
Definition: application_interface.h:262
session_app_wrk_rpc_msg_::wrk_index
u32 wrk_index
dst worker index
Definition: application_interface.h:549
APP_OPTIONS_PREALLOC_FIFO_PAIRS
@ APP_OPTIONS_PREALLOC_FIFO_PAIRS
Definition: application_interface.h:212
session_disconnected_msg_::context
u32 context
Definition: application_interface.h:461
session_unlisten_msg_::context
u32 context
Definition: application_interface.h:362
foreach_fd_type
#define foreach_fd_type
Definition: application_interface.h:251
session_listen_msg_::ext_config
uword ext_config
Definition: application_interface.h:328
vnet_unlisten
int vnet_unlisten(vnet_unlisten_args_t *a)
Definition: application.c:1387
data
u8 data[128]
Definition: ipsec_types.api:95
session_listen_msg_::ip
ip46_address_t ip
Definition: application_interface.h:326
session_disconnected_msg_
Definition: application_interface.h:458
vnet_connect
int vnet_connect(vnet_connect_args_t *a)
Definition: application.c:1348
APP_SAPI_MSG_TYPE_SEND_FDS
@ APP_SAPI_MSG_TYPE_SEND_FDS
Definition: application_interface.h:820
parse_uri
int parse_uri(char *uri, session_endpoint_cfg_t *sep)
Definition: application_interface.c:77
session_accepted_msg_::listener_handle
u64 listener_handle
Definition: application_interface.h:377
session_connect_msg_::port
u16 port
Definition: application_interface.h:402
session_bound_msg_::vpp_evt_q
uword vpp_evt_q
Definition: application_interface.h:354
app_sapi_msg_t
struct app_sapi_msg_ app_sapi_msg_t
session_reset_msg_
Definition: application_interface.h:472
index
u32 index
Definition: flow_types.api:221
session_connect_msg_::wrk_index
u32 wrk_index
Definition: application_interface.h:400
crypto_ctx_::ctx_index
u32 ctx_index
index in crypto context pool
Definition: application_interface.h:195
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
session_cb_vft_::add_segment_callback
int(* add_segment_callback)(u32 app_wrk_index, u64 segment_handle)
Notify server of new segment.
Definition: application_interface.h:35
APP_OPTIONS_TX_FIFO_SIZE
@ APP_OPTIONS_TX_FIFO_SIZE
Definition: application_interface.h:211
APP_SAPI_MSG_TYPE_ADD_DEL_WORKER_REPLY
@ APP_SAPI_MSG_TYPE_ADD_DEL_WORKER_REPLY
Definition: application_interface.h:819
session_connect_msg_::parent_handle
u64 parent_handle
Definition: application_interface.h:408
session_transport_attr_reply_msg_t
struct session_transport_attr_reply_msg_ session_transport_attr_reply_msg_t
app_sapi_msg_
Definition: application_interface.h:883
session_fd_flag_t
enum session_fd_flag_ session_fd_flag_t
app_sapi_msg_::cert_key_add_del
app_sapi_cert_key_add_del_msg_t cert_key_add_del
Definition: application_interface.h:892
session_cb_vft_::session_transport_closed_callback
void(* session_transport_closed_callback)(session_t *s)
Notify app that transport is closed.
Definition: application_interface.h:51
session_migrate_msg_::handle
session_handle_t handle
Definition: application_interface.h:534
transport_endpt_ext_cfg_t
struct transport_endpt_ext_cfg_ transport_endpt_ext_cfg_t
svm_fifo_max_enqueue_prod
static u32 svm_fifo_max_enqueue_prod(svm_fifo_t *f)
Maximum number of bytes that can be enqueued into fifo.
Definition: svm_fifo.h:607
session_fd_type_t
enum session_fd_type_ session_fd_type_t
APP_OPTIONS_ADD_SEGMENT_SIZE
@ APP_OPTIONS_ADD_SEGMENT_SIZE
Definition: application_interface.h:208
u64
unsigned long u64
Definition: types.h:89
session_bound_msg_::lcl_is_ip4
u8 lcl_is_ip4
Definition: application_interface.h:349
vnet_unbind_uri
int vnet_unbind_uri(vnet_unlisten_args_t *a)
Definition: application_interface.c:124
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
session_connect_uri_msg_::context
u32 context
Definition: application_interface.h:421
session_dgram_header_::rmt_port
u16 rmt_port
Definition: session_types.h:443
app_sapi_cert_key_add_del_msg_::index
u32 index
Definition: application_interface.h:870
app_sapi_attach_reply_msg_
Definition: application_interface.h:835
session_connect_msg_t
struct session_connect_msg_ session_connect_msg_t
session_connect_msg_
Definition: application_interface.h:396
crypto_ctx_
Definition: application_interface.h:193
app_sapi_cert_key_add_del_msg_::is_add
u8 is_add
Definition: application_interface.h:873
format_session_error
static u8 * format_session_error(u8 *s, va_list *args)
Definition: application_interface.h:799
app_sapi_attach_reply_msg_::vpp_ctrl_mq_thread
u8 vpp_ctrl_mq_thread
Definition: application_interface.h:843
session_connected_msg_::ct_segment_handle
u64 ct_segment_handle
Definition: application_interface.h:438
buf
u64 buf
Definition: application.c:493
u32
unsigned int u32
Definition: types.h:88
app_map_another_segment_msg_::segment_name
u8 segment_name[128]
Definition: application_interface.h:520
transport_endpoint_
Definition: transport_types.h:193
CRYPTO_ENGINE_LAST
@ CRYPTO_ENGINE_LAST
Definition: application_interface.h:181
options
static struct option options[]
Definition: main.c:52
session_unlisten_reply_msg_::context
u32 context
Definition: application_interface.h:369
app_options_flags_t
enum _app_options_flags app_options_flags_t
session_transport_attr_msg_::client_index
u32 client_index
Definition: application_interface.h:555
session_migrate_msg_::vpp_thread_index
u32 vpp_thread_index
Definition: application_interface.h:537
session_cleanup_msg_
Definition: application_interface.h:540
app_sapi_attach_reply_msg_::fd_flags
u8 fd_flags
Definition: application_interface.h:845
session_cleanup_msg_::type
u8 type
Definition: application_interface.h:543
session_migrate_msg_::vpp_evt_q
uword vpp_evt_q
Definition: application_interface.h:533
APP_OPTIONS_EVT_QUEUE_SIZE
@ APP_OPTIONS_EVT_QUEUE_SIZE
Definition: application_interface.h:206
session_accepted_msg_::server_tx_fifo
uword server_tx_fifo
Definition: application_interface.h:380
session_endpoint_t
struct _session_endpoint session_endpoint_t
session_transport_attr_reply_msg_::attr
transport_endpt_attr_t attr
Definition: application_interface.h:565
session_listen_uri_msg_t
struct session_listen_uri_msg_ session_listen_uri_msg_t
vnet_connect_args_t
struct _vnet_connect_args vnet_connect_args_t
foreach_app_session_field
#define foreach_app_session_field
flag for dgram mode
Definition: application_interface.h:299
session_listen_msg_::wrk_index
u32 wrk_index
Definition: application_interface.h:321
app_sapi_worker_add_del_reply_msg_::retval
i32 retval
Definition: application_interface.h:857
session_bound_msg_::context
u32 context
Definition: application_interface.h:346
session_accepted_msg_::flags
u8 flags
Definition: application_interface.h:386
app_sapi_cert_key_add_del_msg_::cert_len
u16 cert_len
Definition: application_interface.h:871
app_map_another_segment_msg_::segment_size
u32 segment_size
Definition: application_interface.h:519
session_disconnected_msg_t
struct session_disconnected_msg_ session_disconnected_msg_t
APP_OPTIONS_FLAGS
@ APP_OPTIONS_FLAGS
Definition: application_interface.h:205
session_cb_vft_::session_connected_callback
int(* session_connected_callback)(u32 app_wrk_index, u32 opaque, session_t *s, session_error_t code)
Connection request callback.
Definition: application_interface.h:44
session_connected_msg_::server_tx_fifo
uword server_tx_fifo
Definition: application_interface.h:434
session_worker_update_msg_t
struct session_worker_update_msg_ session_worker_update_msg_t
session_bound_msg_t
struct session_bound_msg_ session_bound_msg_t
session_cb_vft_::del_segment_callback
int(* del_segment_callback)(u32 app_wrk_index, u64 segment_handle)
Notify server of new segment.
Definition: application_interface.h:38
session_shutdown_msg_::context
u32 context
Definition: application_interface.h:447
session_connect_msg_::vrf
u32 vrf
Definition: application_interface.h:401
app_sapi_worker_add_del_reply_msg_::wrk_index
u32 wrk_index
Definition: application_interface.h:858
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
svm_msg_q_lock_and_alloc_msg_w_ring
int svm_msg_q_lock_and_alloc_msg_w_ring(svm_msg_q_t *mq, u32 ring_index, u8 noblock, svm_msg_q_msg_t *msg)
Lock message queue and allocate message buffer on ring.
Definition: message_queue.c:239
session_transport_attr_reply_msg_
Definition: application_interface.h:561
session_accepted_msg_t
struct session_accepted_msg_ session_accepted_msg_t
u8
unsigned char u8
Definition: types.h:56
foreach_app_options_flags
#define foreach_app_options_flags
Definition: application_interface.h:226
a
a
Definition: bitmap.h:525
session_listen_uri_msg_::context
u32 context
Definition: application_interface.h:337
APP_SAPI_MSG_TYPE_NONE
@ APP_SAPI_MSG_TYPE_NONE
Definition: application_interface.h:815
crypto_ctx_::crypto_engine
u8 crypto_engine
Definition: application_interface.h:198
session_app_detach_msg_t
struct session_app_detach_msg_ session_app_detach_msg_t
STATIC_ASSERT
STATIC_ASSERT(sizeof(session_listen_msg_t)<=SESSION_CTRL_MSG_MAX_SIZE, "msg too large")
session_connected_msg_::ct_rx_fifo
uword ct_rx_fifo
Definition: application_interface.h:436
session_unlisten_reply_msg_
Definition: application_interface.h:367
session_cb_vft_::builtin_app_tx_callback
int(* builtin_app_tx_callback)(session_t *session)
Direct TX callback for built-in application.
Definition: application_interface.h:69
app_sapi_msg_type
app_sapi_msg_type
Definition: application_interface.h:813
session_connect_msg_::ip
ip46_address_t ip
Definition: application_interface.h:406
app_sapi_msg_::type
app_sapi_msg_type_e type
Definition: application_interface.h:885
session_unlisten_reply_msg_t
struct session_unlisten_reply_msg_ session_unlisten_reply_msg_t
app_sapi_msg_::attach
app_sapi_attach_msg_t attach
Definition: application_interface.h:888
APP_SAPI_MSG_TYPE_ATTACH
@ APP_SAPI_MSG_TYPE_ATTACH
Definition: application_interface.h:816
session_reset_reply_msg_::context
u32 context
Definition: application_interface.h:481
session_migrated_msg_t
struct session_migrate_msg_ session_migrated_msg_t
session_cb_vft_::fifo_tuning_callback
int(* fifo_tuning_callback)(session_t *s, svm_fifo_t *f, session_ft_action_t act, u32 bytes)
Delegate fifo-tuning-logic to application.
Definition: application_interface.h:75
transport_endpt_ext_cfg_type_t
enum transport_endpt_ext_cfg_type_ transport_endpt_ext_cfg_type_t
rv
int __clib_unused rv
Definition: application.c:491
key_len
u16 key_len
Definition: ikev2_types.api:95
session_dgram_header_::lcl_ip
ip46_address_t lcl_ip
Definition: session_types.h:442
app_session_transport_::rmt_port
u16 rmt_port
remote port (network order)
Definition: application_interface.h:294
APP_OPTIONS_PREALLOC_FIFO_HDRS
@ APP_OPTIONS_PREALLOC_FIFO_HDRS
Definition: application_interface.h:213
app_session_evt_t
struct app_session_event_ app_session_evt_t
session_bound_msg_
Definition: application_interface.h:344
certificate_::cert
u8 * cert
Definition: application_interface.h:29
session_transport_attr_reply_msg_::retval
i32 retval
Definition: application_interface.h:563
session_listen_msg_::is_ip4
u8 is_ip4
Definition: application_interface.h:325
foreach_session_error
@ foreach_session_error
Definition: session_types.h:503
vnet_app_attach_args_t
struct _vnet_app_attach_args_t vnet_app_attach_args_t
APP_OPTIONS_PCT_FIRST_ALLOC
@ APP_OPTIONS_PCT_FIRST_ALLOC
Definition: application_interface.h:222
ssvm_private_t
Definition: ssvm.h:81
SVM_Q_WAIT
@ SVM_Q_WAIT
blocking call - best used in combination with condvars, for eventfds we don't yield the cpu
Definition: queue.h:42
vnet_shutdown_session
int vnet_shutdown_session(vnet_shutdown_args_t *a)
Definition: application.c:1418
session_connect_msg_::proto
u8 proto
Definition: application_interface.h:404
APP_OPTIONS_NAMESPACE
@ APP_OPTIONS_NAMESPACE
Definition: application_interface.h:214
app_sapi_attach_reply_msg_::retval
i32 retval
Definition: application_interface.h:837
session_worker_update_msg_::client_index
u32 client_index
Definition: application_interface.h:494
app_sapi_attach_reply_msg_::app_index
u32 app_index
Definition: application_interface.h:838
session_cb_vft_::app_cert_key_pair_delete_callback
int(* app_cert_key_pair_delete_callback)(app_cert_key_pair_t *ckpair)
Cert and key pair delete notification.
Definition: application_interface.h:72
SESSION_MQ_CTRL_EVT_RING
@ SESSION_MQ_CTRL_EVT_RING
Definition: session_types.h:402
svm_msg_q_ring_is_full
static u8 svm_msg_q_ring_is_full(svm_msg_q_t *mq, u32 ring_index)
Definition: message_queue.h:325
session_accepted_msg_::lcl
transport_endpoint_t lcl
Definition: application_interface.h:384
crypto_ctx_::ckpair_index
u32 ckpair_index
certificate & key
Definition: application_interface.h:197
session_accepted_msg_
Definition: application_interface.h:374
session_accepted_msg_::mq_index
u32 mq_index
Definition: application_interface.h:383
svm_fifo_max_dequeue_cons
static u32 svm_fifo_max_dequeue_cons(svm_fifo_t *f)
Fifo max bytes to dequeue optimized for consumer.
Definition: svm_fifo.h:487
app_map_another_segment_msg_::client_index
u32 client_index
Definition: application_interface.h:516
session_accepted_msg_::vpp_event_queue_address
uword vpp_event_queue_address
Definition: application_interface.h:382
session_disconnected_reply_msg_
Definition: application_interface.h:465
APP_OPTIONS_MAX_FIFO_SIZE
@ APP_OPTIONS_MAX_FIFO_SIZE
Definition: application_interface.h:219
session_worker_update_msg_::handle
u64 handle
Definition: application_interface.h:497
app_attach_options_index_t
app_attach_options_index_t
Definition: application_interface.h:203
fifo_segment.h
session_dgram_pre_hdr_
Definition: session_types.h:431
session_cleanup_ntf_t
session_cleanup_ntf_t
Definition: session_types.h:113
session_dgram_header_::is_ip4
u8 is_ip4
Definition: session_types.h:445
session_connect_uri_msg_
Definition: application_interface.h:418
session_cb_vft_::half_open_cleanup_callback
void(* half_open_cleanup_callback)(session_t *s)
Notify app that half open state was cleaned up (optional)
Definition: application_interface.h:57
app_sapi_cert_key_add_del_reply_msg_::retval
i32 retval
Definition: application_interface.h:879
session_connected_msg_::retval
i32 retval
Definition: application_interface.h:431
session_listen_msg_::port
u16 port
Definition: application_interface.h:323
app_sapi_msg_::cert_key_add_del_reply
app_sapi_cert_key_add_del_reply_msg_t cert_key_add_del_reply
Definition: application_interface.h:893
clib_mem_alloc
static void * clib_mem_alloc(uword size)
Definition: mem.h:256
CRYPTO_ENGINE_NONE
@ CRYPTO_ENGINE_NONE
Definition: application_interface.h:176
app_map_another_segment_msg_::segment_handle
u64 segment_handle
Definition: application_interface.h:521
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
APP_OPTIONS_PRIVATE_SEGMENT_COUNT
@ APP_OPTIONS_PRIVATE_SEGMENT_COUNT
Definition: application_interface.h:209
session_unlisten_msg_::handle
session_handle_t handle
Definition: application_interface.h:364
vnet_app_add_tls_key_args_t
struct _vnet_application_add_tls_key_args_t vnet_app_add_tls_key_args_t
app_sapi_worker_add_del_reply_msg_::is_add
u8 is_add
Definition: application_interface.h:864
certificate_::cert_key_index
u32 cert_key_index
Definition: application_interface.h:27
app_session_event_
Definition: application_interface.h:569
APP_OPTIONS_LOW_WATERMARK
@ APP_OPTIONS_LOW_WATERMARK
Definition: application_interface.h:221
session_app_add_segment_msg_t
struct app_map_another_segment_msg_ session_app_add_segment_msg_t
session_dgram_header_::rmt_ip
ip46_address_t rmt_ip
Definition: session_types.h:441
vnet_app_add_tls_cert_args_t
struct _vnet_application_add_tls_cert_args_t vnet_app_add_tls_cert_args_t
session_req_worker_update_msg_t
struct session_req_worker_update_msg_ session_req_worker_update_msg_t
app_sapi_attach_reply_msg_::vpp_ctrl_mq
u64 vpp_ctrl_mq
Definition: application_interface.h:840
SESSION_N_ERRORS
@ SESSION_N_ERRORS
Definition: session_types.h:497
session_disconnect_msg_::client_index
u32 client_index
Definition: application_interface.h:453
app_session_transport_::is_ip4
u8 is_ip4
set if uses ip4 networking
Definition: application_interface.h:296
app_unmap_segment_msg_
Definition: application_interface.h:524
session_accepted_reply_msg_::context
u32 context
Definition: application_interface.h:391
session_connected_msg_::lcl
transport_endpoint_t lcl
Definition: application_interface.h:440
app_sapi_worker_add_del_msg_
Definition: application_interface.h:848
svm_msg_q_unlock
static void svm_msg_q_unlock(svm_msg_q_t *mq)
Unlock message queue.
Definition: message_queue.h:392