#include <vnet/ip/ip.h>
#include <vppinfra/bihash_16_8.h>
#include <vppinfra/bihash_48_8.h>
-
+#include <vnet/tcp/tcp_debug.h>
/*
* Protocol independent transport properties associated to a session
*/
ip46_address_t lcl_ip; /**< Local IP */
u16 lcl_port; /**< Local port */
u16 rmt_port; /**< Remote port */
- u8 proto; /**< Transport protocol id */
+ u8 proto; /**< Transport protocol id (also session type) */
u32 s_index; /**< Parent session index */
u32 c_index; /**< Connection index in transport pool */
u8 is_ip4; /**< Flag if IP4 connection */
u32 thread_index; /**< Worker-thread index */
+#if TRANSPORT_DEBUG
+ elog_track_t elog_track; /**< Event logging */
+#endif
+
/** Macros for 'derived classes' where base is named "connection" */
#define c_lcl_ip connection.lcl_ip
#define c_rmt_ip connection.rmt_ip
#define c_c_index connection.c_index
#define c_is_ip4 connection.is_ip4
#define c_thread_index connection.thread_index
+#define c_elog_track connection.elog_track
} transport_connection_t;
/*
/*
* Setup
*/
- u32 (*bind) (vlib_main_t *, u32, ip46_address_t *, u16);
- u32 (*unbind) (vlib_main_t *, u32);
+ u32 (*bind) (u32, ip46_address_t *, u16);
+ u32 (*unbind) (u32);
int (*open) (ip46_address_t * addr, u16 port_host_byte_order);
void (*close) (u32 conn_index, u32 thread_index);
void (*cleanup) (u32 conn_index, u32 thread_index);
u8 *(*format_connection) (u8 * s, va_list * args);
u8 *(*format_listener) (u8 * s, va_list * args);
u8 *(*format_half_open) (u8 * s, va_list * args);
-
} transport_proto_vft_t;
/* *INDENT-OFF* */
{
struct
{
- ip4_address_t src; ip4_address_t dst;
+ ip4_address_t src;
+ ip4_address_t dst;
u16 src_port;
u16 dst_port;
/* align by making this 4 octets even though its a 1-bit field
struct
{
/* 48 octets */
- ip6_address_t src; ip6_address_t dst;
+ ip6_address_t src;
+ ip6_address_t dst;
u16 src_port;
- u16 dst_port; u32 proto; u8 unused_for_now[8];
- }; u64 as_u64[6];
+ u16 dst_port;
+ u32 proto;
+ u8 unused_for_now[8];
+ };
+ u64 as_u64[6];
};
}) v6_connection_key_t;
/* *INDENT-ON* */
typedef struct _transport_endpoint
{
- ip46_address_t ip;
- u16 port;
- u8 is_ip4;
- u32 vrf;
+ ip46_address_t ip; /** ip address */
+ u16 port; /** port in host order */
+ u8 is_ip4; /** 1 if ip4 */
+ u32 vrf; /** fib table the endpoint is associated with */
} transport_endpoint_t;
typedef clib_bihash_24_8_t transport_endpoint_table_t;