FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
vpp_echo_common.h File Reference
+ Include dependency graph for vpp_echo_common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  echo_session_t
 
union  session_connected_bundled_msg_
 
struct  echo_proto_cb_vft_
 
struct  teardown_stat_
 
struct  echo_stats_
 
struct  echo_main_t
 
struct  echo_connect_args_
 
struct  echo_disconnect_args_
 
union  echo_rpc_args_t
 
struct  echo_rpc_msg_t
 

Macros

#define vl_typedefs   /* define message structures */
 
#define vl_endianfun   /* define message structures */
 
#define vl_print(handle, ...)
 
#define vl_printfun
 
#define TIMEOUT   10.0
 
#define LOGGING_BATCH   (100)
 
#define LOG_EVERY_N_IDLE_CYCLES   (1e8)
 
#define foreach_echo_fail_code
 
#define CHECK_SAME(fail, expected, result, _fmt, _args...)
 
#define CHECK_DIFF(fail, expected, result, _fmt, _args...)
 
#define ECHO_FAIL(fail, _fmt, _args...)
 
#define ECHO_LOG(lvl, _fmt, _args...)
 
#define ECHO_REGISTER_PROTO(proto, vft)
 

Typedefs

typedef enum echo_test_evt_ echo_test_evt_t
 
typedef union session_connected_bundled_msg_ session_connected_bundled_msg_t
 
typedef struct echo_proto_cb_vft_ echo_proto_cb_vft_t
 
typedef struct teardown_stat_ teardown_stat_t
 
typedef struct echo_stats_ echo_stats_t
 
typedef struct echo_connect_args_ echo_connect_args_t
 
typedef struct echo_disconnect_args_ echo_disconnect_args_t
 
typedef void(* echo_rpc_t) (echo_main_t *em, echo_rpc_args_t *arg)
 

Enumerations

enum  echo_fail_t { foreach_echo_fail_code }
 
enum  data_source_t { ECHO_NO_DATA_SOURCE, ECHO_TEST_DATA_SOURCE, ECHO_RX_DATA_SOURCE, ECHO_INVALID_DATA_SOURCE }
 
enum  echo_close_f_t { ECHO_CLOSE_F_INVALID = 0, ECHO_CLOSE_F_PASSIVE, ECHO_CLOSE_F_ACTIVE, ECHO_CLOSE_F_NONE }
 
enum  quic_session_type_t { ECHO_SESSION_TYPE_QUIC, ECHO_SESSION_TYPE_STREAM, ECHO_SESSION_TYPE_LISTEN }
 
enum  quic_session_state_t {
  ECHO_SESSION_STATE_INITIAL, ECHO_SESSION_STATE_READY, ECHO_SESSION_STATE_AWAIT_CLOSING, ECHO_SESSION_STATE_AWAIT_DATA,
  ECHO_SESSION_STATE_CLOSING, ECHO_SESSION_STATE_CLOSED
}
 
enum  connection_state_t {
  STATE_START, STATE_ATTACHED_NO_CERT, STATE_ATTACHED, STATE_LISTEN,
  STATE_READY, STATE_DATA_DONE, STATE_DISCONNECTED, STATE_CLEANED_CERT_KEY,
  STATE_DETACHED
}
 
enum  echo_test_evt_ {
  ECHO_EVT_START = 1, ECHO_EVT_FIRST_QCONNECT = (1 << 1), ECHO_EVT_LAST_QCONNECTED = (1 << 2), ECHO_EVT_FIRST_SCONNECT = (1 << 3),
  ECHO_EVT_LAST_SCONNECTED = (1 << 4), ECHO_EVT_LAST_BYTE = (1 << 5), ECHO_EVT_EXIT = (1 << 6)
}
 
enum  test_return_packets_t { RETURN_PACKETS_NOTEST, RETURN_PACKETS_LOG_WRONG, RETURN_PACKETS_ASSERT }
 

Functions

u8format_ip4_address (u8 *s, va_list *args)
 
u8format_ip6_address (u8 *s, va_list *args)
 
u8format_ip46_address (u8 *s, va_list *args)
 
u8format_api_error (u8 *s, va_list *args)
 
void init_error_string_table ()
 
u8echo_format_session (u8 *s, va_list *args)
 
u8echo_format_session_type (u8 *s, va_list *args)
 
u8echo_format_session_state (u8 *s, va_list *args)
 
u8echo_format_app_state (u8 *s, va_list *args)
 
uword echo_unformat_close (unformat_input_t *input, va_list *args)
 
uword echo_unformat_timing_event (unformat_input_t *input, va_list *args)
 
u8echo_format_timing_event (u8 *s, va_list *args)
 
