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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 option version = "1.1.1";
17 import "vnet/fib/fib_types.api";
18 import "vnet/ip/ip_types.api";
19 import "vnet/interface_types.api";
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.
28 @param mb_is_bind - Bind or unbind
29 @param mb_is_ip4 - The prefix to bind to is IPv4
30 @param mb_prefix - IP prefix
32 autoreply define mpls_ip_bind_unbind
40 vl_api_prefix_t mb_prefix;
45 vl_api_interface_index_t mt_sw_if_index;
51 vl_api_fib_path_t mt_paths[mt_n_paths];
54 define mpls_tunnel_add_del
58 bool mt_is_add [default=true];
59 vl_api_mpls_tunnel_t mt_tunnel;
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
67 define mpls_tunnel_add_del_reply
71 vl_api_interface_index_t sw_if_index;
75 /** \brief Dump mpls eth tunnel table
76 @param client_index - opaque cookie to identify the sender
77 @param sw_if_index - sw_if_index of the MPLS tunnel
78 (as returned from the create)
80 define mpls_tunnel_dump
84 vl_api_interface_index_t sw_if_index [default=0xffffffff];
87 /** \brief mpls tunnel details
89 define mpls_tunnel_details
92 vl_api_mpls_tunnel_t mt_tunnel;
95 /** \brief Dump mpls enabled interface(s)
96 @param client_index - opaque cookie to identify the sender
97 @param sw_if_index - sw_if_index of a specific interface, or -1 (default)
98 to return all MPLS enabled interfaces
100 define mpls_interface_dump
104 vl_api_interface_index_t sw_if_index [default=0xffffffff];
107 /** \brief mpls enabled interface details
109 define mpls_interface_details
112 vl_api_interface_index_t sw_if_index;
115 /** \brief MPLS Route Add / del route
116 @param client_index - opaque cookie to identify the sender
117 @param context - sender context, to match reply w/ request
118 @param mt_table_id - The MPLS table-id the route is added in
119 @param mt_is_add - Is this a route add or delete
120 @param mt_name - A client provided name/tag for the table. If this
121 is not set by the client, then VPP will generate
122 something meaningful.
129 autoreply define mpls_table_add_del
133 bool mt_is_add [default=true];
134 vl_api_mpls_table_t mt_table;
137 /** \brief Dump MPLS fib table
138 @param client_index - opaque cookie to identify the sender
140 define mpls_table_dump
146 define mpls_table_details
149 vl_api_mpls_table_t mt_table;
152 /** \brief MPLS Route
153 @param mr_table_id - The MPLS table-id the route is added in
154 @param mr_label - The MPLS label value
155 @param mr_eos - The End of stack bit
156 @param mr_eos_proto - If EOS then this is the DPO packet's proto post pop
157 @param mr_is_multicast - Is this a multicast route
158 @param mr_n_paths - The number of paths
159 @param mr_paths - The paths
165 /* TODO: check data type */
168 bool mr_is_multicast;
170 vl_api_fib_path_t mr_paths[mr_n_paths];
173 /** \brief MPLS Route Add / del route
174 @param client_index - opaque cookie to identify the sender
175 @param context - sender context, to match reply w/ request
176 @param mr_table_id - The MPLS table-id the route is added in
177 @param mr_is_add - Is this a route add or delete
178 @param mr_is_multipath - Is this route update a multipath - i.e. is this
179 a path addition to an existing route
180 @param mr_route - The Route
182 define mpls_route_add_del
187 bool mr_is_multipath;
188 vl_api_mpls_route_t mr_route;
191 define mpls_route_add_del_reply
198 /** \brief Dump MPLS fib table
199 @param client_index - opaque cookie to identify the sender
201 define mpls_route_dump
205 vl_api_mpls_table_t table;
208 /** \brief mpls FIB table response
209 @param table_id - MPLS fib table id
210 @param s_bit - End-of-stack bit
211 @param label - MPLS label value
212 @param count - the number of fib_path in path
213 @param path - array of of fib_path structures
215 define mpls_route_details
218 vl_api_mpls_route_t mr_route;
221 /** \brief Enable or Disable MPLS on and interface
222 @param client_index - opaque cookie to identify the sender
223 @param context - sender context, to match reply w/ request
224 @param sw_if_index - index of the interface
225 @param enable - if non-zero enable, else disable
227 autoreply define sw_interface_set_mpls_enable
231 vl_api_interface_index_t sw_if_index;
232 bool enable [default=true];
240 description "no error";
246 description "unknown protocol";
248 unsupported_version {
252 description "unsupported version";
258 description "MPLS input packets decapsulated";
264 description "MPLS output packets encapsulated";
270 description "MPLS output packets needs fragmentation";
276 description "MPLS no label for fib/dst";
282 description "MPLS ttl expired";
288 description "MPLS s-bit not set";
294 description "invalid FIB id in label";
300 description "non-ip4 packets dropped";
306 description "disallowed FIB id";
312 description "MPLS not enabled";
318 description "MPLS DROP DPO";
324 description "MPLS PUNT DPO";
329 "/err/mpls-input" "mpls";
330 "/err/mpls-output" "mpls";
331 "/err/mpls-lookup" "mpls";
332 "/err/mpls-midchain" "mpls";
333 "/err/mpls-adj-incomplete" "mpls";
334 "/err/mpls-frag" "mpls";
339 * eval: (c-set-style "gnu")