summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-08-04 16:14:01 -0700
committerDave Barach <vpp@barachs.net>2024-03-29 21:45:18 +0000
commit980ee74b165a4fa629f868935c446773ca82372e (patch)
tree226a93969ab4a28da4be9bb32f03a21c3104a43e /src/vcl
parent71c32a898941e32b5d4f865b50fbe775560c582d (diff)
session: improve use of session handles
First step towards moving to an 8 byte struct instead of u64. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idd0b95520ab7158e175b9af1702fc09c0613a4bb
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vcl_private.h4
-rw-r--r--src/vcl/vppcom.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 41a11b7123f..b89052f96af 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -159,8 +159,8 @@ typedef struct vcl_session_
svm_fifo_t *ct_tx_fifo;
vcl_session_msg_t *accept_evts_fifo;
- u64 vpp_handle;
- u64 parent_handle;
+ session_handle_t vpp_handle;
+ session_handle_t parent_handle;
u32 listener_index; /**< index of parent listener (if any) */
int n_accepted_sessions; /**< sessions accepted by this listener */
vppcom_epoll_t vep;
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index a0bbae170f8..58f6ac0a134 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -1266,7 +1266,7 @@ vppcom_session_unbind (u32 session_handle)
session->vpp_handle);
vcl_evt (VCL_EVT_UNBIND, session);
- session->vpp_handle = ~0;
+ session->vpp_handle = SESSION_INVALID_HANDLE;
session->session_state = VCL_STATE_DISCONNECT;
return VPPCOM_OK;
@@ -1471,7 +1471,7 @@ vppcom_session_create (u8 proto, u8 is_nonblocking)
session->session_type = proto;
session->session_state = VCL_STATE_CLOSED;
- session->vpp_handle = ~0;
+ session->vpp_handle = SESSION_INVALID_HANDLE;
session->is_dgram = vcl_proto_is_dgram (proto);
session->vpp_error = SESSION_E_NONE;
@@ -2818,7 +2818,7 @@ vppcom_epoll_create (void)
vep_session->vep.vep_sh = ~0;
vep_session->vep.next_sh = ~0;
vep_session->vep.prev_sh = ~0;
- vep_session->vpp_handle = ~0;
+ vep_session->vpp_handle = SESSION_INVALID_HANDLE;
vcl_evt (VCL_EVT_EPOLL_CREATE, vep_session, vep_session->session_index);
VDBG (0, "Created vep_idx %u", vep_session->session_index);