uword unformat_transport_proto (unformat_input_t *input, va_list *args)
 
u8format_transport_proto (u8 *s, va_list *args)
 
uword unformat_ip4_address (unformat_input_t *input, va_list *args)
 
uword unformat_ip6_address (unformat_input_t *input, va_list *args)
 
void echo_session_handle_add_del (echo_main_t *em, u64 handle, u32 sid)
 
echo_session_techo_session_new (echo_main_t *em)
 
int echo_send_rpc (echo_main_t *em, void *fp, echo_rpc_args_t *args)
 
echo_session_techo_get_session_from_handle (echo_main_t *em, u64 handle)
 
int wait_for_state_change (echo_main_t *em, connection_state_t state, f64 timeout)
 
void echo_notify_event (echo_main_t *em, echo_test_evt_t e)
 
void echo_session_print_stats (echo_main_t *em, echo_session_t *session)
 
u8echo_format_crypto_engine (u8 *s, va_list *args)
 
uword echo_unformat_crypto_engine (unformat_input_t *input, va_list *args)
 
u8echo_format_bytes_per_sec (u8 *s, va_list *args)
 
int echo_ssvm_segment_attach (char *name, ssvm_segment_type_t type, int fd)
 
void echo_segment_handle_add_del (echo_main_t *em, u64 segment_handle, u8 add)
 
void echo_send_attach (echo_main_t *em)
 
void echo_send_detach (echo_main_t *em)
 
void echo_send_listen (echo_main_t *em, ip46_address_t *ip)
 
void echo_send_unbind (echo_main_t *em, echo_session_t *s)
 
void echo_send_connect (echo_main_t *em, void *args)
 
void echo_send_disconnect_session (echo_main_t *em, void *args)
 
void echo_api_hookup (echo_main_t *em)
 
void echo_send_add_cert_key (echo_main_t *em)
 
void echo_send_del_cert_key (echo_main_t *em)
 

Variables

char * echo_fail_code_str []
 
echo_main_t echo_main
 

Macro Definition Documentation

◆ CHECK_DIFF

#define CHECK_DIFF (   fail,
  expected,
  result,
  _fmt,
  _args... 
)
Value:
do { \
if ((expected) == (result)) \
ECHO_FAIL ((fail), "expected different (both %lld) : "_fmt, \
(u64)(expected), ##_args); \
} while (0)
unsigned long u64
Definition: types.h:89

Definition at line 120 of file vpp_echo_common.h.

◆ CHECK_SAME

#define CHECK_SAME (   fail,
  expected,
  result,
  _fmt,
  _args... 
)
Value:
do { \
if ((expected) != (result)) \
ECHO_FAIL ((fail), "expected same (%lld, got %lld) : "_fmt, \
(u64)(expected), (u64)(result), ##_args); \
} while (0)
unsigned long u64
Definition: types.h:89

Definition at line 113 of file vpp_echo_common.h.

◆ ECHO_FAIL

#define ECHO_FAIL (   fail,
  _fmt,
  _args... 
)
Value:
do { \
echo_main_t *em = &echo_main; \
em->has_failed = (fail); \
if (vec_len(em->fail_descr)) \
em->fail_descr = format(em->fail_descr, " | %s (%u): "_fmt, \
echo_fail_code_str[fail], fail, ##_args); \
else \
em->fail_descr = format(0, "%s (%u): "_fmt, \
echo_fail_code_str[fail], fail, ##_args); \
em->time_to_stop = 1; \
if (em->log_lvl > 0) \
clib_warning ("%v", em->fail_descr); \
} while (0)
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
echo_main_t echo_main
Definition: vpp_echo.c:24
char * echo_fail_code_str[]
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)

Definition at line 127 of file vpp_echo_common.h.

◆ ECHO_LOG

#define ECHO_LOG (   lvl,
  _fmt,
  _args... 
)
Value:
{ \
echo_main_t *em = &echo_main; \
if (em->log_lvl > lvl) \
clib_warning (_fmt, ##_args); \
}
echo_main_t echo_main
Definition: vpp_echo.c:24

Definition at line 142 of file vpp_echo_common.h.

◆ ECHO_REGISTER_PROTO

#define ECHO_REGISTER_PROTO (   proto,
  vft 
)
Value:
static void __clib_constructor \
vpp_echo_init_##proto () \
{ \
echo_main_t *em = &echo_main; \
vec_validate (em->available_proto_cb_vft, proto); \
em->available_proto_cb_vft[proto] = &vft; \
}
echo_main_t echo_main
Definition: vpp_echo.c:24
vl_api_ip_proto_t proto
Definition: acl_types.api:50

