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; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 49 | u8 mt_n_paths; |
| 50 | vl_api_fib_path_t mt_paths[mt_n_paths]; |
| 51 | }; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 52 | define mpls_tunnel_add_del |
| 53 | { |
| 54 | u32 client_index; |
| 55 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 56 | bool mt_is_add [default=true]; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 57 | vl_api_mpls_tunnel_t mt_tunnel; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | /** \brief Reply for MPLS tunnel add / del request |
| 61 | @param context - returned sender context, to match reply w/ request |
| 62 | @param retval - return code |
| 63 | @param sw_if_index - SW interface index of the tunnel created |
| 64 | */ |
| 65 | define mpls_tunnel_add_del_reply |
| 66 | { |
| 67 | u32 context; |
| 68 | i32 retval; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 69 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame] | 70 | u32 tunnel_index; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | /** \brief Dump mpls eth tunnel table |
| 74 | @param client_index - opaque cookie to identify the sender |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame] | 75 | @param sw_if_index - sw_if_index of the MPLS tunnel |
| 76 | (as returned from the create) |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 77 | */ |
| 78 | define mpls_tunnel_dump |
| 79 | { |
| 80 | u32 client_index; |
| 81 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 82 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 83 | }; |
| 84 | |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 85 | /** \brief mpls tunnel details |
| 86 | */ |
| 87 | manual_endian manual_print define mpls_tunnel_details |
| 88 | { |
| 89 | u32 context; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 90 | vl_api_mpls_tunnel_t mt_tunnel; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | /** \brief MPLS Route Add / del route |
| 94 | @param client_index - opaque cookie to identify the sender |
| 95 | @param context - sender context, to match reply w/ request |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 96 | @param mt_table_id - The MPLS table-id the route is added in |
| 97 | @param mt_is_add - Is this a route add or delete |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 98 | @param mt_name - A client provided name/tag for the table. If this |
| 99 | is not set by the client, then VPP will generate |
| 100 | something meaningfull. |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 101 | */ |
Paul Vinciguerra | e717482 | 2019-08-07 00:05:59 -0400 | [diff] [blame] | 102 | typedef mpls_table |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 103 | { |
| 104 | u32 mt_table_id; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 105 | string mt_name[64]; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 106 | }; |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 107 | autoreply define mpls_table_add_del |
| 108 | { |
| 109 | u32 client_index; |
| 110 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 111 | bool mt_is_add [default=true]; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 112 | vl_api_mpls_table_t mt_table; |
| 113 | }; |
| 114 | |
| 115 | /** \brief Dump MPLS fib table |
| 116 | @param client_index - opaque cookie to identify the sender |
| 117 | */ |
| 118 | define mpls_table_dump |
| 119 | { |
| 120 | u32 client_index; |
| 121 | u32 context; |
| 122 | }; |
| 123 | |
| 124 | define mpls_table_details |
| 125 | { |
| 126 | u32 context; |
| 127 | vl_api_mpls_table_t mt_table; |
| 128 | }; |
| 129 | |
| 130 | /** \brief MPLS Route |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 131 | @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] | 132 | @param mr_label - The MPLS label value |
| 133 | @param mr_eos - The End of stack bit |
| 134 | @param mr_eos_proto - If EOS then this is the DPO packect's proto post pop |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 135 | @param mr_is_multicast - Is this a multicast route |
| 136 | @param mr_n_paths - The number of paths |
| 137 | @param mr_paths - The paths |
| 138 | */ |
Paul Vinciguerra | e717482 | 2019-08-07 00:05:59 -0400 | [diff] [blame] | 139 | typedef mpls_route |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 140 | { |
| 141 | u32 mr_table_id; |
| 142 | u32 mr_label; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 143 | /* TODO: check data type */ |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 144 | u8 mr_eos; |
| 145 | u8 mr_eos_proto; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 146 | bool mr_is_multicast; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 147 | u8 mr_n_paths; |
| 148 | vl_api_fib_path_t mr_paths[mr_n_paths]; |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 149 | }; |
| 150 | |
| 151 | /** \brief MPLS Route Add / del route |
| 152 | @param client_index - opaque cookie to identify the sender |
| 153 | @param context - sender context, to match reply w/ request |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 154 | @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] | 155 | @param mr_is_add - Is this a route add or delete |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 156 | @param mr_is_multipath - Is this route update a multipath - i.e. is this |
| 157 | a path addition to an existing route |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 158 | @param mr_route - The Route |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 159 | */ |
Neale Ranns | 008dbe1 | 2018-09-07 09:32:36 -0700 | [diff] [blame] | 160 | define mpls_route_add_del |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 161 | { |
| 162 | u32 client_index; |
| 163 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 164 | bool mr_is_add; |
| 165 | bool mr_is_multipath; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 166 | vl_api_mpls_route_t mr_route; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 167 | }; |
| 168 | |
Neale Ranns | 008dbe1 | 2018-09-07 09:32:36 -0700 | [diff] [blame] | 169 | define mpls_route_add_del_reply |
| 170 | { |
| 171 | u32 context; |
| 172 | i32 retval; |
| 173 | u32 stats_index; |
| 174 | }; |
| 175 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 176 | /** \brief Dump MPLS fib table |
| 177 | @param client_index - opaque cookie to identify the sender |
| 178 | */ |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 179 | define mpls_route_dump |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 180 | { |
| 181 | u32 client_index; |
| 182 | u32 context; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 183 | vl_api_mpls_table_t table; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 184 | }; |
| 185 | |
| 186 | /** \brief mpls FIB table response |
| 187 | @param table_id - MPLS fib table id |
| 188 | @param s_bit - End-of-stack bit |
| 189 | @param label - MPLS label value |
| 190 | @param count - the number of fib_path in path |
| 191 | @param path - array of of fib_path structures |
| 192 | */ |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 193 | manual_endian manual_print define mpls_route_details |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 194 | { |
| 195 | u32 context; |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 196 | vl_api_mpls_route_t mr_route; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 197 | }; |
| 198 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 199 | /** \brief Enable or Disable MPLS on and interface |
| 200 | @param client_index - opaque cookie to identify the sender |
| 201 | @param context - sender context, to match reply w/ request |
| 202 | @param sw_if_index - index of the interface |
| 203 | @param enable - if non-zero enable, else disable |
| 204 | */ |
| 205 | autoreply define sw_interface_set_mpls_enable |
| 206 | { |
| 207 | u32 client_index; |
| 208 | u32 context; |
Jakub Grajciar | 3eb8f20 | 2020-01-03 09:59:07 +0100 | [diff] [blame] | 209 | vl_api_interface_index_t sw_if_index; |
| 210 | bool enable [default=true]; |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 211 | }; |
| 212 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 213 | /* |
| 214 | * Local Variables: |
| 215 | * eval: (c-set-style "gnu") |
| 216 | * End: |
| 217 | */ |