Convert message macro S to accept a message pointer parameter;

Rather than blindly assume an unbound, fixed message parameter
explicilty pass it as a paramter to the S() macro.

Change-Id: Ieea1f1815cadd2eec7d9240408d69acdc3caa49a
Signed-off-by: Jon Loeliger <jdl@netgate.com>
This commit is contained in:
Jon Loeliger
2017-01-31 14:03:33 -06:00
committed by Dave Barach
parent 614e97d87b
commit 7bc770ceb6
13 changed files with 295 additions and 284 deletions

View File

@ -128,7 +128,7 @@ do { \\
} while(0);
/* S: send a message */
#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
#define S(mp) (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
/* W: wait for results, with timeout */
#define W \\
@ -175,7 +175,7 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam)
mp->enable_disable = enable_disable;
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;

View File

@ -122,7 +122,7 @@ static int api_sample_macswap_enable_disable (vat_main_t * vam)
mp->enable_disable = enable_disable;
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;

View File

@ -276,7 +276,7 @@ static int api_acl_plugin_get_version (vat_main_t * vam)
mp->client_index = vam->my_client_index;
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -298,7 +298,7 @@ static int api_macip_acl_interface_get (vat_main_t * vam)
mp->client_index = vam->my_client_index;
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -479,7 +479,7 @@ static int api_acl_add_replace (vat_main_t * vam)
mp->count = htonl(n_rules);
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -502,7 +502,7 @@ static int api_acl_del (vat_main_t * vam)
mp->acl_index = ntohl(acl_index);
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -525,7 +525,7 @@ static int api_macip_acl_del (vat_main_t * vam)
mp->acl_index = ntohl(acl_index);
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -592,7 +592,7 @@ static int api_acl_interface_add_del (vat_main_t * vam)
mp->is_input = is_input;
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -642,7 +642,7 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam)
mp->is_add = is_add;
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -699,7 +699,7 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam)
clib_memcpy(mp->acls, inacls, vec_len(inacls)*sizeof(u32));
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -728,7 +728,7 @@ static int api_acl_interface_list_dump (vat_main_t * vam)
mp->sw_if_index = ntohl (sw_if_index);
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -754,7 +754,7 @@ static int api_acl_dump (vat_main_t * vam)
mp->acl_index = ntohl (acl_index);
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -780,7 +780,7 @@ static int api_macip_acl_dump (vat_main_t * vam)
mp->acl_index = ntohl (acl_index);
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;
@ -912,7 +912,7 @@ static int api_macip_acl_add (vat_main_t * vam)
mp->count = htonl(n_rules);
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;

View File

@ -129,7 +129,7 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam)
mp->which = which;
/* send it... */
S;
S (mp);
/* Wait for a reply... */
W;

View File

@ -110,7 +110,7 @@ api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam)
mp->is_disable = is_disable;
/* send it... */
S;
S (mp);
/* Wait for a reply... */
W;

View File

@ -112,7 +112,7 @@ api_ioam_export_ip6_enable_disable (vat_main_t * vam)
mp->is_disable = is_disable;
/* send it... */
S;
S(mp);
/* Wait for a reply... */
W;

View File

@ -188,7 +188,8 @@ static int api_pot_profile_add (vat_main_t *vam)
mp->id = id;
mp->max_bits = bits;
S; W;
S(mp);
W;
OUT:
vec_free(name);
@ -228,7 +229,8 @@ static int api_pot_profile_activate (vat_main_t *vam)
clib_memcpy(mp->list_name, name, mp->list_name_len);
mp->id = id;
S; W;
S(mp);
W;
OUT:
vec_free(name);
@ -243,7 +245,8 @@ static int api_pot_profile_del (vat_main_t *vam)
M(POT_PROFILE_DEL, mp);
mp->list_name_len = 0;
S; W;
S(mp);
W;
return 0;
}
@ -264,7 +267,8 @@ static int api_pot_profile_show_config_dump (vat_main_t *vam)
mp->id = id;
S; W;
S(mp);
W;
return 0;
}

View File

@ -157,7 +157,7 @@ api_trace_profile_add (vat_main_t * vam)
mp->app_data = htonl (app_data);
mp->num_elts = num_elts;
S;
S (mp);
W;
return (rv);
@ -172,7 +172,7 @@ api_trace_profile_del (vat_main_t * vam)
f64 timeout;
M (TRACE_PROFILE_DEL, mp);
S;
S (mp);
W;
return 0;
}
@ -183,7 +183,7 @@ api_trace_profile_show_config (vat_main_t * vam)
vl_api_trace_profile_show_config_t *mp;
f64 timeout;
M (TRACE_PROFILE_SHOW_CONFIG, mp);
S;
S (mp);
W;
return 0;
}

View File

