16 #ifndef VNET_VNET_URI_TRANSPORT_H_ 17 #define VNET_VNET_URI_TRANSPORT_H_ 27 typedef struct _transport_connection
29 ip46_address_t rmt_ip;
30 ip46_address_t lcl_ip;
49 #define c_lcl_ip connection.lcl_ip 50 #define c_rmt_ip connection.rmt_ip 51 #define c_lcl_ip4 connection.lcl_ip.ip4 52 #define c_rmt_ip4 connection.rmt_ip.ip4 53 #define c_lcl_ip6 connection.lcl_ip.ip6 54 #define c_rmt_ip6 connection.rmt_ip.ip6 55 #define c_lcl_port connection.lcl_port 56 #define c_rmt_port connection.rmt_port 57 #define c_proto connection.proto 58 #define c_state connection.state 59 #define c_s_index connection.s_index 60 #define c_c_index connection.c_index 61 #define c_is_ip4 connection.is_ip4 62 #define c_thread_index connection.thread_index 63 #define c_elog_track connection.elog_track 64 #define c_cc_stat_tstamp connection.cc_stat_tstamp 65 #define c_rmt_fei connection.rmt_fei 66 #define c_rmt_dpo connection.rmt_dpo 72 typedef struct _transport_proto_vft
79 int (*open) (ip46_address_t *
addr,
u16 port_host_byte_order);
80 void (*close) (u32 conn_index, u32 thread_index);
81 void (*
cleanup) (u32 conn_index, u32 thread_index);
101 u8 *(*format_connection) (
u8 * s, va_list * args);
102 u8 *(*format_listener) (
u8 * s, va_list * args);
103 u8 *(*format_half_open) (
u8 * s, va_list * args);
125 }) v4_connection_key_t;
142 }) v6_connection_key_t;
150 u16 lcl_port,
u16 rmt_port,
u8 proto)
152 v4_connection_key_t *key = (v4_connection_key_t *) kv->
key;
154 key->src.as_u32 = lcl->
as_u32;
155 key->dst.as_u32 = rmt->
as_u32;
156 key->src_port = lcl_port;
157 key->dst_port = rmt_port;
167 v4_connection_key_t *key = (v4_connection_key_t *) kv->
key;
169 key->src.as_u32 = lcl->
as_u32;
171 key->src_port = lcl_port;
181 return make_v4_ss_kv (kv, &t->lcl_ip.ip4, &t->rmt_ip.ip4, t->lcl_port,
182 t->rmt_port, t->proto);
187 u16 lcl_port,
u16 rmt_port,
u8 proto)
189 v6_connection_key_t *key = (v6_connection_key_t *) kv->
key;
191 key->src.as_u64[0] = lcl->
as_u64[0];
192 key->src.as_u64[1] = lcl->
as_u64[1];
193 key->dst.as_u64[0] = rmt->
as_u64[0];
194 key->dst.as_u64[1] = rmt->
as_u64[1];
195 key->src_port = lcl_port;
196 key->dst_port = rmt_port;
207 v6_connection_key_t *key = (v6_connection_key_t *) kv->
key;
209 key->src.as_u64[0] = lcl->
as_u64[0];
210 key->src.as_u64[1] = lcl->
as_u64[1];
211 key->dst.as_u64[0] = 0;
212 key->dst.as_u64[1] = 0;
213 key->src_port = lcl_port;
224 make_v6_ss_kv (kv, &t->lcl_ip.ip6, &t->rmt_ip.ip6, t->lcl_port,
225 t->rmt_port, t->proto);
228 typedef struct _transport_endpoint
238 #define TRANSPORT_ENDPOINT_INVALID_INDEX ((u32)~0) 242 ip46_address_t * ip,
u16 port);
struct _transport_connection transport_connection_t
static void make_v4_ss_kv_from_tc(session_kv4_t *kv, transport_connection_t *t)
clib_bihash_kv_16_8_t session_kv4_t
static void make_v6_ss_kv(session_kv6_t *kv, ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
static void make_v6_ss_kv_from_tc(session_kv6_t *kv, transport_connection_t *t)
static void make_v6_listener_kv(session_kv6_t *kv, ip6_address_t *lcl, u16 lcl_port, u8 proto)
static void make_v4_listener_kv(session_kv4_t *kv, ip4_address_t *lcl, u16 lcl_port, u8 proto)
clib_bihash_kv_48_8_t session_kv6_t
void transport_endpoint_table_add(transport_endpoint_table_t *ht, transport_endpoint_t *te, u32 value)
struct _transport_proto_vft transport_proto_vft_t
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static void cleanup(void)
typedef CLIB_PACKED(struct{union{struct{ip4_address_t src;ip4_address_t dst;u16 src_port;u16 dst_port;u32 proto;};u64 as_u64[2];};}) v4_connection_key_t
clib_bihash_24_8_t transport_endpoint_table_t
u32 fib_node_index_t
A typedef of a node index.
static void make_v4_ss_kv(session_kv4_t *kv, ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
void transport_endpoint_table_del(transport_endpoint_table_t *ht, transport_endpoint_t *te)
struct _transport_endpoint transport_endpoint_t
static void elog_track(elog_main_t *em, elog_event_type_t *type, elog_track_t *track, u32 data)
Log a single-datum event to a specific track, non-inline version.
u32 transport_endpoint_lookup(transport_endpoint_table_t *ht, ip46_address_t *ip, u16 port)