34 bmp->_vl_msg_id =
ntohs (VL_API_APP_ATTACH);
36 bmp->
context = ntohl (0xfeedface);
61 bmp->_vl_msg_id =
ntohs (VL_API_APPLICATION_DETACH);
63 bmp->
context = ntohl (0xfeedface);
76 clib_memset (bmp, 0,
sizeof (*bmp) + cert_len + key_len);
78 bmp->_vl_msg_id =
ntohs (VL_API_APP_ADD_CERT_KEY_PAIR);
80 bmp->
context = ntohl (0xfeedface);
81 bmp->
cert_len = clib_host_to_net_u16 (cert_len);
82 bmp->
certkey_len = clib_host_to_net_u16 (key_len + cert_len);
96 bmp->_vl_msg_id =
ntohs (VL_API_APP_DEL_CERT_KEY_PAIR);
98 bmp->
context = ntohl (0xfeedface);
112 memset (mp, 0,
sizeof (*mp));
114 mp->
context = ntohl (0xfeedface);
134 memset (mp, 0,
sizeof (*mp));
156 memset (mp, 0,
sizeof (*mp));
183 memset (mp, 0,
sizeof (*mp));
243 ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY,
244 "Adding cert and key returned %d",
245 clib_net_to_host_u32 (mp->
retval));
251 ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY,
"Wrong state");
260 (vl_api_app_del_cert_key_pair_reply_t * mp)
265 ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_DEL_REPLY,
266 "Delete cert and key returned %d",
267 clib_net_to_host_u32 (mp->retval));
280 char *segment_name = 0;
287 ECHO_FAIL (ECHO_FAIL_VL_API_APP_ATTACH,
"attach failed: %U",
294 ECHO_FAIL (ECHO_FAIL_VL_API_NULL_APP_MQ,
"NULL app_mq");
306 "vl_socket_client_recv_fd_msg failed");
310 if (mp->
fd_flags & SESSION_FD_F_VPP_MQ_SEGMENT)
313 ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
314 "svm_fifo_segment_attach failed on SSVM_SEGMENT_MEMFD");
318 if (mp->
fd_flags & SESSION_FD_F_MEMFD_SEGMENT)
325 ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
326 "svm_fifo_segment_attach ('%s') " 327 "failed on SSVM_SEGMENT_MEMFD", segment_name);
334 if (mp->
fd_flags & SESSION_FD_F_MQ_EVENTFD)
345 ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
346 "svm_fifo_segment_attach ('%s') " 347 "failed on SSVM_SEGMENT_SHM", segment_name);
354 ECHO_LOG (2,
"Mapped segment 0x%lx", segment_handle);
370 ECHO_FAIL (ECHO_FAIL_VL_API_DETACH_REPLY,
371 "app detach returned with err: %d", mp->retval);
377 #define foreach_quic_echo_msg \ 378 _(APP_ATTACH_REPLY, app_attach_reply) \ 379 _(APPLICATION_DETACH_REPLY, application_detach_reply) \ 380 _(APP_ADD_CERT_KEY_PAIR_REPLY, app_add_cert_key_pair_reply) \ 381 _(APP_DEL_CERT_KEY_PAIR_REPLY, app_del_cert_key_pair_reply) 387 vl_msg_api_set_handlers(VL_API_##N, #n, \ 388 vl_api_##n##_t_handler, \ 390 vl_api_##n##_t_endian, \ 391 vl_api_##n##_t_print, \ 392 sizeof(vl_api_##n##_t), 1);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define hash_set(h, key, value)
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
static void vl_api_app_add_cert_key_pair_reply_t_handler(vl_api_app_add_cert_key_pair_reply_t *mp)
#define hash_unset(h, key)
void echo_send_del_cert_key(echo_main_t *em)
svm_queue_t * vl_input_queue
#define clib_memcpy_fast(a, b, c)
static u8 * format_api_error(u8 *s, va_list *args)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void echo_send_add_cert_key(echo_main_t *em)
volatile connection_state_t state
volatile int max_sim_connects
void * vl_msg_api_alloc(int nbytes)
foreach_app_session_field u64 vpp_session_handle
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
enum ssvm_segment_type_ ssvm_segment_type_t
static void app_alloc_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt, u8 evt_type)
void echo_send_attach(echo_main_t *em)
Application attach reply.
static const u32 test_srv_key_rsa_len
void echo_send_unbind(echo_main_t *em, echo_session_t *s)
clib_spinlock_t segment_handles_lock
void echo_send_disconnect_session(echo_main_t *em, void *args)
#define ECHO_FAIL(fail, _fmt, _args...)
static void vl_api_app_del_cert_key_pair_reply_t_handler(vl_api_app_del_cert_key_pair_reply_t *mp)
void vl_msg_api_send_shmem(svm_queue_t *q, u8 *elem)
char * segment_name
segment name
vl_api_fib_path_type_t type
int fifo_segment_attach(fifo_segment_main_t *sm, fifo_segment_create_args_t *a)
Attach as slave to a fifo segment.
void echo_api_hookup(echo_main_t *em)
static void vl_api_application_detach_reply_t_handler(vl_api_application_detach_reply_t *mp)
static const char test_srv_crt_rsa[]
fifo_segment_main_t segment_main
#define clib_atomic_sub_fetch(a, b)
static void app_send_ctrl_evt_to_vpp(svm_msg_q_t *mq, app_session_evt_t *app_evt)
clib_error_t * vl_socket_client_recv_fd_msg(int fds[], int n_fds, u32 wait)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
#define foreach_quic_echo_msg
uword * shared_segment_handles
#define ECHO_LOG(lvl, _fmt, _args...)
char * vl_api_from_api_to_new_c_string(vl_api_string_t *astr)
static void vl_api_app_attach_reply_t_handler(vl_api_app_attach_reply_t *mp)
int memfd_fd
fd for memfd segments
static const char test_srv_key_rsa[]
u64 parent_session_handle
struct echo_main_t::@665 uri_elts
#define uword_to_pointer(u, type)
void echo_segment_handle_add_del(echo_main_t *em, u64 segment_handle, u8 add)
Application detach from session layer.
echo_session_t * echo_get_session_from_handle(echo_main_t *em, u64 handle)
void svm_msg_q_set_consumer_eventfd(svm_msg_q_t *mq, int fd)
Set event fd for queue consumer.
ssvm_segment_type_t segment_type
type of segment requested
void echo_send_detach(echo_main_t *em)
int echo_ssvm_segment_attach(char *name, ssvm_segment_type_t type, int fd)
void(* sent_disconnect_cb)(echo_session_t *s)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
echo_proto_cb_vft_t * proto_cb_vft
void echo_send_listen(echo_main_t *em, ip46_address_t *ip)
void echo_send_connect(echo_main_t *em, void *args)
Application attach to session layer.
Delete certificate and key.
int vl_api_vec_to_api_string(const u8 *vec, vl_api_string_t *str)
static const u32 test_srv_crt_rsa_len
u32 * new_segment_indices
return vec of new seg indices