Definition at line 149 of file vpp_echo_common.h.

◆ foreach_echo_fail_code

#define foreach_echo_fail_code

Definition at line 42 of file vpp_echo_common.h.

◆ LOG_EVERY_N_IDLE_CYCLES

#define LOG_EVERY_N_IDLE_CYCLES   (1e8)

Definition at line 40 of file vpp_echo_common.h.

◆ LOGGING_BATCH

#define LOGGING_BATCH   (100)

Definition at line 39 of file vpp_echo_common.h.

◆ TIMEOUT

#define TIMEOUT   10.0

Definition at line 38 of file vpp_echo_common.h.

◆ vl_endianfun

#define vl_endianfun   /* define message structures */

Definition at line 28 of file vpp_echo_common.h.

◆ vl_print

#define vl_print (   handle,
  ... 
)

Definition at line 33 of file vpp_echo_common.h.

◆ vl_printfun

#define vl_printfun

Definition at line 34 of file vpp_echo_common.h.

◆ vl_typedefs

#define vl_typedefs   /* define message structures */

Definition at line 22 of file vpp_echo_common.h.

Typedef Documentation

◆ echo_connect_args_t

◆ echo_disconnect_args_t

◆ echo_proto_cb_vft_t

◆ echo_rpc_t

typedef void(* echo_rpc_t) (echo_main_t *em, echo_rpc_args_t *arg)

Definition at line 405 of file vpp_echo_common.h.

◆ echo_stats_t

typedef struct echo_stats_ echo_stats_t

◆ echo_test_evt_t

◆ session_connected_bundled_msg_t

◆ teardown_stat_t

Enumeration Type Documentation

◆ connection_state_t

Enumerator
STATE_START 
STATE_ATTACHED_NO_CERT 
STATE_ATTACHED 
STATE_LISTEN 
STATE_READY 
STATE_DATA_DONE 
STATE_DISCONNECTED 
STATE_CLEANED_CERT_KEY 
STATE_DETACHED 

Definition at line 208 of file vpp_echo_common.h.

◆ data_source_t

Enumerator
ECHO_NO_DATA_SOURCE 
ECHO_TEST_DATA_SOURCE 
ECHO_RX_DATA_SOURCE 
ECHO_INVALID_DATA_SOURCE 

Definition at line 175 of file vpp_echo_common.h.

◆ echo_close_f_t

Enumerator
ECHO_CLOSE_F_INVALID 
ECHO_CLOSE_F_PASSIVE 
ECHO_CLOSE_F_ACTIVE 
ECHO_CLOSE_F_NONE 

Definition at line 183 of file vpp_echo_common.h.

◆ echo_fail_t

Enumerator
foreach_echo_fail_code 

Definition at line 104 of file vpp_echo_common.h.

◆ echo_test_evt_

Enumerator
ECHO_EVT_START 
ECHO_EVT_FIRST_QCONNECT 
ECHO_EVT_LAST_QCONNECTED 
ECHO_EVT_FIRST_SCONNECT 
ECHO_EVT_LAST_SCONNECTED 
ECHO_EVT_LAST_BYTE 
ECHO_EVT_EXIT 

Definition at line 221 of file vpp_echo_common.h.

◆ quic_session_state_t

Enumerator
ECHO_SESSION_STATE_INITIAL 
ECHO_SESSION_STATE_READY 
ECHO_SESSION_STATE_AWAIT_CLOSING 
ECHO_SESSION_STATE_AWAIT_DATA 
ECHO_SESSION_STATE_CLOSING 
ECHO_SESSION_STATE_CLOSED 

Definition at line 198 of file vpp_echo_common.h.

◆ quic_session_type_t

Enumerator
ECHO_SESSION_TYPE_QUIC 
ECHO_SESSION_TYPE_STREAM 
ECHO_SESSION_TYPE_LISTEN 

Definition at line 191 of file vpp_echo_common.h.

◆ test_return_packets_t

Enumerator
RETURN_PACKETS_NOTEST 
RETURN_PACKETS_LOG_WRONG 
RETURN_PACKETS_ASSERT 

Definition at line 253 of file vpp_echo_common.h.

Function Documentation

◆ echo_api_hookup()

void echo_api_hookup ( echo_main_t em)

Definition at line 384 of file vpp_echo_bapi.c.

+ Here is the caller graph for this function:

◆ echo_format_app_state()

u8* echo_format_app_state ( u8 s,
va_list *  args 
)

Definition at line 199 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_format_bytes_per_sec()

u8* echo_format_bytes_per_sec ( u8 s,
va_list *  args 
)

Definition at line 261 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_format_crypto_engine()

u8* echo_format_crypto_engine ( u8 s,
va_list *  args 
)

