FD.io VPP  v19.08-27-gf4dcae4
Vector Packet Processing
session_types.h File Reference
+ Include dependency graph for session_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  session_
 
struct  session_rpc_args_t
 
struct  session_dgram_pre_hdr_
 
struct  session_dgram_header_
 

Macros

#define SESSION_INVALID_INDEX   ((u32)~0)
 
#define SESSION_INVALID_HANDLE   ((u64)~0)
 
#define foreach_session_endpoint_fields
 
#define SESSION_IP46_ZERO
 
#define TRANSPORT_ENDPOINT_NULL
 
#define SESSION_ENDPOINT_NULL
 
#define SESSION_ENDPOINT_CFG_NULL
 
#define session_endpoint_to_transport(_sep)   ((transport_endpoint_t *)_sep)
 
#define session_endpoint_to_transport_cfg(_sep)   ((transport_endpoint_cfg_t *)_sep)
 
#define FIFO_EVENT_APP_RX   SESSION_IO_EVT_RX
 
#define FIFO_EVENT_APP_TX   SESSION_IO_EVT_TX
 
#define FIFO_EVENT_DISCONNECT   SESSION_CTRL_EVT_CLOSE
 
#define FIFO_EVENT_BUILTIN_RX   SESSION_IO_EVT_BUILTIN_RX
 
#define FIFO_EVENT_BUILTIN_TX   SESSION_IO_EVT_BUILTIN_TX
 
#define SESSION_MSG_NULL   { }
 
#define SESSION_CONN_ID_LEN   37
 
#define SESSION_CONN_HDR_LEN   45
 

Typedefs

typedef struct _session_endpoint session_endpoint_t
 
typedef struct _session_endpoint_cfg session_endpoint_cfg_t
 
typedef u8 session_type_t
 
typedef u64 session_handle_t
 
typedef enum session_flags_ session_flags_t
 
typedef struct session_ session_t
 
typedef struct session_dgram_pre_hdr_ session_dgram_pre_hdr_t
 
typedef struct session_dgram_header_ session_dgram_hdr_t
 

Enumerations

enum  session_cleanup_ntf_t { SESSION_CLEANUP_TRANSPORT, SESSION_CLEANUP_SESSION }
 
enum  session_state_t {
  SESSION_STATE_CREATED, SESSION_STATE_LISTENING, SESSION_STATE_CONNECTING, SESSION_STATE_ACCEPTING,
  SESSION_STATE_READY, SESSION_STATE_OPENED, SESSION_STATE_TRANSPORT_CLOSING, SESSION_STATE_CLOSING,
  SESSION_STATE_APP_CLOSED, SESSION_STATE_TRANSPORT_CLOSED, SESSION_STATE_TRANSPORT_DELETED, SESSION_STATE_CLOSED,
  SESSION_STATE_N_STATES
}
 
enum  session_flags_ { SESSION_F_RX_EVT = 1, SESSION_F_PROXY = (1 << 1), SESSION_F_CUSTOM_TX = (1 << 2) }
 
enum  session_evt_type_t {
  SESSION_IO_EVT_RX, SESSION_IO_EVT_TX, SESSION_IO_EVT_TX_FLUSH, SESSION_IO_EVT_BUILTIN_RX,
  SESSION_IO_EVT_BUILTIN_TX, SESSION_CTRL_EVT_RPC, SESSION_CTRL_EVT_CLOSE, SESSION_CTRL_EVT_BOUND,
  SESSION_CTRL_EVT_UNLISTEN_REPLY, SESSION_CTRL_EVT_ACCEPTED, SESSION_CTRL_EVT_ACCEPTED_REPLY, SESSION_CTRL_EVT_CONNECTED,
  SESSION_CTRL_EVT_CONNECTED_REPLY, SESSION_CTRL_EVT_DISCONNECTED, SESSION_CTRL_EVT_DISCONNECTED_REPLY, SESSION_CTRL_EVT_RESET,
  SESSION_CTRL_EVT_RESET_REPLY, SESSION_CTRL_EVT_REQ_WORKER_UPDATE, SESSION_CTRL_EVT_WORKER_UPDATE, SESSION_CTRL_EVT_WORKER_UPDATE_REPLY
}
 
enum  session_mq_rings_e { SESSION_MQ_IO_EVT_RING, SESSION_MQ_CTRL_EVT_RING, SESSION_MQ_N_RINGS }
 

Functions

static u8 session_endpoint_fib_proto (session_endpoint_t *sep)
 
static u8 session_endpoint_is_local (session_endpoint_t *sep)
 
static u8 session_endpoint_is_zero (session_endpoint_t *sep)
 
static session_type_t session_type_from_proto_and_ip (transport_proto_t proto, u8 is_ip4)
 
static transport_proto_t session_type_transport_proto (session_type_t st)
 
static u8 session_type_is_ip4 (session_type_t st)
 
static transport_proto_t session_get_transport_proto (session_t *s)
 
static fib_protocol_t session_get_fib_proto (session_t *s)
 
