X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlibapi%2Fvat_helper_macros.h;h=1dd597cce966aaf58ca68f547db983b9dbb0d7d9;hb=b3559cef7759e323c2a495c0613124058ed652d2;hp=239e2091dc1ddb1c7b1147b098da43379eb9215b;hpb=69eeadc03f30c9fb3fe1bb7e2eeb6b04d1bcc596;p=vpp.git diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h index 239e2091dc1..1dd597cce96 100644 --- a/src/vlibapi/vat_helper_macros.h +++ b/src/vlibapi/vat_helper_macros.h @@ -62,6 +62,22 @@ do { \ mp->client_index = vam->my_client_index; \ } while(0); +#define PING(_tm, mp_ping) \ + do \ + { \ + socket_client_main_t *scm = vam->socket_client_main; \ + if (scm && scm->socket_enable) \ + mp_ping = vl_socket_client_msg_alloc (sizeof (*mp_ping)); \ + else \ + mp_ping = vl_msg_api_alloc_as_if_client (sizeof (*mp_ping)); \ + mp_ping->_vl_msg_id = htons (VL_API_CONTROL_PING + 1); \ + mp_ping->client_index = vam->my_client_index; \ + vam->result_ready = 0; \ + if (scm) \ + scm->control_pings_outstanding++; \ + } \ + while (0); + /* S: send a message */ #define S(mp) \ do { \