FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
main.c File Reference
+ Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  memif_connection_t
 
struct  icmpr_thread_data_t
 

Macros

#define APP_NAME   "ICMP_Responder"
 
#define IF_NAME   "memif_connection"
 
#define DBG(...)
 
#define LOG(...)
 
#define INFO(...)
 
#define MAX_MEMIF_BUFS   256
 
#define MAX_CONNS   50
 

Functions

static void print_memif_details ()
 
int add_epoll_fd (int fd, uint32_t events)
 
int mod_epoll_fd (int fd, uint32_t events)
 
int del_epoll_fd (int fd)
 
int on_connect (memif_conn_handle_t conn, void *private_ctx)
 
int on_disconnect (memif_conn_handle_t conn, void *private_ctx)
 
int control_fd_update (int fd, uint8_t events)
 
int icmpr_buffer_alloc (long index, long n, uint16_t *r, uint16_t i, uint16_t qid)
 
int icmpr_tx_burst (long index, uint16_t qid)
 
int on_interrupt (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
 
int on_interrupt0 (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
 
int on_interrupt1 (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
 
int icmpr_memif_create (long index, long mode, char *s)
 
int icmpr_memif_delete (long index)
 
void print_help ()
 
int icmpr_free ()
 
int icmpr_set_ip (long index, char *ip)
 
int icmpr_set_rx_mode (long index, long qid, char *mode)
 
void icmpr_print_counters ()
 
void icmpr_reset_counters ()
 
void * icmpr_send_proc (void *data)
 
int icmpr_send (long index, long packet_num, char *hw, char *ip)
 
int user_input_handler ()
 
int poll_event (int timeout)
 
int main ()
 

Variables

int epfd
 
int out_fd
 
uint8_t enable_log
 
memif_connection_t memif_connection [MAX_CONNS]
 
icmpr_thread_data_t icmpr_thread_data [MAX_CONNS]
 
pthread_t thread [MAX_CONNS]
 
long ctx [MAX_CONNS]
 

Macro Definition Documentation

#define APP_NAME   "ICMP_Responder"

Definition at line 53 of file main.c.

#define DBG (   ...)

Definition at line 71 of file main.c.

#define IF_NAME   "memif_connection"

Definition at line 54 of file main.c.

#define INFO (   ...)
Value:
do { \
printf ("INFO: "__VA_ARGS__); \
printf ("\n"); \
} while (0)

Definition at line 75 of file main.c.

#define LOG (   ...)

Definition at line 72 of file main.c.

#define MAX_CONNS   50

Definition at line 83 of file main.c.

#define MAX_MEMIF_BUFS   256

Definition at line 82 of file main.c.

Function Documentation

int add_epoll_fd ( int  fd,
uint32_t  events 
)

Definition at line 215 of file main.c.

+ Here is the caller graph for this function:

int control_fd_update ( int  fd,
uint8_t  events 
)

Definition at line 297 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int del_epoll_fd ( int  fd)

Definition at line 257 of file main.c.

+ Here is the caller graph for this function:

int icmpr_buffer_alloc ( long  index,
long  n,
uint16_t *  r,
uint16_t  i,
uint16_t  qid 
)

Definition at line 316 of file main.c.

+ Here is the call graph for this function:

int icmpr_free ( )

Definition at line 799 of file main.c.

+ Here is the call graph for this function:

int icmpr_memif_create ( long  index,
long  mode,
char *  s 
)

Definition at line 637 of file main.c.

+ Here is the call graph for this function:

int icmpr_memif_delete ( long  index)

Definition at line 735 of file main.c.

+ Here is the call graph for this function:

void icmpr_print_counters ( )

Definition at line 915 of file main.c.

+ Here is the caller graph for this function:

void icmpr_reset_counters ( )

Definition at line 933 of file main.c.

+ Here is the caller graph for this function:

int icmpr_send ( long  index,
long  packet_num,
char *  hw,
char *  ip 
)

Definition at line 1036 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* icmpr_send_proc ( void *  data)

Definition at line 947 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int icmpr_set_ip ( long  index,
char *  ip 
)

Definition at line 822 of file main.c.

+ Here is the caller graph for this function:

int icmpr_set_rx_mode ( long  index,
long  qid,
char *  mode 
)

Definition at line 880 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int icmpr_tx_burst ( long  index,
uint16_t  qid 
)

Definition at line 335 of file main.c.

+ Here is the call graph for this function:

int main ( )

Definition at line 1297 of file main.c.

+ Here is the call graph for this function:

int mod_epoll_fd ( int  fd,
uint32_t  events 
)

Definition at line 236 of file main.c.

+ Here is the caller graph for this function:

int on_connect ( memif_conn_handle_t  conn,
void *  private_ctx 
)

Definition at line 278 of file main.c.

int on_disconnect ( memif_conn_handle_t  conn,
void *  private_ctx 
)

Definition at line 288 of file main.c.

int on_interrupt ( memif_conn_handle_t  conn,
void *  private_ctx,
uint16_t  qid 
)

Definition at line 353 of file main.c.

+ Here is the call graph for this function:

int on_interrupt0 ( memif_conn_handle_t  conn,
void *  private_ctx,
uint16_t  qid 
)

Definition at line 458 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int on_interrupt1 ( memif_conn_handle_t  conn,
void *  private_ctx,
uint16_t  qid 
)

Definition at line 571 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int poll_event ( int  timeout)

Definition at line 1235 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void print_help ( )

Definition at line 769 of file main.c.

static void print_memif_details ( )
static

Definition at line 126 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int user_input_handler ( )

Definition at line 1118 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

long ctx[MAX_CONNS]

Definition at line 122 of file main.c.

uint8_t enable_log

Definition at line 87 of file main.c.

int epfd

Definition at line 85 of file main.c.

icmpr_thread_data_t icmpr_thread_data[MAX_CONNS]

Definition at line 120 of file main.c.

Definition at line 119 of file main.c.

int out_fd

Definition at line 86 of file main.c.

pthread_t thread[MAX_CONNS]

Definition at line 121 of file main.c.