diff options
author | Florin Coras <fcoras@cisco.com> | 2019-08-21 16:20:44 -0700 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-08-27 18:21:39 +0000 |
commit | 458089bbad9cf5bef6cf8119f23fc44e66b36ad3 (patch) | |
tree | 4ee7da1148172ca6f8a878746c8bd48c1e2dc95e /src/vnet/session/application_interface.h | |
parent | 7adaa226eaa2401d6bb0dfd38a0d943c9645d7dc (diff) |
session: move ctrl messages from bapi to mq
Type:refactor
Moves connect, disconnect, bind, unbind and app detach to message
queue from binary api. Simplifies app/vcl interaction with the session
layer since all session control messages are now handled over the mq.
Add/del segment messages require internal C api changes which affect all
builtin applications. They'll be moved in a different patch and might
not be back portable to 19.08.
Change-Id: I93f6d18e551b024effa75d47f5ff25f23ba8aff5
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application_interface.h')
-rw-r--r-- | src/vnet/session/application_interface.h | 64 |
1 files changed, 61 insertions, 3 deletions
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h index 6cc1af4d78b..f5f684e37da 100644 --- a/src/vnet/session/application_interface.h +++ b/src/vnet/session/application_interface.h @@ -261,6 +261,25 @@ typedef struct #undef _ } app_session_t; +typedef struct session_listen_msg_ +{ + u32 client_index; + u32 context; /* Not needed but keeping it for compatibility with bapi */ + u32 wrk_index; + u32 vrf; + u16 port; + u8 proto; + u8 is_ip4; + ip46_address_t ip; +} __clib_packed session_listen_msg_t; + +typedef struct session_listen_uri_msg_ +{ + u32 client_index; + u32 context; + u8 uri[56]; +} __clib_packed session_listen_uri_msg_t; + typedef struct session_bound_msg_ { u32 context; @@ -277,6 +296,14 @@ typedef struct session_bound_msg_ u8 segment_name[128]; } __clib_packed session_bound_msg_t; +typedef struct session_unlisten_msg_ +{ + u32 client_index; + u32 context; + u32 wrk_index; + session_handle_t handle; +} __clib_packed session_unlisten_msg_t; + typedef struct session_unlisten_reply_msg_ { u32 context; @@ -303,9 +330,27 @@ typedef struct session_accepted_reply_msg_ u64 handle; } __clib_packed session_accepted_reply_msg_t; -/* Make sure this is not too large, otherwise it won't fit when dequeued in - * the session queue node */ -STATIC_ASSERT (sizeof (session_accepted_reply_msg_t) <= 16, "accept reply"); +typedef struct session_connect_msg_ +{ + u32 client_index; + u32 context; + u32 wrk_index; + u32 vrf; + u16 port; + u8 proto; + u8 is_ip4; + ip46_address_t ip; + u8 hostname_len; + u8 hostname[16]; + u64 parent_handle; +} __clib_packed session_connect_msg_t; + +typedef struct session_connect_uri_msg_ +{ + u32 client_index; + u32 context; + u8 uri[56]; +} __clib_packed session_connect_uri_msg_t; typedef struct session_connected_msg_ { @@ -325,6 +370,13 @@ typedef struct session_connected_msg_ transport_endpoint_t lcl; } __clib_packed session_connected_msg_t; +typedef struct session_disconnect_msg_ +{ + u32 client_index; + u32 context; + session_handle_t handle; +} __clib_packed session_disconnect_msg_t; + typedef struct session_disconnected_msg_ { u32 client_index; @@ -375,6 +427,12 @@ typedef struct session_worker_update_reply_msg_ u64 segment_handle; } __clib_packed session_worker_update_reply_msg_t; +typedef struct session_app_detach_msg_ +{ + u32 client_index; + u32 context; +} session_app_detach_msg_t; + typedef struct app_session_event_ { svm_msg_q_msg_t msg; |