FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
vppcom.c File Reference
+ Include dependency graph for vppcom.c:

Go to the source code of this file.

Data Structures

struct  session_t
 
struct  vppcom_cfg_t_
 
struct  vppcom_main_t_
 

Macros

#define vl_typedefs   /* define message structures */
 
#define vl_endianfun   /* define message structures */
 
#define vl_print(handle, ...)
 
#define vl_printfun
 
#define VPPCOM_DEBUG   1
 
#define foreach_sock_msg
 

Typedefs

typedef struct vppcom_cfg_t_ vppcom_cfg_t
 
typedef struct vppcom_main_t_ vppcom_main_t
 

Enumerations

enum  app_state_t { STATE_APP_START, STATE_APP_CONN_VPP, STATE_APP_ENABLED, STATE_APP_ATTACHED }
 
enum  session_state_t {
  STATE_START, STATE_CONNECT, STATE_LISTEN, STATE_ACCEPT,
  STATE_DISCONNECT, STATE_FAILED
}
 

Functions

static const char * vppcom_app_state_str (app_state_t state)
 
static const char * vppcom_session_state_str (session_state_t state)
 
static int vppcom_session_at_index (u32 session_index, session_t *volatile *sess)
 
static int vppcom_connect_to_vpp (char *app_name)
 
static u8format_api_error (u8 *s, va_list *args)
 
static void vppcom_init_error_string_table (void)
 
static int vppcom_wait_for_app_state_change (app_state_t app_state)
 
static int vppcom_wait_for_session_state_change (u32 session_index, session_state_t state, f64 wait_for_time)
 
static int vppcom_wait_for_client_session_index (f64 wait_for_time)
 
static void vppcom_send_session_enable_disable (u8 is_enable)
 
static int vppcom_app_session_enable (void)
 
static void vl_api_session_enable_disable_reply_t_handler (vl_api_session_enable_disable_reply_t *mp)
 
static void vppcom_app_send_attach (void)
 
static int vppcom_app_attach (void)
 
static void vppcom_app_detach (void)
 
static void vl_api_application_attach_reply_t_handler (vl_api_application_attach_reply_t *mp)
 
static void vl_api_application_detach_reply_t_handler (vl_api_application_detach_reply_t *mp)
 
static void vl_api_disconnect_session_reply_t_handler (vl_api_disconnect_session_reply_t *mp)
 
static void vl_api_map_another_segment_t_handler (vl_api_map_another_segment_t *mp)
 
static void vl_api_disconnect_session_t_handler (vl_api_disconnect_session_t *mp)
 
static void vl_api_reset_session_t_handler (vl_api_reset_session_t *mp)
 
static void vl_api_connect_session_reply_t_handler (vl_api_connect_session_reply_t *mp)
 
static void vppcom_send_connect_sock (session_t *session, u32 session_index)
 
static int vppcom_send_disconnect (u32 session_index)
 
static void vl_api_bind_sock_reply_t_handler (vl_api_bind_sock_reply_t *mp)
 
static void vl_api_unbind_sock_reply_t_handler (vl_api_unbind_sock_reply_t *mp)
 
u8format_ip4_address (u8 *s, va_list *args)
 
u8format_ip6_address (u8 *s, va_list *args)
 
u8format_ip46_address (u8 *s, va_list *args)
 
static void vl_api_accept_session_t_handler (vl_api_accept_session_t *mp)
 
static void vl_api_connect_sock_t_handler (vl_api_connect_sock_t *mp)
 
static void vppcom_send_bind_sock (session_t *session)
 
static void vppcom_send_unbind_sock (u32 session_index)
 
static int vppcom_session_unbind_cut_thru (session_t *session)
 
static int vppcom_session_unbind (u32 session_index)
 
static int vppcom_session_disconnect (u32 session_index)
 
static void vppcom_api_hookup (void)
 
static void vppcom_cfg_init (vppcom_cfg_t *vcl_cfg)
 
static void vppcom_cfg_heapsize (char *conf_fname)
 
static void vppcom_cfg_read (char *conf_fname)
 
int vppcom_app_create (char *app_name)
 
void vppcom_app_destroy (void)
 
int vppcom_session_create (u32 vrf, u8 proto, u8 is_nonblocking)
 
int vppcom_session_close (uint32_t session_index)
 
