Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015-2016 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 16 | option version = "1.1.1"; |
Neale Ranns | 31ed744 | 2018-02-23 05:29:09 -0800 | [diff] [blame] | 17 | import "vnet/fib/fib_types.api"; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 18 | import "vnet/ip/ip_types.api"; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 19 | import "vnet/interface_types.api"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 20 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 21 | /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create |
| 22 | a per-prefix label entry. |
| 23 | @param client_index - opaque cookie to identify the sender |
| 24 | @param context - sender context, to match reply w/ request |
| 25 | @param mb_mpls_table_id - The MPLS table-id the MPLS entry will be added in |
| 26 | @param mb_label - The MPLS label value to bind |
| 27 | @param mb_ip_table_id - The IP table-id of the IP prefix to bind to. |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 28 | @param mb_is_bind - Bind or unbind |
| 29 | @param mb_is_ip4 - The prefix to bind to is IPv4 |
Ole Troan | 75761b9 | 2019-09-11 17:49:08 +0200 | [diff] [blame] | 30 | @param mb_prefix - IP prefix |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 31 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 32 | autoreply define mpls_ip_bind_unbind |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 33 | { |
| 34 | u32 client_index; |
| 35 | u32 context; |
| 36 | u32 mb_mpls_table_id; |
| 37 | u32 mb_label; |
| 38 | u32 mb_ip_table_id; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 39 | bool mb_is_bind; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 40 | vl_api_prefix_t mb_prefix; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 41 | }; |
| 42 | |
Paul Vinciguerra | e717482 | 2019-08-07 00:05:59 -0400 | [diff] [blame] | 43 | typedef mpls_tunnel |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 44 | { |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 45 | vl_api_interface_index_t mt_sw_if_index; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 46 | u32 mt_tunnel_index; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 47 | bool mt_l2_only; |
| 48 | bool mt_is_multicast; |
IJsbrand Wijnands | 39ae0a0 | 2020-03-05 10:56:26 -0800 | [diff] [blame] | 49 | string mt_tag[64]; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 50 | u8 mt_n_paths; |
| 51 | vl_api_fib_path_t mt_paths[mt_n_paths]; |
| 52 | }; |
IJsbrand Wijnands | 39ae0a0 | 2020-03-05 10:56:26 -0800 | [diff] [blame] | 53 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 54 | define mpls_tunnel_add_del |
| 55 | { |
| 56 | u32 client_index; |
| 57 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 58 | bool mt_is_add [default=true]; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 59 | vl_api_mpls_tunnel_t mt_tunnel; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | /** \brief Reply for MPLS tunnel add / del request |
| 63 | @param context - returned sender context, to match reply w/ request |
| 64 | @param retval - return code |
| 65 | @param sw_if_index - SW interface index of the tunnel created |
| 66 | */ |
| 67 | define mpls_tunnel_add_del_reply |
| 68 | { |
| 69 | u32 context; |
| 70 | i32 retval; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 71 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame] | 72 | u32 tunnel_index; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 73 | }; |
| 74 | |
| 75 | /** \brief Dump mpls eth tunnel table |
| 76 | @param client_index - opaque cookie to identify the sender |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame] | 77 | @param sw_if_index - sw_if_index of the MPLS tunnel |
| 78 | (as returned from the create) |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 79 | */ |
| 80 | define mpls_tunnel_dump |
| 81 | { |
| 82 | u32 client_index; |
| 83 | u32 context; |
Paul Vinciguerra | c0e9441 | 2020-04-28 01:12:04 -0400 | [diff] [blame] | 84 | vl_api_interface_index_t sw_if_index [default=0xffffffff]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 85 | }; |
| 86 | |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 87 | /** \brief mpls tunnel details |
| 88 | */ |
Ole Troan | df87f80 | 2020-11-18 19:17:48 +0100 | [diff] [blame] | 89 | define mpls_tunnel_details |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 90 | { |
| 91 | u32 context; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 92 | vl_api_mpls_tunnel_t mt_tunnel; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 93 | }; |
| 94 | |
| 95 | /** \brief MPLS Route Add / del route |
| 96 | @param client_index - opaque cookie to identify the sender |
| 97 | @param context - sender context, to match reply w/ request |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 98 | @param mt_table_id - The MPLS table-id the route is added in |
| 99 | @param mt_is_add - Is this a route add or delete |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 100 | @param mt_name - A client provided name/tag for the table. If this |
| 101 | is not set by the client, then VPP will generate |
Paul Vinciguerra | c0e9441 | 2020-04-28 01:12:04 -0400 | [diff] [blame] | 102 | something meaningful. |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 103 | */ |
Paul Vinciguerra | e717482 | 2019-08-07 00:05:59 -0400 | [diff] [blame] | 104 | typedef mpls_table |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 105 | { |
| 106 | u32 mt_table_id; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 107 | string mt_name[64]; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 108 | }; |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 109 | autoreply define mpls_table_add_del |
| 110 | { |
| 111 | u32 client_index; |
| 112 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 113 | bool mt_is_add [default=true]; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 114 | vl_api_mpls_table_t mt_table; |
| 115 | }; |
| 116 | |
| 117 | /** \brief Dump MPLS fib table |
| 118 | @param client_index - opaque cookie to identify the sender |
| 119 | */ |
| 120 | define mpls_table_dump |
| 121 | { |
| 122 | u32 client_index; |
| 123 | u32 context; |
| 124 | }; |
| 125 | |
| 126 | define mpls_table_details |
| 127 | { |
| 128 | u32 context; |
| 129 | vl_api_mpls_table_t mt_table; |
| 130 | }; |
| 131 | |
| 132 | /** \brief MPLS Route |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 133 | @param mr_table_id - The MPLS table-id the route is added in |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 134 | @param mr_label - The MPLS label value |
| 135 | @param mr_eos - The End of stack bit |
Paul Vinciguerra | c0e9441 | 2020-04-28 01:12:04 -0400 | [diff] [blame] | 136 | @param mr_eos_proto - If EOS then this is the DPO packet's proto post pop |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 137 | @param mr_is_multicast - Is this a multicast route |
| 138 | @param mr_n_paths - The number of paths |
| 139 | @param mr_paths - The paths |
| 140 | */ |
Paul Vinciguerra | e717482 | 2019-08-07 00:05:59 -0400 | [diff] [blame] | 141 | typedef mpls_route |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 142 | { |
| 143 | u32 mr_table_id; |
| 144 | u32 mr_label; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 145 | /* TODO: check data type */ |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 146 | u8 mr_eos; |
| 147 | u8 mr_eos_proto; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 148 | bool mr_is_multicast; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 149 | u8 mr_n_paths; |
| 150 | vl_api_fib_path_t mr_paths[mr_n_paths]; |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 151 | }; |
| 152 | |
| 153 | /** \brief MPLS Route Add / del route |
| 154 | @param client_index - opaque cookie to identify the sender |
| 155 | @param context - sender context, to match reply w/ request |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 156 | @param mr_table_id - The MPLS table-id the route is added in |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 157 | @param mr_is_add - Is this a route add or delete |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 158 | @param mr_is_multipath - Is this route update a multipath - i.e. is this |
| 159 | a path addition to an existing route |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 160 | @param mr_route - The Route |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 161 | */ |
Neale Ranns | 008dbe1 | 2018-09-07 09:32:36 -0700 | [diff] [blame] | 162 | define mpls_route_add_del |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 163 | { |
| 164 | u32 client_index; |
| 165 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 166 | bool mr_is_add; |
| 167 | bool mr_is_multipath; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 168 | vl_api_mpls_route_t mr_route; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 169 | }; |
| 170 | |
Neale Ranns | 008dbe1 | 2018-09-07 09:32:36 -0700 | [diff] [blame] | 171 | define mpls_route_add_del_reply |
| 172 | { |
| 173 | u32 context; |
| 174 | i32 retval; |
| 175 | u32 stats_index; |
| 176 | }; |
| 177 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 178 | /** \brief Dump MPLS fib table |
| 179 | @param client_index - opaque cookie to identify the sender |
| 180 | */ |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 181 | define mpls_route_dump |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 182 | { |
| 183 | u32 client_index; |
| 184 | u32 context; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 185 | vl_api_mpls_table_t table; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 186 | }; |
| 187 | |
| 188 | /** \brief mpls FIB table response |
| 189 | @param table_id - MPLS fib table id |
| 190 | @param s_bit - End-of-stack bit |
| 191 | @param label - MPLS label value |
| 192 | @param count - the number of fib_path in path |
| 193 | @param path - array of of fib_path structures |
| 194 | */ |
Ole Troan | df87f80 | 2020-11-18 19:17:48 +0100 | [diff] [blame] | 195 | define mpls_route_details |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 196 | { |
| 197 | u32 context; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 198 | vl_api_mpls_route_t mr_route; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 199 | }; |
| 200 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 201 | /** \brief Enable or Disable MPLS on and interface |
| 202 | @param client_index - opaque cookie to identify the sender |
| 203 | @param context - sender context, to match reply w/ request |
| 204 | @param sw_if_index - index of the interface |
| 205 | @param enable - if non-zero enable, else disable |
| 206 | */ |
| 207 | autoreply define sw_interface_set_mpls_enable |
| 208 | { |
| 209 | u32 client_index; |
| 210 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 211 | vl_api_interface_index_t sw_if_index; |
| 212 | bool enable [default=true]; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 213 | }; |
| 214 | |
Neale Ranns | 41a85c0 | 2022-08-09 01:24:41 +0000 | [diff] [blame] | 215 | counters mpls { |
| 216 | none { |
| 217 | severity info; |
| 218 | type counter64; |
| 219 | units "packets"; |
| 220 | description "no error"; |
| 221 | }; |
| 222 | unknown_protocol { |
| 223 | severity error; |
| 224 | type counter64; |
| 225 | units "packets"; |
| 226 | description "unknown protocol"; |
| 227 | }; |
| 228 | unsupported_version { |
| 229 | severity error; |
| 230 | type counter64; |
| 231 | units "packets"; |
| 232 | description "unsupported version"; |
| 233 | }; |
| 234 | pkts_decap { |
| 235 | severity info; |
| 236 | type counter64; |
| 237 | units "packets"; |
| 238 | description "MPLS input packets decapsulated"; |
| 239 | }; |
| 240 | pkts_encap { |
| 241 | severity info; |
| 242 | type counter64; |
| 243 | units "packets"; |
| 244 | description "MPLS output packets encapsulated"; |
| 245 | }; |
| 246 | pkts_need_frag { |
| 247 | severity info; |
| 248 | type counter64; |
| 249 | units "packets"; |
| 250 | description "MPLS output packets needs fragmentation"; |
| 251 | }; |
| 252 | no_label { |
| 253 | severity error; |
| 254 | type counter64; |
| 255 | units "packets"; |
| 256 | description "MPLS no label for fib/dst"; |
| 257 | }; |
| 258 | ttl_expired { |
| 259 | severity error; |
| 260 | type counter64; |
| 261 | units "packets"; |
| 262 | description "MPLS ttl expired"; |
| 263 | }; |
| 264 | s_not_set { |
| 265 | severity error; |
| 266 | type counter64; |
| 267 | units "packets"; |
| 268 | description "MPLS s-bit not set"; |
| 269 | }; |
| 270 | bad_label { |
| 271 | severity error; |
| 272 | type counter64; |
| 273 | units "packets"; |
| 274 | description "invalid FIB id in label"; |
| 275 | }; |
| 276 | not_ip4 { |
| 277 | severity error; |
| 278 | type counter64; |
| 279 | units "packets"; |
| 280 | description "non-ip4 packets dropped"; |
| 281 | }; |
| 282 | disallowed_fib { |
| 283 | severity error; |
| 284 | type counter64; |
| 285 | units "packets"; |
| 286 | description "disallowed FIB id"; |
| 287 | }; |
| 288 | not_enabled { |
| 289 | severity error; |
| 290 | type counter64; |
| 291 | units "packets"; |
| 292 | description "MPLS not enabled"; |
| 293 | }; |
| 294 | drop { |
| 295 | severity error; |
| 296 | type counter64; |
| 297 | units "packets"; |
| 298 | description "MPLS DROP DPO"; |
| 299 | }; |
| 300 | punt { |
| 301 | severity error; |
| 302 | type counter64; |
| 303 | units "packets"; |
| 304 | description "MPLS PUNT DPO"; |
| 305 | }; |
| 306 | }; |
| 307 | |
| 308 | paths { |
| 309 | "/err/mpls-input" "mpls"; |
| 310 | "/err/mpls-output" "mpls"; |
| 311 | "/err/mpls-lookup" "mpls"; |
| 312 | "/err/mpls-midchain" "mpls"; |
| 313 | "/err/mpls-adj-incomplete" "mpls"; |
| 314 | "/err/mpls-frag" "mpls"; |
| 315 | }; |
| 316 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 317 | /* |
| 318 | * Local Variables: |
| 319 | * eval: (c-set-style "gnu") |
| 320 | * End: |
| 321 | */ |