tests: move defaults from defaultmapping to .api files
[vpp.git] / src / vnet / srv6 / sr.api
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;
27   u32 weight;
28   vl_api_ip6_address_t sids[16];
29 };
30
31 /** \brief IPv6 SR LocalSID add/del request
32     @param client_index - opaque cookie to identify the sender
33     @param context - sender context, to match reply w/ request
34     @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
38     @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the
39      fib_table. Default:0xffffffff
40     @param vlan_index Only for L2 xconnect. Outgoing VLAN tag.
41     @param fib_table  FIB table in which we should install the localsid entry
42     @param nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect.
43 */
44 autoreply define sr_localsid_add_del
45 {
46   u32 client_index;
47   u32 context;
48   bool is_del [default=false];
49   vl_api_ip6_address_t localsid;
50   bool end_psp;
51   vl_api_sr_behavior_t behavior;
52   vl_api_interface_index_t sw_if_index [default=0xffffffff];
53   u32 vlan_index;
54   u32 fib_table;
55   vl_api_address_t nh_addr;
56 };
57
58 /** \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)
64     @param is_spray is the type of the SR policy. (0.Default // 1.Spray)
65     @param fib_table is the VRF where to install the FIB entry for the BSID
66     @param sids is a srv6_sid_list object
67 */
68 autoreply define sr_policy_add
69 {
70   u32 client_index;
71   u32 context;
72   vl_api_ip6_address_t bsid_addr;
73   u32 weight;
74   bool is_encap;
75   bool is_spray;
76   u32 fib_table;
77   vl_api_srv6_sid_list_t sids;
78 };
79
80 /** \brief IPv6 SR policy modification
81     @param client_index - opaque cookie to identify the sender
82     @param context - sender context, to match reply w/ request
83     @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)
87     @param sl_index is the index of the Segment List to modify/delete
88     @param weight is the weight of the sid list. optional.
89     @param sids is a srv6_sid_list object
90 */
91 autoreply define sr_policy_mod
92 {
93   u32 client_index;
94   u32 context;
95   vl_api_ip6_address_t bsid_addr;
96   u32 sr_policy_index;
97   u32 fib_table;
98   vl_api_sr_policy_op_t operation;
99   u32 sl_index;
100   u32 weight;
101   vl_api_srv6_sid_list_t sids;
102 };
103
104 /** \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 */
110 autoreply define sr_policy_del
111 {
112   u32 client_index;
113   u32 context;
114   vl_api_ip6_address_t bsid_addr;
115   u32 sr_policy_index;
116 };
117
118 /** \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 */
124 autoreply define sr_set_encap_source
125 {
126   u32 client_index;
127   u32 context;
128   vl_api_ip6_address_t encaps_source;
129 };
130
131 /** \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 */
136 autoreply define sr_set_encap_hop_limit
137 {
138   u32 client_index;
139   u32 context;
140   u8 hop_limit;
141 };
142
143 /** \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 */
155 autoreply define sr_steering_add_del
156 {
157   u32 client_index;
158   u32 context;
159   bool is_del [default=false];
160   vl_api_ip6_address_t bsid_addr;
161   u32 sr_policy_index;
162   u32 table_id;
163   vl_api_prefix_t prefix;
164   vl_api_interface_index_t sw_if_index;
165   vl_api_sr_steer_t traffic_type;
166 };
167
168 /** \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 */
172 define sr_localsids_dump
173 {
174   u32 client_index;
175   u32 context;
176 };
177
178 define sr_localsids_details
179 {
180   u32 context;
181   vl_api_ip6_address_t addr;
182   bool end_psp;
183   vl_api_sr_behavior_t behavior;
184   u32 fib_table;
185   u32 vlan_index;
186   vl_api_address_t xconnect_nh_addr;
187   u32 xconnect_iface_or_vrf_table;
188 };
189
190 /** \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 */
194 define sr_policies_dump
195 {
196   u32 client_index;
197   u32 context;
198 };
199
200 define sr_policies_details
201 {
202   u32 context;
203   vl_api_ip6_address_t bsid;
204   bool is_spray;
205   bool is_encap;
206   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 */
215 define sr_steering_pol_dump
216 {
217   u32 client_index;
218   u32 context;
219 };
220
221 define sr_steering_pol_details
222 {
223   u32 context;
224   vl_api_sr_steer_t traffic_type;
225   u32 fib_table;
226   vl_api_prefix_t prefix;
227   vl_api_interface_index_t sw_if_index;
228   vl_api_ip6_address_t bsid;
229 };
230
231 /*
232  * fd.io coding-style-patch-verification: OFF
233  * Local Variables:
234  * eval: (c-set-style "gnu")
235  * End:
236  */