FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
sr.api
Go to the documentation of this file.
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
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  */
16 
17 option version = "2.0.0";
18 
19 import "vnet/interface_types.api";
20 import "vnet/ip/ip_types.api";
21 import "vnet/srv6/sr_types.api";
22 
23 
24 typedef srv6_sid_list
25 {
26  u8 num_sids;
28  vl_api_ip6_address_t sids[16];
29 };
30 
32 {
33  u8 num_sids;
34  u32 weight;
36  vl_api_ip6_address_t sids[16];
37 };
38 
39 /** \brief IPv6 SR LocalSID add/del request
40  @param client_index - opaque cookie to identify the sender
41  @param context - sender context, to match reply w/ request
42  @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
46  @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the
47  fib_table. Default:0xffffffff
48  @param vlan_index Only for L2 xconnect. Outgoing VLAN tag.
49  @param fib_table FIB table in which we should install the localsid entry
50  @param nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect.
51 */
52 autoreply define sr_localsid_add_del
53 {
56  bool is_del [default=false];
57  vl_api_ip6_address_t localsid;
58  bool end_psp;
59  vl_api_sr_behavior_t behavior;
60  vl_api_interface_index_t sw_if_index [default=0xffffffff];
63  vl_api_address_t nh_addr;
64 };
65 
66 /** \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)
72  @param is_spray is the type of the SR policy. (0.Default // 1.Spray)
73  @param fib_table is the VRF where to install the FIB entry for the BSID
74  @param sids is a srv6_sid_list object
75 */
76 autoreply define sr_policy_add
77 {
80  vl_api_ip6_address_t bsid_addr;
82  bool is_encap;
83  bool is_spray;
85  vl_api_srv6_sid_list_t sids;
86 };
87 
88 /** \brief IPv6 SR policy modification
89  @param client_index - opaque cookie to identify the sender
90  @param context - sender context, to match reply w/ request
91  @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)
95  @param sl_index is the index of the Segment List to modify/delete
96  @param weight is the weight of the sid list. optional.
97  @param sids is a srv6_sid_list object
98 */
99 autoreply define sr_policy_mod
100 {
103  vl_api_ip6_address_t bsid_addr;
106  vl_api_sr_policy_op_t operation;
109  vl_api_srv6_sid_list_t sids;
110 };
111 
112 /** \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 */
118 autoreply define sr_policy_del
119 {
122  vl_api_ip6_address_t bsid_addr;
124 };
125 
126 /** \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 */
132 autoreply define sr_set_encap_source
133 {
136  vl_api_ip6_address_t encaps_source;
137 };
138 
139 /** \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 */
144 autoreply define sr_set_encap_hop_limit
145 {
149 };
150 
151 /** \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 */
163 autoreply define sr_steering_add_del
164 {
167  bool is_del [default=false];
168  vl_api_ip6_address_t bsid_addr;
171  vl_api_prefix_t prefix;
172  vl_api_interface_index_t sw_if_index;
173  vl_api_sr_steer_t traffic_type;
174 };
175 
176 /** \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 */
180 define sr_localsids_dump
181 {
184 };
185 
186 define sr_localsids_details
187 {
189  vl_api_ip6_address_t addr;
190  bool end_psp;
191  vl_api_sr_behavior_t behavior;
194  vl_api_address_t xconnect_nh_addr;
196 };
197 
198 /** \brief Dump the list of SR policies
199  @param client_index - opaque cookie to identify the sender
200  @param context - sender context, to match reply w/ request
201 */
202 define sr_policies_dump
203 {
206 };
207 
208 
209 define sr_policies_details
210 {
212  vl_api_ip6_address_t bsid;
213  bool is_spray;
214  bool is_encap;
217  vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
218 };
219 
220 /** \brief Dump the list of SR policies along with actual segment list index on VPP
221  @param client_index - opaque cookie to identify the sender
222  @param context - sender context, to match reply w/ request
223 */
224 define sr_policies_with_sl_index_dump
225 {
228  option status="in_progress";
229 };
230 
231 
232 define sr_policies_with_sl_index_details
233 {
235  vl_api_ip6_address_t bsid;
236  bool is_spray;
237  bool is_encap;
240  vl_api_srv6_sid_list_with_sl_index_t sid_lists[num_sid_lists];
241  option status="in_progress";
242 };
243 
244 /** \brief Dump the steering policies
245  @param client_index - opaque cookie to identify the sender
246  @param context - sender context, to match reply w/ request
247 */
248 define sr_steering_pol_dump
249 {
252 };
253 
254 define sr_steering_pol_details
255 {
257  vl_api_sr_steer_t traffic_type;
259  vl_api_prefix_t prefix;
260  vl_api_interface_index_t sw_if_index;
261  vl_api_ip6_address_t bsid;
262 };
263 
264 /*
265  * fd.io coding-style-patch-verification: OFF
266  * Local Variables:
267  * eval: (c-set-style "gnu")
268  * End:
269  */
vl_api_sr_policy_mod_t::sr_policy_index
u32 sr_policy_index
Definition: sr.api:104
vl_api_sr_policies_details_t::sid_lists
vl_api_srv6_sid_list_t sid_lists[num_sid_lists]
Definition: sr.api:217
vl_api_sr_localsids_details_t::xconnect_nh_addr
vl_api_address_t xconnect_nh_addr
Definition: sr.api:194
vl_api_sr_steering_add_del_t::traffic_type
vl_api_sr_steer_t traffic_type
Definition: sr.api:173
vl_api_sr_policy_mod_t::sl_index
u32 sl_index
Definition: sr.api:107
vl_api_sr_steering_pol_dump_t
Dump the steering policies.
Definition: sr.api:248
vl_api_sr_policy_mod_t
IPv6 SR policy modification.
Definition: sr.api:99
vl_api_sr_steering_pol_dump_t::client_index
u32 client_index
Definition: sr.api:250
vl_api_sr_policies_with_sl_index_details_t
Definition: sr.api:232
vl_api_sr_localsid_add_del_t::nh_addr
vl_api_address_t nh_addr
Definition: sr.api:63
sl_index
u32 sl_index
Definition: sr.api:35
vl_api_sr_policy_del_t
IPv6 SR policy deletion.
Definition: sr.api:118
vl_api_sr_localsids_details_t::behavior
vl_api_sr_behavior_t behavior
Definition: sr.api:191
vl_api_sr_policies_with_sl_index_details_t::sid_lists
vl_api_srv6_sid_list_with_sl_index_t sid_lists[num_sid_lists]
Definition: sr.api:240
vl_api_sr_policies_with_sl_index_details_t::is_encap
bool is_encap
Definition: sr.api:237
vl_api_sr_steering_add_del_t::prefix
vl_api_prefix_t prefix
Definition: sr.api:171
vl_api_sr_policies_with_sl_index_details_t::is_spray
bool is_spray
Definition: sr.api:236
vl_api_sr_policies_dump_t::context
u32 context
Definition: sr.api:205
srv6_sid_list_with_sl_index
typedef srv6_sid_list_with_sl_index
Definition: sr.api:32
vl_api_sr_localsids_dump_t::client_index
u32 client_index
Definition: sr.api:182
vl_api_sr_localsids_dump_t::context
u32 context
Definition: sr.api:183
vl_api_sr_steering_pol_details_t::prefix
vl_api_prefix_t prefix
Definition: sr.api:259
vl_api_sr_set_encap_hop_limit_t
IPv6 SR Set SRv6 encapsulation hop-limit.
Definition: sr.api:144
vl_api_sr_policy_mod_t::bsid_addr
vl_api_ip6_address_t bsid_addr
Definition: sr.api:103
vl_api_sr_localsids_details_t::fib_table
u32 fib_table
Definition: sr.api:192
vl_api_sr_set_encap_hop_limit_t::client_index
u32 client_index
Definition: sr.api:146
vl_api_sr_localsid_add_del_t::behavior
vl_api_sr_behavior_t behavior
Definition: sr.api:59
vl_api_sr_steering_add_del_t::context
u32 context
Definition: sr.api:166
vl_api_sr_localsid_add_del_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: sr.api:60
vl_api_sr_policies_details_t::is_encap
bool is_encap
Definition: sr.api:214
vl_api_sr_policies_with_sl_index_dump_t::client_index
u32 client_index
Definition: sr.api:226
vl_api_sr_policy_mod_t::fib_table
u32 fib_table
Definition: sr.api:105
vl_api_sr_policies_details_t::num_sid_lists
u8 num_sid_lists
Definition: sr.api:216
vl_api_sr_policies_with_sl_index_details_t::num_sid_lists
u8 num_sid_lists
Definition: sr.api:239
vl_api_sr_steering_add_del_t::client_index
u32 client_index
Definition: sr.api:165
vl_api_sr_policy_add_t::fib_table
u32 fib_table
Definition: sr.api:84
vl_api_sr_steering_add_del_t::is_del
bool is_del[default=false]
Definition: sr.api:167
vl_api_sr_steering_pol_details_t::fib_table
u32 fib_table
Definition: sr.api:258
vl_api_sr_policy_del_t::bsid_addr
vl_api_ip6_address_t bsid_addr
Definition: sr.api:122
vl_api_sr_steering_pol_details_t::bsid
vl_api_ip6_address_t bsid
Definition: sr.api:261
vl_api_sr_policy_add_t::bsid_addr
vl_api_ip6_address_t bsid_addr
Definition: sr.api:80
vl_api_sr_steering_pol_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: sr.api:260
sids
vl_api_ip6_address_t sids[16]
Definition: sr.api:28
vl_api_sr_steering_add_del_t::sr_policy_index
u32 sr_policy_index
Definition: sr.api:169
vl_api_sr_steering_add_del_t::table_id
u32 table_id
Definition: sr.api:170
vl_api_sr_policy_del_t::context
u32 context
Definition: sr.api:121
vl_api_sr_policies_with_sl_index_details_t::bsid
vl_api_ip6_address_t bsid
Definition: sr.api:235
sr_policy_mod
int sr_policy_mod(ip6_address_t *bsid, u32 index, u32 fib_table, u8 operation, ip6_address_t *segments, u32 sl_index, u32 weight)
Modify an existing SR policy.
Definition: sr_policy_rewrite.c:831
sr_policy_del
int sr_policy_del(ip6_address_t *bsid, u32 index)
Delete a SR policy.
Definition: sr_policy_rewrite.c:723
weight
u32 weight
Definition: sr.api:27
vl_api_sr_localsid_add_del_t::fib_table
u32 fib_table
Definition: sr.api:62
vl_api_sr_localsid_add_del_t::client_index
u32 client_index
Definition: sr.api:54
vl_api_sr_policy_add_t::context
u32 context
Definition: sr.api:79
vl_api_sr_localsids_details_t::xconnect_iface_or_vrf_table
u32 xconnect_iface_or_vrf_table
Definition: sr.api:195
vl_api_sr_policy_add_t::client_index
u32 client_index
Definition: sr.api:78
vl_api_sr_steering_add_del_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: sr.api:172
vl_api_sr_localsid_add_del_t::end_psp
bool end_psp
Definition: sr.api:58
vl_api_sr_policy_mod_t::client_index
u32 client_index
Definition: sr.api:101
vl_api_sr_localsid_add_del_t::context
u32 context
Definition: sr.api:55
vl_api_sr_localsids_details_t::end_psp
bool end_psp
Definition: sr.api:190
vl_api_sr_policy_mod_t::context
u32 context
Definition: sr.api:102
vl_api_sr_policy_add_t
IPv6 SR policy add.
Definition: sr.api:76
vl_api_sr_steering_pol_details_t::context
u32 context
Definition: sr.api:256
vl_api_sr_localsid_add_del_t::localsid
vl_api_ip6_address_t localsid
Definition: sr.api:57
vl_api_sr_policies_with_sl_index_details_t::context
u32 context
Definition: sr.api:234
vl_api_sr_policies_with_sl_index_details_t::status
option status
Definition: sr.api:241
vl_api_sr_steering_add_del_t::bsid_addr
vl_api_ip6_address_t bsid_addr
Definition: sr.api:168
vl_api_sr_set_encap_source_t::context
u32 context
Definition: sr.api:135
vl_api_sr_policies_details_t::bsid
vl_api_ip6_address_t bsid
Definition: sr.api:212
vl_api_sr_set_encap_source_t
IPv6 SR Set SRv6 encapsulation source.
Definition: sr.api:132
vl_api_sr_policy_add_t::is_encap
bool is_encap
Definition: sr.api:82
u32
unsigned int u32
Definition: types.h:88
vl_api_sr_set_encap_hop_limit_t::context
u32 context
Definition: sr.api:147
vl_api_sr_localsids_details_t
Definition: sr.api:186
vl_api_sr_policy_del_t::sr_policy_index
u32 sr_policy_index
Definition: sr.api:123
vl_api_sr_steering_pol_dump_t::context
u32 context
Definition: sr.api:251
vl_api_sr_policies_dump_t
Dump the list of SR policies.
Definition: sr.api:202
vl_api_sr_policies_with_sl_index_dump_t::context
u32 context
Definition: sr.api:227
vl_api_sr_set_encap_hop_limit_t::hop_limit
u8 hop_limit
Definition: sr.api:148
vl_api_sr_steering_add_del_t
IPv6 SR steering add/del.
Definition: sr.api:163
vl_api_sr_steering_pol_details_t
Definition: sr.api:254
sr_policy_add
int sr_policy_add(ip6_address_t *bsid, ip6_address_t *segments, u32 weight, u8 behavior, u32 fib_table, u8 is_encap, u16 plugin, void *plugin_mem)
Create a new SR policy.
Definition: sr_policy_rewrite.c:635
vl_api_sr_policies_with_sl_index_dump_t::status
option status
Definition: sr.api:228
vl_api_sr_policy_mod_t::weight
u32 weight
Definition: sr.api:108
vl_api_sr_policy_add_t::weight
u32 weight
Definition: sr.api:81
vl_api_sr_policies_with_sl_index_dump_t
Dump the list of SR policies along with actual segment list index on VPP.
Definition: sr.api:224
vl_api_sr_policies_details_t::is_spray
bool is_spray
Definition: sr.api:213
vl_api_sr_policy_mod_t::sids
vl_api_srv6_sid_list_t sids
Definition: sr.api:109
vl_api_sr_localsids_details_t::vlan_index
u32 vlan_index
Definition: sr.api:193
u8
unsigned char u8
Definition: types.h:56
vl_api_sr_policy_del_t::client_index
u32 client_index
Definition: sr.api:120
version
option version
Definition: sr.api:17
vl_api_sr_localsid_add_del_t::is_del
bool is_del[default=false]
Definition: sr.api:56
vl_api_sr_policies_dump_t::client_index
u32 client_index
Definition: sr.api:204
vl_api_sr_policies_details_t::context
u32 context
Definition: sr.api:211
vl_api_sr_policy_add_t::is_spray
bool is_spray
Definition: sr.api:83
vl_api_sr_policy_add_t::sids
vl_api_srv6_sid_list_t sids
Definition: sr.api:85
vl_api_sr_localsids_dump_t
Dump the list of SR LocalSIDs.
Definition: sr.api:180
vl_api_sr_set_encap_source_t::encaps_source
vl_api_ip6_address_t encaps_source
Definition: sr.api:136
vl_api_sr_policy_mod_t::operation
vl_api_sr_policy_op_t operation
Definition: sr.api:106
vl_api_sr_policies_details_t::fib_table
u32 fib_table
Definition: sr.api:215
vl_api_sr_localsids_details_t::addr
vl_api_ip6_address_t addr
Definition: sr.api:189
vl_api_sr_localsid_add_del_t
IPv6 SR LocalSID add/del request.
Definition: sr.api:52
vl_api_sr_set_encap_source_t::client_index
u32 client_index
Definition: sr.api:134
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vl_api_sr_policies_details_t
Definition: sr.api:209
vl_api_sr_steering_pol_details_t::traffic_type
vl_api_sr_steer_t traffic_type
Definition: sr.api:257
vl_api_sr_localsid_add_del_t::vlan_index
u32 vlan_index
Definition: sr.api:61
srv6_sid_list
typedef srv6_sid_list
Definition: sr.api:25
vl_api_sr_localsids_details_t::context
u32 context
Definition: sr.api:188
vl_api_sr_policies_with_sl_index_details_t::fib_table
u32 fib_table
Definition: sr.api:238