Definition at line 475 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_format_session()

u8* echo_format_session ( u8 s,
va_list *  args 
)

Definition at line 146 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_format_session_state()

u8* echo_format_session_state ( u8 s,
va_list *  args 
)

Definition at line 174 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_format_session_type()

u8* echo_format_session_type ( u8 s,
va_list *  args 
)

Definition at line 156 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_format_timing_event()

u8* echo_format_timing_event ( u8 s,
va_list *  args 
)

Definition at line 275 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_get_session_from_handle()

echo_session_t* echo_get_session_from_handle ( echo_main_t em,
u64  handle 
)

Definition at line 567 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_notify_event()

void echo_notify_event ( echo_main_t em,
echo_test_evt_t  e 
)

Definition at line 598 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_segment_handle_add_del()

void echo_segment_handle_add_del ( echo_main_t em,
u64  segment_handle,
u8  add 
)

Definition at line 220 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_add_cert_key()

void echo_send_add_cert_key ( echo_main_t em)

Definition at line 69 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_attach()

void echo_send_attach ( echo_main_t em)

Definition at line 28 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_connect()

void echo_send_connect ( echo_main_t em,
void *  args 
)

Definition at line 143 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_del_cert_key()

void echo_send_del_cert_key ( echo_main_t em)

Definition at line 90 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_detach()

void echo_send_detach ( echo_main_t em)

Definition at line 55 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_disconnect_session()

void echo_send_disconnect_session ( echo_main_t em,
void *  args 
)

Definition at line 173 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_listen()

void echo_send_listen ( echo_main_t em,
ip46_address_t *  ip 
)

Definition at line 104 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_rpc()

int echo_send_rpc ( echo_main_t em,
void *  fp,
echo_rpc_args_t args 
)

Definition at line 542 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_send_unbind()

void echo_send_unbind ( echo_main_t em,
echo_session_t s 
)

Definition at line 126 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_session_handle_add_del()

void echo_session_handle_add_del ( echo_main_t em,
u64  handle,
u32  sid 
)

Definition at line 515 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_session_new()

echo_session_t* echo_session_new ( echo_main_t em)

Definition at line 532 of file vpp_echo_common.c.

+ Here is the caller graph for this function:

◆ echo_session_print_stats()

void echo_session_print_stats ( echo_main_t em,
echo_session_t session 
)

Definition at line 610 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_ssvm_segment_attach()

int echo_ssvm_segment_attach ( char *  name,
ssvm_segment_type_t  type,
int  fd 
)

Definition at line 200 of file vpp_echo_bapi.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_unformat_close()

uword echo_unformat_close ( unformat_input_t input,
va_list *  args 
)

Definition at line 223 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_unformat_crypto_engine()

uword echo_unformat_crypto_engine ( unformat_input_t input,
va_list *  args 
)

Definition at line 491 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ echo_unformat_timing_event()

uword echo_unformat_timing_event ( unformat_input_t input,
va_list *  args 
)

Definition at line 238 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_api_error()

u8* format_api_error ( u8 s,
va_list *  args 
)

Definition at line 117 of file vpp_echo_common.c.

+ Here is the call graph for this function:

◆ format_ip46_address()

u8* format_ip46_address ( u8 s,
va_list *  args 
)

Definition at line 395 of file ip6_format.c.

+ Here is the call graph for this function:

◆ format_ip4_address()

u8* format_ip4_address ( u8 s,
va_list *  args 
)

Definition at line 44 of file ip4_format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ip6_address()

u8* format_ip6_address ( u8 s,
va_list *  args 
)

Definition at line 44 of file ip6_format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_transport_proto()

u8* format_transport_proto ( u8 s,
va_list *  args 
)

Definition at line 52 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_error_string_table()

void init_error_string_table ( )

Definition at line 133 of file vpp_echo_common.c.

◆ unformat_ip4_address()

uword unformat_ip4_address ( unformat_input_t input,
va_list *  args 
)

Definition at line 76 of file ip4_format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_ip6_address()

uword unformat_ip6_address ( unformat_input_t input,
va_list *  args 
)

Definition at line 138 of file ip6_format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_transport_proto()

uword unformat_transport_proto ( unformat_input_t input,
va_list *  args 
)

Definition at line 155 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wait_for_state_change()

int wait_for_state_change ( echo_main_t em,
connection_state_t  state,
f64  timeout 
)

Definition at line 582 of file vpp_echo_common.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ echo_fail_code_str

char* echo_fail_code_str[]

Definition at line 21 of file vpp_echo_common.c.

◆ echo_main

echo_main_t echo_main

Definition at line 24 of file vpp_echo.c.