@ -132,7 +132,7 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam)
mp->trace_enable = has_trace_option;
S;
S (mp);
W;
return (0);
@ -146,7 +146,7 @@ api_vxlan_gpe_ioam_disable (vat_main_t * vam)
f64 timeout;
M (VXLAN_GPE_IOAM_DISABLE, mp);
S;
S (mp);
W;
return 0;
}
@ -240,7 +240,7 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam)
mp->vni = ntohl (vni);
mp->is_ipv6 = ipv6_set;
S;
S (mp);
W;
return (0);
@ -335,7 +335,7 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam)
mp->vni = ntohl (vni);
mp->is_ipv6 = ipv6_set;
S;
S (mp);
W;
return 0;
@ -405,7 +405,7 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam)
mp->outer_fib_index = htonl (outer_fib_index);
mp->is_ipv6 = ipv6_set;
S;
S (mp);
W;
return (0);
@ -474,7 +474,7 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam)
mp->outer_fib_index = htonl (outer_fib_index);
mp->is_ipv6 = ipv6_set;
S;
S (mp);
W;

View File

@ -146,7 +146,7 @@ static int api_lb_conf (vat_main_t * vam)
}
M(LB_CONF, mp);
S;
S(mp);
W;
/* NOTREACHED */
@ -186,7 +186,7 @@ static int api_lb_add_del_vip (vat_main_t * vam)
}
M(LB_ADD_DEL_VIP, mp);
S;
S(mp);
W;
/* NOTREACHED */
return 0;
@ -211,7 +211,7 @@ static int api_lb_add_del_as (vat_main_t * vam)
}
M(LB_ADD_DEL_AS, mp);
S;
S(mp);
W;
/* NOTREACHED */
return 0;

View File

@ -159,7 +159,8 @@ static int api_snat_add_address_range (vat_main_t * vam)
mp->is_ip4 = 1;
mp->is_add = is_add;
S; W;
S(mp);
W;
/* NOTREACHED */
return 0;
@ -205,7 +206,8 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam)
mp->is_add = is_add;
mp->is_inside = is_inside;
S; W;
S(mp);
W;
/* NOTREACHED */
return 0;
}
@ -273,7 +275,8 @@ static int api_snat_add_static_mapping(vat_main_t * vam)
memcpy (mp->local_ip_address, &local_addr, 4);
memcpy (mp->external_ip_address, &external_addr, 4);
S; W;
S(mp);
W;
/* NOTREACHED */
return 0;
}
@ -331,12 +334,12 @@ static int api_snat_static_mapping_dump(vat_main_t * vam)
"port", "vrf");
M(SNAT_STATIC_MAPPING_DUMP, mp);
S;
S(mp);
/* Use a control ping for synchronization */
{
vl_api_snat_control_ping_t *mp;
M(SNAT_CONTROL_PING, mp);
S;
S(mp);
}
W;
/* NOTREACHED */
@ -386,7 +389,8 @@ static int api_snat_show_config(vat_main_t * vam)
}
M(SNAT_SHOW_CONFIG, mp);
S; W;
S(mp);
W;
/* NOTREACHED */
return 0;
}
@ -412,12 +416,12 @@ static int api_snat_address_dump(vat_main_t * vam)
}
M(SNAT_ADDRESS_DUMP, mp);
S;
S(mp);
/* Use a control ping for synchronization */
{
vl_api_snat_control_ping_t *mp;
M(SNAT_CONTROL_PING, mp);
S;
S(mp);
}
W;
/* NOTREACHED */
@ -446,12 +450,12 @@ static int api_snat_interface_dump(vat_main_t * vam)
}
M(SNAT_INTERFACE_DUMP, mp);
S;
S(mp);
/* Use a control ping for synchronization */
{
vl_api_snat_control_ping_t *mp;
M(SNAT_CONTROL_PING, mp);
S;
S(mp);
}
W;
/* NOTREACHED */
@ -479,7 +483,8 @@ static int api_snat_set_workers (vat_main_t * vam)
M(SNAT_SET_WORKERS, mp);
mp->worker_mask = clib_host_to_net_u64 (bitmap[0]);
S; W;
S(mp);
W;
/* NOTREACHED */
return 0;
@ -507,12 +512,12 @@ static int api_snat_worker_dump(vat_main_t * vam)
}
M(SNAT_WORKER_DUMP, mp);
S;
S(mp);
/* Use a control ping for synchronization */
{
vl_api_snat_control_ping_t *mp;
M(SNAT_CONTROL_PING, mp);
S;
S(mp);
}
W;
/* NOTREACHED */
@ -553,7 +558,8 @@ static int api_snat_ipfix_enable_disable (vat_main_t * vam)
mp->sw_if_index = ntohl(sw_if_index);
mp->is_add = is_add;
S; W;
S(mp);
W;
/* NOTREACHED */
return 0;
}
@ -579,12 +585,12 @@ static int api_snat_interface_addr_dump(vat_main_t * vam)
}
M(SNAT_INTERFACE_ADDR_DUMP, mp);
S;
S(mp);
/* Use a control ping for synchronization */
{
vl_api_snat_control_ping_t *mp;
M(SNAT_CONTROL_PING, mp);
S;
S(mp);
}
W;
/* NOTREACHED */
@ -620,7 +626,8 @@ static int api_snat_add_del_interface_addr (vat_main_t * vam)
mp->src_port = htons((u16) src_port);
mp->enable = enable;
S; W;
S(mp);
W;
/* NOTREACHED */
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ do { \
} while(0);
/* S: send a message */
#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
#define S(mp) (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
/* W: wait for results, with timeout */
#define W \