summaryrefslogtreecommitdiffstats
path: root/src/vlibapi
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2021-07-23 22:03:05 +0000
committerOle Tr�an <otroan@employees.org>2021-10-18 07:03:12 +0000
commitf0e67d78ae23ff3d5751ea10e9e76cb6e81ba4a5 (patch)
treec63b1ac48809a7247bb288e01d5c9cdfb6038b7c /src/vlibapi
parent2e55823af6c1cc6856e4a1f2cea659170bd76fb7 (diff)
interface: add api test file
Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ib07029204ecf12bf2adb5a39afa54bc98fb81f34
Diffstat (limited to 'src/vlibapi')
-rw-r--r--src/vlibapi/vat_helper_macros.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h
index 2e1b9422bf7..1dd597cce96 100644
--- a/src/vlibapi/vat_helper_macros.h
+++ b/src/vlibapi/vat_helper_macros.h
@@ -65,13 +65,16 @@ do { \
#define PING(_tm, mp_ping) \
do \
{ \
- if (!(_tm)->ping_id) \
- (_tm)->ping_id = \
- vl_msg_api_get_msg_index ((u8 *) (VL_API_CONTROL_PING_CRC)); \
- mp_ping = vl_msg_api_alloc_as_if_client (sizeof (*mp_ping)); \
- mp_ping->_vl_msg_id = htons ((_tm)->ping_id); \
+ 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);