From 2d23eca3e583cc3408d4fafc3aae6fe5b1109e55 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Wed, 1 Feb 2017 13:09:58 -0600 Subject: Remove unnecessary block structure around CONTROL_PING messages. Now that the M() and S() macros accept a message parameter, there is no longer a need to introduce a new block structure around the CONTROL_PING messages just to have a new unbound "mp" variable. Instead, just use one named "mp_ping" directly. Change-Id: I6b283562bb6eec25806e3d35c35b977680ecd1dd Signed-off-by: Jon Loeliger --- src/plugins/snat/snat_test.c | 50 ++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index 086059a3942..50e81eaec46 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -317,6 +317,7 @@ static void vl_api_snat_static_mapping_details_t_handler static int api_snat_static_mapping_dump(vat_main_t * vam) { vl_api_snat_static_mapping_dump_t * mp; + vl_api_snat_control_ping_t *mp_ping; int ret; if (vam->json_output) @@ -331,12 +332,11 @@ static int api_snat_static_mapping_dump(vat_main_t * vam) M(SNAT_STATIC_MAPPING_DUMP, mp); S(mp); + /* Use a control ping for synchronization */ - { - vl_api_snat_control_ping_t *mp; - M(SNAT_CONTROL_PING, mp); - S(mp); - } + M(SNAT_CONTROL_PING, mp_ping); + S(mp_ping); + W (ret); return ret; } @@ -401,6 +401,7 @@ static void vl_api_snat_address_details_t_handler static int api_snat_address_dump(vat_main_t * vam) { vl_api_snat_address_dump_t * mp; + vl_api_snat_control_ping_t *mp_ping; int ret; if (vam->json_output) @@ -411,12 +412,11 @@ static int api_snat_address_dump(vat_main_t * vam) M(SNAT_ADDRESS_DUMP, mp); S(mp); + /* Use a control ping for synchronization */ - { - vl_api_snat_control_ping_t *mp; - M(SNAT_CONTROL_PING, mp); - S(mp); - } + M(SNAT_CONTROL_PING, mp_ping); + S(mp_ping); + W (ret); return ret; } @@ -434,6 +434,7 @@ static void vl_api_snat_interface_details_t_handler static int api_snat_interface_dump(vat_main_t * vam) { vl_api_snat_interface_dump_t * mp; + vl_api_snat_control_ping_t *mp_ping; int ret; if (vam->json_output) @@ -444,12 +445,11 @@ static int api_snat_interface_dump(vat_main_t * vam) M(SNAT_INTERFACE_DUMP, mp); S(mp); + /* Use a control ping for synchronization */ - { - vl_api_snat_control_ping_t *mp; - M(SNAT_CONTROL_PING, mp); - S(mp); - } + M(SNAT_CONTROL_PING, mp_ping); + S(mp_ping); + W (ret); return ret; } @@ -493,6 +493,7 @@ static void vl_api_snat_worker_details_t_handler static int api_snat_worker_dump(vat_main_t * vam) { vl_api_snat_worker_dump_t * mp; + vl_api_snat_control_ping_t *mp_ping; int ret; if (vam->json_output) @@ -503,12 +504,11 @@ static int api_snat_worker_dump(vat_main_t * vam) M(SNAT_WORKER_DUMP, mp); S(mp); + /* Use a control ping for synchronization */ - { - vl_api_snat_control_ping_t *mp; - M(SNAT_CONTROL_PING, mp); - S(mp); - } + M(SNAT_CONTROL_PING, mp_ping); + S(mp_ping); + W (ret); return ret; } @@ -564,6 +564,7 @@ static void vl_api_snat_interface_addr_details_t_handler static int api_snat_interface_addr_dump(vat_main_t * vam) { vl_api_snat_interface_addr_dump_t * mp; + vl_api_snat_control_ping_t *mp_ping; int ret; if (vam->json_output) @@ -574,12 +575,11 @@ static int api_snat_interface_addr_dump(vat_main_t * vam) M(SNAT_INTERFACE_ADDR_DUMP, mp); S(mp); + /* Use a control ping for synchronization */ - { - vl_api_snat_control_ping_t *mp; - M(SNAT_CONTROL_PING, mp); - S(mp); - } + M(SNAT_CONTROL_PING, mp_ping); + S(mp_ping); + W (ret); return ret; } -- cgit 1.2.3-korg