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