aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/api/test_client.c
diff options
context:
space:
mode:
authorJon Loeliger <jdl@netgate.com>2017-02-23 13:57:35 -0600
committerJohn Lo <loj@cisco.com>2017-03-03 23:19:21 +0000
commitc83c3b7f117b981b677f646a0e30f44ec70de239 (patch)
tree323266bab831bcbfb14f089e803b7cbc13b857e1 /src/vpp/api/test_client.c
parenta084d62a6e47d3505b3ed314230598704314f7bc (diff)
Implement a loopback instance allocation scheme.
To support creating loopback interfaces with a specific instance number, a new CREATE_LOOPBACK_INSTANCE API call with flag is_specified and value user_instance is introduced. Presumably the existing CREATE_LOOPBACK API message will be obsoleted and revmoved. The VAT cli commands can now mention and format the new field as 'instance %d' data. If no instance number is named, the old call CREATE_LOOPBACK is used to maintain backward compatibility. However, if the instance is named, the new CREATE_LOOPBACK_INSTANCE message will be used. Both the dynamically allocated and user-requested instance number are tracked in a bitvector. If is_specified is 0, the next free instance will be used.. A request for a specific instance number will be granted if it is available. On error, the value ~0 is returned. Change-Id: I849815563a5da736dcd6bccd262ef49b963f6643 Signed-off-by: Jon Loeliger <jdl@netgate.com>
Diffstat (limited to 'src/vpp/api/test_client.c')
-rw-r--r--src/vpp/api/test_client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vpp/api/test_client.c b/src/vpp/api/test_client.c
index ceafc35788d..8b61f4f3a05 100644
--- a/src/vpp/api/test_client.c
+++ b/src/vpp/api/test_client.c
@@ -534,6 +534,13 @@ static void vl_api_create_loopback_reply_t_handler
ntohl (mp->retval), ntohl (mp->sw_if_index));
}
+static void vl_api_create_loopback_instance_reply_t_handler
+ (vl_api_create_loopback_instance_reply_t * mp)
+{
+ fformat (stdout, "create loopback status %d, sw_if_index %d\n",
+ ntohl (mp->retval), ntohl (mp->sw_if_index));
+}
+
static void
vl_api_sr_tunnel_add_del_reply_t_handler (vl_api_sr_tunnel_add_del_reply_t *
mp)
@@ -598,6 +605,7 @@ _(SW_INTERFACE_IP6ND_RA_PREFIX_REPLY, sw_interface_ip6nd_ra_prefix_reply) \
_(SW_INTERFACE_IP6_ENABLE_DISABLE_REPLY, sw_interface_ip6_enable_disable_reply) \
_(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS_REPLY, sw_interface_ip6_set_link_local_address_reply) \
_(CREATE_LOOPBACK_REPLY, create_loopback_reply) \
+ _(CREATE_LOOPBACK_INSTANCE_REPLY, create_loopback_instance_reply) \
_(L2_PATCH_ADD_DEL_REPLY, l2_patch_add_del_reply) \
_(SR_TUNNEL_ADD_DEL_REPLY,sr_tunnel_add_del_reply) \
_(SW_INTERFACE_SET_L2_XCONNECT_REPLY, sw_interface_set_l2_xconnect_reply) \