FD.io VPP  v19.08.3-2-gbabecb413
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_thread_data_t
 
struct  memif_connection_t
 

Macros

#define APP_NAME   "ICMP_Responder"
 
#define IF_NAME   "memif_connection"
 
#define DBG(...)
 
#define INFO(...)
 
#define MAX_MEMIF_BUFS   256
 
#define MAX_CONNS   50
 
#define MAX_QUEUES   2
 
#define MAX_THREADS   ((MAX_CONNS) * (MAX_QUEUES))
 

Functions

void user_signal_handler (int sig)
 
static void print_memif_details ()
 
int add_epoll_fd (int epfd, int fd, uint32_t events)
 
int mod_epoll_fd (int epfd, int fd, uint32_t events)
 
int del_epoll_fd (int epfd, int fd)
 
void * memif_rx_poll (void *ptr)
 
void * memif_rx_interrupt (void *ptr)
 
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 icmpr_memif_create (long index)
 
int icmpr_memif_delete (long index)
 
void print_help ()
 
int icmpr_free ()
 
int icmpr_set_ip (long index, char *ip)
 
int user_input_handler ()
 
int poll_event (int timeout)
 
int main ()
 

Variables

int main_epfd
 
memif_connection_t memif_connection [MAX_CONNS]
 
long ctx [MAX_CONNS]
 
memif_thread_data_t thread_data [MAX_THREADS]
 
pthread_t thread [MAX_THREADS]
 

Macro Definition Documentation

◆ APP_NAME

#define APP_NAME   "ICMP_Responder"

Definition at line 51 of file main.c.

◆ DBG

#define DBG (   ...)

Definition at line 62 of file main.c.

◆ IF_NAME

#define IF_NAME   "memif_connection"

Definition at line 52 of file main.c.

◆ INFO

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

Definition at line 65 of file main.c.

◆ MAX_CONNS

#define MAX_CONNS   50

Definition at line 72 of file main.c.

◆ MAX_MEMIF_BUFS

#define MAX_MEMIF_BUFS   256

Definition at line 71 of file main.c.

◆ MAX_QUEUES

#define MAX_QUEUES   2

Definition at line 73 of file main.c.

◆ MAX_THREADS

#define MAX_THREADS   ((MAX_CONNS) * (MAX_QUEUES))

Definition at line 74 of file main.c.

Function Documentation

◆ add_epoll_fd()

int add_epoll_fd ( int  epfd,
int  fd,
uint32_t  events 
)

Definition at line 207 of file main.c.

◆ control_fd_update()

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

Definition at line 568 of file main.c.

+ Here is the call graph for this function:

◆ del_epoll_fd()

int del_epoll_fd ( int  epfd,
int  fd 
)

Definition at line 249 of file main.c.

◆ icmpr_free()

int icmpr_free ( )

Definition at line 684 of file main.c.

+ Here is the call graph for this function:

◆ icmpr_memif_create()

int icmpr_memif_create ( long  index)

Definition at line 587 of file main.c.

+ Here is the call graph for this function:

◆ icmpr_memif_delete()

int icmpr_memif_delete ( long  index)

Definition at line 637 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 704 of file main.c.

◆ main()

int main ( )

Definition at line 882 of file main.c.

+ Here is the call graph for this function:

◆ memif_rx_interrupt()

void* memif_rx_interrupt ( void *  ptr)

Definition at line 371 of file main.c.

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

◆ memif_rx_poll()

void* memif_rx_poll ( void *  ptr)

Definition at line 268 of file main.c.

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

◆ mod_epoll_fd()

int mod_epoll_fd ( int  epfd,
int  fd,
uint32_t  events 
)

Definition at line 228 of file main.c.

◆ on_connect()

int on_connect ( memif_conn_handle_t  conn,
void *  private_ctx 
)

Definition at line 504 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 544 of file main.c.

◆ poll_event()

int poll_event ( int  timeout)

Definition at line 827 of file main.c.

+ Here is the call graph for this function:

◆ print_help()

void print_help ( )

Definition at line 660 of file main.c.

+ Here is the call graph for this function:

◆ print_memif_details()

static void print_memif_details ( )
static

Definition at line 118 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 763 of file main.c.

+ Here is the call graph for this function:

◆ user_signal_handler()

void user_signal_handler ( int  sig)

Definition at line 113 of file main.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ ctx

long ctx[MAX_CONNS]

Definition at line 106 of file main.c.

◆ main_epfd

int main_epfd

Definition at line 76 of file main.c.

◆ memif_connection

Definition at line 105 of file main.c.

◆ thread

pthread_t thread[MAX_THREADS]

Definition at line 110 of file main.c.

◆ thread_data

Definition at line 109 of file main.c.