static u8 session_has_transport (session_t *s)
 
static transport_service_type_t session_transport_service_type (session_t *s)
 
static transport_tx_fn_type_t session_transport_tx_fn_type (session_t *s)
 
static u8 session_tx_is_dgram (session_t *s)
 
static session_handle_t session_handle (session_t *s)
 
static u32 session_index_from_handle (session_handle_t handle)
 
static u32 session_thread_from_handle (session_handle_t handle)
 
static void session_parse_handle (session_handle_t handle, u32 *index, u32 *thread_index)
 
static session_handle_t session_make_handle (u32 session_index, u32 thread_index)
 
 STATIC_ASSERT (sizeof(session_dgram_hdr_t)==(SESSION_CONN_ID_LEN+8),"session conn id wrong length")
 

Macro Definition Documentation

#define FIFO_EVENT_APP_RX   SESSION_IO_EVT_RX

Definition at line 309 of file session_types.h.

#define FIFO_EVENT_APP_TX   SESSION_IO_EVT_TX

Definition at line 310 of file session_types.h.

#define FIFO_EVENT_BUILTIN_RX   SESSION_IO_EVT_BUILTIN_RX

Definition at line 312 of file session_types.h.

#define FIFO_EVENT_BUILTIN_TX   SESSION_IO_EVT_BUILTIN_TX

Definition at line 313 of file session_types.h.

#define FIFO_EVENT_DISCONNECT   SESSION_CTRL_EVT_CLOSE

Definition at line 311 of file session_types.h.

#define foreach_session_endpoint_fields
Value:
foreach_transport_endpoint_cfg_fields \
_(u8, transport_proto) \
unsigned char u8
Definition: types.h:56

Definition at line 25 of file session_types.h.

#define SESSION_CONN_HDR_LEN   45

Definition at line 364 of file session_types.h.

#define SESSION_CONN_ID_LEN   37

Definition at line 363 of file session_types.h.

#define SESSION_ENDPOINT_CFG_NULL
Value:
{ \
.sw_if_index = ENDPOINT_INVALID_INDEX, \
.fib_index = ENDPOINT_INVALID_INDEX, \
.is_ip4 = 0, \
.port = 0, \
.transport_proto = 0, \
.app_wrk_index = ENDPOINT_INVALID_INDEX, \
.hostname = 0, \
.parent_handle = SESSION_INVALID_HANDLE \
}
#define ENDPOINT_INVALID_INDEX
#define SESSION_INVALID_HANDLE
Definition: session_types.h:23
#define SESSION_IP46_ZERO
Definition: session_types.h:49
#define TRANSPORT_ENDPOINT_NULL
Definition: session_types.h:56

Definition at line 74 of file session_types.h.

#define SESSION_ENDPOINT_NULL
Value:
{ \
.sw_if_index = ENDPOINT_INVALID_INDEX, \
.fib_index = ENDPOINT_INVALID_INDEX, \
.is_ip4 = 0, \
.port = 0, \
.transport_proto = 0, \
}
#define ENDPOINT_INVALID_INDEX
#define SESSION_IP46_ZERO
Definition: session_types.h:49
#define TRANSPORT_ENDPOINT_NULL
Definition: session_types.h:56

Definition at line 64 of file session_types.h.

#define session_endpoint_to_transport (   _sep)    ((transport_endpoint_t *)_sep)

Definition at line 89 of file session_types.h.

#define session_endpoint_to_transport_cfg (   _sep)    ((transport_endpoint_cfg_t *)_sep)

Definition at line 90 of file session_types.h.

#define SESSION_INVALID_HANDLE   ((u64)~0)

Definition at line 23 of file session_types.h.

#define SESSION_INVALID_INDEX   ((u32)~0)

Definition at line 22 of file session_types.h.

#define SESSION_IP46_ZERO
Value:
{ \
.ip6 = { \
{ 0, 0, }, \
}, \
}

Definition at line 49 of file session_types.h.

#define SESSION_MSG_NULL   { }

Definition at line 344 of file session_types.h.

#define TRANSPORT_ENDPOINT_NULL
Value:
{ \
.sw_if_index = ENDPOINT_INVALID_INDEX, \
.fib_index = ENDPOINT_INVALID_INDEX, \
.is_ip4 = 0, \
.port = 0, \
}
#define ENDPOINT_INVALID_INDEX
#define SESSION_IP46_ZERO
Definition: session_types.h:49

Definition at line 56 of file session_types.h.

Typedef Documentation

typedef struct _session_endpoint_cfg session_endpoint_cfg_t
typedef struct _session_endpoint session_endpoint_t

Definition at line 113 of file session_types.h.

typedef struct session_ session_t
typedef u8 session_type_t

Definition at line 112 of file session_types.h.

Enumeration Type Documentation

Enumerator
SESSION_CLEANUP_TRANSPORT 
SESSION_CLEANUP_SESSION 

Definition at line 115 of file session_types.h.

