summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-02-04 23:01:34 -0800
committerFlorin Coras <florin.coras@gmail.com>2019-02-05 19:35:55 +0000
commit4edc37eb90a74bcd1aad20d6447159c05853d23e (patch)
treeb12e5a35d4f03595a9f0f7e9e08caadefeb6eac5 /src/vnet/session/session.c
parent2ff5b8decf35aa34b44ad3b57fab2ea93af107e7 (diff)
session: cleanup part 3
Aggregate session specific types, getters and setters under session_types.h Change-Id: Ib205337502654969d60c72d1800c90247e1a9068 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 520d329f742..7b1c754d31c 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1235,28 +1235,6 @@ session_transport_cleanup (session_t * s)
session_free_w_fifos (s);
}
-transport_service_type_t
-session_transport_service_type (session_t * s)
-{
- transport_proto_t tp;
- tp = session_get_transport_proto (s);
- return transport_protocol_service_type (tp);
-}
-
-transport_tx_fn_type_t
-session_transport_tx_fn_type (session_t * s)
-{
- transport_proto_t tp;
- tp = session_get_transport_proto (s);
- return transport_protocol_tx_fn_type (tp);
-}
-
-u8
-session_tx_is_dgram (session_t * s)
-{
- return (session_transport_tx_fn_type (s) == TRANSPORT_TX_DGRAM);
-}
-
/**
* Allocate event queues in the shared-memory segment
*
@@ -1385,30 +1363,27 @@ session_register_transport (transport_proto_t transport_proto,
transport_connection_t *
session_get_transport (session_t * s)
{
- transport_proto_t tp;
if (s->session_state != SESSION_STATE_LISTENING)
- {
- tp = session_get_transport_proto (s);
- return tp_vfts[tp].get_connection (s->connection_index,
- s->thread_index);
- }
- return 0;
+ return transport_get_connection (session_get_transport_proto (s),
+ s->connection_index, s->thread_index);
+ else
+ return transport_get_listener (session_get_transport_proto (s),
+ s->connection_index);
}
transport_connection_t *
listen_session_get_transport (session_t * s)
{
- transport_proto_t tp = session_get_transport_proto (s);
- return tp_vfts[tp].get_listener (s->connection_index);
+ return transport_get_listener (session_get_transport_proto (s),
+ s->connection_index);
}
int
listen_session_get_local_session_endpoint (session_t * listener,
session_endpoint_t * sep)
{
- transport_proto_t tp = session_get_transport_proto (listener);
transport_connection_t *tc;
- tc = tp_vfts[tp].get_listener (listener->connection_index);
+ tc = listen_session_get_transport (listener);
if (!tc)
{
clib_warning ("no transport");