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 vrf_id - VRF id of tenant, ~0 means independent of VRF
30 @param is_add - 1 if add, 0 if delete
32 autoreply define snat_add_address_range {
36 u8 first_ip_address[16];
37 u8 last_ip_address[16];
42 /** \brief Dump S-NAT addresses
43 @param client_index - opaque cookie to identify the sender
44 @param context - sender context, to match reply w/ request
46 define snat_address_dump {
51 /** \brief S-NAT address details response
52 @param context - sender context, to match reply w/ request
53 @param is_ip4 - 1 if address type is IPv4
54 @param ip_address - IP address
55 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
57 define snat_address_details {
64 /** \brief Enable/disable S-NAT feature on the interface
65 @param client_index - opaque cookie to identify the sender
66 @param context - sender context, to match reply w/ request
67 @param is_add - 1 if add, 0 if delete
68 @param is_inside - 1 if inside, 0 if outside
69 @param sw_if_index - software index of the interface
71 autoreply define snat_interface_add_del_feature {
79 /** \brief Dump interfaces with S-NAT feature
80 @param client_index - opaque cookie to identify the sender
81 @param context - sender context, to match reply w/ request
83 define snat_interface_dump {
88 /** \brief S-NAT interface details response
89 @param context - sender context, to match reply w/ request
90 @param is_inside - 1 if inside, 0 if outside
91 @param sw_if_index - software index of the interface
93 define snat_interface_details {
99 /** \brief Enable/disbale S-NAT as an interface output feature (postrouting
101 @param client_index - opaque cookie to identify the sender
102 @param context - sender context, to match reply w/ request
103 @param is_add - 1 if add, 0 if delete
104 @param is_inside - 1 if inside, 0 if outside
105 @param sw_if_index - software index of the interface
107 autoreply define snat_interface_add_del_output_feature {
115 /** \brief Dump interfaces with S-NAT output feature
116 @param client_index - opaque cookie to identify the sender
117 @param context - sender context, to match reply w/ request
119 define snat_interface_output_feature_dump {
124 /** \brief S-NAT interface with output feature details response
125 @param context - sender context, to match reply w/ request
126 @param is_inside - 1 if inside, 0 if outside
127 @param sw_if_index - software index of the interface
129 define snat_interface_output_feature_details {
135 /** \brief Add/delete S-NAT static mapping
136 @param client_index - opaque cookie to identify the sender
137 @param context - sender context, to match reply w/ request
138 @param is_add - 1 if add, 0 if delete
139 @param is_ip4 - 1 if address type is IPv4
140 @param addr_only - 1 if address only mapping
141 @param local_ip_address - local IP address
142 @param external_ip_address - external IP address
143 @param protocol - IP protocol
144 @param local_port - local port number
145 @param external_port - external port number
146 @param external_sw_if_index - external interface (if set
147 external_ip_address is ignored, ~0 means not
149 @param vfr_id - VRF ID
151 autoreply define snat_add_static_mapping {
157 u8 local_ip_address[16];
158 u8 external_ip_address[16];
162 u32 external_sw_if_index;
166 /** \brief Dump S-NAT static mappings
167 @param client_index - opaque cookie to identify the sender
168 @param context - sender context, to match reply w/ request
170 define snat_static_mapping_dump {
175 /** \brief S-NAT static mapping details response
176 @param context - sender context, to match reply w/ request
177 @param is_ip4 - 1 if address type is IPv4
178 @param addr_only - 1 if address only mapping
179 @param local_ip_address - local IP address
180 @param external_ip_address - external IP address
181 @param protocol - IP protocol
182 @param local_port - local port number
183 @param external_port - external port number
184 @param external_sw_if_index - external interface
185 @param vfr_id - VRF ID
187 define snat_static_mapping_details {
191 u8 local_ip_address[16];
192 u8 external_ip_address[16];
196 u32 external_sw_if_index;
200 /** \brief Control ping from client to api server request
201 @param client_index - opaque cookie to identify the sender
202 @param context - sender context, to match reply w/ request
204 define snat_control_ping
210 /** \brief Control ping from the client to the server response
211 @param client_index - opaque cookie to identify the sender
212 @param context - sender context, to match reply w/ request
213 @param retval - return code for the request
214 @param vpe_pid - the pid of the vpe, returned by the server
216 define snat_control_ping_reply
224 /** \brief Show S-NAT plugin startup config
225 @param client_index - opaque cookie to identify the sender
226 @param context - sender context, to match reply w/ request
228 define snat_show_config
234 /** \brief Show S-NAT plugin startup config reply
235 @param context - sender context, to match reply w/ request
236 @param retval - return code for the request
237 @param static_mapping_only - if 1 dynamic translations disabled
238 @param static_mapping_connection_tracking - if 1 create session data
239 @param deterministic - if 1 deterministic mapping
240 @param translation_buckets - number of translation hash buckets
241 @param translation_memory_size - translation hash memory size
242 @param user_buckets - number of user hash buckets
243 @param user_memory_size - user hash memory size
244 @param max_translations_per_user - maximum number of translations per user
245 @param outside_vrf_id - outside VRF id
246 @param inside_vrf_id - default inside VRF id
248 define snat_show_config_reply
252 u8 static_mapping_only;
253 u8 static_mapping_connection_tracking;
255 u32 translation_buckets;
256 u32 translation_memory_size;
258 u32 user_memory_size;
259 u32 max_translations_per_user;
264 /** \brief Set S-NAT workers
265 @param client_index - opaque cookie to identify the sender
266 @param context - sender context, to match reply w/ request
267 @param worker_mask - S-NAT workers mask
269 autoreply define snat_set_workers {
275 /** \brief Dump S-NAT workers
276 @param client_index - opaque cookie to identify the sender
277 @param context - sender context, to match reply w/ request
279 define snat_worker_dump {
284 /** \brief S-NAT workers details response
285 @param context - sender context, to match reply w/ request
286 @param worker_index - worker index
287 @param lcore_id - lcore ID
288 @param name - worker name
290 define snat_worker_details {
297 /** \brief Add/delete S-NAT pool address from specific interfce
298 @param client_index - opaque cookie to identify the sender
299 @param context - sender context, to match reply w/ request
300 @param is_add - 1 if add, 0 if delete
301 @param sw_if_index - software index of the interface
303 autoreply define snat_add_del_interface_addr {
311 /** \brief Dump S-NAT pool addresses interfaces
312 @param client_index - opaque cookie to identify the sender
313 @param context - sender context, to match reply w/ request
315 define snat_interface_addr_dump {
320 /** \brief S-NAT pool addresses interfaces details response
321 @param context - sender context, to match reply w/ request
322 @param sw_if_index - software index of the interface
324 define snat_interface_addr_details {
329 /** \brief Enable/disable S-NAT IPFIX logging
330 @param client_index - opaque cookie to identify the sender
331 @param context - sender context, to match reply w/ request
332 @param domain_id - observation domain ID
333 @param src_port - source port number
334 @param enable - 1 if enable, 0 if disable
336 autoreply define snat_ipfix_enable_disable {
344 /** \brief Dump S-NAT users
345 @param client_index - opaque cookie to identify the sender
346 @param context - sender context, to match reply w/ request
348 define snat_user_dump {
353 /** \brief S-NAT users response
354 @param context - sender context, to match reply w/ request
356 @param is_ip4 - 1 if address type is IPv4
357 @param ip_adress - IP address
358 @param nsessions - number of dynamic sessions
359 @param nstaticsessions - number of static sessions
361 define snat_user_details {
370 /** \brief S-NAT user's sessions
371 @param client_index - opaque cookie to identify the sender
372 @param context - sender context, to match reply w/ request
373 @param is_ip4 - 1 if address type is IPv4
374 @param user_ip - IP address of the user to dump
375 @param vrf_id - VRF_ID
377 define snat_user_session_dump {
385 /** \brief S-NAT user's sessions response
386 @param context - sender context, to match reply w/ request
387 @param is_ip4 - 1 if address type is IPv4
388 @param outside_ip_address - outside IP address
389 @param outside_port - outside port
390 @param inside_ip_address - inside IP address
391 @param inside_port - inside port
392 @param protocol - protocol
393 @param is_static - 1 if session is static
394 @param last_heard - last heard timer
395 @param total_bytes - count of bytes sent through session
396 @param total_pkts - count of pakets sent through session
398 define snat_user_session_details {
401 u8 outside_ip_address[16];
403 u8 inside_ip_address[16];
412 /** \brief Add/delete S-NAT deterministic mapping
413 @param client_index - opaque cookie to identify the sender
414 @param context - sender context, to match reply w/ request
415 @param is_add - 1 if add, 0 if delete
416 @param is_ip4 - 1 if address type is IPv4
417 @param in_addr - inside IP address
418 @param in_plen - inside IP address prefix length
419 @param out_addr - outside IP address
420 @param out_addr - outside IP address prefix length
422 autoreply define snat_add_det_map {
434 /** \brief Get outside address and port range from inside address
435 @param client_index - opaque cookie to identify the sender
436 @param context - sender context, to match reply w/ request
437 @param is_ip4 - 1 if address type is IPv4
438 @param in_addr - inside IP address
440 define snat_det_forward {
447 /** \brief Get outside address and port range from inside address
448 @param context - sender context, to match reply w/ request
449 @param retval - return code
450 @param out_port_lo - outside port range start
451 @param out_port_hi - outside port range end
452 @param is_ip4 - 1 if address type is IPv4
453 @param out_addr - outside IP address
455 define snat_det_forward_reply {
464 /** \brief Get inside address from outside address and port
465 @param client_index - opaque cookie to identify the sender
466 @param context - sender context, to match reply w/ request
467 @param out_port - outside port
468 @param is_ip4 - 1 if address type is IPv4
469 @param out_addr - outside IP address
471 define snat_det_reverse {
479 /** \brief Get inside address from outside address and port reply
480 @param context - sender context, to match reply w/ request
481 @param retval - return code
482 @param is_ip4 - 1 if address type is IPv4
483 @param in_addr - inside IP address
485 define snat_det_reverse_reply {
492 /** \brief Dump S-NAT deterministic mappings
493 @param client_index - opaque cookie to identify the sender
494 @param context - sender context, to match reply w/ request
496 define snat_det_map_dump {
501 /** \brief S-NAT users response
502 @param context - sender context, to match reply w/ request
503 @param is_ip4 - 1 if address type is IPv4
504 @param in_addr - inside IP address
505 @param in_plen - inside IP address prefix length
506 @param out_addr - outside IP address
507 @param out_plen - outside IP address prefix length
508 @param sharing_ratio - outside to inside address sharing ratio
509 @param ports_per_host - number of ports available to a host
510 @param ses_num - number of sessions belonging to this mapping
512 define snat_det_map_details {
524 /** \brief Set values of timeouts for deterministic NAT (seconds, 0 = default)
525 @param client_index - opaque cookie to identify the sender
526 @param context - sender context, to match reply w/ request
527 @param udp - UDP timeout (default 300sec)
528 @param tcp_established - TCP established timeout (default 7440sec)
529 @param tcp_transitory - TCP transitory timeout (default 240sec)
530 @param icmp - ICMP timeout (default 60sec)
532 autoreply define snat_det_set_timeouts {
541 /** \brief Get values of timeouts for deterministic NAT (seconds)
542 @param client_index - opaque cookie to identify the sender
543 @param context - sender context, to match reply w/ request
545 define snat_det_get_timeouts {
550 /** \brief Get values of timeouts for deterministic NAT reply
551 @param context - sender context, to match reply w/ request
552 @param retval - return code
553 @param udp - UDP timeout (default 300sec)
554 @param tcp_established - TCP established timeout (default 7440sec)
555 @param tcp_transitory - TCP transitory timeout (default 240sec)
556 @param icmp - ICMP timeout (default 60sec)
558 define snat_det_get_timeouts_reply {
567 /** \brief Close CGNAT session by outside address and port
568 @param client_index - opaque cookie to identify the sender
569 @param context - sender context, to match reply w/ request
570 @param is_ip4 - 1 if address type is IPv4
571 @param out_addr - outside IP address
572 @param out_port - outside port
573 @param ext_addr - external host address
574 @param ext_port - external host port
576 autoreply define snat_det_close_session_out {
586 /** \brief Close CGNAT session by inside address and port
587 @param client_index - opaque cookie to identify the sender
588 @param context - sender context, to match reply w/ request
589 @param is_ip4 - 1 if address type is IPv4
590 @param in_addr - inside IP address
591 @param in_port - inside port
592 @param ext_addr - external host address
593 @param ext_port - external host port
595 autoreply define snat_det_close_session_in {
605 /** \brief Dump S-NAT deterministic sessions
606 @param client_index - opaque cookie to identify the sender
607 @param context - sender context, to match reply w/ request
608 @param is_ip4 - 1 if address type is IPv4
609 @param user_addr - address of an inside user whose sessions to dump
611 define snat_det_session_dump {
618 /** \brief S-NAT deterministic sessions reply
619 @param context - sender context, to match reply w/ request
620 @param is_ip4 - 1 if address type is IPv4
621 @param in_port - inside port
622 @param ext_addr - external host address
623 @param ext_port - external host port
624 @param out_port - outside NAT port
625 @param state - session state
626 @param expire - session expiration timestamp
628 define snat_det_session_details {
640 /** \brief Add/delete address range to NAT64 pool
641 @param client_index - opaque cookie to identify the sender
642 @param context - sender context, to match reply w/ request
643 @param start_addr - start address of the range
644 @param end_addr - end address of the range
645 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
646 @param is_add - 1 if add, 0 if delete
648 autoreply define nat64_add_del_pool_addr_range {
657 /** \brief Dump NAT64 pool addresses
658 @param client_index - opaque cookie to identify the sender
659 @param context - sender context, to match reply w/ request
661 define nat64_pool_addr_dump {
666 /** \brief NAT64 pool address details response
667 @param context - sender context, to match reply w/ request
668 @param address - IPv4 address
669 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
671 define nat64_pool_addr_details {
677 /** \brief Enable/disable NAT64 feature on the interface
678 @param client_index - opaque cookie to identify the sender
679 @param context - sender context, to match reply w/ request
680 @param sw_if_index - index of the interface
681 @param is_inside - 1 if inside, 0 if outside
682 @param is_add - 1 if add, 0 if delete
684 autoreply define nat64_add_del_interface {
692 /** \brief Dump interfaces with NAT64 feature
693 @param client_index - opaque cookie to identify the sender
694 @param context - sender context, to match reply w/ request
696 define nat64_interface_dump {
701 /** \brief NAT64 interface details response
702 @param context - sender context, to match reply w/ request
703 @param is_inside - 1 if inside, 0 if outside
704 @param sw_if_index - index of the interface
706 define nat64_interface_details {
712 /** \brief Add/delete NAT64 static BIB entry
713 @param client_index - opaque cookie to identify the sender
714 @param context - sender context, to match reply w/ request
715 @param i_addr - inside IPv6 address
716 @param o_addr - outside IPv4 address
717 @param i_port - inside port number
718 @param o_port - outside port number
719 @param vrf_id - VRF id of tenant
720 @param proto - protocol number
721 @param is_add - 1 if add, 0 if delete
723 autoreply define nat64_add_del_static_bib {
735 /** \brief Dump NAT64 BIB
736 @param client_index - opaque cookie to identify the sender
737 @param context - sender context, to match reply w/ request
738 @param proto - protocol of the BIB: 255 - all BIBs
742 otherwise - "unknown" protocol BIB
744 define nat64_bib_dump {
750 /** \brief NAT64 BIB details response
751 @param context - sender context, to match reply w/ request
752 @param i_addr - inside IPv6 address
753 @param o_addr - outside IPv4 address
754 @param i_port - inside port number
755 @param o_port - outside port number
756 @param vrf_id - VRF id of tenant
757 @param proto - protocol number
758 @param is_static - 1 if static BIB entry, 0 if dynamic
759 @param ses_num - number of sessions associated with the BIB entry
761 define nat64_bib_details {
773 /** \brief Set values of timeouts for NAT64 (seconds, 0 = default)
774 @param client_index - opaque cookie to identify the sender
775 @param context - sender context, to match reply w/ request
776 @param udp - UDP timeout (default 300sec)
777 @param icmp - ICMP timeout (default 60sec)
778 @param tcp_trans - TCP transitory timeout (default 240sec)
779 @param tcp_est - TCP established timeout (default 7440sec)
780 @param tcp_incoming_syn - TCP incoming SYN timeout (default 6sec)
782 autoreply define nat64_set_timeouts {
789 u32 tcp_incoming_syn;
792 /** \brief Get values of timeouts for NAT64 (seconds)
793 @param client_index - opaque cookie to identify the sender
794 @param context - sender context, to match reply w/ request
796 define nat64_get_timeouts {
801 /** \brief Get values of timeouts for NAT64 reply
802 @param context - sender context, to match reply w/ request
803 @param retval - return code
804 @param udp - UDP timeout
805 @param icmp - ICMP timeout
806 @param tcp_trans - TCP transitory timeout
807 @param tcp_est - TCP established timeout
808 @param tcp_incoming_syn - TCP incoming SYN timeout
810 define nat64_get_timeouts_reply {
817 u32 tcp_incoming_syn;
820 /** \brief Dump NAT64 session table
821 @param client_index - opaque cookie to identify the sender
822 @param context - sender context, to match reply w/ request
823 @param proto - protocol of the session table: 255 - all STs
827 otherwise - "unknown" proto ST
829 define nat64_st_dump {
835 /** \brief NAT64 session table details response
836 @param context - sender context, to match reply w/ request
837 @param il_addr - inside IPv6 address of the local host
838 @param ol_addr - outside IPv4 address of the local host
839 @param il_port - inside port number id of the local host/inside ICMP id
840 @param ol_port - outside port number of the local host/outside ICMP id
841 @param il_addr - inside IPv6 address of the remote host
842 @param ol_addr - outside IPv4 address of the remote host
843 @param l_port - port number of the remote host (not used for ICMP)
844 @param vrf_id - VRF id of tenant
845 @param proto - protocol number
847 define nat64_st_details {
860 /** \brief Add/del NAT64 prefix
861 @param client_index - opaque cookie to identify the sender
862 @param context - sender context, to match reply w/ request
863 @param prefix - NAT64 prefix
864 @param prefix - NAT64 prefix length
865 @param vrf_id - VRF id of tenant
866 @param is_add - 1 if add, 0 if delete
868 autoreply define nat64_add_del_prefix {
877 /** \brief Dump NAT64 prefix
878 @param client_index - opaque cookie to identify the sender
879 @param context - sender context, to match reply w/ request
881 define nat64_prefix_dump {
886 /** \brief Dump NAT64 prefix details response
887 @param context - sender context, to match reply w/ request
888 @param prefix - NAT64 prefix
889 @param prefix - NAT64 prefix length
890 @param vrf_id - VRF id of tenant
892 define nat64_prefix_details {