16 #ifndef SRC_VNET_SESSION_TRANSPORT_INTERFACE_H_ 17 #define SRC_VNET_SESSION_TRANSPORT_INTERFACE_H_ 43 typedef struct _transport_proto_vft
51 void (*close) (
u32 conn_index,
u32 thread_index);
63 void (*update_time) (
f64 time_now,
u8 thread_index);
76 u8 *(*format_connection) (
u8 * s, va_list * args);
77 u8 *(*format_listener) (
u8 * s, va_list * args);
78 u8 *(*format_half_open) (
u8 * s, va_list * args);
90 #define transport_proto_foreach(VAR, BODY) \ 92 for (VAR = 0; VAR < vec_len (tp_vfts); VAR++) \ 93 if (tp_vfts[VAR].push_header != 0) \ 94 do { BODY; } while (0); \ 110 return tc->elog_track.track_index_plus_one - 1;
117 u32 rate_bytes_per_sec,
118 u32 initial_bucket,
u64 time_now);
127 u32 rate_bytes_per_sec,
struct _transport_connection transport_connection_t
struct _transport_proto_vft transport_proto_vft_t
static u8 transport_connection_is_tx_paced(transport_connection_t *tc)
Check if transport connection is paced.
enum transport_service_type_ transport_service_type_t
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
void transport_enable_disable(vlib_main_t *vm, u8 is_en)
u32 transport_connection_snd_space(transport_connection_t *tc, u64 time_now, u16 mss)
Get maximum tx burst allowed for transport connection.
u32 transport_connection_tx_pacer_burst(transport_connection_t *tc, u64 time_now)
void transport_connection_tx_pacer_init(transport_connection_t *tc, u32 rate_bytes_per_sec, u32 initial_bucket)
Initialize tx pacer for connection.
void transport_update_time(f64 time_now, u8 thread_index)
#define TRANSPORT_CONNECTION_F_IS_TX_PACED
enum transport_dequeue_type_ transport_tx_fn_type_t
void transport_connection_update_tx_stats(transport_connection_t *tc, u32 bytes)
Update tx byte stats for transport connection.
void transport_register_protocol(transport_proto_t transport_proto, const transport_proto_vft_t *vft, fib_protocol_t fib_proto, u32 output_node)
Register transport virtual function table.
void transport_init_tx_pacers_period(void)
Initialize period for tx pacers.
transport_proto_vft_t * tp_vfts
Per-type vector of transport protocol virtual function tables.
static void cleanup(void)
reliable transport protos
static u32 transport_elog_track_index(transport_connection_t *tc)
transport_tx_fn_type_t transport_protocol_tx_fn_type(transport_proto_t tp)
void transport_connection_tx_pacer_update(transport_connection_t *tc, u64 bytes_per_sec)
Update tx pacer pacing rate.
apps acting as transports
void transport_connection_tx_pacer_update_bytes(transport_connection_t *tc, u32 bytes)
transport_proto_vft_t * transport_protocol_get_vft(transport_proto_t tp)
Get transport virtual function table.
unreliable transport protos
enum _transport_proto transport_proto_t
transport_service_type_t transport_protocol_service_type(transport_proto_t)
u8 * format_transport_pacer(u8 *s, va_list *args)
void transport_connection_tx_pacer_reset(transport_connection_t *tc, u32 rate_bytes_per_sec, u32 initial_bucket, u64 time_now)