FD.io VPP  v21.01.1
Vector Packet Processing
sock_test.h File Reference
+ Include dependency graph for sock_test.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SOCK_TEST_AF_UNIX_FILENAME   "/tmp/ldp_server_af_unix_socket"
 
#define SOCK_TEST_MIXED_EPOLL_DATA   "Hello, world! (over an AF_UNIX socket)"
 
#define SOCK_TEST_AF_UNIX_ACCEPT_DATA   0xaf0000af
 
#define SOCK_TEST_AF_UNIX_FD_MASK   0x00af0000
 
#define SOCK_TEST_BANNER_STRING   "============================================\n"
 
#define stinf(_fmt, _args...)   printf ("st: " _fmt "\n", ##_args)
 
#define stwrn(_fmt, _args...)   printf ("WARNING: " _fmt "\n", ##_args)
 
#define sterr(_fn, _rv)
 
#define stabrt(_fmt, _args...)
 
#define stfail(_fn)
 

Functions

static int sock_test_read (int fd, uint8_t *buf, uint32_t nbytes, vcl_test_stats_t *stats)
 
static int sock_test_write (int fd, uint8_t *buf, uint32_t nbytes, vcl_test_stats_t *stats, uint32_t verbose)
 

Macro Definition Documentation

◆ SOCK_TEST_AF_UNIX_ACCEPT_DATA

#define SOCK_TEST_AF_UNIX_ACCEPT_DATA   0xaf0000af

Definition at line 27 of file sock_test.h.

◆ SOCK_TEST_AF_UNIX_FD_MASK

#define SOCK_TEST_AF_UNIX_FD_MASK   0x00af0000

Definition at line 28 of file sock_test.h.

◆ SOCK_TEST_AF_UNIX_FILENAME

#define SOCK_TEST_AF_UNIX_FILENAME   "/tmp/ldp_server_af_unix_socket"

Definition at line 25 of file sock_test.h.

◆ SOCK_TEST_BANNER_STRING

#define SOCK_TEST_BANNER_STRING   "============================================\n"

Definition at line 29 of file sock_test.h.

◆ SOCK_TEST_MIXED_EPOLL_DATA

#define SOCK_TEST_MIXED_EPOLL_DATA   "Hello, world! (over an AF_UNIX socket)"

Definition at line 26 of file sock_test.h.

◆ stabrt

#define stabrt (   _fmt,
  _args... 
)
Value:
{ \
printf ("\nERROR: " _fmt "\n", ##_args); \
exit (1); \
}

Definition at line 41 of file sock_test.h.

◆ sterr

#define sterr (   _fn,
  _rv 
)
Value:
{ \
errno = -_rv; \
printf ("\nERROR: " _fn " failed (errno = %d)!\n", -_rv); \
}

Definition at line 36 of file sock_test.h.

◆ stfail

#define stfail (   _fn)
Value:
{ \
perror ("ERROR when calling " _fn); \
printf ("\nERROR: " _fn " failed (errno = %d)!\n", errno); \
exit (1); \
}

Definition at line 46 of file sock_test.h.

◆ stinf

#define stinf (   _fmt,
  _args... 
)    printf ("st: " _fmt "\n", ##_args)

Definition at line 32 of file sock_test.h.

◆ stwrn

#define stwrn (   _fmt,
  _args... 
)    printf ("WARNING: " _fmt "\n", ##_args)

Definition at line 34 of file sock_test.h.

Function Documentation

◆ sock_test_read()

static int sock_test_read ( int  fd,
uint8_t *  buf,
uint32_t  nbytes,
vcl_test_stats_t stats 
)
inlinestatic

Definition at line 54 of file sock_test.h.

+ Here is the caller graph for this function:

◆ sock_test_write()

static int sock_test_write ( int  fd,
uint8_t *  buf,
uint32_t  nbytes,
vcl_test_stats_t stats,
uint32_t  verbose 
)
inlinestatic

Definition at line 87 of file sock_test.h.

+ Here is the caller graph for this function: