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 memset (mp, 0, sizeof (*mp)); \ 59 mp->_vl_msg_id = ntohs (VL_API_##T); \ 60 mp->client_index = am->my_client_index; \ 74 int main (
int argc,
char ** argv)
83 printf(
"Connect failed: %d\n", rv);
87 struct timeb timer_msec;
88 long long int timestamp_msec_start;
89 if (!ftime(&timer_msec)) {
90 timestamp_msec_start = ((
long long int) timer_msec.time) * 1000ll +
91 (
long long int) timer_msec.millitm;
94 timestamp_msec_start = -1;
103 long int no_msgs = 10000;
106 for (i = 0; i < no_msgs; i++) {
126 long long int timestamp_msec_end;
127 if (!ftime(&timer_msec)) {
128 timestamp_msec_end = ((
long long int) timer_msec.time) * 1000ll +
129 (
long long int) timer_msec.millitm;
132 timestamp_msec_end = -1;
135 printf(
"Took %lld msec, %lld msgs/msec \n", (timestamp_msec_end - timestamp_msec_start),
136 no_msgs/(timestamp_msec_end - timestamp_msec_start));
137 printf(
"Exiting...\n");
Control ping from client to api server request.
int vac_write(char *p, int l)
int wrap_vac_callback(char *data, int len)
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.
vlib_main_t ** vlib_mains
volatile int sigterm_received
vlib_main_t vlib_global_main