Enumerator
SESSION_IO_EVT_RX 
SESSION_IO_EVT_TX 
SESSION_IO_EVT_TX_FLUSH 
SESSION_IO_EVT_BUILTIN_RX 
SESSION_IO_EVT_BUILTIN_TX 
SESSION_CTRL_EVT_RPC 
SESSION_CTRL_EVT_CLOSE 
SESSION_CTRL_EVT_BOUND 
SESSION_CTRL_EVT_UNLISTEN_REPLY 
SESSION_CTRL_EVT_ACCEPTED 
SESSION_CTRL_EVT_ACCEPTED_REPLY 
SESSION_CTRL_EVT_CONNECTED 
SESSION_CTRL_EVT_CONNECTED_REPLY 
SESSION_CTRL_EVT_DISCONNECTED 
SESSION_CTRL_EVT_DISCONNECTED_REPLY 
SESSION_CTRL_EVT_RESET 
SESSION_CTRL_EVT_RESET_REPLY 
SESSION_CTRL_EVT_REQ_WORKER_UPDATE 
SESSION_CTRL_EVT_WORKER_UPDATE 
SESSION_CTRL_EVT_WORKER_UPDATE_REPLY 

Definition at line 284 of file session_types.h.

Enumerator
SESSION_F_RX_EVT 
SESSION_F_PROXY 
SESSION_F_CUSTOM_TX 

Definition at line 141 of file session_types.h.

Enumerator
SESSION_MQ_IO_EVT_RING 
SESSION_MQ_CTRL_EVT_RING 
SESSION_MQ_N_RINGS 

Definition at line 315 of file session_types.h.

Enumerator
SESSION_STATE_CREATED 
SESSION_STATE_LISTENING 
SESSION_STATE_CONNECTING 
SESSION_STATE_ACCEPTING 
SESSION_STATE_READY 
SESSION_STATE_OPENED 
SESSION_STATE_TRANSPORT_CLOSING 
SESSION_STATE_CLOSING 
SESSION_STATE_APP_CLOSED 
SESSION_STATE_TRANSPORT_CLOSED 
SESSION_STATE_TRANSPORT_DELETED 
SESSION_STATE_CLOSED 
SESSION_STATE_N_STATES 

Definition at line 124 of file session_types.h.

Function Documentation

static u8 session_endpoint_fib_proto ( session_endpoint_t sep)
inlinestatic

Definition at line 94 of file session_types.h.

+ Here is the caller graph for this function:

static u8 session_endpoint_is_local ( session_endpoint_t sep)
inlinestatic

Definition at line 100 of file session_types.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 session_endpoint_is_zero ( session_endpoint_t sep)
inlinestatic

Definition at line 107 of file session_types.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static fib_protocol_t session_get_fib_proto ( session_t s)
inlinestatic

Definition at line 218 of file session_types.h.

+ Here is the caller graph for this function:

static transport_proto_t session_get_transport_proto ( session_t s)
inlinestatic

Definition at line 212 of file session_types.h.

+ Here is the caller graph for this function:

static session_handle_t session_handle ( session_t s)
inlinestatic

Definition at line 253 of file session_types.h.

+ Here is the caller graph for this function:

static u8 session_has_transport ( session_t s)
inlinestatic

Definition at line 225 of file session_types.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 session_index_from_handle ( session_handle_t  handle)
inlinestatic

Definition at line 259 of file session_types.h.

+ Here is the caller graph for this function:

static session_handle_t session_make_handle ( u32  session_index,
u32  thread_index 
)
inlinestatic

Definition at line 279 of file session_types.h.

+ Here is the caller graph for this function:

static void session_parse_handle ( session_handle_t  handle,
u32 index,
u32 thread_index 
)
inlinestatic

Definition at line 271 of file session_types.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 session_thread_from_handle ( session_handle_t  handle)
inlinestatic

Definition at line 265 of file session_types.h.

+ Here is the caller graph for this function:

static transport_service_type_t session_transport_service_type ( session_t s)
inlinestatic

Definition at line 231 of file session_types.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static transport_tx_fn_type_t session_transport_tx_fn_type ( session_t s)
inlinestatic

Definition at line 239 of file session_types.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 session_tx_is_dgram ( session_t s)
inlinestatic

Definition at line 247 of file session_types.h.

+ Here is the call graph for this function:

static session_type_t session_type_from_proto_and_ip ( transport_proto_t  proto,
u8  is_ip4 
)
inlinestatic

Definition at line 194 of file session_types.h.

+ Here is the caller graph for this function:

static u8 session_type_is_ip4 ( session_type_t  st)
inlinestatic

Definition at line 206 of file session_types.h.

+ Here is the caller graph for this function:

static transport_proto_t session_type_transport_proto ( session_type_t  st)
inlinestatic

Definition at line 200 of file session_types.h.

+ Here is the caller graph for this function:

STATIC_ASSERT ( sizeof(session_dgram_hdr_t = =(SESSION_CONN_ID_LEN+8),
"session conn id wrong length"   
)