FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
socket.h File Reference
+ Include dependency graph for socket.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CLIB_SOCKET_F_IS_SERVER   (1 << 0)
 
#define CLIB_SOCKET_F_IS_CLIENT   (0 << 0)
 
#define CLIB_SOCKET_F_RX_END_OF_FILE   (1 << 2)
 
#define CLIB_SOCKET_F_NON_BLOCKING_CONNECT   (1 << 3)
 
#define CLIB_SOCKET_F_ALLOW_GROUP_WRITE   (1 << 4)
 
#define CLIB_SOCKET_F_SEQPACKET   (1 << 5)
 
#define CLIB_SOCKET_F_PASSCRED   (1 << 6)
 

Typedefs

typedef struct _socket_t clib_socket_t
 

Functions

clib_error_tclib_socket_init (clib_socket_t *socket)
 
clib_error_tclib_socket_accept (clib_socket_t *server, clib_socket_t *client)
 
static uword clib_socket_is_server (clib_socket_t *sock)
 
static uword clib_socket_is_client (clib_socket_t *s)
 
static uword clib_socket_is_connected (clib_socket_t *sock)
 
static int clib_socket_rx_end_of_file (clib_socket_t *s)
 
static void * clib_socket_tx_add (clib_socket_t *s, int n_bytes)
 
static void clib_socket_tx_add_va_formatted (clib_socket_t *s, char *fmt, va_list *va)
 
static clib_error_tclib_socket_tx (clib_socket_t *s)
 
static clib_error_tclib_socket_rx (clib_socket_t *s, int n_bytes)
 
static clib_error_tclib_socket_sendmsg (clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
 
static clib_error_tclib_socket_recvmsg (clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
 
static void clib_socket_free (clib_socket_t *s)
 
static clib_error_tclib_socket_close (clib_socket_t *sock)
 
void clib_socket_tx_add_formatted (clib_socket_t *s, char *fmt,...)
 

Macro Definition Documentation

◆ CLIB_SOCKET_F_ALLOW_GROUP_WRITE

#define CLIB_SOCKET_F_ALLOW_GROUP_WRITE   (1 << 4)

Definition at line 62 of file socket.h.

◆ CLIB_SOCKET_F_IS_CLIENT

#define CLIB_SOCKET_F_IS_CLIENT   (0 << 0)

Definition at line 59 of file socket.h.

◆ CLIB_SOCKET_F_IS_SERVER

#define CLIB_SOCKET_F_IS_SERVER   (1 << 0)

Definition at line 58 of file socket.h.

◆ CLIB_SOCKET_F_NON_BLOCKING_CONNECT

#define CLIB_SOCKET_F_NON_BLOCKING_CONNECT   (1 << 3)

Definition at line 61 of file socket.h.

◆ CLIB_SOCKET_F_PASSCRED

#define CLIB_SOCKET_F_PASSCRED   (1 << 6)

Definition at line 64 of file socket.h.

◆ CLIB_SOCKET_F_RX_END_OF_FILE

#define CLIB_SOCKET_F_RX_END_OF_FILE   (1 << 2)

Definition at line 60 of file socket.h.

◆ CLIB_SOCKET_F_SEQPACKET

#define CLIB_SOCKET_F_SEQPACKET   (1 << 5)

Definition at line 63 of file socket.h.

Typedef Documentation

◆ clib_socket_t

typedef struct _socket_t clib_socket_t

Function Documentation

◆ clib_socket_accept()

clib_error_t* clib_socket_accept ( clib_socket_t server,
clib_socket_t client 
)

Definition at line 526 of file socket.c.

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

◆ clib_socket_close()

static clib_error_t* clib_socket_close ( clib_socket_t sock)
inlinestatic

Definition at line 175 of file socket.h.

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

◆ clib_socket_free()

static void clib_socket_free ( clib_socket_t s)
inlinestatic

Definition at line 165 of file socket.h.

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

◆ clib_socket_init()

clib_error_t* clib_socket_init ( clib_socket_t socket)

Definition at line 384 of file socket.c.

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

◆ clib_socket_is_client()

static uword clib_socket_is_client ( clib_socket_t s)
inlinestatic

Definition at line 106 of file socket.h.

+ Here is the call graph for this function:

◆ clib_socket_is_connected()

static uword clib_socket_is_connected ( clib_socket_t sock)
inlinestatic

Definition at line 112 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_is_server()

static uword clib_socket_is_server ( clib_socket_t sock)
inlinestatic

Definition at line 100 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_recvmsg()

static clib_error_t* clib_socket_recvmsg ( clib_socket_t s,
void *  msg,
int  msglen,
int  fds[],
int  num_fds 
)
inlinestatic

Definition at line 158 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_rx()

static clib_error_t* clib_socket_rx ( clib_socket_t s,
int  n_bytes 
)
inlinestatic

Definition at line 145 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_rx_end_of_file()

static int clib_socket_rx_end_of_file ( clib_socket_t s)
inlinestatic

Definition at line 119 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_sendmsg()

static clib_error_t* clib_socket_sendmsg ( clib_socket_t s,
void *  msg,
int  msglen,
int  fds[],
int  num_fds 
)
inlinestatic

Definition at line 151 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_tx()

static clib_error_t* clib_socket_tx ( clib_socket_t s)
inlinestatic

Definition at line 139 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_tx_add()

static void* clib_socket_tx_add ( clib_socket_t s,
int  n_bytes 
)
inlinestatic

Definition at line 125 of file socket.h.

+ Here is the caller graph for this function:

◆ clib_socket_tx_add_formatted()

void clib_socket_tx_add_formatted ( clib_socket_t s,
char *  fmt,
  ... 
)

Definition at line 58 of file socket.c.

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

◆ clib_socket_tx_add_va_formatted()

static void clib_socket_tx_add_va_formatted ( clib_socket_t s,
char *  fmt,
va_list *  va 
)
inlinestatic

Definition at line 133 of file socket.h.

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