X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Ftransport.h;h=421121d2fa6c1538325ffbc3bab5aa1c6fa447c9;hb=e69f4954a9de40a47f0bc27cdab0ba44e6985dac;hp=f486dbb289f49fd8a3c74f11e79f4e002439f871;hpb=ede470b4fc50b4e53caf303536e7b7b0ba2b77d9;p=vpp.git diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h index f486dbb289f..421121d2fa6 100644 --- a/src/vnet/session/transport.h +++ b/src/vnet/session/transport.h @@ -20,7 +20,7 @@ #include #include #include - +#include /* * Protocol independent transport properties associated to a session */ @@ -37,6 +37,10 @@ typedef struct _transport_connection u8 is_ip4; /**< Flag if IP4 connection */ u32 thread_index; /**< Worker-thread index */ +#if TRANSPORT_DEBUG + elog_track_t elog_track; /**< Debug purposes */ +#endif + /** Macros for 'derived classes' where base is named "connection" */ #define c_lcl_ip connection.lcl_ip #define c_rmt_ip connection.rmt_ip @@ -52,6 +56,7 @@ typedef struct _transport_connection #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; /* @@ -62,8 +67,8 @@ typedef struct _transport_proto_vft /* * 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); @@ -74,7 +79,7 @@ typedef struct _transport_proto_vft u32 (*push_header) (transport_connection_t * tconn, vlib_buffer_t * b); u16 (*send_mss) (transport_connection_t * tc); u32 (*send_space) (transport_connection_t * tc); - u32 (*rx_fifo_offset) (transport_connection_t * tc); + u32 (*tx_fifo_offset) (transport_connection_t * tc); /* * Connection retrieval @@ -89,42 +94,41 @@ typedef struct _transport_proto_vft 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* */ /* 16 octets */ -typedef CLIB_PACKED (struct - { - union - { - struct - { - 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 - * NOTE: avoid key overlap with other transports that use 5 tuples for - * session identification. - */ - u32 proto; - }; - u64 as_u64[2]; - }; - }) v4_connection_key_t; - -typedef CLIB_PACKED (struct - { - union - { - struct - { - /* 48 octets */ - 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]; - }; - }) v6_connection_key_t; +typedef CLIB_PACKED (struct { + union + { + struct + { + 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 + * NOTE: avoid key overlap with other transports that use 5 tuples for + * session identification. + */ + u32 proto; + }; + u64 as_u64[2]; + }; +}) v4_connection_key_t; + +typedef CLIB_PACKED (struct { + union + { + struct + { + /* 48 octets */ + 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]; + }; +}) v6_connection_key_t; +/* *INDENT-ON* */ typedef clib_bihash_kv_16_8_t session_kv4_t; typedef clib_bihash_kv_48_8_t session_kv6_t;