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 protocol - IP protocol
122 @param local_port - local port number
123 @param external_port - external port number
124 @param external_sw_if_index - external interface (if set
125 external_ip_address is ignored)
126 @param vfr_id - VRF ID
128 define snat_add_static_mapping {
134 u8 local_ip_address[16];
135 u8 external_ip_address[16];
139 u32 external_sw_if_index;
143 /** \brief Add/delete S-NAT static mapping reply
144 @param context - sender context, to match reply w/ request
145 @param retval - return code
147 define snat_add_static_mapping_reply {
152 /** \brief Dump S-NAT static mappings
153 @param client_index - opaque cookie to identify the sender
154 @param context - sender context, to match reply w/ request
156 define snat_static_mapping_dump {
161 /** \brief S-NAT static mapping details response
162 @param context - sender context, to match reply w/ request
163 @param is_ip4 - 1 if address type is IPv4
164 @param addr_only - 1 if address only mapping
165 @param local_ip_address - local IP address
166 @param external_ip_address - external IP address
167 @param protocol - IP protocol
168 @param local_port - local port number
169 @param external_port - external port number
170 @param external_sw_if_index - external interface
171 @param vfr_id - VRF ID
173 define snat_static_mapping_details {
177 u8 local_ip_address[16];
178 u8 external_ip_address[16];
182 u32 external_sw_if_index;
186 /** \brief Control ping from client to api server request
187 @param client_index - opaque cookie to identify the sender
188 @param context - sender context, to match reply w/ request
190 define snat_control_ping
196 /** \brief Control ping from the client to the server response
197 @param client_index - opaque cookie to identify the sender
198 @param context - sender context, to match reply w/ request
199 @param retval - return code for the request
200 @param vpe_pid - the pid of the vpe, returned by the server
202 define snat_control_ping_reply
210 /** \brief Show S-NAT plugin startup config
211 @param client_index - opaque cookie to identify the sender
212 @param context - sender context, to match reply w/ request
214 define snat_show_config
220 /** \brief Show S-NAT plugin startup config reply
221 @param context - sender context, to match reply w/ request
222 @param retval - return code for the request
223 @param static_mapping_only - if 1 dynamic translations disabled
224 @param static_mapping_connection_tracking - if 1 create session data
225 @param translation_buckets - number of translation hash buckets
226 @param translation_memory_size - translation hash memory size
227 @param user_buckets - number of user hash buckets
228 @param user_memory_size - user hash memory size
229 @param max_translations_per_user - maximum number of translations per user
230 @param outside_vrf_id - outside VRF id
231 @param inside_vrf_id - default inside VRF id
233 define snat_show_config_reply
237 u8 static_mapping_only;
238 u8 static_mapping_connection_tracking;
239 u32 translation_buckets;
240 u32 translation_memory_size;
242 u32 user_memory_size;
243 u32 max_translations_per_user;
248 /** \brief Set S-NAT workers
249 @param client_index - opaque cookie to identify the sender
250 @param context - sender context, to match reply w/ request
251 @param worker_mask - S-NAT workers mask
253 define snat_set_workers {
259 /** \brief Set S-NAT workers reply
260 @param context - sender context, to match reply w/ request
261 @param retval - return code
263 define snat_set_workers_reply {
268 /** \brief Dump S-NAT workers
269 @param client_index - opaque cookie to identify the sender
270 @param context - sender context, to match reply w/ request
272 define snat_worker_dump {
277 /** \brief S-NAT workers details response
278 @param context - sender context, to match reply w/ request
279 @param worker_index - worker index
280 @param lcore_id - lcore ID
281 @param name - worker name
283 define snat_worker_details {
290 /** \brief Add/delete S-NAT pool address from specific interfce
291 @param client_index - opaque cookie to identify the sender
292 @param context - sender context, to match reply w/ request
293 @param is_add - 1 if add, 0 if delete
294 @param sw_if_index - software index of the interface
296 define snat_add_del_interface_addr {
304 /** \brief Add/delete S-NAT pool address from specific interfce reply
305 @param context - sender context, to match reply w/ request
306 @param retval - return code
308 define snat_add_del_interface_addr_reply {
313 /** \brief Dump S-NAT pool addresses interfaces
314 @param client_index - opaque cookie to identify the sender
315 @param context - sender context, to match reply w/ request
317 define snat_interface_addr_dump {
322 /** \brief S-NAT pool addresses interfaces details response
323 @param context - sender context, to match reply w/ request
324 @param sw_if_index - software index of the interface
326 define snat_interface_addr_details {
331 /** \brief Enable/disable S-NAT IPFIX logging
332 @param client_index - opaque cookie to identify the sender
333 @param context - sender context, to match reply w/ request
334 @param domain_id - observation domain ID
335 @param src_port - source port number
336 @param enable - 1 if enable, 0 if disable
338 define snat_ipfix_enable_disable {
346 /** \brief Enable/disable S-NAT IPFIX logging reply
347 @param context - sender context, to match reply w/ request
348 @param retval - return code
350 define snat_ipfix_enable_disable_reply {
355 /** \brief Dump S-NAT users
356 @param client_index - opaque cookie to identify the sender
357 @param context - sender context, to match reply w/ request
359 define snat_user_dump {
364 /** \brief S-NAT users response
365 @param context - sender context, to match reply w/ request
367 @param is_ip4 - 1 if address type is IPv4
368 @param ip_adress - IP address
369 @param nsessions - number of dynamic sessions
370 @param nstaticsessions - number of static sessions
372 define snat_user_details {
381 /** \brief S-NAT user's sessions
382 @param client_index - opaque cookie to identify the sender
383 @param context - sender context, to match reply w/ request
384 @param user_ip - IP address of the user to dump
385 @param vrf_id - VRF_ID
387 define snat_user_session_dump {
394 /** \brief S-NAT user's sessions response
395 @param context - sender context, to match reply w/ request
396 @param is_ip4 - 1 if address type is IPv4
397 @param outside_ip_address - outside IP address
398 @param outside_port - outside port
399 @param inside_ip_address - inside IP address
400 @param inside_port - inside port
401 @param protocol - protocol
402 @param is_static - 1 if session is static
403 @param last_heard - last heard timer
404 @param total_bytes - count of bytes sent through session
405 @param total_pkts - count of pakets sent through session
407 define snat_user_session_details {
410 u8 outside_ip_address[16];
412 u8 inside_ip_address[16];