blob: b33f0ebd81100c9869da829958425456d0a88fdb [file] [log] [blame]
Dave Barach0d056e52017-09-28 15:11:16 -04001/* Hey Emacs use -*- mode: C -*- */
Pavel Kotucek0f971d82017-01-03 10:48:54 +01002/*
3 * Copyright (c) 2015-2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Pablo Camarillofb380952016-12-07 18:34:18 +010016
Jakub Grajciar0938eba2020-03-04 13:08:27 +010017option version = "2.0.0";
Pablo Camarillo3337bd22018-06-19 15:49:02 +020018
Jakub Grajciar0938eba2020-03-04 13:08:27 +010019import "vnet/interface_types.api";
20import "vnet/ip/ip_types.api";
21import "vnet/srv6/sr_types.api";
22
Pablo Camarillo3337bd22018-06-19 15:49:02 +020023
Paul Vinciguerrae7174822019-08-07 00:05:59 -040024typedef srv6_sid_list
Pablo Camarillo3337bd22018-06-19 15:49:02 +020025{
26 u8 num_sids;
27 u32 weight;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010028 vl_api_ip6_address_t sids[16];
Pablo Camarillo3337bd22018-06-19 15:49:02 +020029};
Dave Barach0d056e52017-09-28 15:11:16 -040030
Pablo Camarillofb380952016-12-07 18:34:18 +010031/** \brief IPv6 SR LocalSID add/del request
Pavel Kotucek0f971d82017-01-03 10:48:54 +010032 @param client_index - opaque cookie to identify the sender
33 @param context - sender context, to match reply w/ request
Pablo Camarillofb380952016-12-07 18:34:18 +010034 @param is_del Boolean of whether its a delete instruction
35 @param localsid_addr IPv6 address of the localsid
36 @param end_psp Boolean of whether decapsulation is allowed in this function
37 @param behavior Type of behavior (function) for this localsid
Dave Barach0d056e52017-09-28 15:11:16 -040038 @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040039 fib_table. Default:0xffffffff
Pablo Camarillofb380952016-12-07 18:34:18 +010040 @param vlan_index Only for L2 xconnect. Outgoing VLAN tag.
41 @param fib_table FIB table in which we should install the localsid entry
Jakub Grajciar0938eba2020-03-04 13:08:27 +010042 @param nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect.
Pavel Kotucek0f971d82017-01-03 10:48:54 +010043*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040044autoreply define sr_localsid_add_del
Pavel Kotucek0f971d82017-01-03 10:48:54 +010045{
46 u32 client_index;
47 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010048 bool is_del [default=false];
49 vl_api_ip6_address_t localsid;
50 bool end_psp;
51 vl_api_sr_behavior_t behavior;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040052 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Pablo Camarillofb380952016-12-07 18:34:18 +010053 u32 vlan_index;
54 u32 fib_table;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010055 vl_api_address_t nh_addr;
Juraj Slobodae9fcf232018-04-23 10:14:37 +020056};
57
Pablo Camarillofb380952016-12-07 18:34:18 +010058/** \brief IPv6 SR policy add
59 @param client_index - opaque cookie to identify the sender
60 @param context - sender context, to match reply w/ request
61 @param bsid is the bindingSID of the SR Policy
62 @param weight is the weight of the sid list. optional.
63 @param is_encap is the behavior of the SR policy. (0.SRH insert // 1.Encapsulation)
Jakub Grajciar0938eba2020-03-04 13:08:27 +010064 @param is_spray is the type of the SR policy. (0.Default // 1.Spray)
Pablo Camarillofb380952016-12-07 18:34:18 +010065 @param fib_table is the VRF where to install the FIB entry for the BSID
Pablo Camarillo3337bd22018-06-19 15:49:02 +020066 @param sids is a srv6_sid_list object
Pablo Camarillofb380952016-12-07 18:34:18 +010067*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040068autoreply define sr_policy_add
Pablo Camarillofb380952016-12-07 18:34:18 +010069{
70 u32 client_index;
71 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010072 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +010073 u32 weight;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010074 bool is_encap;
75 bool is_spray;
Pablo Camarillofb380952016-12-07 18:34:18 +010076 u32 fib_table;
Pablo Camarillo3337bd22018-06-19 15:49:02 +020077 vl_api_srv6_sid_list_t sids;
Pavel Kotucek0f971d82017-01-03 10:48:54 +010078};
79
Pablo Camarillofb380952016-12-07 18:34:18 +010080/** \brief IPv6 SR policy modification
Pavel Kotucek0f971d82017-01-03 10:48:54 +010081 @param client_index - opaque cookie to identify the sender
82 @param context - sender context, to match reply w/ request
Pablo Camarillofb380952016-12-07 18:34:18 +010083 @param bsid is the bindingSID of the SR Policy
84 @param sr_policy_index is the index of the SR policy
85 @param fib_table is the VRF where to install the FIB entry for the BSID
86 @param operation is the operation to perform (among the top ones)
Pablo Camarillofb380952016-12-07 18:34:18 +010087 @param sl_index is the index of the Segment List to modify/delete
88 @param weight is the weight of the sid list. optional.
Pablo Camarillo3337bd22018-06-19 15:49:02 +020089 @param sids is a srv6_sid_list object
Pavel Kotucek0f971d82017-01-03 10:48:54 +010090*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040091autoreply define sr_policy_mod
Pavel Kotucek0f971d82017-01-03 10:48:54 +010092{
93 u32 client_index;
94 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010095 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +010096 u32 sr_policy_index;
97 u32 fib_table;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010098 vl_api_sr_policy_op_t operation;
Pablo Camarillofb380952016-12-07 18:34:18 +010099 u32 sl_index;
100 u32 weight;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200101 vl_api_srv6_sid_list_t sids;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100102};
103
Pablo Camarillofb380952016-12-07 18:34:18 +0100104/** \brief IPv6 SR policy deletion
105 @param client_index - opaque cookie to identify the sender
106 @param context - sender context, to match reply w/ request
107 @param bsid is the bindingSID of the SR Policy
108 @param index is the index of the SR policy
109*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400110autoreply define sr_policy_del
Pablo Camarillofb380952016-12-07 18:34:18 +0100111{
112 u32 client_index;
113 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100114 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +0100115 u32 sr_policy_index;
116};
117
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100118/** \brief IPv6 SR Set SRv6 encapsulation source
119 @param client_index - opaque cookie to identify the sender
120 @param context - sender context, to match reply w/ request
121 @param bsid is the bindingSID of the SR Policy
122 @param index is the index of the SR policy
123*/
124autoreply define sr_set_encap_source
125{
126 u32 client_index;
127 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100128 vl_api_ip6_address_t encaps_source;
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100129};
130
Ignas Bačiuseeb5fb32019-10-03 17:15:38 +0300131/** \brief IPv6 SR Set SRv6 encapsulation hop-limit
132 @param client_index - opaque cookie to identify the sender
133 @param context - sender context, to match reply w/ request
134 @param hop_limit is the hop-limit value to set
135*/
136autoreply define sr_set_encap_hop_limit
137{
138 u32 client_index;
139 u32 context;
140 u8 hop_limit;
141};
142
Pablo Camarillofb380952016-12-07 18:34:18 +0100143/** \brief IPv6 SR steering add/del
144 @param client_index - opaque cookie to identify the sender
145 @param context - sender context, to match reply w/ request
146 @param is_del
147 @param bsid is the bindingSID of the SR Policy (alt to sr_policy_index)
148 @param sr_policy is the index of the SR Policy (alt to bsid)
149 @param table_id is the VRF where to install the FIB entry for the BSID
150 @param prefix is the IPv4/v6 address for L3 traffic type
151 @param mask_width is the mask for L3 traffic type
152 @param sw_if_index is the incoming interface for L2 traffic
153 @param traffic_type describes the type of traffic
154*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400155autoreply define sr_steering_add_del
Pablo Camarillofb380952016-12-07 18:34:18 +0100156{
157 u32 client_index;
158 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100159 bool is_del [default=false];
160 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +0100161 u32 sr_policy_index;
162 u32 table_id;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100163 vl_api_prefix_t prefix;
164 vl_api_interface_index_t sw_if_index;
165 vl_api_sr_steer_t traffic_type;
Pablo Camarillofb380952016-12-07 18:34:18 +0100166};
167
Pablo Camarillofb380952016-12-07 18:34:18 +0100168/** \brief Dump the list of SR LocalSIDs
169 @param client_index - opaque cookie to identify the sender
170 @param context - sender context, to match reply w/ request
171*/
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100172define sr_localsids_dump
Pablo Camarillofb380952016-12-07 18:34:18 +0100173{
174 u32 client_index;
175 u32 context;
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100176};
Pablo Camarillofb380952016-12-07 18:34:18 +0100177
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100178define sr_localsids_details
Pablo Camarillofb380952016-12-07 18:34:18 +0100179{
180 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100181 vl_api_ip6_address_t addr;
182 bool end_psp;
183 vl_api_sr_behavior_t behavior;
Pablo Camarillofb380952016-12-07 18:34:18 +0100184 u32 fib_table;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200185 u32 vlan_index;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100186 vl_api_address_t xconnect_nh_addr;
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100187 u32 xconnect_iface_or_vrf_table;
188};
Pablo Camarillofb380952016-12-07 18:34:18 +0100189
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200190/** \brief Dump the list of SR policies
191 @param client_index - opaque cookie to identify the sender
192 @param context - sender context, to match reply w/ request
193*/
194define sr_policies_dump
195{
196 u32 client_index;
197 u32 context;
198};
199
200define sr_policies_details
201{
202 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100203 vl_api_ip6_address_t bsid;
204 bool is_spray;
205 bool is_encap;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200206 u32 fib_table;
207 u8 num_sid_lists;
208 vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
209};
210
211/** \brief Dump the steering policies
212 @param client_index - opaque cookie to identify the sender
213 @param context - sender context, to match reply w/ request
214*/
215define sr_steering_pol_dump
216{
217 u32 client_index;
218 u32 context;
219};
220
221define sr_steering_pol_details
222{
223 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100224 vl_api_sr_steer_t traffic_type;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200225 u32 fib_table;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100226 vl_api_prefix_t prefix;
227 vl_api_interface_index_t sw_if_index;
228 vl_api_ip6_address_t bsid;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200229};
230
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100231/*
Dave Barach0d056e52017-09-28 15:11:16 -0400232 * fd.io coding-style-patch-verification: OFF
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100233 * Local Variables:
234 * eval: (c-set-style "gnu")
235 * End:
236 */