session: segment handle in accept/connect notifications
[vpp.git] / src / vnet / session / application_interface.h
index 1f481dc..ecd99d8 100644 (file)
@@ -33,13 +33,14 @@ typedef struct _vnet_app_attach_args_t
 typedef struct _vnet_app_detach_args_t
 {
   u32 app_index;
+  u32 api_client_index;
 } vnet_app_detach_args_t;
 
 typedef struct _vnet_bind_args_t
 {
   union
   {
-    session_endpoint_extended_t sep_ext;
+    session_endpoint_cfg_t sep_ext;
     session_endpoint_t sep;
     char *uri;
   };
@@ -64,14 +65,14 @@ typedef struct _vnet_unbind_args_t
     u64 handle;                        /**< Session handle */
   };
   u32 app_index;               /**< Owning application index */
-  u32 app_wrk_index;           /**< App's local pool worker index */
+  u32 wrk_map_index;           /**< App's local pool worker index */
 } vnet_unbind_args_t;
 
 typedef struct _vnet_connect_args
 {
   union
   {
-    session_endpoint_extended_t sep_ext;
+    session_endpoint_cfg_t sep_ext;
     session_endpoint_t sep;
     char *uri;
   };
@@ -123,6 +124,7 @@ typedef enum
   _(ACCEPT_REDIRECT, "Use FIFO with redirects")                        \
   _(ADD_SEGMENT, "Add segment and signal app if needed")       \
   _(IS_BUILTIN, "Application is builtin")                      \
+  _(IS_TRANSPORT_APP, "Application is a transport proto")      \
   _(IS_PROXY, "Application is proxying")                       \
   _(USE_GLOBAL_SCOPE, "App can use global session scope")      \
   _(USE_LOCAL_SCOPE, "App can use local session scope")                \
@@ -232,6 +234,7 @@ typedef struct session_accepted_msg_
   u64 handle;
   u64 server_rx_fifo;
   u64 server_tx_fifo;
+  u64 segment_handle;
   u64 vpp_event_queue_address;
   u64 server_event_queue_address;
   u64 client_event_queue_address;
@@ -258,6 +261,7 @@ typedef struct session_connected_msg_
   u64 handle;
   u64 server_rx_fifo;
   u64 server_tx_fifo;
+  u64 segment_handle;
   u64 vpp_event_queue_address;
   u64 client_event_queue_address;
   u64 server_event_queue_address;
@@ -313,7 +317,7 @@ app_alloc_ctrl_evt_to_vpp (svm_msg_q_t * mq, app_session_evt_t * app_evt,
                                       SVM_Q_WAIT, &app_evt->msg);
   svm_msg_q_unlock (mq);
   app_evt->evt = svm_msg_q_msg_data (mq, &app_evt->msg);
-  memset (app_evt->evt, 0, sizeof (*app_evt->evt));
+  clib_memset (app_evt->evt, 0, sizeof (*app_evt->evt));
   app_evt->evt->event_type = evt_type;
 }
 
@@ -396,10 +400,10 @@ app_send_dgram_raw (svm_fifo_t * f, app_session_transport_t * at,
   actual_write = clib_min (len, max_enqueue);
   hdr.data_length = actual_write;
   hdr.data_offset = 0;
-  clib_memcpy (&hdr.rmt_ip, &at->rmt_ip, sizeof (ip46_address_t));
+  clib_memcpy_fast (&hdr.rmt_ip, &at->rmt_ip, sizeof (ip46_address_t));
   hdr.is_ip4 = at->is_ip4;
   hdr.rmt_port = at->rmt_port;
-  clib_memcpy (&hdr.lcl_ip, &at->lcl_ip, sizeof (ip46_address_t));
+  clib_memcpy_fast (&hdr.lcl_ip, &at->lcl_ip, sizeof (ip46_address_t));
   hdr.lcl_port = at->lcl_port;
   rv = svm_fifo_enqueue_nowait (f, sizeof (hdr), (u8 *) & hdr);
   ASSERT (rv == sizeof (hdr));