vcl session: extended connect/listen configuration
[vpp.git] / src / vnet / session / session_types.h
index 7a9f687..148f100 100644 (file)
@@ -49,6 +49,7 @@ typedef struct _session_endpoint_cfg
   u32 ckpair_index;
   u8 crypto_engine;
   u8 flags;
+  transport_endpt_ext_cfg_t *ext_cfg;
 } session_endpoint_cfg_t;
 
 #define SESSION_IP46_ZERO                      \
@@ -76,21 +77,15 @@ typedef struct _session_endpoint_cfg
   .peer = TRANSPORT_ENDPOINT_NULL,             \
   .transport_proto = 0,                                \
 }
-#define SESSION_ENDPOINT_CFG_NULL              \
-{                                              \
-  .sw_if_index = ENDPOINT_INVALID_INDEX,       \
-  .ip = SESSION_IP46_ZERO,                     \
-  .fib_index = ENDPOINT_INVALID_INDEX,         \
-  .is_ip4 = 0,                                 \
-  .port = 0,                                   \
-  .peer = TRANSPORT_ENDPOINT_NULL,             \
-  .transport_proto = 0,                                \
-  .app_wrk_index = ENDPOINT_INVALID_INDEX,     \
-  .opaque = ENDPOINT_INVALID_INDEX,            \
-  .hostname = 0,                               \
-  .parent_handle = SESSION_INVALID_HANDLE,     \
-  .ckpair_index = 0                            \
-}
+#define SESSION_ENDPOINT_CFG_NULL                                             \
+  {                                                                           \
+    .sw_if_index = ENDPOINT_INVALID_INDEX, .ip = SESSION_IP46_ZERO,           \
+    .fib_index = ENDPOINT_INVALID_INDEX, .is_ip4 = 0, .port = 0,              \
+    .peer = TRANSPORT_ENDPOINT_NULL, .transport_proto = 0,                    \
+    .app_wrk_index = ENDPOINT_INVALID_INDEX,                                  \
+    .opaque = ENDPOINT_INVALID_INDEX, .hostname = 0,                          \
+    .parent_handle = SESSION_INVALID_HANDLE, .ckpair_index = 0, .ext_cfg = 0, \
+  }
 
 #define session_endpoint_to_transport(_sep) ((transport_endpoint_t *)_sep)
 #define session_endpoint_to_transport_cfg(_sep)                \
@@ -360,33 +355,36 @@ typedef enum
   SESSION_CTRL_EVT_MIGRATED,
   SESSION_CTRL_EVT_CLEANUP,
   SESSION_CTRL_EVT_APP_WRK_RPC,
+  SESSION_CTRL_EVT_TRANSPORT_ATTR,
+  SESSION_CTRL_EVT_TRANSPORT_ATTR_REPLY,
 } session_evt_type_t;
 
-#define foreach_session_ctrl_evt                               \
-  _(LISTEN, listen)                                            \
-  _(LISTEN_URI, listen_uri)                                    \
-  _(BOUND, bound)                                              \
-  _(UNLISTEN, unlisten)                                                \
-  _(UNLISTEN_REPLY, unlisten_reply)                            \
-  _(ACCEPTED, accepted)                                                \
-  _(ACCEPTED_REPLY, accepted_reply)                            \
-  _(CONNECT, connect)                                          \
-  _(CONNECT_URI, connect_uri)                                  \
-  _(CONNECTED, connected)                                      \
-  _(DISCONNECT, disconnect)                                    \
-  _(DISCONNECTED, disconnected)                                        \
-  _(DISCONNECTED_REPLY, disconnected_reply)                    \
-  _(RESET_REPLY, reset_reply)                                  \
-  _(REQ_WORKER_UPDATE, req_worker_update)                      \
-  _(WORKER_UPDATE, worker_update)                              \
-  _(WORKER_UPDATE_REPLY, worker_update_reply)                  \
-  _(APP_DETACH, app_detach)                                    \
-  _(APP_ADD_SEGMENT, app_add_segment)                          \
-  _(APP_DEL_SEGMENT, app_del_segment)                          \
-  _(MIGRATED, migrated)                                                \
-  _(CLEANUP, cleanup)                                          \
-  _(APP_WRK_RPC, app_wrk_rpc)                                  \
-
+#define foreach_session_ctrl_evt                                              \
+  _ (LISTEN, listen)                                                          \
+  _ (LISTEN_URI, listen_uri)                                                  \
+  _ (BOUND, bound)                                                            \
+  _ (UNLISTEN, unlisten)                                                      \
+  _ (UNLISTEN_REPLY, unlisten_reply)                                          \
+  _ (ACCEPTED, accepted)                                                      \
+  _ (ACCEPTED_REPLY, accepted_reply)                                          \
+  _ (CONNECT, connect)                                                        \
+  _ (CONNECT_URI, connect_uri)                                                \
+  _ (CONNECTED, connected)                                                    \
+  _ (DISCONNECT, disconnect)                                                  \
+  _ (DISCONNECTED, disconnected)                                              \
+  _ (DISCONNECTED_REPLY, disconnected_reply)                                  \
+  _ (RESET_REPLY, reset_reply)                                                \
+  _ (REQ_WORKER_UPDATE, req_worker_update)                                    \
+  _ (WORKER_UPDATE, worker_update)                                            \
+  _ (WORKER_UPDATE_REPLY, worker_update_reply)                                \
+  _ (APP_DETACH, app_detach)                                                  \
+  _ (APP_ADD_SEGMENT, app_add_segment)                                        \
+  _ (APP_DEL_SEGMENT, app_del_segment)                                        \
+  _ (MIGRATED, migrated)                                                      \
+  _ (CLEANUP, cleanup)                                                        \
+  _ (APP_WRK_RPC, app_wrk_rpc)                                                \
+  _ (TRANSPORT_ATTR, transport_attr)                                          \
+  _ (TRANSPORT_ATTR_REPLY, transport_attr_reply)                              \
 /* Deprecated and will be removed. Use types above */
 #define FIFO_EVENT_APP_RX SESSION_IO_EVT_RX
 #define FIFO_EVENT_APP_TX SESSION_IO_EVT_TX
