FD.io VPP  v21.01
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_flow_t
 

Macros

#define APP_NAME   "ICMP_Responder"
 
#define IF_NAME   "memif_connection"
 
#define HEADROOM   0x80 /* 128b */
 
#define ENCAP   0x60
 
#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, void *ctx)
 
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 ()
 
int icmpr_send (long index, long packet_num, char *input)
 
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]
 
long ctx [MAX_CONNS]
 
icmpr_flow_tflow
 

Macro Definition Documentation

◆ APP_NAME

#define APP_NAME   "ICMP_Responder"

Definition at line 52 of file main.c.

◆ DBG

#define DBG (   ...)

Definition at line 72 of file main.c.

◆ ENCAP

#define ENCAP   0x60

Definition at line 56 of file main.c.

◆ HEADROOM

#define HEADROOM   0x80 /* 128b */

Definition at line 55 of file main.c.

◆ IF_NAME

#define IF_NAME   "memif_connection"

Definition at line 53 of file main.c.

◆ INFO

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

Definition at line 76 of file main.c.

◆ LOG

#define LOG (   ...)

Definition at line 73 of file main.c.

◆ MAX_CONNS

#define MAX_CONNS   50

Definition at line 84 of file main.c.

◆ MAX_MEMIF_BUFS

#define MAX_MEMIF_BUFS   256

Definition at line 83 of file main.c.

Function Documentation

◆ add_epoll_fd()

int add_epoll_fd ( int  fd,
uint32_t  events 
)

Definition at line 216 of file main.c.

◆ control_fd_update()

int control_fd_update ( int  fd,
uint8_t  events,
void *  ctx 
)

Definition at line 299 of file main.c.

+ Here is the call graph for this function:

◆ del_epoll_fd()

int del_epoll_fd ( int  fd)

Definition at line 258 of file main.c.

◆ icmpr_free()

int icmpr_free ( )

Definition at line 702 of file main.c.

+ Here is the call graph for this function:

◆ icmpr_memif_create()

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

Definition at line 546 of file main.c.

+ Here is the call graph for this function:

◆ icmpr_memif_delete()

int icmpr_memif_delete ( long  index)

Definition at line 640 of file main.c.

+ Here is the call graph for this function:

◆ icmpr_print_counters()

void icmpr_print_counters ( )

Definition at line 818 of file main.c.

◆ icmpr_reset_counters()

void icmpr_reset_counters ( )

Definition at line 836 of file main.c.

◆ icmpr_send()

int icmpr_send ( long  index,
long  packet_num,
char *  input 
)

Definition at line 942 of file main.c.

+ Here is the call graph for this function:

◆ icmpr_send_proc()

void icmpr_send_proc ( )

Definition at line 850 of file main.c.

+ Here is the call graph for this function:

◆ icmpr_set_ip()

int icmpr_set_ip ( long  index,
char *  ip 
)

Definition at line 725 of file main.c.

◆ icmpr_set_rx_mode()

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

Definition at line 783 of file main.c.

+ Here is the call graph for this function:

◆ main()

int main ( )

Definition at line 1221 of file main.c.

+ Here is the call graph for this function:

◆ mod_epoll_fd()

int mod_epoll_fd ( int  fd,
uint32_t  events 
)

Definition at line 237 of file main.c.

◆ on_connect()

int on_connect ( memif_conn_handle_t  conn,
void *  private_ctx 
)

Definition at line 279 of file main.c.

+ Here is the call graph for this function:

◆ on_disconnect()

int on_disconnect ( memif_conn_handle_t  conn,
void *  private_ctx 
)

Definition at line 290 of file main.c.

◆ on_interrupt()

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

Definition at line 321 of file main.c.

+ Here is the call graph for this function:

◆ on_interrupt0()

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

Definition at line 402 of file main.c.

+ Here is the call graph for this function:

◆ on_interrupt1()

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

Definition at line 483 of file main.c.

+ Here is the call graph for this function:

◆ poll_event()

int poll_event ( int  timeout)

Definition at line 1160 of file main.c.

+ Here is the call graph for this function:

◆ print_help()

void print_help ( )

Definition at line 671 of file main.c.

+ Here is the call graph for this function:

◆ print_memif_details()

static void print_memif_details ( )
static

Definition at line 127 of file main.c.

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

◆ user_input_handler()

int user_input_handler ( )

Definition at line 1045 of file main.c.

+ Here is the call graph for this function:

Variable Documentation

◆ ctx

long ctx[MAX_CONNS]

Definition at line 122 of file main.c.

◆ enable_log

uint8_t enable_log

Definition at line 88 of file main.c.

◆ epfd

int epfd

Definition at line 86 of file main.c.

◆ flow

Definition at line 123 of file main.c.

◆ memif_connection

Definition at line 121 of file main.c.

◆ out_fd

int out_fd

Definition at line 87 of file main.c.