21 #include <sys/types.h> 22 #include <sys/socket.h> 25 #include <netinet/in.h> 29 #include <sys/timeb.h> 55 #define M_NOALLOC(T,t) \ 58 clib_memset (mp, 0, sizeof (*mp)); \ 59 mp->_vl_msg_id = ntohs (VL_API_##T); \ 60 mp->client_index = am->my_client_index; \ 79 printf(
"Connect failed: %d\n", rv);
97 printf(
"Connect failed: %d\n", rv);
100 struct timeb timer_msec;
101 long long int timestamp_msec_start;
102 if (!ftime(&timer_msec)) {
103 timestamp_msec_start = ((
long long int) timer_msec.time) * 1000ll +
104 (
long long int) timer_msec.millitm;
107 timestamp_msec_start = -1;
116 long int no_msgs = 10000;
119 for (i = 0; i < no_msgs; i++) {
139 long long int timestamp_msec_end;
140 if (!ftime(&timer_msec)) {
141 timestamp_msec_end = ((
long long int) timer_msec.time) * 1000ll +
142 (
long long int) timer_msec.millitm;
145 timestamp_msec_end = -1;
148 printf(
"Took %lld msec, %lld msgs/msec \n", (timestamp_msec_end - timestamp_msec_start),
149 no_msgs/(timestamp_msec_end - timestamp_msec_start));
150 printf(
"Exiting...\n");
154 int main (
int argc,
char ** argv)
158 for (i = 0; i < 1000; i++) {
Control ping from client to api server request.
static void test_connect()
void wrap_vac_callback(unsigned char *data, int len)
int vac_write(char *p, int l)
volatile u16 result_msg_id
volatile u32 result_ready
int vac_connect(char *name, char *chroot_prefix, vac_callback_t cb, int rx_qlen)
API main structure, used by both vpp and binary API clients.
static void test_messages(void)
vlib_main_t ** vlib_mains
volatile int sigterm_received
static api_main_t * vlibapi_get_main(void)
vlib_main_t vlib_global_main