Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 1 | /* Hey Emacs use -*- mode: C -*- */ |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 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 | */ |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 16 | |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 17 | option version = "2.0.0"; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 18 | |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 19 | import "vnet/interface_types.api"; |
| 20 | import "vnet/ip/ip_types.api"; |
| 21 | import "vnet/srv6/sr_types.api"; |
| 22 | |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 23 | |
Paul Vinciguerra | e717482 | 2019-08-07 00:05:59 -0400 | [diff] [blame] | 24 | typedef srv6_sid_list |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 25 | { |
| 26 | u8 num_sids; |
| 27 | u32 weight; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 28 | vl_api_ip6_address_t sids[16]; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 29 | }; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 30 | |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 31 | /** \brief IPv6 SR LocalSID add/del request |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 32 | @param client_index - opaque cookie to identify the sender |
| 33 | @param context - sender context, to match reply w/ request |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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 |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 38 | @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the |
Paul Vinciguerra | c0e9441 | 2020-04-28 01:12:04 -0400 | [diff] [blame] | 39 | fib_table. Default:0xffffffff |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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 |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 42 | @param nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect. |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 43 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 44 | autoreply define sr_localsid_add_del |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 45 | { |
| 46 | u32 client_index; |
| 47 | u32 context; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 48 | bool is_del [default=false]; |
| 49 | vl_api_ip6_address_t localsid; |
| 50 | bool end_psp; |
| 51 | vl_api_sr_behavior_t behavior; |
Paul Vinciguerra | c0e9441 | 2020-04-28 01:12:04 -0400 | [diff] [blame] | 52 | vl_api_interface_index_t sw_if_index [default=0xffffffff]; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 53 | u32 vlan_index; |
| 54 | u32 fib_table; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 55 | vl_api_address_t nh_addr; |
Juraj Sloboda | e9fcf23 | 2018-04-23 10:14:37 +0200 | [diff] [blame] | 56 | }; |
| 57 | |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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) |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 64 | @param is_spray is the type of the SR policy. (0.Default // 1.Spray) |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 65 | @param fib_table is the VRF where to install the FIB entry for the BSID |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 66 | @param sids is a srv6_sid_list object |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 67 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 68 | autoreply define sr_policy_add |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 69 | { |
| 70 | u32 client_index; |
| 71 | u32 context; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 72 | vl_api_ip6_address_t bsid_addr; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 73 | u32 weight; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 74 | bool is_encap; |
| 75 | bool is_spray; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 76 | u32 fib_table; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 77 | vl_api_srv6_sid_list_t sids; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 78 | }; |
| 79 | |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 80 | /** \brief IPv6 SR policy modification |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 81 | @param client_index - opaque cookie to identify the sender |
| 82 | @param context - sender context, to match reply w/ request |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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) |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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. |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 89 | @param sids is a srv6_sid_list object |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 90 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 91 | autoreply define sr_policy_mod |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 92 | { |
| 93 | u32 client_index; |
| 94 | u32 context; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 95 | vl_api_ip6_address_t bsid_addr; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 96 | u32 sr_policy_index; |
| 97 | u32 fib_table; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 98 | vl_api_sr_policy_op_t operation; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 99 | u32 sl_index; |
| 100 | u32 weight; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 101 | vl_api_srv6_sid_list_t sids; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 102 | }; |
| 103 | |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 110 | autoreply define sr_policy_del |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 111 | { |
| 112 | u32 client_index; |
| 113 | u32 context; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 114 | vl_api_ip6_address_t bsid_addr; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 115 | u32 sr_policy_index; |
| 116 | }; |
| 117 | |
Pablo Camarillo | 1a5e301 | 2017-11-16 16:02:50 +0100 | [diff] [blame] | 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; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 128 | vl_api_ip6_address_t encaps_source; |
Pablo Camarillo | 1a5e301 | 2017-11-16 16:02:50 +0100 | [diff] [blame] | 129 | }; |
| 130 | |
Ignas Bačius | eeb5fb3 | 2019-10-03 17:15:38 +0300 | [diff] [blame] | 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 | |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 155 | autoreply define sr_steering_add_del |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 156 | { |
| 157 | u32 client_index; |
| 158 | u32 context; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 159 | bool is_del [default=false]; |
| 160 | vl_api_ip6_address_t bsid_addr; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 161 | u32 sr_policy_index; |
| 162 | u32 table_id; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 163 | vl_api_prefix_t prefix; |
| 164 | vl_api_interface_index_t sw_if_index; |
| 165 | vl_api_sr_steer_t traffic_type; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 166 | }; |
| 167 | |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 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 | */ |
Pablo Camarillo | 1a5e301 | 2017-11-16 16:02:50 +0100 | [diff] [blame] | 172 | define sr_localsids_dump |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 173 | { |
| 174 | u32 client_index; |
| 175 | u32 context; |
Pablo Camarillo | 1a5e301 | 2017-11-16 16:02:50 +0100 | [diff] [blame] | 176 | }; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 177 | |
Pablo Camarillo | 1a5e301 | 2017-11-16 16:02:50 +0100 | [diff] [blame] | 178 | define sr_localsids_details |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 179 | { |
| 180 | u32 context; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 181 | vl_api_ip6_address_t addr; |
| 182 | bool end_psp; |
| 183 | vl_api_sr_behavior_t behavior; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 184 | u32 fib_table; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 185 | u32 vlan_index; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 186 | vl_api_address_t xconnect_nh_addr; |
Pablo Camarillo | 1a5e301 | 2017-11-16 16:02:50 +0100 | [diff] [blame] | 187 | u32 xconnect_iface_or_vrf_table; |
| 188 | }; |
Pablo Camarillo | fb38095 | 2016-12-07 18:34:18 +0100 | [diff] [blame] | 189 | |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 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; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 203 | vl_api_ip6_address_t bsid; |
| 204 | bool is_spray; |
| 205 | bool is_encap; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 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; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 224 | vl_api_sr_steer_t traffic_type; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 225 | u32 fib_table; |
Jakub Grajciar | 0938eba | 2020-03-04 13:08:27 +0100 | [diff] [blame] | 226 | vl_api_prefix_t prefix; |
| 227 | vl_api_interface_index_t sw_if_index; |
| 228 | vl_api_ip6_address_t bsid; |
Pablo Camarillo | 3337bd2 | 2018-06-19 15:49:02 +0200 | [diff] [blame] | 229 | }; |
| 230 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 231 | /* |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 232 | * fd.io coding-style-patch-verification: OFF |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 233 | * Local Variables: |
| 234 | * eval: (c-set-style "gnu") |
| 235 | * End: |
| 236 | */ |