34 bmp->_vl_msg_id = ntohs (VL_API_APP_ATTACH);
36 bmp->
context = ntohl (0xfeedface);
63 bmp->_vl_msg_id = ntohs (VL_API_APPLICATION_DETACH);
65 bmp->
context = ntohl (0xfeedface);
78 clib_memset (bmp, 0,
sizeof (*bmp) + cert_len + key_len);
80 bmp->_vl_msg_id = ntohs (VL_API_APP_ADD_CERT_KEY_PAIR);
82 bmp->
context = ntohl (0xfeedface);
83 bmp->
cert_len = clib_host_to_net_u16 (cert_len);
84 bmp->
certkey_len = clib_host_to_net_u16 (key_len + cert_len);
98 bmp->_vl_msg_id = ntohs (VL_API_APP_DEL_CERT_KEY_PAIR);
100 bmp->
context = ntohl (0xfeedface);
114 memset (mp, 0,
sizeof (*mp));
116 mp->
context = ntohl (0xfeedface);
136 memset (mp, 0,
sizeof (*mp));
158 memset (mp, 0,
sizeof (*mp));
185 memset (mp, 0,
sizeof (*mp));
245 ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY,
246 "Adding cert and key returned %d",
247 clib_net_to_host_u32 (mp->
retval));
253 ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_ADD_REPLY,
"Wrong state");
262 (vl_api_app_del_cert_key_pair_reply_t * mp)
267 ECHO_FAIL (ECHO_FAIL_VL_API_CERT_KEY_DEL_REPLY,
268 "Delete cert and key returned %d",
269 clib_net_to_host_u32 (mp->retval));
287 ECHO_FAIL (ECHO_FAIL_VL_API_APP_ATTACH,
"attach failed: %U",
294 ECHO_FAIL (ECHO_FAIL_VL_API_MISSING_SEGMENT_NAME,
295 "segment_name_length zero");
301 ECHO_FAIL (ECHO_FAIL_VL_API_NULL_APP_MQ,
"NULL app_mq");
313 "vl_socket_client_recv_fd_msg failed");
317 if (mp->
fd_flags & SESSION_FD_F_VPP_MQ_SEGMENT)
320 ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
321 "svm_fifo_segment_attach failed on SSVM_SEGMENT_MEMFD");
325 if (mp->
fd_flags & SESSION_FD_F_MEMFD_SEGMENT)
329 ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
330 "svm_fifo_segment_attach ('%s') " 334 if (mp->
fd_flags & SESSION_FD_F_MQ_EVENTFD)
344 ECHO_FAIL (ECHO_FAIL_VL_API_SVM_FIFO_SEG_ATTACH,
345 "svm_fifo_segment_attach ('%s') " 351 ECHO_LOG (2,
"Mapped segment 0x%lx", segment_handle);
367 ECHO_FAIL (ECHO_FAIL_VL_API_DETACH_REPLY,
368 "app detach returned with err: %d", mp->retval);
374 #define foreach_quic_echo_msg \ 375 _(APP_ATTACH_REPLY, app_attach_reply) \ 376 _(APPLICATION_DETACH_REPLY, application_detach_reply) \ 377 _(APP_ADD_CERT_KEY_PAIR_REPLY, app_add_cert_key_pair_reply) \ 378 _(APP_DEL_CERT_KEY_PAIR_REPLY, app_del_cert_key_pair_reply) 384 vl_msg_api_set_handlers(VL_API_##N, #n, \ 385 vl_api_##n##_t_handler, \ 387 vl_api_##n##_t_endian, \ 388 vl_api_##n##_t_print, \ 389 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)
struct echo_main_t::@573 uri_elts
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)
#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...)
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
#define uword_to_pointer(u, type)
void echo_segment_handle_add_del(echo_main_t *em, u64 segment_handle, u8 add)
client->vpp, attach application to session layer WILL BE DEPRECATED POST 20.01
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.
static const u32 test_srv_crt_rsa_len
u32 * new_segment_indices
return vec of new seg indices