@@ -449,37 +447,38 @@ typedef struct session_dgram_header_
 STATIC_ASSERT (sizeof (session_dgram_hdr_t) == (SESSION_CONN_ID_LEN + 8),
               "session conn id wrong length");
 
-#define foreach_session_error                                          \
-  _(NONE, "no error")                                                  \
-  _(UNKNOWN, "generic/unknown error")                                  \
-  _(REFUSED, "refused")                                                        \
-  _(TIMEDOUT, "timedout")                                              \
-  _(ALLOC, "obj/memory allocation error")                              \
-  _(OWNER, "object not owned by application")                          \
-  _(NOROUTE, "no route")                                               \
-  _(NOINTF, "no resolving interface")                                  \
-  _(NOIP, "no ip for lcl interface")                                   \
-  _(NOPORT, "no lcl port")                                             \
-  _(NOSUPPORT, "not supported")                                                \
-  _(NOLISTEN, "not listening")                                         \
-  _(NOSESSION, "session does not exist")                               \
-  _(NOAPP, "app not attached")                                         \
-  _(PORTINUSE, "lcl port in use")                                      \
-  _(IPINUSE, "ip in use")                                              \
-  _(ALREADY_LISTENING, "ip port pair already listened on")             \
-  _(INVALID_RMT_IP, "invalid remote ip")                               \
-  _(INVALID_APPWRK, "invalid app worker")                              \
-  _(INVALID_NS, "invalid namespace")                                   \
-  _(SEG_NO_SPACE, "Couldn't allocate a fifo pair")                     \
-  _(SEG_NO_SPACE2, "Created segment, couldn't allocate a fifo pair")   \
-  _(SEG_CREATE, "Couldn't create a new segment")                       \
-  _(FILTERED, "session filtered")                                      \
-  _(SCOPE, "scope not supported")                                      \
-  _(BAPI_NO_FD, "bapi doesn't have a socket fd")                       \
-  _(BAPI_SEND_FD, "couldn't send fd over bapi socket fd")              \
-  _(BAPI_NO_REG, "app bapi registration not found")                    \
-  _(MQ_MSG_ALLOC, "failed to alloc mq msg")                            \
-  _(TLS_HANDSHAKE, "failed tls handshake")                             \
+#define foreach_session_error                                                 \
+  _ (NONE, "no error")                                                        \
+  _ (UNKNOWN, "generic/unknown error")                                        \
+  _ (REFUSED, "refused")                                                      \
+  _ (TIMEDOUT, "timedout")                                                    \
+  _ (ALLOC, "obj/memory allocation error")                                    \
+  _ (OWNER, "object not owned by application")                                \
+  _ (NOROUTE, "no route")                                                     \
+  _ (NOINTF, "no resolving interface")                                        \
+  _ (NOIP, "no ip for lcl interface")                                         \
+  _ (NOPORT, "no lcl port")                                                   \
+  _ (NOSUPPORT, "not supported")                                              \
+  _ (NOLISTEN, "not listening")                                               \
+  _ (NOSESSION, "session does not exist")                                     \
+  _ (NOAPP, "app not attached")                                               \
+  _ (PORTINUSE, "lcl port in use")                                            \
+  _ (IPINUSE, "ip in use")                                                    \
+  _ (ALREADY_LISTENING, "ip port pair already listened on")                   \
+  _ (INVALID_RMT_IP, "invalid remote ip")                                     \
+  _ (INVALID_APPWRK, "invalid app worker")                                    \
+  _ (INVALID_NS, "invalid namespace")                                         \
+  _ (SEG_NO_SPACE, "Couldn't allocate a fifo pair")                           \
+  _ (SEG_NO_SPACE2, "Created segment, couldn't allocate a fifo pair")         \
+  _ (SEG_CREATE, "Couldn't create a new segment")                             \
+  _ (FILTERED, "session filtered")                                            \
+  _ (SCOPE, "scope not supported")                                            \
+  _ (BAPI_NO_FD, "bapi doesn't have a socket fd")                             \
+  _ (BAPI_SEND_FD, "couldn't send fd over bapi socket fd")                    \
+  _ (BAPI_NO_REG, "app bapi registration not found")                          \
+  _ (MQ_MSG_ALLOC, "failed to alloc mq msg")                                  \
+  _ (TLS_HANDSHAKE, "failed tls handshake")                                   \
+  _ (EVENTFD_ALLOC, "failed to alloc eventfd")
 
 typedef enum session_error_p_
 {