diff options
author | Florin Coras <fcoras@cisco.com> | 2024-03-28 20:07:31 -0700 |
---|---|---|
committer | Dave Barach <vpp@barachs.net> | 2024-03-29 21:45:18 +0000 |
commit | a58fce23de31778fc3df306d7953e0eef068b4a9 (patch) | |
tree | 70c4f817a44b4017e10a5e2dac11948629089c5e /src/vnet/session | |
parent | 980ee74b165a4fa629f868935c446773ca82372e (diff) |
session: use custom types for session flags and state
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I04f836d09a1cbd5a5b55dc64359d2d761dfc4988
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/session_types.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h index ce115b21af8..5e650727d61 100644 --- a/src/vnet/session/session_types.h +++ b/src/vnet/session/session_types.h @@ -154,19 +154,19 @@ typedef enum session_ft_action_ /* * Session states */ -#define foreach_session_state \ - _(CREATED, "created") \ - _(LISTENING, "listening") \ - _(CONNECTING, "connecting") \ - _(ACCEPTING, "accepting") \ - _(READY, "ready") \ - _(OPENED, "opened") \ - _(TRANSPORT_CLOSING, "transport-closing") \ - _(CLOSING, "closing") \ - _(APP_CLOSED, "app-closed") \ - _(TRANSPORT_CLOSED, "transport-closed") \ - _(CLOSED, "closed") \ - _(TRANSPORT_DELETED, "transport-deleted") \ +#define foreach_session_state \ + _ (CREATED, "created") \ + _ (LISTENING, "listening") \ + _ (CONNECTING, "connecting") \ + _ (ACCEPTING, "accepting") \ + _ (READY, "ready") \ + _ (OPENED, "opened") \ + _ (TRANSPORT_CLOSING, "transport-closing") \ + _ (CLOSING, "closing") \ + _ (APP_CLOSED, "app-closed") \ + _ (TRANSPORT_CLOSED, "transport-closed") \ + _ (CLOSED, "closed") \ + _ (TRANSPORT_DELETED, "transport-deleted") typedef enum { @@ -174,7 +174,7 @@ typedef enum foreach_session_state #undef _ SESSION_N_STATES, -} session_state_t; +} __clib_packed session_state_t; #define foreach_session_flag \ _ (RX_EVT, "rx-event") \ @@ -225,13 +225,13 @@ typedef struct session_ session_type_t session_type; /** State in session layer state machine. See @ref session_state_t */ - volatile u8 session_state; + volatile session_state_t session_state; /** Index of the app worker that owns the session */ u32 app_wrk_index; /** Session flags. See @ref session_flags_t */ - u32 flags; + session_flags_t flags; /** Index of the transport connection associated to the session */ u32 connection_index; |