From 68ac244283b60cbaf6356ab732f1d31583bb3e7a Mon Sep 17 00:00:00 2001 From: Takeru Hayasaka Date: Fri, 28 Oct 2022 04:26:05 +0900 Subject: srv6-mobile: Implement SRv6 mobile API funcs This merge request adds the feature to manipulate localsids and policies for SRv6 mobile via API. Type: feature Signed-off-by: Takeru Hayasaka Change-Id: Ibb46bf71ae1d9d4591ce2c8ccf66f520887dad70 --- src/plugins/srv6-mobile/sr_mobile.api | 79 +++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/plugins/srv6-mobile/sr_mobile.api (limited to 'src/plugins/srv6-mobile/sr_mobile.api') diff --git a/src/plugins/srv6-mobile/sr_mobile.api b/src/plugins/srv6-mobile/sr_mobile.api new file mode 100644 index 00000000000..1487085a695 --- /dev/null +++ b/src/plugins/srv6-mobile/sr_mobile.api @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2022 BBSakura Networks Inc and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +option version = "0.1.0"; + +import "vnet/interface_types.api"; +import "vnet/ip/ip_types.api"; +import "vnet/srv6/sr_types.api"; +import "vnet/srv6/sr.api"; +import "plugins/srv6-mobile/sr_mobile_types.api"; + +/** \brief IPv6 SR for Mobile LocalSID add/del request + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param is_del - Boolean of whether its a delete instruction + @param localsid_prefix - IPv6 address of the localsid + @param behavior - the behavior of the SR policy. + @param fib_table - FIB table in which we should install the localsid entry + @param local_fib_table - lookup and forward GTP-U packet based on outer IP destination address. optional + @param drop_in - that reconverts to GTPv1 mode. optional + @param nhtype - next-header type. optional. + @param sr_prefix - v6 src ip encoding prefix.optional. + @param v4src_position - bit position where IPv4 src address embedded. optional. +*/ +autoreply define sr_mobile_localsid_add_del +{ + u32 client_index; + u32 context; + bool is_del [default=false]; + vl_api_ip6_prefix_t localsid_prefix; + string behavior[64]; + u32 fib_table; + u32 local_fib_table; + bool drop_in; + vl_api_sr_mobile_nhtype_t nhtype; + vl_api_ip6_prefix_t sr_prefix; + vl_api_ip4_address_t v4src_addr; + u32 v4src_position; +}; + +/** \brief IPv6 SR for Mobile policy add + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param bsid - the bindingSID of the SR Policy + @param sr_prefix - v6 dst ip encoding prefix. optional + @param v6src_position - v6 src prefix. optional + @param behavior - the behavior of the SR policy. + @param fib_table - the VRF where to install the FIB entry for the BSID + @param encap_src is a encaps IPv6 source addr. optional + @param local_fib_table - lookup and forward GTP-U packet based on outer IP destination address. optional + @param drop_in - that reconverts to GTPv1 mode. optional + @param nhtype - next-header type. +*/ +autoreply define sr_mobile_policy_add +{ + u32 client_index; + u32 context; + vl_api_ip6_address_t bsid_addr; + vl_api_ip6_prefix_t sr_prefix; + vl_api_ip6_prefix_t v6src_prefix; + string behavior[64]; + u32 fib_table; + u32 local_fib_table; + vl_api_ip6_address_t encap_src; + bool drop_in; + vl_api_sr_mobile_nhtype_t nhtype; +}; -- cgit 1.2.3-korg