summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr.api
blob: 4766ce3ba116b76ab252016b5d14b545d1873c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2015-2016 Cisco 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 = "2.1.0";

import "vnet/interface_types.api";
import "vnet/ip/ip_types.api";
import "vnet/srv6/sr_types.api";


typedef srv6_sid_list
{
  u8 num_sids;
  u32 weight;
  vl_api_ip6_address_t sids[16];
};

typedef srv6_sid_list_with_sl_index
{
  u8 num_sids;
  u32 weight;
  u32 sl_index;
  vl_api_ip6_address_t sids[16];
};

/** \brief IPv6 SR 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_addr IPv6 address of the localsid
    @param end_psp Boolean of whether decapsulation is allowed in this function
    @param behavior Type of behavior (function) for this localsid
    @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the
     fib_table. Default:0xffffffff
    @param vlan_index Only for L2 xconnect. Outgoing VLAN tag.
    @param fib_table  FIB table in which we should install the localsid entry
    @param nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect.
*/
autoreply define sr_localsid_add_del
{
  u32 client_index;
  u32 context;
  bool is_del [default=false];
  vl_api_ip6_address_t localsid;
  bool end_psp;
  vl_api_sr_behavior_t behavior;
  vl_api_interface_index_t sw_if_index [default=0xffffffff];
  u32 vlan_index;
  u32 fib_table;
  vl_api_address_t nh_addr;
};

/** \brief IPv6 SR policy add
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param bsid is the bindingSID of the SR Policy
    @param weight is the weight of the sid list. optional.
    @param is_encap is the behavior of the SR policy. (0.SRH insert // 1.Encapsulation)
    @param is_spray is the type of the SR policy. (0.Default // 1.Spray)
    @param fib_table is the VRF where to install the FIB entry for the BSID
    @param sids is a srv6_sid_list object
*/
autoreply define sr_policy_add
{
  u32 client_index;
  u32 context;
  vl_api_ip6_address_t bsid_addr;
  u32 weight;
  bool is_encap;
  bool is_spray;
  u32 fib_table;
  vl_api_srv6_sid_list_t sids;
};

/** \brief IPv6 SR policy modification
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param bsid is the bindingSID of the SR Policy
    @param sr_policy_index is the index of the SR policy
    @param fib_table is the VRF where to install the FIB entry for the BSID
    @param operation is the operation to perform (among the top ones)
    @param sl_index is the index of the Segment List to modify/delete
    @param weight is the weight of the sid list. optional.
    @param sids is a srv6_sid_list object
*/
autoreply define sr_policy_mod
{
  u32 client_index;
  u32 context;
  vl_api_ip6_address_t bsid_addr;
  u32 sr_policy_index;
  u32 fib_table;
  vl_api_sr_policy_op_t operation;
  u32 sl_index;
  u32 weight;
  vl_api_srv6_sid_list_t sids;
};

enum sr_policy_type : u8
{
  SR_API_POLICY_TYPE_DEFAULT = 0,
  SR_API_POLICY_TYPE_SPRAY = 1,
  SR_API_POLICY_TYPE_TEF = 2,
};

/** \brief IPv6 SR policy add
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param bsid is the bindingSID of the SR Policy
    @param weight is the weight of the sid list. optional.
    @param is_encap is the behavior of the SR policy. (0.SRH insert // 1.Encapsulation)
    @param type is the SR policy param. (0.Default // 1.Spray // 2.Tef)
    @param fib_table is the VRF where to install the FIB entry for the BSID
    @param sids is a srv6_sid_list object
    @param encap_src is a encaps IPv6 source addr. optional.
*/
autoreply define sr_policy_add_v2
{
  u32 client_index;
  u32 context;
  vl_api_ip6_address_t bsid_addr;
  u32 weight;
  bool is_encap;
  vl_api_sr_policy_type_t type [default=0x0];
  u32 fib_table;
  vl_api_srv6_sid_list_t sids;
  vl_api_ip6_address_t encap_src;
  option status="in_progress";
};

/** \brief IPv6 SR policy modification
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param bsid is the bindingSID of the SR Policy
    @param sr_policy_index is the index of the SR policy
    @param fib_table is the VRF where to install the FIB entry for the BSID
    @param operation is the operation to perform (among the top ones)
    @param sl_index is the index of the Segment List to modify/delete
    @param weight is the weight of the sid list. optional.
    @param sids is a srv6_sid_list object
    @param encap_src is a encaps IPv6 source addr. optional.
*/
autoreply define sr_policy_mod_v2
{
  u32 client_index;
  u32 context;
  vl_api_ip6_address_t bsid_addr;
  u32 sr_policy_index;
  u32 fib_table;
  vl_api_sr_policy_op_t operation;
  u32 sl_index;
  u32 weight;
  vl_api_srv6_sid_list_t sids;
  vl_api_ip6_address_t encap_src;
  option status="in_progress";
};

