#include <vnet/session/session.h>
#include <vnet/session/application.h>
-/**
- * External vector of per transport virtual functions table
- */
-extern transport_proto_vft_t *tp_vfts;
-
/**
* Network namespace index (i.e., fib index) to session lookup table. We
* should have one per network protocol type but for now we only support IP4/6
int
session_lookup_del_session (session_t * s)
{
- transport_proto_t tp = session_get_transport_proto (s);
transport_connection_t *ts;
- ts = tp_vfts[tp].get_connection (s->connection_index, s->thread_index);
+ ts = transport_get_connection (session_get_transport_proto (s),
+ s->connection_index, s->thread_index);
return session_lookup_del_connection (ts);
}
transport_connection_t *
session_lookup_half_open_connection (u64 handle, u8 proto, u8 is_ip4)
{
- u32 sst;
-
if (handle != HALF_OPEN_LOOKUP_INVALID_VALUE)
{
- sst = session_type_from_proto_and_ip (proto, is_ip4);
- return tp_vfts[sst].get_half_open (handle & 0xFFFFFFFF);
+ u32 sst = session_type_from_proto_and_ip (proto, is_ip4);
+ return transport_get_half_open (sst, handle & 0xFFFFFFFF);
}
return 0;
}
return 0;
}
s = session_get (kv4.value & 0xFFFFFFFFULL, thread_index);
- return tp_vfts[proto].get_connection (s->connection_index,
- thread_index);
+ return transport_get_connection (proto, s->connection_index,
+ thread_index);
}
/*
*/
rv = clib_bihash_search_inline_16_8 (&st->v4_half_open_hash, &kv4);
if (rv == 0)
- return tp_vfts[proto].get_half_open (kv4.value & 0xFFFFFFFF);
+ return transport_get_half_open (proto, kv4.value & 0xFFFFFFFF);
/*
* Check the session rules table
}
if ((s = session_lookup_action_to_session (action_index,
FIB_PROTOCOL_IP4, proto)))
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}
*/
s = session_lookup_listener4_i (st, lcl, lcl_port, proto, 1);
if (s)
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}
if (rv == 0)
{
s = session_get_from_handle (kv4.value);
- return tp_vfts[proto].get_connection (s->connection_index,
- s->thread_index);
+ return transport_get_connection (proto, s->connection_index,
+ s->thread_index);
}
/*
*/
rv = clib_bihash_search_inline_16_8 (&st->v4_half_open_hash, &kv4);
if (rv == 0)
- return tp_vfts[proto].get_half_open (kv4.value & 0xFFFFFFFF);
+ return transport_get_half_open (proto, kv4.value & 0xFFFFFFFF);
/*
* Check the session rules table
return 0;
if ((s = session_lookup_action_to_session (action_index,
FIB_PROTOCOL_IP4, proto)))
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}
*/
s = session_lookup_listener4_i (st, lcl, lcl_port, proto, 1);
if (s)
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}
return 0;
}
s = session_get (kv6.value & 0xFFFFFFFFULL, thread_index);
- return tp_vfts[proto].get_connection (s->connection_index,
- thread_index);
+ return transport_get_connection (proto, s->connection_index,
+ thread_index);
}
/* Try half-open connections */
rv = clib_bihash_search_inline_48_8 (&st->v6_half_open_hash, &kv6);
if (rv == 0)
- return tp_vfts[proto].get_half_open (kv6.value & 0xFFFFFFFF);
+ return transport_get_half_open (proto, kv6.value & 0xFFFFFFFF);
/* Check the session rules table */
action_index = session_rules_table_lookup6 (&st->session_rules[proto], lcl,
}
if ((s = session_lookup_action_to_session (action_index,
FIB_PROTOCOL_IP6, proto)))
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}
/* If nothing is found, check if any listener is available */
s = session_lookup_listener6_i (st, lcl, lcl_port, proto, 1);
if (s)
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}
if (rv == 0)
{
s = session_get_from_handle (kv6.value);
- return tp_vfts[proto].get_connection (s->connection_index,
- s->thread_index);
+ return transport_get_connection (proto, s->connection_index,
+ s->thread_index);
}
/* Try half-open connections */
rv = clib_bihash_search_inline_48_8 (&st->v6_half_open_hash, &kv6);
if (rv == 0)
- return tp_vfts[proto].get_half_open (kv6.value & 0xFFFFFFFF);
+ return transport_get_half_open (proto, kv6.value & 0xFFFFFFFF);
/* Check the session rules table */
action_index = session_rules_table_lookup6 (&st->session_rules[proto], lcl,
return 0;
if ((s = session_lookup_action_to_session (action_index,
FIB_PROTOCOL_IP6, proto)))
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}
/* If nothing is found, check if any listener is available */
s = session_lookup_listener6_i (st, lcl, lcl_port, proto, 1);
if (s)
- return tp_vfts[proto].get_listener (s->connection_index);
+ return transport_get_listener (proto, s->connection_index);
return 0;
}