int vppcom_session_bind (uint32_t session_index, vppcom_endpt_t *ep)
 
int vppcom_session_listen (uint32_t listen_session_index, uint32_t q_len)
 
int vppcom_session_accept (uint32_t listen_session_index, vppcom_endpt_t *ep, double wait_for_time)
 
int vppcom_session_connect (uint32_t session_index, vppcom_endpt_t *server_ep)
 
int vppcom_session_read (uint32_t session_index, void *buf, int n)
 
static int vppcom_session_read_ready (session_t *session, u32 session_index)
 
int vppcom_session_write (uint32_t session_index, void *buf, int n)
 
static int vppcom_session_write_ready (session_t *session, u32 session_index)
 
int vppcom_select (unsigned long n_bits, unsigned long *read_map, unsigned long *write_map, unsigned long *except_map, double time_to_wait)
 

Variables

vppcom_main_t vppcom_main = {.my_client_index = ~0 }
 

Macro Definition Documentation

#define foreach_sock_msg
Value:
_(SESSION_ENABLE_DISABLE_REPLY, session_enable_disable_reply) \
_(BIND_SOCK_REPLY, bind_sock_reply) \
_(UNBIND_SOCK_REPLY, unbind_sock_reply) \
_(ACCEPT_SESSION, accept_session) \
_(CONNECT_SOCK, connect_sock) \
_(CONNECT_SESSION_REPLY, connect_session_reply) \
_(DISCONNECT_SESSION, disconnect_session) \
_(DISCONNECT_SESSION_REPLY, disconnect_session_reply) \
_(RESET_SESSION, reset_session) \
_(APPLICATION_ATTACH_REPLY, application_attach_reply) \
_(APPLICATION_DETACH_REPLY, application_detach_reply) \
_(MAP_ANOTHER_SEGMENT, map_another_segment)

Definition at line 1280 of file vppcom.c.

#define vl_endianfun   /* define message structures */

Definition at line 33 of file vppcom.c.

#define vl_print (   handle,
  ... 
)

Definition at line 38 of file vppcom.c.

#define vl_printfun

Definition at line 39 of file vppcom.c.

#define vl_typedefs   /* define message structures */

Definition at line 27 of file vppcom.c.

#define VPPCOM_DEBUG   1

Definition at line 45 of file vppcom.c.

Typedef Documentation

typedef struct vppcom_cfg_t_ vppcom_cfg_t
typedef struct vppcom_main_t_ vppcom_main_t

Enumeration Type Documentation

Enumerator
STATE_APP_START 
STATE_APP_CONN_VPP 
STATE_APP_ENABLED 
STATE_APP_ATTACHED 

Definition at line 53 of file vppcom.c.

Enumerator
STATE_START 
STATE_CONNECT 
STATE_LISTEN 
STATE_ACCEPT 
STATE_DISCONNECT 
STATE_FAILED 

Definition at line 61 of file vppcom.c.

Function Documentation

static u8* format_api_error ( u8 s,
va_list *  args 
)
static

Definition at line 274 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip46_address ( u8 s,
va_list *  args 
)

Definition at line 926 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip4_address ( u8 s,
va_list *  args 
)

Definition at line 868 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ip6_address ( u8 s,
va_list *  args 
)

Definition at line 875 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_accept_session_t_handler ( vl_api_accept_session_t mp)
static

Definition at line 951 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_application_attach_reply_t_handler ( vl_api_application_attach_reply_t mp)
static

Definition at line 483 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_application_detach_reply_t_handler ( vl_api_application_detach_reply_t *  mp)
static

Definition at line 528 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_bind_sock_reply_t_handler ( vl_api_bind_sock_reply_t mp)
static

Definition at line 821 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_connect_session_reply_t_handler ( vl_api_connect_session_reply_t mp)
static

Definition at line 685 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_connect_sock_t_handler ( vl_api_connect_sock_t mp)
static

Definition at line 1019 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_disconnect_session_reply_t_handler ( vl_api_disconnect_session_reply_t mp)
static

Definition at line 541 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_disconnect_session_t_handler ( vl_api_disconnect_session_t mp)
static

Definition at line 602 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_map_another_segment_t_handler ( vl_api_map_another_segment_t mp)
static

Definition at line 577 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_reset_session_t_handler ( vl_api_reset_session_t mp)
static

Definition at line 644 of file vppcom.c.

