2 * Copyright (c) 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.
17 * @brief VPP control-plane API messages.
19 * This file defines VPP control-plane API messages which are generally
20 * called through a shared memory interface.
23 /** \brief Add/del S-NAT address range
24 @param client_index - opaque cookie to identify the sender
25 @param context - sender context, to match reply w/ request
26 @param is_ip4 - 1 if address type is IPv4
27 @param first_ip_address - first IP address
28 @param last_ip_address - last IP address
29 @param is_add - 1 if add, 0 if delete
31 define snat_add_address_range {
35 u8 first_ip_address[16];
36 u8 last_ip_address[16];
40 /** \brief Add S-NAT address range reply
41 @param context - sender context, to match reply w/ request
42 @param retval - return code
44 define snat_add_address_range_reply {
49 /** \brief Dump S-NAT addresses
50 @param client_index - opaque cookie to identify the sender
51 @param context - sender context, to match reply w/ request
53 define snat_address_dump {
58 /** \brief S-NAT address details response
59 @param context - sender context, to match reply w/ request
60 @param is_ip4 - 1 if address type is IPv4
61 @param ip_address - IP address
63 define snat_address_details {
69 /** \brief Enable/disable S-NAT feature on the interface
70 @param client_index - opaque cookie to identify the sender
71 @param context - sender context, to match reply w/ request
72 @param is_add - 1 if add, 0 if delete
73 @param is_inside - 1 if inside, 0 if outside
74 @param sw_if_index - software index of the interface
76 define snat_interface_add_del_feature {
84 /** \brief Enable/disable S-NAT feature on the interface reply
85 @param context - sender context, to match reply w/ request
86 @param retval - return code
88 define snat_interface_add_del_feature_reply {
93 /** \brief Dump interfaces with S-NAT feature
94 @param client_index - opaque cookie to identify the sender
95 @param context - sender context, to match reply w/ request
97 define snat_interface_dump {
102 /** \brief S-NAT interface details response
103 @param context - sender context, to match reply w/ request
104 @param is_inside - 1 if inside, 0 if outside
105 @param sw_if_index - software index of the interface
107 define snat_interface_details {
113 /** \brief Add/delete S-NAT static mapping
114 @param client_index - opaque cookie to identify the sender
115 @param context - sender context, to match reply w/ request
116 @param is_add - 1 if add, 0 if delete
117 @param is_ip4 - 1 if address type is IPv4
118 @param addr_only - 1 if address only mapping
119 @param local_ip_address - local IP address
120 @param external_ip_address - external IP address
121 @param local_port - local port number
122 @param external_port - external port number
123 @param external_sw_if_index - external interface (if set
124 external_ip_address is ignored)
125 @param vfr_id - VRF ID
127 define snat_add_static_mapping {
133 u8 local_ip_address[16];
134 u8 external_ip_address[16];
137 u32 external_sw_if_index;
141 /** \brief Add/delete S-NAT static mapping reply
142 @param context - sender context, to match reply w/ request
143 @param retval - return code
145 define snat_add_static_mapping_reply {
150 /** \brief Dump S-NAT static mappings
151 @param client_index - opaque cookie to identify the sender
152 @param context - sender context, to match reply w/ request
154 define snat_static_mapping_dump {
159 /** \brief S-NAT static mapping details response
160 @param context - sender context, to match reply w/ request
161 @param is_ip4 - 1 if address type is IPv4
162 @param addr_only - 1 if address only mapping
163 @param local_ip_address - local IP address
164 @param external_ip_address - external IP address
165 @param local_port - local port number
166 @param external_port - external port number
167 @param vfr_id - VRF ID
169 define snat_static_mapping_details {
173 u8 local_ip_address[16];
174 u8 external_ip_address[16];
180 /** \brief Control ping from client to api server request
181 @param client_index - opaque cookie to identify the sender
182 @param context - sender context, to match reply w/ request
184 define snat_control_ping
190 /** \brief Control ping from the client to the server response
191 @param client_index - opaque cookie to identify the sender
192 @param context - sender context, to match reply w/ request
193 @param retval - return code for the request
194 @param vpe_pid - the pid of the vpe, returned by the server
196 define snat_control_ping_reply
204 /** \brief Show S-NAT plugin startup config
205 @param client_index - opaque cookie to identify the sender
206 @param context - sender context, to match reply w/ request
208 define snat_show_config
214 /** \brief Show S-NAT plugin startup config reply
215 @param context - sender context, to match reply w/ request
216 @param retval - return code for the request
217 @param static_mapping_only - if 1 dynamic translations disabled
218 @param static_mapping_connection_tracking - if 1 create session data
219 @param translation_buckets - number of translation hash buckets
220 @param translation_memory_size - translation hash memory size
221 @param user_buckets - number of user hash buckets
222 @param user_memory_size - user hash memory size
223 @param max_translations_per_user - maximum number of translations per user
224 @param outside_vrf_id - outside VRF id
225 @param inside_vrf_id - default inside VRF id
227 define snat_show_config_reply
231 u8 static_mapping_only;
232 u8 static_mapping_connection_tracking;
233 u32 translation_buckets;
234 u32 translation_memory_size;
236 u32 user_memory_size;
237 u32 max_translations_per_user;
242 /** \brief Set S-NAT workers
243 @param client_index - opaque cookie to identify the sender
244 @param context - sender context, to match reply w/ request
245 @param worker_mask - S-NAT workers mask
247 define snat_set_workers {
253 /** \brief Set S-NAT workers reply
254 @param context - sender context, to match reply w/ request
255 @param retval - return code
257 define snat_set_workers_reply {
262 /** \brief Dump S-NAT workers
263 @param client_index - opaque cookie to identify the sender
264 @param context - sender context, to match reply w/ request
266 define snat_worker_dump {
271 /** \brief S-NAT workers details response
272 @param context - sender context, to match reply w/ request
273 @param worker_index - worker index
274 @param lcore_id - lcore ID
275 @param name - worker name
277 define snat_worker_details {
284 /** \brief Add/delete S-NAT pool address from specific interfce
285 @param client_index - opaque cookie to identify the sender
286 @param context - sender context, to match reply w/ request
287 @param is_add - 1 if add, 0 if delete
288 @param sw_if_index - software index of the interface
290 define snat_add_del_interface_addr {
298 /** \brief Add/delete S-NAT pool address from specific interfce reply
299 @param context - sender context, to match reply w/ request
300 @param retval - return code
302 define snat_add_del_interface_addr_reply {
307 /** \brief Dump S-NAT pool addresses interfaces
308 @param client_index - opaque cookie to identify the sender
309 @param context - sender context, to match reply w/ request
311 define snat_interface_addr_dump {
316 /** \brief S-NAT pool addresses interfaces details response
317 @param context - sender context, to match reply w/ request
318 @param sw_if_index - software index of the interface
320 define snat_interface_addr_details {
325 /** \brief Enable/disable S-NAT IPFIX logging
326 @param client_index - opaque cookie to identify the sender
327 @param context - sender context, to match reply w/ request
328 @param domain_id - observation domain ID
329 @param src_port - source port number
330 @param enable - 1 if enable, 0 if disable
332 define snat_ipfix_enable_disable {
340 /** \brief Enable/disable S-NAT IPFIX logging reply
341 @param context - sender context, to match reply w/ request
342 @param retval - return code
344 define snat_ipfix_enable_disable_reply {