FD.io VPP  v19.08-27-gf4dcae4
Vector Packet Processing
transport.h File Reference
+ Include dependency graph for transport.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define transport_proto_foreach(VAR, BODY)
 

Typedefs

typedef struct _transport_options_t transport_options_t
 
typedef struct _transport_proto_vft transport_proto_vft_t
 

Functions

int transport_connect (transport_proto_t tp, transport_endpoint_cfg_t *tep)
 
void transport_close (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
u32 transport_start_listen (transport_proto_t tp, u32 session_index, transport_endpoint_t *tep)
 
u32 transport_stop_listen (transport_proto_t tp, u32 conn_index)
 
void transport_cleanup (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
void transport_get_endpoint (transport_proto_t tp, u32 conn_index, u32 thread_index, transport_endpoint_t *tep, u8 is_lcl)
 
void transport_get_listener_endpoint (transport_proto_t tp, u32 conn_index, transport_endpoint_t *tep, u8 is_lcl)
 
static transport_connection_ttransport_get_connection (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
static transport_connection_ttransport_get_listener (transport_proto_t tp, u32 conn_index)
 
static transport_connection_ttransport_get_half_open (transport_proto_t tp, u32 conn_index)
 
static int transport_custom_tx (transport_proto_t tp, void *s, u32 max_burst_size)
 
static int transport_app_rx_evt (transport_proto_t tp, u32 conn_index, u32 thread_index)
 
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. More...
 
transport_proto_vft_ttransport_protocol_get_vft (transport_proto_t tp)
 Get transport virtual function table. More...
 
void transport_update_time (f64 time_now, u8 thread_index)
 
int transport_alloc_local_port (u8 proto, ip46_address_t *ip)
 Allocate local port and add if successful add entry to local endpoint table to mark the pair as used. More...
 
int transport_alloc_local_endpoint (u8 proto, transport_endpoint_cfg_t *rmt, ip46_address_t *lcl_addr, u16 *lcl_port)
 
void transport_endpoint_cleanup (u8 proto, ip46_address_t *lcl_ip, u16 port)
 
void transport_enable_disable (vlib_main_t *vm, u8 is_en)
 
void transport_init (void)
 
static u32 transport_elog_track_index (transport_connection_t *tc)
 
void transport_connection_tx_pacer_reset (transport_connection_t *tc, u32 rate_bytes_per_sec, u32 initial_bucket, 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. More...
 
void transport_connection_tx_pacer_update (transport_connection_t *tc, u64 bytes_per_sec)
 Update tx pacer pacing rate. More...
 
u32 transport_connection_snd_space (transport_connection_t *tc, u64 time_now, u16 mss)
 Get maximum tx burst allowed for transport connection. More...
 
u32 transport_connection_tx_pacer_burst (transport_connection_t *tc, u64 time_now)
 Get tx pacer max burst. More...
 
u64 transport_connection_tx_pacer_rate (transport_connection_t *tc)
 Get tx pacer current rate. More...
 
void transport_init_tx_pacers_period (void)
 Initialize period for tx pacers. More...
 
static u8 transport_connection_is_tx_paced (transport_connection_t *tc)
 Check if transport connection is paced. More...
 
u8format_transport_pacer (u8 *s, va_list *args)
 
void transport_connection_update_tx_bytes (transport_connection_t *tc, u32 bytes)
 Update tx bytes for paced transport connection. More...
 
void transport_connection_tx_pacer_update_bytes (transport_connection_t *tc, u32 bytes)
 

Variables

transport_proto_vft_ttp_vfts
 Per-type vector of transport protocol virtual function tables. More...
 

Macro Definition Documentation

#define transport_proto_foreach (   VAR,
  BODY 
)
Value:
do { \
for (VAR = 0; VAR < vec_len (tp_vfts); VAR++) \
if (tp_vfts[VAR].push_header != 0) \
do { BODY; } while (0); \
} while (0)
for(i=1;i<=collision_buckets;i++)
transport_proto_vft_t * tp_vfts
Per-type vector of transport protocol virtual function tables.
Definition: transport.c:23
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)

Definition at line 90 of file transport.h.

Typedef Documentation

typedef struct _transport_options_t transport_options_t
typedef struct _transport_proto_vft transport_proto_vft_t

Function Documentation

u8* format_transport_pacer ( u8 s,
va_list *  args 
)

Definition at line 604 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int transport_alloc_local_endpoint ( u8  proto,
transport_endpoint_cfg_t rmt,
ip46_address_t *  lcl_addr,
u16 lcl_port 
)

Definition at line 544 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int transport_alloc_local_port ( u8  proto,
ip46_address_t *  ip 
)

Allocate local port and add if successful add entry to local endpoint table to mark the pair as used.

Definition at line 447 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int transport_app_rx_evt ( transport_proto_t  tp,
u32  conn_index,
u32  thread_index 
)
inlinestatic

Definition at line 136 of file transport.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_cleanup ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)

Definition at line 310 of file transport.c.

+ Here is the caller graph for this function:

void transport_close ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)

Definition at line 322 of file transport.c.

+ Here is the caller graph for this function:

