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 | |
Neale Ranns | 31ed744 | 2018-02-23 05:29:09 -0800 | [diff] [blame] | 16 | option version = "1.1.0"; |
| 17 | import "vnet/fib/fib_types.api"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 18 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 19 | /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create |
| 20 | a per-prefix label entry. |
| 21 | @param client_index - opaque cookie to identify the sender |
| 22 | @param context - sender context, to match reply w/ request |
| 23 | @param mb_mpls_table_id - The MPLS table-id the MPLS entry will be added in |
| 24 | @param mb_label - The MPLS label value to bind |
| 25 | @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] | 26 | @param mb_is_bind - Bind or unbind |
| 27 | @param mb_is_ip4 - The prefix to bind to is IPv4 |
| 28 | @param mb_address_length - Length of IP prefix |
| 29 | @param mb_address[16] - IP prefix/ |
| 30 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 31 | autoreply define mpls_ip_bind_unbind |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 32 | { |
| 33 | u32 client_index; |
| 34 | u32 context; |
| 35 | u32 mb_mpls_table_id; |
| 36 | u32 mb_label; |
| 37 | u32 mb_ip_table_id; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 38 | u8 mb_is_bind; |
| 39 | u8 mb_is_ip4; |
| 40 | u8 mb_address_length; |
| 41 | u8 mb_address[16]; |
| 42 | }; |
| 43 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 44 | define mpls_tunnel_add_del |
| 45 | { |
| 46 | u32 client_index; |
| 47 | u32 context; |
| 48 | u32 mt_sw_if_index; |
| 49 | u8 mt_is_add; |
| 50 | u8 mt_l2_only; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 51 | u8 mt_is_multicast; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 52 | u8 mt_next_hop_proto_is_ip4; |
| 53 | u8 mt_next_hop_weight; |
Neale Ranns | 57b5860 | 2017-07-15 07:37:25 -0700 | [diff] [blame] | 54 | u8 mt_next_hop_preference; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 55 | u8 mt_next_hop[16]; |
| 56 | u8 mt_next_hop_n_out_labels; |
Neale Ranns | 7c922dc | 2018-08-30 06:12:27 -0700 | [diff] [blame] | 57 | u32 mt_next_hop_via_label; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 58 | u32 mt_next_hop_sw_if_index; |
| 59 | u32 mt_next_hop_table_id; |
Neale Ranns | 31ed744 | 2018-02-23 05:29:09 -0800 | [diff] [blame] | 60 | vl_api_fib_mpls_label_t mt_next_hop_out_label_stack[mt_next_hop_n_out_labels]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | /** \brief Reply for MPLS tunnel add / del request |
| 64 | @param context - returned sender context, to match reply w/ request |
| 65 | @param retval - return code |
| 66 | @param sw_if_index - SW interface index of the tunnel created |
| 67 | */ |
| 68 | define mpls_tunnel_add_del_reply |
| 69 | { |
| 70 | u32 context; |
| 71 | i32 retval; |
| 72 | u32 sw_if_index; |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame^] | 73 | u32 tunnel_index; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | /** \brief Dump mpls eth tunnel table |
| 77 | @param client_index - opaque cookie to identify the sender |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame^] | 78 | @param sw_if_index - sw_if_index of the MPLS tunnel |
| 79 | (as returned from the create) |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 80 | */ |
| 81 | define mpls_tunnel_dump |
| 82 | { |
| 83 | u32 client_index; |
| 84 | u32 context; |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame^] | 85 | u32 sw_if_index; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 86 | }; |
| 87 | |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 88 | /** \brief mpls tunnel details |
| 89 | */ |
| 90 | manual_endian manual_print define mpls_tunnel_details |
| 91 | { |
| 92 | u32 context; |
Neale Ranns | 6a30b5f | 2018-09-25 07:22:36 -0700 | [diff] [blame] | 93 | u32 mt_sw_if_index; |
Neale Ranns | f5fa5ae | 2018-09-26 05:07:25 -0700 | [diff] [blame^] | 94 | u32 mt_tunnel_index; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 95 | u8 mt_l2_only; |
| 96 | u8 mt_is_multicast; |
| 97 | u32 mt_count; |
Neale Ranns | 31ed744 | 2018-02-23 05:29:09 -0800 | [diff] [blame] | 98 | vl_api_fib_path_t mt_paths[mt_count]; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 99 | }; |
| 100 | |
| 101 | /** \brief MPLS Route Add / del route |
| 102 | @param client_index - opaque cookie to identify the sender |
| 103 | @param context - sender context, to match reply w/ request |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 104 | @param mt_table_id - The MPLS table-id the route is added in |
| 105 | @param mt_is_add - Is this a route add or delete |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 106 | @param mt_name - A client provided name/tag for the table. If this |
| 107 | is not set by the client, then VPP will generate |
| 108 | something meaningfull. |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 109 | */ |
| 110 | autoreply define mpls_table_add_del |
| 111 | { |
| 112 | u32 client_index; |
| 113 | u32 context; |
| 114 | u32 mt_table_id; |
| 115 | u8 mt_is_add; |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 116 | u8 mt_name[64]; |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 117 | }; |
| 118 | |
| 119 | /** \brief MPLS Route Add / del route |
| 120 | @param client_index - opaque cookie to identify the sender |
| 121 | @param context - sender context, to match reply w/ request |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 122 | @param mr_label - The MPLS label value |
| 123 | @param mr_eos - The End of stack bit |
| 124 | @param mr_table_id - The MPLS table-id the route is added in |
| 125 | @param mr_classify_table_index - If this is a classify route, |
| 126 | this is the classify table index |
Florin Coras | d0a5972 | 2017-10-15 17:41:21 +0000 | [diff] [blame] | 127 | create them |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 128 | @param mr_is_add - Is this a route add or delete |
| 129 | @param mr_is_classify - Is this route result a classify |
| 130 | @param mr_is_multicast - Is this a multicast route |
| 131 | @param mr_is_multipath - Is this route update a multipath - i.e. is this |
| 132 | a path addition to an existing route |
| 133 | @param mr_is_resolve_host - Recurse resolution constraint via a host prefix |
| 134 | @param mr_is_resolve_attached - Recurse resolution constraint via attached prefix |
| 135 | @param mr_is_interface_rx - Interface Receive path |
| 136 | @param mr_is_interface_rx - RPF-ID Receive path. The next-hop interface |
| 137 | is used as the RPF-ID |
Neale Ranns | da78f95 | 2017-05-24 09:15:43 -0700 | [diff] [blame] | 138 | @param mr_next_hop_proto - The next-hop protocol, of type dpo_proto_t |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 139 | @param mr_next_hop_weight - The weight, for UCMP |
| 140 | @param mr_next_hop[16] - the nextop address |
| 141 | @param mr_next_hop_sw_if_index - the next-hop SW interface |
| 142 | @param mr_next_hop_table_id - the next-hop table-id (if appropriate) |
| 143 | @param mr_next_hop_n_out_labels - the number of labels in the label stack |
| 144 | @param mr_next_hop_out_label_stack - the next-hop output label stack, outer most first |
| 145 | @param next_hop_via_label - The next-hop is a resolved via a local label |
| 146 | */ |
Neale Ranns | 008dbe1 | 2018-09-07 09:32:36 -0700 | [diff] [blame] | 147 | define mpls_route_add_del |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 148 | { |
| 149 | u32 client_index; |
| 150 | u32 context; |
| 151 | u32 mr_label; |
| 152 | u8 mr_eos; |
| 153 | u32 mr_table_id; |
| 154 | u32 mr_classify_table_index; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 155 | u8 mr_is_add; |
| 156 | u8 mr_is_classify; |
| 157 | u8 mr_is_multicast; |
| 158 | u8 mr_is_multipath; |
| 159 | u8 mr_is_resolve_host; |
| 160 | u8 mr_is_resolve_attached; |
| 161 | u8 mr_is_interface_rx; |
| 162 | u8 mr_is_rpf_id; |
Neale Ranns | da78f95 | 2017-05-24 09:15:43 -0700 | [diff] [blame] | 163 | u8 mr_next_hop_proto; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 164 | u8 mr_next_hop_weight; |
Neale Ranns | 57b5860 | 2017-07-15 07:37:25 -0700 | [diff] [blame] | 165 | u8 mr_next_hop_preference; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 166 | u8 mr_next_hop[16]; |
| 167 | u8 mr_next_hop_n_out_labels; |
| 168 | u32 mr_next_hop_sw_if_index; |
| 169 | u32 mr_next_hop_table_id; |
| 170 | u32 mr_next_hop_via_label; |
Neale Ranns | 31ed744 | 2018-02-23 05:29:09 -0800 | [diff] [blame] | 171 | vl_api_fib_mpls_label_t mr_next_hop_out_label_stack[mr_next_hop_n_out_labels]; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 172 | }; |
| 173 | |
Neale Ranns | 008dbe1 | 2018-09-07 09:32:36 -0700 | [diff] [blame] | 174 | define mpls_route_add_del_reply |
| 175 | { |
| 176 | u32 context; |
| 177 | i32 retval; |
| 178 | u32 stats_index; |
| 179 | }; |
| 180 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 181 | /** \brief Dump MPLS fib table |
| 182 | @param client_index - opaque cookie to identify the sender |
| 183 | */ |
| 184 | define mpls_fib_dump |
| 185 | { |
| 186 | u32 client_index; |
| 187 | u32 context; |
| 188 | }; |
| 189 | |
| 190 | /** \brief mpls FIB table response |
| 191 | @param table_id - MPLS fib table id |
| 192 | @param s_bit - End-of-stack bit |
| 193 | @param label - MPLS label value |
| 194 | @param count - the number of fib_path in path |
| 195 | @param path - array of of fib_path structures |
| 196 | */ |
| 197 | manual_endian manual_print define mpls_fib_details |
| 198 | { |
| 199 | u32 context; |
| 200 | u32 table_id; |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 201 | u8 table_name[64]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 202 | u8 eos_bit; |
| 203 | u32 label; |
| 204 | u32 count; |
Neale Ranns | 31ed744 | 2018-02-23 05:29:09 -0800 | [diff] [blame] | 205 | vl_api_fib_path_t path[count]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 206 | }; |
| 207 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 208 | /** \brief Enable or Disable MPLS on and interface |
| 209 | @param client_index - opaque cookie to identify the sender |
| 210 | @param context - sender context, to match reply w/ request |
| 211 | @param sw_if_index - index of the interface |
| 212 | @param enable - if non-zero enable, else disable |
| 213 | */ |
| 214 | autoreply define sw_interface_set_mpls_enable |
| 215 | { |
| 216 | u32 client_index; |
| 217 | u32 context; |
| 218 | u32 sw_if_index; |
| 219 | u8 enable; |
| 220 | }; |
| 221 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 222 | /* |
| 223 | * Local Variables: |
| 224 | * eval: (c-set-style "gnu") |
| 225 | * End: |
| 226 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 227 | |