quic: Add support for unidirectional streams
[vpp.git] / src / vnet / session / session_api.c
old mode 100755 (executable)
new mode 100644 (file)
index 0b610f3..99e00a7
@@ -196,6 +196,7 @@ mq_send_session_accepted_cb (session_t * s)
   mp->server_rx_fifo = pointer_to_uword (s->rx_fifo);
   mp->server_tx_fifo = pointer_to_uword (s->tx_fifo);
   mp->segment_handle = session_segment_handle (s);
+  mp->flags = s->flags;
 
   if (session_has_transport (s))
     {
@@ -665,7 +666,7 @@ done:
   REPLY_MACRO2 (VL_API_APP_ATTACH_REPLY, ({
     if (!rv)
       {
-       ctrl_thread = vlib_num_workers ()? 1 : 0;
+       ctrl_thread = vlib_num_workers () ? 1 : 0;
        ctrl_mq = session_main_get_vpp_event_queue (ctrl_thread);
        segp = a->segment;
        rmp->app_index = clib_host_to_net_u32 (a->app_index);
@@ -1403,7 +1404,7 @@ done:
   /* *INDENT-OFF* */
   REPLY_MACRO2 (VL_API_APP_ADD_CERT_KEY_PAIR_REPLY, ({
     if (!rv)
-      rmp->index = a->index;
+      rmp->index = clib_host_to_net_u32 (a->index);
   }));
   /* *INDENT-ON* */
 }
@@ -1412,16 +1413,18 @@ static void
 vl_api_app_del_cert_key_pair_t_handler (vl_api_app_del_cert_key_pair_t * mp)
 {
   vl_api_app_del_cert_key_pair_reply_t *rmp;
+  u32 ckpair_index;
   int rv = 0;
   if (session_main_is_enabled () == 0)
     {
       rv = VNET_API_ERROR_FEATURE_DISABLED;
       goto done;
     }
-  rv = vnet_app_del_cert_key_pair (mp->index);
+  ckpair_index = clib_net_to_host_u32 (mp->index);
+  rv = vnet_app_del_cert_key_pair (ckpair_index);
 
 done:
-  REPLY_MACRO (VL_API_APP_ADD_CERT_KEY_PAIR_REPLY);
+  REPLY_MACRO (VL_API_APP_DEL_CERT_KEY_PAIR_REPLY);
 }
 
 /* ### WILL BE DEPRECATED POST 20.01 ### */
@@ -1529,7 +1532,7 @@ setup_message_id_table (api_main_t * am)
 static clib_error_t *
 session_api_hookup (vlib_main_t * vm)
 {
-  api_main_t *am = &api_main;
+  api_main_t *am = vlibapi_get_main ();
 
 #define _(N,n)                                                  \
     vl_msg_api_set_handlers(VL_API_##N, #n,                     \