aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/mpls/mpls.api
diff options
context:
space:
mode:
authorPim van Pelt <pim@ipng.nl>2023-06-10 16:46:34 +0200
committerNeale Ranns <neale@graphiant.com>2023-08-29 12:42:13 +0000
commit8d61c59c3f1e05e49b89a700a1640aa9bcebc6b8 (patch)
tree813e853847debe8e51b80ff40494d823065fc247 /src/vnet/mpls/mpls.api
parent7e43005d4daea3614a216b582fa0870b3a91feb5 (diff)
mpls: add mpls_interface_dump
Add an API call mpls_interface_dump() which returns a list of mpls_interface_details: - If no sw_if_index is given, all MPLS enabled sw_if_index are returned. - If a particular sw_if_index is given, and it doesn't exist, an empty list is returned. - If a sw_if_index exists and has MPLS enabled, a list of that one sw_if_index is returned. Tested: - Create 3 loopback interfaces - Call for ~0 and for sw_if_index 0..5 all return empty lists - set int mpls loop0 enable - set int mpls loop1 enable - Call for ~0 returns 2, and the call for sw_if_index=1 and =2 (the loopbacks) returns each a list of one sw_if_index 1 resp 2, the other values of sw_if_index return empty list - set int mpls loop0 disable - Call for ~0 returns 1, and the call for sw_if_index=2 (loop1) returns both a list of one sw_if_index=2, the other values of sw_if_index return empty list - set int mpls loop1 disable - Call for ~0 and for sw_if_index 0..5 all return empty lists Example Python3 API program: ``` api_response = vpp.api.mpls_interface_dump() print(f"Response is {api_response}") for i in [ 0, 1, 2, 3, 4, 5 ]: api_response = vpp.api.mpls_interface_dump(sw_if_index=i) print(f"Response[{i}] = {api_response}") ``` Type: improvement Change-Id: If87f7d7f8972d99260e859757dbcb251c6fa54a8 Signed-off-by: Pim van Pelt <pim@ipng.nl>
Diffstat (limited to 'src/vnet/mpls/mpls.api')
-rw-r--r--src/vnet/mpls/mpls.api20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vnet/mpls/mpls.api b/src/vnet/mpls/mpls.api
index 4c164bb2bf2..5d775dafdfc 100644
--- a/src/vnet/mpls/mpls.api
+++ b/src/vnet/mpls/mpls.api
@@ -92,6 +92,26 @@ define mpls_tunnel_details
vl_api_mpls_tunnel_t mt_tunnel;
};
+/** \brief Dump mpls enabled interface(s)
+ @param client_index - opaque cookie to identify the sender
+ @param sw_if_index - sw_if_index of a specific interface, or -1 (default)
+ to return all MPLS enabled interfaces
+*/
+define mpls_interface_dump
+{
+ u32 client_index;
+ u32 context;
+ vl_api_interface_index_t sw_if_index [default=0xffffffff];
+};
+
+/** \brief mpls enabled interface details
+*/
+define mpls_interface_details
+{
+ u32 context;
+ vl_api_interface_index_t sw_if_index;
+};
+
/** \brief MPLS Route Add / del route
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request