+ Here is the call graph for this function:

static void vl_api_session_enable_disable_reply_t_handler ( vl_api_session_enable_disable_reply_t *  mp)
static

Definition at line 417 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_unbind_sock_reply_t_handler ( vl_api_unbind_sock_reply_t *  mp)
static

Definition at line 847 of file vppcom.c.

+ Here is the call graph for this function:

static void vppcom_api_hookup ( void  )
static

Definition at line 1295 of file vppcom.c.

+ Here is the caller graph for this function:

static int vppcom_app_attach ( void  )
static

Definition at line 451 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_app_create ( char *  app_name)

Definition at line 1690 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vppcom_app_destroy ( void  )

Definition at line 1776 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_app_detach ( void  )
static

Definition at line 469 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_app_send_attach ( void  )
static

Definition at line 431 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_app_session_enable ( void  )
static

Definition at line 395 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static const char* vppcom_app_state_str ( app_state_t  state)
static

Definition at line 160 of file vppcom.c.

+ Here is the caller graph for this function:

static void vppcom_cfg_heapsize ( char *  conf_fname)
static

Definition at line 1328 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_cfg_init ( vppcom_cfg_t vcl_cfg)
static

Definition at line 1309 of file vppcom.c.

+ Here is the caller graph for this function:

static void vppcom_cfg_read ( char *  conf_fname)
static

Definition at line 1441 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_connect_to_vpp ( char *  app_name)
static

Definition at line 250 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_init_error_string_table ( void  )
static

Definition at line 290 of file vppcom.c.

+ Here is the caller graph for this function:

int vppcom_select ( unsigned long  n_bits,
unsigned long *  read_map,
unsigned long *  write_map,
unsigned long *  except_map,
double  time_to_wait 
)

Definition at line 2306 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_send_bind_sock ( session_t session)
static

Definition at line 1158 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_send_connect_sock ( session_t session,
u32  session_index 
)
static

Definition at line 765 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_send_disconnect ( u32  session_index)
static

Definition at line 792 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_send_session_enable_disable ( u8  is_enable)
static

Definition at line 380 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vppcom_send_unbind_sock ( u32  session_index)
static

Definition at line 1181 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_session_accept ( uint32_t  listen_session_index,
vppcom_endpt_t ep,
double  wait_for_time 
)

Definition at line 1972 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_session_at_index ( u32  session_index,
session_t *volatile *  sess 
)
inlinestatic

Definition at line 233 of file vppcom.c.

+ Here is the caller graph for this function:

int vppcom_session_bind ( uint32_t  session_index,
vppcom_endpt_t ep 
)

Definition at line 1882 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_session_close ( uint32_t  session_index)

Definition at line 1825 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_session_connect ( uint32_t  session_index,
vppcom_endpt_t server_ep 
)

Definition at line 2052 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_session_create ( u32  vrf,
u8  proto,
u8  is_nonblocking 
)

Definition at line 1802 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_session_disconnect ( u32  session_index)
static

Definition at line 1259 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_session_listen ( uint32_t  listen_session_index,
uint32_t  q_len 
)

Definition at line 1918 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_session_read ( uint32_t  session_index,
void *  buf,
int  n 
)

Definition at line 2111 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_session_read_ready ( session_t session,
u32  session_index 
)
inlinestatic

Definition at line 2160 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static const char* vppcom_session_state_str ( session_state_t  state)
static

Definition at line 191 of file vppcom.c.

+ Here is the caller graph for this function:

static int vppcom_session_unbind ( u32  session_index)
static

Definition at line 1227 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_session_unbind_cut_thru ( session_t session)
static

Definition at line 1210 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vppcom_session_write ( uint32_t  session_index,
void *  buf,
int  n 
)

Definition at line 2194 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_session_write_ready ( session_t session,
u32  session_index 
)
inlinestatic

Definition at line 2276 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_wait_for_app_state_change ( app_state_t  app_state)
inlinestatic

Definition at line 304 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_wait_for_client_session_index ( f64  wait_for_time)
inlinestatic

Definition at line 355 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vppcom_wait_for_session_state_change ( u32  session_index,
session_state_t  state,
f64  wait_for_time 
)
inlinestatic

Definition at line 321 of file vppcom.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

vppcom_main_t vppcom_main = {.my_client_index = ~0 }

Definition at line 157 of file vppcom.c.