22 #include <sys/types.h> 23 #include <sys/socket.h> 26 #include <netinet/in.h> 54 #define M_NOALLOC(T,t) \ 57 clib_memset (mp, 0, sizeof (*mp)); \ 58 mp->_vl_msg_id = ntohs (VL_API_##T); \ 59 mp->client_index = am->my_client_index; \ 77 printf(
"Connect failed: %d\n", rv);
95 printf(
"Connect failed: %d\n", rv);
106 long int no_msgs = 10000;
109 for (i = 0; i < no_msgs; i++) {
130 printf(
"\nTook %.2f msec, %.0f msgs/msec \n", (timestamp_end - timestamp_start),
131 no_msgs/(timestamp_end - timestamp_start));
132 printf(
"Exiting...\n");
155 for (i = 0; i <
vec_len (res); i++) {
156 switch (res[i].
type) {
158 if (res[i].name_vector == 0)
160 for (k = 0; k <
vec_len (res[i].name_vector); k++)
161 if (res[i].name_vector[k])
162 fformat (stdout,
"[%d]: %s %s\n", k, res[i].name_vector[k],
166 for (j = 0; j <
vec_len (res[i].error_vector); j++)
167 fformat (stdout,
"%llu %s\n", res[i].error_vector[j],
183 printf(
"%s", leak_report);
188 int main (
int argc,
char ** argv)
195 for (i = 0; i < 1000; i++) {
int stat_segment_connect(const char *socket_name)
Control ping from client to api server request.
void stat_segment_data_free(stat_segment_data_t *res)
void * clib_mem_init(void *base, uword size)
static void test_connect()
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void wrap_vac_callback(unsigned char *data, int len)
int vac_write(char *p, int l)
static void test_stats(void)
description fragment has unexpected format
volatile u16 result_msg_id
uword clib_mem_trace_enable_disable(uword enable)
volatile u32 result_ready
vl_api_fib_path_type_t type
int vac_connect(char *name, char *chroot_prefix, vac_callback_t cb, int rx_qlen)
void stat_segment_disconnect(void)
API main structure, used by both vpp and binary API clients.
#define STAT_SEGMENT_SOCKET_FILE
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
static void test_messages(void)
static u64 unix_time_now_nsec(void)
uint32_t * stat_segment_ls(uint8_t **patterns)
u8 * format_clib_mem_heap(u8 *s, va_list *va)
stat_segment_data_t * stat_segment_dump(uint32_t *stats)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_main_t ** vlib_mains
volatile int sigterm_received
static api_main_t * vlibapi_get_main(void)
vlib_main_t vlib_global_main
void clib_mem_trace(int enable)