blob: 08ae9fa2300b3d3b8512a604ee73f440b4e6a289 [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
Chinmaya Agarwal30fa97d2020-07-13 22:34:12 +053031typedef srv6_sid_list_with_sl_index
32{
33 u8 num_sids;
34 u32 weight;
35 u32 sl_index;
36 vl_api_ip6_address_t sids[16];
37};
38
Pablo Camarillofb380952016-12-07 18:34:18 +010039/** \brief IPv6 SR LocalSID add/del request
Pavel Kotucek0f971d82017-01-03 10:48:54 +010040 @param client_index - opaque cookie to identify the sender
41 @param context - sender context, to match reply w/ request
Pablo Camarillofb380952016-12-07 18:34:18 +010042 @param is_del Boolean of whether its a delete instruction
43 @param localsid_addr IPv6 address of the localsid
44 @param end_psp Boolean of whether decapsulation is allowed in this function
45 @param behavior Type of behavior (function) for this localsid
Dave Barach0d056e52017-09-28 15:11:16 -040046 @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040047 fib_table. Default:0xffffffff
Pablo Camarillofb380952016-12-07 18:34:18 +010048 @param vlan_index Only for L2 xconnect. Outgoing VLAN tag.
49 @param fib_table FIB table in which we should install the localsid entry
Jakub Grajciar0938eba2020-03-04 13:08:27 +010050 @param nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect.
Pavel Kotucek0f971d82017-01-03 10:48:54 +010051*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040052autoreply define sr_localsid_add_del
Pavel Kotucek0f971d82017-01-03 10:48:54 +010053{
54 u32 client_index;
55 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010056 bool is_del [default=false];
57 vl_api_ip6_address_t localsid;
58 bool end_psp;
59 vl_api_sr_behavior_t behavior;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040060 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Pablo Camarillofb380952016-12-07 18:34:18 +010061 u32 vlan_index;
62 u32 fib_table;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010063 vl_api_address_t nh_addr;
Juraj Slobodae9fcf232018-04-23 10:14:37 +020064};
65
Pablo Camarillofb380952016-12-07 18:34:18 +010066/** \brief IPv6 SR policy add
67 @param client_index - opaque cookie to identify the sender
68 @param context - sender context, to match reply w/ request
69 @param bsid is the bindingSID of the SR Policy
70 @param weight is the weight of the sid list. optional.
71 @param is_encap is the behavior of the SR policy. (0.SRH insert // 1.Encapsulation)
Jakub Grajciar0938eba2020-03-04 13:08:27 +010072 @param is_spray is the type of the SR policy. (0.Default // 1.Spray)
Pablo Camarillofb380952016-12-07 18:34:18 +010073 @param fib_table is the VRF where to install the FIB entry for the BSID
Pablo Camarillo3337bd22018-06-19 15:49:02 +020074 @param sids is a srv6_sid_list object
Pablo Camarillofb380952016-12-07 18:34:18 +010075*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040076autoreply define sr_policy_add
Pablo Camarillofb380952016-12-07 18:34:18 +010077{
78 u32 client_index;
79 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010080 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +010081 u32 weight;
Jakub Grajciar0938eba2020-03-04 13:08:27 +010082 bool is_encap;
83 bool is_spray;
Pablo Camarillofb380952016-12-07 18:34:18 +010084 u32 fib_table;
Pablo Camarillo3337bd22018-06-19 15:49:02 +020085 vl_api_srv6_sid_list_t sids;
Pavel Kotucek0f971d82017-01-03 10:48:54 +010086};
87
Pablo Camarillofb380952016-12-07 18:34:18 +010088/** \brief IPv6 SR policy modification
Pavel Kotucek0f971d82017-01-03 10:48:54 +010089 @param client_index - opaque cookie to identify the sender
90 @param context - sender context, to match reply w/ request
Pablo Camarillofb380952016-12-07 18:34:18 +010091 @param bsid is the bindingSID of the SR Policy
92 @param sr_policy_index is the index of the SR policy
93 @param fib_table is the VRF where to install the FIB entry for the BSID
94 @param operation is the operation to perform (among the top ones)
Pablo Camarillofb380952016-12-07 18:34:18 +010095 @param sl_index is the index of the Segment List to modify/delete
96 @param weight is the weight of the sid list. optional.
Pablo Camarillo3337bd22018-06-19 15:49:02 +020097 @param sids is a srv6_sid_list object
Pavel Kotucek0f971d82017-01-03 10:48:54 +010098*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040099autoreply define sr_policy_mod
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100100{
101 u32 client_index;
102 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100103 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +0100104 u32 sr_policy_index;
105 u32 fib_table;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100106 vl_api_sr_policy_op_t operation;
Pablo Camarillofb380952016-12-07 18:34:18 +0100107 u32 sl_index;
108 u32 weight;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200109 vl_api_srv6_sid_list_t sids;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100110};
111
Pablo Camarillofb380952016-12-07 18:34:18 +0100112/** \brief IPv6 SR policy deletion
113 @param client_index - opaque cookie to identify the sender
114 @param context - sender context, to match reply w/ request
115 @param bsid is the bindingSID of the SR Policy
116 @param index is the index of the SR policy
117*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400118autoreply define sr_policy_del
Pablo Camarillofb380952016-12-07 18:34:18 +0100119{
120 u32 client_index;
121 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100122 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +0100123 u32 sr_policy_index;
124};
125
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100126/** \brief IPv6 SR Set SRv6 encapsulation source
127 @param client_index - opaque cookie to identify the sender
128 @param context - sender context, to match reply w/ request
129 @param bsid is the bindingSID of the SR Policy
130 @param index is the index of the SR policy
131*/
132autoreply define sr_set_encap_source
133{
134 u32 client_index;
135 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100136 vl_api_ip6_address_t encaps_source;
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100137};
138
Ignas Bačiuseeb5fb32019-10-03 17:15:38 +0300139/** \brief IPv6 SR Set SRv6 encapsulation hop-limit
140 @param client_index - opaque cookie to identify the sender
141 @param context - sender context, to match reply w/ request
142 @param hop_limit is the hop-limit value to set
143*/
144autoreply define sr_set_encap_hop_limit
145{
146 u32 client_index;
147 u32 context;
148 u8 hop_limit;
149};
150
Pablo Camarillofb380952016-12-07 18:34:18 +0100151/** \brief IPv6 SR steering add/del
152 @param client_index - opaque cookie to identify the sender
153 @param context - sender context, to match reply w/ request
154 @param is_del
155 @param bsid is the bindingSID of the SR Policy (alt to sr_policy_index)
156 @param sr_policy is the index of the SR Policy (alt to bsid)
157 @param table_id is the VRF where to install the FIB entry for the BSID
158 @param prefix is the IPv4/v6 address for L3 traffic type
159 @param mask_width is the mask for L3 traffic type
160 @param sw_if_index is the incoming interface for L2 traffic
161 @param traffic_type describes the type of traffic
162*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400163autoreply define sr_steering_add_del
Pablo Camarillofb380952016-12-07 18:34:18 +0100164{
165 u32 client_index;
166 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100167 bool is_del [default=false];
168 vl_api_ip6_address_t bsid_addr;
Pablo Camarillofb380952016-12-07 18:34:18 +0100169 u32 sr_policy_index;
170 u32 table_id;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100171 vl_api_prefix_t prefix;
172 vl_api_interface_index_t sw_if_index;
173 vl_api_sr_steer_t traffic_type;
Pablo Camarillofb380952016-12-07 18:34:18 +0100174};
175
Pablo Camarillofb380952016-12-07 18:34:18 +0100176/** \brief Dump the list of SR LocalSIDs
177 @param client_index - opaque cookie to identify the sender
178 @param context - sender context, to match reply w/ request
179*/
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100180define sr_localsids_dump
Pablo Camarillofb380952016-12-07 18:34:18 +0100181{
182 u32 client_index;
183 u32 context;
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100184};
Pablo Camarillofb380952016-12-07 18:34:18 +0100185
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100186define sr_localsids_details
Pablo Camarillofb380952016-12-07 18:34:18 +0100187{
188 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100189 vl_api_ip6_address_t addr;
190 bool end_psp;
191 vl_api_sr_behavior_t behavior;
Pablo Camarillofb380952016-12-07 18:34:18 +0100192 u32 fib_table;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200193 u32 vlan_index;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100194 vl_api_address_t xconnect_nh_addr;
Pablo Camarillo1a5e3012017-11-16 16:02:50 +0100195 u32 xconnect_iface_or_vrf_table;
196};
Pablo Camarillofb380952016-12-07 18:34:18 +0100197
ChinmayaAgarwal9503eb52022-09-27 12:25:22 +0530198
199/** \brief Dump the list of SR LocalSIDs along with packet statistics
200 @param client_index - opaque cookie to identify the sender
201 @param context - sender context, to match reply w/ request
202*/
203define sr_localsids_with_packet_stats_dump
204{
205 u32 client_index;
206 u32 context;
207 option status="in_progress";
208};
209
210define sr_localsids_with_packet_stats_details
211{
212 u32 context;
213 vl_api_ip6_address_t addr;
214 bool end_psp;
215 vl_api_sr_behavior_t behavior;
216 u32 fib_table;
217 u32 vlan_index;
218 vl_api_address_t xconnect_nh_addr;
219 u32 xconnect_iface_or_vrf_table;
220 u64 good_traffic_bytes;
221 u64 good_traffic_pkt_count;
222 u64 bad_traffic_bytes;
223 u64 bad_traffic_pkt_count;
224 option status="in_progress";
225};
226
227
228
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200229/** \brief Dump the list of SR policies
230 @param client_index - opaque cookie to identify the sender
231 @param context - sender context, to match reply w/ request
232*/
233define sr_policies_dump
234{
235 u32 client_index;
236 u32 context;
237};
238
Chinmaya Agarwal30fa97d2020-07-13 22:34:12 +0530239
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200240define sr_policies_details
241{
242 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100243 vl_api_ip6_address_t bsid;
244 bool is_spray;
245 bool is_encap;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200246 u32 fib_table;
247 u8 num_sid_lists;
248 vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
249};
250
Chinmaya Agarwal30fa97d2020-07-13 22:34:12 +0530251/** \brief Dump the list of SR policies along with actual segment list index on VPP
252 @param client_index - opaque cookie to identify the sender
253 @param context - sender context, to match reply w/ request
254*/
255define sr_policies_with_sl_index_dump
256{
257 u32 client_index;
258 u32 context;
259 option status="in_progress";
260};
261
262
263define sr_policies_with_sl_index_details
264{
265 u32 context;
266 vl_api_ip6_address_t bsid;
267 bool is_spray;
268 bool is_encap;
269 u32 fib_table;
270 u8 num_sid_lists;
271 vl_api_srv6_sid_list_with_sl_index_t sid_lists[num_sid_lists];
272 option status="in_progress";
273};
274
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200275/** \brief Dump the steering policies
276 @param client_index - opaque cookie to identify the sender
277 @param context - sender context, to match reply w/ request
278*/
279define sr_steering_pol_dump
280{
281 u32 client_index;
282 u32 context;
283};
284
285define sr_steering_pol_details
286{
287 u32 context;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100288 vl_api_sr_steer_t traffic_type;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200289 u32 fib_table;
Jakub Grajciar0938eba2020-03-04 13:08:27 +0100290 vl_api_prefix_t prefix;
291 vl_api_interface_index_t sw_if_index;
292 vl_api_ip6_address_t bsid;
Pablo Camarillo3337bd22018-06-19 15:49:02 +0200293};
294
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100295/*
Dave Barach0d056e52017-09-28 15:11:16 -0400296 * fd.io coding-style-patch-verification: OFF
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100297 * Local Variables:
298 * eval: (c-set-style "gnu")
299 * End:
300 */