aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/api/vpe.api
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/vpe.api
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/vpe.api')
-rw-r--r--src/vpp/api/vpe.api28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/vpp/api/vpe.api b/src/vpp/api/vpe.api
index 7f9c2038..a4ba180d 100644
--- a/src/vpp/api/vpe.api
+++ b/src/vpp/api/vpe.api
@@ -425,6 +425,34 @@ define create_loopback_reply
u32 sw_if_index;
};
+/** \brief Create loopback interface instance request
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param mac_address - mac addr to assign to the interface if none-zero
+ @param is_specified - if non-0, a specific user_instance is being requested
+ @param user_instance - requested instance, ~0 => dynamically allocate
+*/
+define create_loopback_instance
+{
+ u32 client_index;
+ u32 context;
+ u8 mac_address[6];
+ u8 is_specified;
+ u32 user_instance;
+};
+
+/** \brief Create loopback interface instance response
+ @param context - sender context, to match reply w/ request
+ @param sw_if_index - sw index of the interface that was created
+ @param retval - return code for the request
+*/
+define create_loopback_instance_reply
+{
+ u32 context;
+ i32 retval;
+ u32 sw_if_index;
+};
+
/** \brief Delete loopback interface request
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request