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 vfr_id - VRF ID
125 define snat_add_static_mapping {
131 u8 local_ip_address[16];
132 u8 external_ip_address[16];
138 /** \brief Add/delete S-NAT static mapping reply
139 @param context - sender context, to match reply w/ request
140 @param retval - return code
142 define snat_add_static_mapping_reply {
147 /** \brief Dump S-NAT static mappings
148 @param client_index - opaque cookie to identify the sender
149 @param context - sender context, to match reply w/ request
151 define snat_static_mapping_dump {
156 /** \brief S-NAT static mapping details response
157 @param context - sender context, to match reply w/ request
158 @param is_ip4 - 1 if address type is IPv4
159 @param addr_only - 1 if address only mapping
160 @param local_ip_address - local IP address
161 @param external_ip_address - external IP address
162 @param local_port - local port number
163 @param external_port - external port number
164 @param vfr_id - VRF ID
166 define snat_static_mapping_details {
170 u8 local_ip_address[16];
171 u8 external_ip_address[16];
177 /** \brief Control ping from client to api server request
178 @param client_index - opaque cookie to identify the sender
179 @param context - sender context, to match reply w/ request
181 define snat_control_ping
187 /** \brief Control ping from the client to the server response
188 @param client_index - opaque cookie to identify the sender
189 @param context - sender context, to match reply w/ request
190 @param retval - return code for the request
191 @param vpe_pid - the pid of the vpe, returned by the server
193 define snat_control_ping_reply
201 /** \brief Show S-NAT plugin startup config
202 @param client_index - opaque cookie to identify the sender
203 @param context - sender context, to match reply w/ request
205 define snat_show_config
211 /** \brief Show S-NAT plugin startup config reply
212 @param context - sender context, to match reply w/ request
213 @param retval - return code for the request
214 @param static_mapping_only - if 1 dynamic translations disabled
215 @param static_mapping_connection_tracking - if 1 create session data
216 @param translation_buckets - number of translation hash buckets
217 @param translation_memory_size - translation hash memory size
218 @param user_buckets - number of user hash buckets
219 @param user_memory_size - user hash memory size
220 @param max_translations_per_user - maximum number of translations per user
221 @param outside_vrf_id - outside VRF id
222 @param inside_vrf_id - default inside VRF id
224 define snat_show_config_reply
228 u8 static_mapping_only;
229 u8 static_mapping_connection_tracking;
230 u32 translation_buckets;
231 u32 translation_memory_size;
233 u32 user_memory_size;
234 u32 max_translations_per_user;
239 /** \brief Set S-NAT workers
240 @param client_index - opaque cookie to identify the sender
241 @param context - sender context, to match reply w/ request
242 @param worker_mask - S-NAT workers mask
244 define snat_set_workers {
250 /** \brief Set S-NAT workers reply
251 @param context - sender context, to match reply w/ request
252 @param retval - return code
254 define snat_set_workers_reply {
259 /** \brief Dump S-NAT workers
260 @param client_index - opaque cookie to identify the sender
261 @param context - sender context, to match reply w/ request
263 define snat_worker_dump {
268 /** \brief S-NAT workers details response
269 @param context - sender context, to match reply w/ request
270 @param worker_index - worker index
271 @param lcore_id - lcore ID
272 @param name - worker name
274 define snat_worker_details {
281 /** \brief Add/delete S-NAT pool address from specific interfce
282 @param client_index - opaque cookie to identify the sender
283 @param context - sender context, to match reply w/ request
284 @param is_add - 1 if add, 0 if delete
285 @param sw_if_index - software index of the interface
287 define snat_add_del_interface_addr {
295 /** \brief Add/delete S-NAT pool address from specific interfce reply
296 @param context - sender context, to match reply w/ request
297 @param retval - return code
299 define snat_add_del_interface_addr_reply {
304 /** \brief Dump S-NAT pool addresses interfaces
305 @param client_index - opaque cookie to identify the sender
306 @param context - sender context, to match reply w/ request
308 define snat_interface_addr_dump {
313 /** \brief S-NAT pool addresses interfaces details response
314 @param context - sender context, to match reply w/ request
315 @param sw_if_index - software index of the interface
317 define snat_interface_addr_details {
322 /** \brief Enable/disable S-NAT IPFIX logging
323 @param client_index - opaque cookie to identify the sender
324 @param context - sender context, to match reply w/ request
325 @param domain_id - observation domain ID
326 @param src_port - source port number
327 @param enable - 1 if enable, 0 if disable
329 define snat_ipfix_enable_disable {
337 /** \brief Enable/disable S-NAT IPFIX logging reply
338 @param context - sender context, to match reply w/ request
339 @param retval - return code
341 define snat_ipfix_enable_disable_reply {