"autoreply" flag: autogenerate standard xxx_reply_t messages
[vpp.git] / src / vnet / mpls / mpls.api
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
16 /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create
17            a per-prefix label entry.
18     @param client_index - opaque cookie to identify the sender
19     @param context - sender context, to match reply w/ request
20     @param mb_mpls_table_id - The MPLS table-id the MPLS entry will be added in
21     @param mb_label - The MPLS label value to bind
22     @param mb_ip_table_id - The IP table-id of the IP prefix to bind to.
23     @param mb_create_table_if_needed - Create either/both tables if required.
24     @param mb_is_bind - Bind or unbind
25     @param mb_is_ip4 - The prefix to bind to is IPv4
26     @param mb_address_length - Length of IP prefix
27     @param mb_address[16] - IP prefix/
28 */
29 autoreply define mpls_ip_bind_unbind
30 {
31   u32 client_index;
32   u32 context;
33   u32 mb_mpls_table_id;
34   u32 mb_label;
35   u32 mb_ip_table_id;
36   u8 mb_create_table_if_needed;
37   u8 mb_is_bind;
38   u8 mb_is_ip4;
39   u8 mb_address_length;
40   u8 mb_address[16];
41 };
42
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
48     @param mt_is_multicast - Is the tunnel's underlying LSP multicast
49     @param mt_next_hop_proto_is_ip4 - The next-hop is IPV4
50     @param mt_next_hop_weight - The weight, for UCMP
51     @param mt_next_hop[16] - the nextop address
52     @param mt_next_hop_sw_if_index - the next-hop SW interface
53     @param mt_next_hop_table_id - the next-hop table-id (if appropriate)
54     @param mt_next_hop_n_out_labels - the number of next-hop output labels
55     @param mt_next_hop_out_label_stack - the next-hop output label stack,  outer most first
56 */
57 define mpls_tunnel_add_del
58 {
59   u32 client_index;
60   u32 context;
61   u32 mt_sw_if_index;
62   u8 mt_is_add;
63   u8 mt_l2_only;
64   u8 mt_is_multicast;
65   u8 mt_next_hop_proto_is_ip4;
66   u8 mt_next_hop_weight;
67   u8 mt_next_hop[16];
68   u8 mt_next_hop_n_out_labels;
69   u32 mt_next_hop_sw_if_index;
70   u32 mt_next_hop_table_id;
71   u32 mt_next_hop_out_label_stack[mt_next_hop_n_out_labels];
72 };
73
74 /** \brief Reply for MPLS tunnel add / del request
75     @param context - returned sender context, to match reply w/ request
76     @param retval - return code
77     @param sw_if_index - SW interface index of the tunnel created
78 */
79 define mpls_tunnel_add_del_reply
80 {
81   u32 context;
82   i32 retval;
83   u32 sw_if_index;
84 };
85
86 /** \brief Dump mpls eth tunnel table
87     @param client_index - opaque cookie to identify the sender
88     @param tunnel_index - eth tunnel identifier or -1 in case of all tunnels
89 */
90 define mpls_tunnel_dump
91 {
92   u32 client_index;
93   u32 context;
94   i32 tunnel_index;
95 };
96
97 /** \brief FIB path
98     @param sw_if_index - index of the interface
99     @param weight - The weight, for UCMP
100     @param is_local - local if non-zero, else remote
101     @param is_drop - Drop the packet
102     @param is_unreach - Drop the packet and rate limit send ICMP unreachable
103     @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
104     @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2
105     @param next_hop[16] - the next hop address
106
107     WARNING: this type is replicated, pending cleanup completion
108
109 */
110 typeonly manual_print manual_endian define fib_path2
111 {
112   u32 sw_if_index;
113   u32 weight;
114   u8 is_local;
115   u8 is_drop;
116   u8 is_unreach;
117   u8 is_prohibit;
118   u8 afi;
119   u8 next_hop[16];
120   u32 labels[16];
121 };
122
123 /** \brief mpls tunnel details
124 */
125 manual_endian manual_print define mpls_tunnel_details
126 {
127   u32 context;
128   u8 mt_sw_if_index;
129   u8 mt_tunnel_index;
130   u8 mt_l2_only;
131   u8 mt_is_multicast;
132   u32 mt_count;
133   vl_api_fib_path2_t mt_paths[mt_count];
134 };
135
136 /** \brief MPLS Route Add / del route
137     @param client_index - opaque cookie to identify the sender
138     @param context - sender context, to match reply w/ request
139     @param mr_label - The MPLS label value
140     @param mr_eos - The End of stack bit
141     @param mr_table_id - The MPLS table-id the route is added in
142     @param mr_classify_table_index - If this is a classify route, 
143                                      this is the classify table index
144     @param  mr_create_table_if_needed - If the MPLS or IP tables do not exist,
145                                         create them
146     @param mr_is_add - Is this a route add or delete
147     @param mr_is_classify - Is this route result a classify
148     @param mr_is_multicast - Is this a multicast route
149     @param mr_is_multipath - Is this route update a multipath - i.e. is this
150                              a path addition to an existing route
151     @param mr_is_resolve_host - Recurse resolution constraint via a host prefix
152     @param mr_is_resolve_attached - Recurse resolution constraint via attached prefix
153     @param mr_is_interface_rx - Interface Receive path
154     @param mr_is_interface_rx - RPF-ID Receive path. The next-hop interface
155                                 is used as the RPF-ID
156     @param mr_next_hop_proto_is_ip4 - The next-hop is IPV4
157     @param mr_next_hop_weight - The weight, for UCMP
158     @param mr_next_hop[16] - the nextop address
159     @param mr_next_hop_sw_if_index - the next-hop SW interface
160     @param mr_next_hop_table_id - the next-hop table-id (if appropriate)
161     @param mr_next_hop_n_out_labels - the number of labels in the label stack
162     @param mr_next_hop_out_label_stack - the next-hop output label stack, outer most first
163     @param next_hop_via_label - The next-hop is a resolved via a local label
164 */
165 autoreply define mpls_route_add_del
166 {
167   u32 client_index;
168   u32 context;
169   u32 mr_label;
170   u8 mr_eos;
171   u32 mr_table_id;
172   u32 mr_classify_table_index;
173   u8 mr_create_table_if_needed;
174   u8 mr_is_add;
175   u8 mr_is_classify;
176   u8 mr_is_multicast;
177   u8 mr_is_multipath;
178   u8 mr_is_resolve_host;
179   u8 mr_is_resolve_attached;
180   u8 mr_is_interface_rx;
181   u8 mr_is_rpf_id;
182   u8 mr_next_hop_proto_is_ip4;
183   u8 mr_next_hop_weight;
184   u8 mr_next_hop[16];
185   u8 mr_next_hop_n_out_labels;
186   u32 mr_next_hop_sw_if_index;
187   u32 mr_next_hop_table_id;
188   u32 mr_next_hop_via_label;
189   u32 mr_next_hop_out_label_stack[mr_next_hop_n_out_labels];
190 };
191
192 /** \brief Dump MPLS fib table
193     @param client_index - opaque cookie to identify the sender
194 */
195 define mpls_fib_dump
196 {
197   u32 client_index;
198   u32 context;
199 };
200
201 /** \brief mpls FIB table response
202     @param table_id - MPLS fib table id
203     @param s_bit - End-of-stack bit
204     @param label - MPLS label value
205     @param count - the number of fib_path in path
206     @param path  - array of of fib_path structures
207 */
208 manual_endian manual_print define mpls_fib_details
209 {
210   u32 context;
211   u32 table_id;
212   u8  eos_bit;
213   u32 label;
214   u32 count;
215   vl_api_fib_path2_t path[count];
216 };
217
218 /*
219  * Local Variables:
220  * eval: (c-set-style "gnu")
221  * End:
222  */
223