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 | d792d9c | 2017-10-21 10:53:20 -0700 | [diff] [blame] | 16 | vl_api_version 1.0.1 |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 17 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 18 | /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create |
| 19 | a per-prefix label entry. |
| 20 | @param client_index - opaque cookie to identify the sender |
| 21 | @param context - sender context, to match reply w/ request |
| 22 | @param mb_mpls_table_id - The MPLS table-id the MPLS entry will be added in |
| 23 | @param mb_label - The MPLS label value to bind |
| 24 | @param mb_ip_table_id - The IP table-id of the IP prefix to bind to. |
Florin Coras | d0a5972 | 2017-10-15 17:41:21 +0000 | [diff] [blame] | 25 | @param mb_create_table_if_needed - Create either/both tables if required. |
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; |
Florin Coras | d0a5972 | 2017-10-15 17:41:21 +0000 | [diff] [blame] | 38 | u8 mb_create_table_if_needed; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 39 | u8 mb_is_bind; |
| 40 | u8 mb_is_ip4; |
| 41 | u8 mb_address_length; |
| 42 | u8 mb_address[16]; |
| 43 | }; |
| 44 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 45 | /** \brief MPLS tunnel Add / del route |
| 46 | @param client_index - opaque cookie to identify the sender |
| 47 | @param context - sender context, to match reply w/ request |
| 48 | @param mt_is_add - Is this a route add or delete |
| 49 | @param mt_sw_if_index - The SW interface index of the tunnel to delete |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 50 | @param mt_is_multicast - Is the tunnel's underlying LSP multicast |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 51 | @param mt_next_hop_proto_is_ip4 - The next-hop is IPV4 |
| 52 | @param mt_next_hop_weight - The weight, for UCMP |
Neale Ranns | 57b5860 | 2017-07-15 07:37:25 -0700 | [diff] [blame] | 53 | @param mt_next_hop_preference - The preference |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 54 | @param mt_next_hop[16] - the nextop address |
| 55 | @param mt_next_hop_sw_if_index - the next-hop SW interface |
| 56 | @param mt_next_hop_table_id - the next-hop table-id (if appropriate) |
| 57 | @param mt_next_hop_n_out_labels - the number of next-hop output labels |
| 58 | @param mt_next_hop_out_label_stack - the next-hop output label stack, outer most first |
| 59 | */ |
| 60 | define mpls_tunnel_add_del |
| 61 | { |
| 62 | u32 client_index; |
| 63 | u32 context; |
| 64 | u32 mt_sw_if_index; |
| 65 | u8 mt_is_add; |
| 66 | u8 mt_l2_only; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 67 | u8 mt_is_multicast; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 68 | u8 mt_next_hop_proto_is_ip4; |
| 69 | u8 mt_next_hop_weight; |
Neale Ranns | 57b5860 | 2017-07-15 07:37:25 -0700 | [diff] [blame] | 70 | u8 mt_next_hop_preference; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 71 | u8 mt_next_hop[16]; |
| 72 | u8 mt_next_hop_n_out_labels; |
| 73 | u32 mt_next_hop_sw_if_index; |
| 74 | u32 mt_next_hop_table_id; |
| 75 | u32 mt_next_hop_out_label_stack[mt_next_hop_n_out_labels]; |
| 76 | }; |
| 77 | |
| 78 | /** \brief Reply for MPLS tunnel add / del request |
| 79 | @param context - returned sender context, to match reply w/ request |
| 80 | @param retval - return code |
| 81 | @param sw_if_index - SW interface index of the tunnel created |
| 82 | */ |
| 83 | define mpls_tunnel_add_del_reply |
| 84 | { |
| 85 | u32 context; |
| 86 | i32 retval; |
| 87 | u32 sw_if_index; |
| 88 | }; |
| 89 | |
| 90 | /** \brief Dump mpls eth tunnel table |
| 91 | @param client_index - opaque cookie to identify the sender |
| 92 | @param tunnel_index - eth tunnel identifier or -1 in case of all tunnels |
| 93 | */ |
| 94 | define mpls_tunnel_dump |
| 95 | { |
| 96 | u32 client_index; |
| 97 | u32 context; |
| 98 | i32 tunnel_index; |
| 99 | }; |
| 100 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 101 | /** \brief FIB path |
| 102 | @param sw_if_index - index of the interface |
| 103 | @param weight - The weight, for UCMP |
| 104 | @param is_local - local if non-zero, else remote |
| 105 | @param is_drop - Drop the packet |
| 106 | @param is_unreach - Drop the packet and rate limit send ICMP unreachable |
| 107 | @param is_prohibit - Drop the packet and rate limit send ICMP prohibited |
| 108 | @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2 |
| 109 | @param next_hop[16] - the next hop address |
| 110 | |
| 111 | WARNING: this type is replicated, pending cleanup completion |
| 112 | |
| 113 | */ |
| 114 | typeonly manual_print manual_endian define fib_path2 |
| 115 | { |
| 116 | u32 sw_if_index; |
Neale Ranns | d792d9c | 2017-10-21 10:53:20 -0700 | [diff] [blame] | 117 | u32 table_id; |
Neale Ranns | a0a908f | 2017-08-01 11:40:03 -0700 | [diff] [blame] | 118 | u8 weight; |
| 119 | u8 preference; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 120 | u8 is_local; |
| 121 | u8 is_drop; |
| 122 | u8 is_unreach; |
| 123 | u8 is_prohibit; |
| 124 | u8 afi; |
| 125 | u8 next_hop[16]; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 126 | u32 labels[16]; |
| 127 | }; |
| 128 | |
| 129 | /** \brief mpls tunnel details |
| 130 | */ |
| 131 | manual_endian manual_print define mpls_tunnel_details |
| 132 | { |
| 133 | u32 context; |
| 134 | u8 mt_sw_if_index; |
| 135 | u8 mt_tunnel_index; |
| 136 | u8 mt_l2_only; |
| 137 | u8 mt_is_multicast; |
| 138 | u32 mt_count; |
| 139 | vl_api_fib_path2_t mt_paths[mt_count]; |
| 140 | }; |
| 141 | |
| 142 | /** \brief MPLS Route Add / del route |
| 143 | @param client_index - opaque cookie to identify the sender |
| 144 | @param context - sender context, to match reply w/ request |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 145 | @param mt_table_id - The MPLS table-id the route is added in |
| 146 | @param mt_is_add - Is this a route add or delete |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 147 | @param mt_name - A client provided name/tag for the table. If this |
| 148 | is not set by the client, then VPP will generate |
| 149 | something meaningfull. |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 150 | */ |
| 151 | autoreply define mpls_table_add_del |
| 152 | { |
| 153 | u32 client_index; |
| 154 | u32 context; |
| 155 | u32 mt_table_id; |
| 156 | u8 mt_is_add; |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 157 | u8 mt_name[64]; |
Neale Ranns | 28ab9cc | 2017-08-14 07:18:42 -0700 | [diff] [blame] | 158 | }; |
| 159 | |
| 160 | /** \brief MPLS Route Add / del route |
| 161 | @param client_index - opaque cookie to identify the sender |
| 162 | @param context - sender context, to match reply w/ request |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 163 | @param mr_label - The MPLS label value |
| 164 | @param mr_eos - The End of stack bit |
| 165 | @param mr_table_id - The MPLS table-id the route is added in |
| 166 | @param mr_classify_table_index - If this is a classify route, |
| 167 | this is the classify table index |
Florin Coras | d0a5972 | 2017-10-15 17:41:21 +0000 | [diff] [blame] | 168 | @param mr_create_table_if_needed - If the MPLS or IP tables do not exist, |
| 169 | create them |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 170 | @param mr_is_add - Is this a route add or delete |
| 171 | @param mr_is_classify - Is this route result a classify |
| 172 | @param mr_is_multicast - Is this a multicast route |
| 173 | @param mr_is_multipath - Is this route update a multipath - i.e. is this |
| 174 | a path addition to an existing route |
| 175 | @param mr_is_resolve_host - Recurse resolution constraint via a host prefix |
| 176 | @param mr_is_resolve_attached - Recurse resolution constraint via attached prefix |
| 177 | @param mr_is_interface_rx - Interface Receive path |
| 178 | @param mr_is_interface_rx - RPF-ID Receive path. The next-hop interface |
| 179 | is used as the RPF-ID |
Neale Ranns | da78f95 | 2017-05-24 09:15:43 -0700 | [diff] [blame] | 180 | @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] | 181 | @param mr_next_hop_weight - The weight, for UCMP |
| 182 | @param mr_next_hop[16] - the nextop address |
| 183 | @param mr_next_hop_sw_if_index - the next-hop SW interface |
| 184 | @param mr_next_hop_table_id - the next-hop table-id (if appropriate) |
| 185 | @param mr_next_hop_n_out_labels - the number of labels in the label stack |
| 186 | @param mr_next_hop_out_label_stack - the next-hop output label stack, outer most first |
| 187 | @param next_hop_via_label - The next-hop is a resolved via a local label |
| 188 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 189 | autoreply define mpls_route_add_del |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 190 | { |
| 191 | u32 client_index; |
| 192 | u32 context; |
| 193 | u32 mr_label; |
| 194 | u8 mr_eos; |
| 195 | u32 mr_table_id; |
| 196 | u32 mr_classify_table_index; |
Florin Coras | d0a5972 | 2017-10-15 17:41:21 +0000 | [diff] [blame] | 197 | u8 mr_create_table_if_needed; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 198 | u8 mr_is_add; |
| 199 | u8 mr_is_classify; |
| 200 | u8 mr_is_multicast; |
| 201 | u8 mr_is_multipath; |
| 202 | u8 mr_is_resolve_host; |
| 203 | u8 mr_is_resolve_attached; |
| 204 | u8 mr_is_interface_rx; |
| 205 | u8 mr_is_rpf_id; |
Neale Ranns | da78f95 | 2017-05-24 09:15:43 -0700 | [diff] [blame] | 206 | u8 mr_next_hop_proto; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 207 | u8 mr_next_hop_weight; |
Neale Ranns | 57b5860 | 2017-07-15 07:37:25 -0700 | [diff] [blame] | 208 | u8 mr_next_hop_preference; |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 209 | u8 mr_next_hop[16]; |
| 210 | u8 mr_next_hop_n_out_labels; |
| 211 | u32 mr_next_hop_sw_if_index; |
| 212 | u32 mr_next_hop_table_id; |
| 213 | u32 mr_next_hop_via_label; |
| 214 | u32 mr_next_hop_out_label_stack[mr_next_hop_n_out_labels]; |
| 215 | }; |
| 216 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 217 | /** \brief Dump MPLS fib table |
| 218 | @param client_index - opaque cookie to identify the sender |
| 219 | */ |
| 220 | define mpls_fib_dump |
| 221 | { |
| 222 | u32 client_index; |
| 223 | u32 context; |
| 224 | }; |
| 225 | |
| 226 | /** \brief mpls FIB table response |
| 227 | @param table_id - MPLS fib table id |
| 228 | @param s_bit - End-of-stack bit |
| 229 | @param label - MPLS label value |
| 230 | @param count - the number of fib_path in path |
| 231 | @param path - array of of fib_path structures |
| 232 | */ |
| 233 | manual_endian manual_print define mpls_fib_details |
| 234 | { |
| 235 | u32 context; |
| 236 | u32 table_id; |
Neale Ranns | 2297af0 | 2017-09-12 09:45:04 -0700 | [diff] [blame] | 237 | u8 table_name[64]; |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 238 | u8 eos_bit; |
| 239 | u32 label; |
| 240 | u32 count; |
| 241 | vl_api_fib_path2_t path[count]; |
| 242 | }; |
| 243 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 244 | /** \brief Enable or Disable MPLS on and interface |
| 245 | @param client_index - opaque cookie to identify the sender |
| 246 | @param context - sender context, to match reply w/ request |
| 247 | @param sw_if_index - index of the interface |
| 248 | @param enable - if non-zero enable, else disable |
| 249 | */ |
| 250 | autoreply define sw_interface_set_mpls_enable |
| 251 | { |
| 252 | u32 client_index; |
| 253 | u32 context; |
| 254 | u32 sw_if_index; |
| 255 | u8 enable; |
| 256 | }; |
| 257 | |
Pavel Kotucek | 0f971d8 | 2017-01-03 10:48:54 +0100 | [diff] [blame] | 258 | /* |
| 259 | * Local Variables: |
| 260 | * eval: (c-set-style "gnu") |
| 261 | * End: |
| 262 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 263 | |