int transport_connect ( transport_proto_t  tp,
transport_endpoint_cfg_t tep 
)

Definition at line 316 of file transport.c.

+ Here is the caller graph for this function:

static u8 transport_connection_is_tx_paced ( transport_connection_t tc)
inlinestatic

Check if transport connection is paced.

Definition at line 232 of file transport.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 transport_connection_snd_space ( transport_connection_t tc,
u64  time_now,
u16  mss 
)

Get maximum tx burst allowed for transport connection.

Parameters
tctransport connection
time_nowcurrent cpu time as returned by clib_cpu_time_now
msstransport's mss

Definition at line 687 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 transport_connection_tx_pacer_burst ( transport_connection_t tc,
u64  time_now 
)

Get tx pacer max burst.

Parameters
tctransport connection
time_nowcurrent cpu time
Returns
max burst for connection

Definition at line 679 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_connection_tx_pacer_init ( transport_connection_t tc,
u32  rate_bytes_per_sec,
u32  initial_bucket 
)

Initialize tx pacer for connection.

Parameters
tctransport connection
rate_bytes_per_secondinitial byte rate
burst_bytesinitial burst size in bytes

Definition at line 660 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u64 transport_connection_tx_pacer_rate ( transport_connection_t tc)

Get tx pacer current rate.

Parameters
tctransport connection
Returns
rate for connection in bytes/s

Definition at line 705 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_connection_tx_pacer_reset ( transport_connection_t tc,
u32  rate_bytes_per_sec,
u32  initial_bucket,
u64  time_now 
)

Definition at line 649 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_connection_tx_pacer_update ( transport_connection_t tc,
u64  bytes_per_sec 
)

Update tx pacer pacing rate.

Parameters
tctransport connection
bytes_per_secnew pacing rate

Definition at line 672 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_connection_tx_pacer_update_bytes ( transport_connection_t tc,
u32  bytes 
)

Definition at line 718 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_connection_update_tx_bytes ( transport_connection_t tc,
u32  bytes 
)

Update tx bytes for paced transport connection.

If tx pacing is enabled, this update pacer bucket to account for the amount of bytes that have been sent.

Parameters
tctransport connection
bytesbytes recently sent

Definition at line 711 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int transport_custom_tx ( transport_proto_t  tp,
void *  s,
u32  max_burst_size 
)
inlinestatic

Definition at line 130 of file transport.h.

+ Here is the caller graph for this function:

static u32 transport_elog_track_index ( transport_connection_t tc)
inlinestatic

Definition at line 160 of file transport.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_enable_disable ( vlib_main_t vm,
u8  is_en 
)

Definition at line 743 of file transport.c.

+ Here is the caller graph for this function:

void transport_endpoint_cleanup ( u8  proto,
ip46_address_t *  lcl_ip,
u16  port 
)

Definition at line 413 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static transport_connection_t* transport_get_connection ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)
inlinestatic

Definition at line 111 of file transport.h.

+ Here is the caller graph for this function:

void transport_get_endpoint ( transport_proto_t  tp,
u32  conn_index,
u32  thread_index,
transport_endpoint_t tep,
u8  is_lcl 
)

Definition at line 365 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static transport_connection_t* transport_get_half_open ( transport_proto_t  tp,
u32  conn_index 
)
inlinestatic

Definition at line 124 of file transport.h.

+ Here is the caller graph for this function:

static transport_connection_t* transport_get_listener ( transport_proto_t  tp,
u32  conn_index 
)
inlinestatic

Definition at line 118 of file transport.h.

+ Here is the caller graph for this function:

void transport_get_listener_endpoint ( transport_proto_t  tp,
u32  conn_index,
transport_endpoint_t tep,
u8  is_lcl 
)

Definition at line 381 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_init ( void  )

Definition at line 754 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void transport_init_tx_pacers_period ( void  )

Initialize period for tx pacers.

Defines a unit of time with respect to number of cpu cycles that is to be used by all tx pacers.

Definition at line 725 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

transport_proto_vft_t* transport_protocol_get_vft ( transport_proto_t  transport_proto)

Get transport virtual function table.

Parameters
type- session type (not protocol type)

Definition at line 284 of file transport.c.

+ Here is the caller graph for this function:

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.

Parameters
transport_proto- transport protocol type (i.e., TCP, UDP ..)
vft- virtual function table for transport proto
fib_proto- network layer protocol
output_node- output node index that session layer will hand off buffers to, for requested fib proto

Definition at line 266 of file transport.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 transport_start_listen ( transport_proto_t  tp,
u32  session_index,
transport_endpoint_t tep 
)

Definition at line 328 of file transport.c.

+ Here is the caller graph for this function:

u32 transport_stop_listen ( transport_proto_t  tp,
u32  conn_index 
)

Definition at line 335 of file transport.c.

+ Here is the caller graph for this function:

void transport_update_time ( f64  time_now,
u8  thread_index 
)

Definition at line 732 of file transport.c.

+ Here is the caller graph for this function:

Variable Documentation

Per-type vector of transport protocol virtual function tables.

Definition at line 23 of file transport.c.