/** \brief IPv6 SR policy deletion
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param bsid is the bindingSID of the SR Policy
    @param index is the index of the SR policy
*/
autoreply define sr_policy_del
{
  u32 client_index;
  u32 context;
  vl_api_ip6_address_t bsid_addr;
  u32 sr_policy_index;
};

/** \brief IPv6 SR Set SRv6 encapsulation source
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param bsid is the bindingSID of the SR Policy
    @param index is the index of the SR policy
*/
autoreply define sr_set_encap_source
{
  u32 client_index;
  u32 context;
  vl_api_ip6_address_t encaps_source;
};

/** \brief IPv6 SR Set SRv6 encapsulation hop-limit
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param hop_limit is the hop-limit value to set
*/
autoreply define sr_set_encap_hop_limit
{
  u32 client_index;
  u32 context;
  u8 hop_limit;
};

/** \brief IPv6 SR steering add/del
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_del
    @param bsid is the bindingSID of the SR Policy (alt to sr_policy_index)
    @param sr_policy is the index of the SR Policy (alt to bsid)
    @param table_id is the VRF where to install the FIB entry for the BSID
    @param prefix is the IPv4/v6 address for L3 traffic type
    @param mask_width is the mask for L3 traffic type
    @param sw_if_index is the incoming interface for L2 traffic
    @param traffic_type describes the type of traffic
*/
autoreply define sr_steering_add_del
{
  u32 client_index;
  u32 context;
  bool is_del [default=false];
  vl_api_ip6_address_t bsid_addr;
  u32 sr_policy_index;
  u32 table_id;
  vl_api_prefix_t prefix;
  vl_api_interface_index_t sw_if_index;
  vl_api_sr_steer_t traffic_type;
};

/** \brief Dump the list of SR LocalSIDs
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define sr_localsids_dump
{
  u32 client_index;
  u32 context;
};

define sr_localsids_details
{
  u32 context;
  vl_api_ip6_address_t addr;
  bool end_psp;
  vl_api_sr_behavior_t behavior;
  u32 fib_table;
  u32 vlan_index;
  vl_api_address_t xconnect_nh_addr;
  u32 xconnect_iface_or_vrf_table;
};


/** \brief Dump the list of SR LocalSIDs along with packet statistics
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define sr_localsids_with_packet_stats_dump
{
  u32 client_index;
  u32 context;
  option status="in_progress";
};

define sr_localsids_with_packet_stats_details
{
  u32 context;
  vl_api_ip6_address_t addr;
  bool end_psp;
  vl_api_sr_behavior_t behavior;
  u32 fib_table;
  u32 vlan_index;
  vl_api_address_t xconnect_nh_addr;
  u32 xconnect_iface_or_vrf_table;
  u64 good_traffic_bytes;
  u64 good_traffic_pkt_count;
  u64 bad_traffic_bytes;
  u64 bad_traffic_pkt_count;
  option status="in_progress";
};



/** \brief Dump the list of SR policies
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define sr_policies_dump
{
  option deprecated;

  u32 client_index;
  u32 context;
};


define sr_policies_details
{
  u32 context;
  vl_api_ip6_address_t bsid;
  bool is_spray;
  bool is_encap;
  u32 fib_table;
  u8 num_sid_lists;
  vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
};

/** \brief Dump the list of SR policies v2
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define sr_policies_v2_dump
{
  u32 client_index;
  u32 context;
};

define sr_policies_v2_details
{
  u32 context;
  vl_api_ip6_address_t bsid;
  vl_api_ip6_address_t encap_src;
  vl_api_sr_policy_type_t type;
  bool is_encap;
  u32 fib_table;
  u8 num_sid_lists;
  vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
};

/** \brief Dump the list of SR policies along with actual segment list index on VPP
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define sr_policies_with_sl_index_dump
{
  u32 client_index;
  u32 context;
  option status="in_progress";
};


define sr_policies_with_sl_index_details
{
  u32 context;
  vl_api_ip6_address_t bsid;
  bool is_spray;
  bool is_encap;
  u32 fib_table;
  u8 num_sid_lists;
  vl_api_srv6_sid_list_with_sl_index_t sid_lists[num_sid_lists];
  option status="in_progress";
};

/** \brief Dump the steering policies
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define sr_steering_pol_dump
{
  u32 client_index;
  u32 context;
};

define sr_steering_pol_details
{
  u32 context;
  vl_api_sr_steer_t traffic_type;
  u32 fib_table;
  vl_api_prefix_t prefix;
  vl_api_interface_index_t sw_if_index;
  vl_api_ip6_address_t bsid;
};

/*
 * fd.io coding-style-patch-verification: OFF
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */