nat: nat44-ei configuration improvements
[vpp.git] / src / plugins / nat / nat44-ei / nat44_ei.api
1 /*
2  * Copyright (c) 2020 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 option version = "1.1.1";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/lib/nat_types.api";
20
21 enum nat44_ei_config_flags : u8
22 {
23   NAT44_EI_NONE = 0x00,
24   NAT44_EI_STATIC_MAPPING_ONLY = 0x01,
25   NAT44_EI_CONNECTION_TRACKING = 0x02,
26   NAT44_EI_OUT2IN_DPO = 0x04,
27   NAT44_EI_ADDR_ONLY_MAPPING = 0x08,
28   NAT44_EI_IF_INSIDE = 0x10,
29   NAT44_EI_IF_OUTSIDE = 0x20,
30   NAT44_EI_STATIC_MAPPING = 0x40,
31 };
32
33 /** \brief Enable/disable NAT44 plugin
34     @param client_index - opaque cookie to identify the sender
35     @param context - sender context, to match reply w/ request
36     @param inside_vrf - inside vrf id
37     @param outside_vrf - outside vrf id
38     @param users - maximum number of users per thread
39     @param user_memory - overwrite hash allocation parameter
40     @param sessions - maximum number of sessions per thread
41     @param session_memory - overwrite hash allocation parameter
42     @param user_sessions - maximum number of sessions per user
43     @param enable - true if enable, false if disable
44     @param flags - flag NAT44_EI_IS_STATIC_MAPPING_ONLY,
45                         NAT44_EI_IS_CONNECTION_TRACKING,
46                         NAT44_EI_IS_OUT2IN_DPO
47 */
48 autoreply define nat44_ei_plugin_enable_disable {
49   option in_progress;
50   u32 client_index;
51   u32 context;
52   u32 inside_vrf;
53   u32 outside_vrf;
54   u32 users;
55   u32 user_memory;
56   u32 sessions;
57   u32 session_memory;
58   u32 user_sessions;
59   bool enable;
60   vl_api_nat44_ei_config_flags_t flags;
61 };
62
63 /** \brief Show NAT44 plugin running config
64     @param client_index - opaque cookie to identify the sender
65     @param context - sender context, to match reply w/ request
66 */
67 define nat44_ei_show_running_config
68 {
69   option in_progress;
70   u32 client_index;
71   u32 context;
72 };
73
74 /** \brief Show NAT44 plugin running config reply
75     @param context - sender context, to match reply w/ request
76     @param retval - return code for the request
77     @param inside_vrf - default inside VRF id
78     @param outside_vrf - outside VRF id
79     @param users - maximum number of users per worker thread
80     @param sessions - maximum number of sessions per worker thread
81     @param user_sessions - maximum number of sessions per user
82     @param user_buckets - number of user hash buckets
83     @param translation_buckets - number of translation hash buckets
84     @param flags - flag NAT44_EI_IS_STATIC_MAPPING_ONLY,
85                         NAT44_EI_IS_CONNECTION_TRACKING,
86                         NAT44_EI_IS_OUT2IN_DPO
87 */
88 define nat44_ei_show_running_config_reply
89 {
90   option in_progress;
91   u32 context;
92   i32 retval;
93   u32 inside_vrf;
94   u32 outside_vrf;
95   u32 users;
96   u32 sessions;
97   u32 user_sessions;
98   u32 user_buckets;
99   u32 translation_buckets;
100   bool forwarding_enabled;
101   bool ipfix_logging_enabled;
102   vl_api_nat_timeouts_t timeouts;
103   vl_api_nat_log_level_t log_level;
104   vl_api_nat44_ei_config_flags_t flags;
105 };
106
107 /** \brief Set NAT44 logging level
108     @param client_index - opaque cookie to identify the sender
109     @param context - sender context, to match reply w/ request
110     @param log_level - logging level
111 */
112 autoreply define nat44_ei_set_log_level {
113   option deprecated;
114   u32 client_index;
115   u32 context;
116   vl_api_nat_log_level_t log_level;
117 };
118
119 /** \brief Set NAT workers
120     @param client_index - opaque cookie to identify the sender
121     @param context - sender context, to match reply w/ request
122     @param worker_mask - NAT workers mask
123 */
124 autoreply define nat44_ei_set_workers {
125   option in_progress;
126   u32 client_index;
127   u32 context;
128   u64 worker_mask;
129 };
130
131 /** \brief Dump NAT workers
132     @param client_index - opaque cookie to identify the sender
133     @param context - sender context, to match reply w/ request
134 */
135 define nat44_ei_worker_dump {
136   option in_progress;
137   u32 client_index;
138   u32 context;
139 };
140
141 /** \brief NAT workers details response
142     @param context - sender context, to match reply w/ request
143     @param worker_index - worker index
144     @param lcore_id - lcore ID
145     @param name - worker name
146 */
147 define nat44_ei_worker_details {
148   option in_progress;
149   u32 context;
150   u32 worker_index;
151   u32 lcore_id;
152   string name[64];
153 };
154
155 /** \brief Enable/disable NAT IPFIX logging
156     @param client_index - opaque cookie to identify the sender
157     @param context - sender context, to match reply w/ request
158     @param domain_id - observation domain ID
159     @param src_port - source port number
160     @param enable - true if enable, false if disable
161 */
162 autoreply define nat44_ei_ipfix_enable_disable {
163   option in_progress;
164   u32 client_index;
165   u32 context;
166   u32 domain_id;
167   u16 src_port;
168   bool enable;
169 };
170
171 /** \brief Set values of timeouts for NAT sessions (seconds)
172     @param client_index - opaque cookie to identify the sender
173     @param context - sender context, to match reply w/ request
174     @param udp - UDP timeout (default 300sec)
175     @param tcp_established - TCP established timeout (default 7440sec)
176     @param tcp_transitory - TCP transitory timeout (default 240sec)
177     @param icmp - ICMP timeout (default 60sec)
178 */
179 autoreply define nat44_ei_set_timeouts {
180   option in_progress;
181   u32 client_index;
182   u32 context;
183   u32 udp;
184   u32 tcp_established;
185   u32 tcp_transitory;
186   u32 icmp;
187 };
188
189 /** \brief Set address and port assignment algorithm
190     @param client_index - opaque cookie to identify the sender
191     @param context - sender context, to match reply w/ request
192     @param alg - address and port assignment algorithm:
193                  0 - default, 1 - MAP-E, 2 - port range
194                  (see nat44_ei_addr_and_port_alloc_alg_t in nat.h)
195     @param psid_offset - number of offset bits (valid only for MAP-E alg)
196     @param psid_length - length of PSID (valid only for MAP-E alg)
197     @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
198     @param start_port - beginning of the port range
199     @param end_port - end of the port range
200 */
201 autoreply define nat44_ei_set_addr_and_port_alloc_alg {
202   option in_progress;
203   u32 client_index;
204   u32 context;
205   u8 alg;
206   u8 psid_offset;
207   u8 psid_length;
208   u16 psid;
209   u16 start_port;
210   u16 end_port;
211 };
212
213 /** \brief Get address and port assignment algorithm
214     @param client_index - opaque cookie to identify the sender
215     @param context - sender context, to match reply w/ request
216 */
217 define nat44_ei_get_addr_and_port_alloc_alg {
218   option deprecated;
219   u32 client_index;
220   u32 context;
221 };
222
223 /** \brief Get address and port assignment algorithm reply
224     @param context - sender context, to match reply w/ request
225     @param retval - return code
226     @param alg - address and port assignment algorithm:
227                  0 - default, 1 - MAP-E, 2 - port range
228                  (see nat44_ei_addr_and_port_alloc_alg_t in nat.h)
229     @param psid_offset - number of offset bits (valid only for MAP-E alg)
230     @param psid_length - length of PSID (valid only for MAP-E alg)
231     @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
232     @param start_port - beginning of the port range
233     @param end_port - end of the port range
234 */
235 define nat44_ei_get_addr_and_port_alloc_alg_reply {
236   option deprecated;
237   u32 context;
238   i32 retval;
239   u8 alg;
240   u8 psid_offset;
241   u8 psid_length;
242   u16 psid;
243   u16 start_port;
244   u16 end_port;
245 };
246
247 /** \brief Set TCP MSS rewriting configuration
248     @param client_index - opaque cookie to identify the sender
249     @param context - sender context, to match reply w/ request
250     @param mss_value - MSS value to be used for MSS rewriting
251     @param enable - if true enable MSS rewriting feature else disable
252 */
253 autoreply define nat44_ei_set_mss_clamping {
254   option in_progress;
255   u32 client_index;
256   u32 context;
257   u16 mss_value;
258   bool enable;
259 };
260
261 /** \brief Get TCP MSS rewriting configuration
262     @param client_index - opaque cookie to identify the sender
263     @param context - sender context, to match reply w/ request
264 */
265 define nat44_ei_get_mss_clamping {
266   option deprecated;
267   u32 client_index;
268   u32 context;
269 };
270
271 /** \brief Get TCP MSS rewriting configuration reply
272     @param context - sender context, to match reply w/ request
273     @param retval - return code
274     @param mss_value - MSS value to be used for MSS rewriting
275     @param enable - if true enable MSS rewriting feature else disable
276 */
277 define nat44_ei_get_mss_clamping_reply {
278   option deprecated;
279   u32 context;
280   i32 retval;
281   u16 mss_value;
282   bool enable;
283 };
284
285 /** \brief Set HA listener (local settings)
286     @param client_index - opaque cookie to identify the sender
287     @param context - sender context, to match reply w/ request
288     @param ip_address - local IP4 address
289     @param port - local UDP port number
290     @param path_mtu - path MTU between local and failover
291 */
292 autoreply define nat44_ei_ha_set_listener {
293   option in_progress;
294   u32 client_index;
295   u32 context;
296   vl_api_ip4_address_t ip_address;
297   u16 port;
298   u32 path_mtu;
299 };
300
301 /** \brief Set HA failover (remote settings)
302     @param client_index - opaque cookie to identify the sender
303     @param context - sender context, to match reply w/ request
304     @param ip_address - failover IP4 address
305     @param port - failvoer UDP port number
306     @param session_refresh_interval - number of seconds after which to send
307                                       session counters refresh
308 */
309 autoreply define nat44_ei_ha_set_failover {
310   option in_progress;
311   u32 client_index;
312   u32 context;
313   vl_api_ip4_address_t ip_address;
314   u16 port;
315   u32 session_refresh_interval;
316 };
317
318 /** \brief Get HA listener/local configuration
319     @param client_index - opaque cookie to identify the sender
320     @param context - sender context, to match reply w/ request
321 */
322 define nat44_ei_ha_get_listener {
323   option deprecated;
324   u32 client_index;
325   u32 context;
326 };
327
328 /** \brief Get HA listener/local configuration reply
329     @param context - sender context, to match reply w/ request
330     @param retval - return code
331     @param ip_address - local IP4 address
332     @param port - local UDP port number
333     @param path_mtu - Path MTU between local and failover
334 */
335 define nat44_ei_ha_get_listener_reply {
336   option deprecated;
337   u32 context;
338   i32 retval;
339   vl_api_ip4_address_t ip_address;
340   u16 port;
341   u32 path_mtu;
342 };
343
344 /** \brief Get HA failover/remote settings
345     @param client_index - opaque cookie to identify the sender
346     @param context - sender context, to match reply w/ request
347 */
348 define nat44_ei_ha_get_failover {
349   option deprecated;
350   u32 client_index;
351   u32 context;
352 };
353
354 /** \brief Get HA failover/remote settings reply
355     @param context - sender context, to match reply w/ request
356     @param retval - return code
357     @param ip_address - failover IP4 address
358     @param port - failvoer UDP port number
359     @param session_refresh_interval - number of seconds after which to send
360                                       session counters refresh
361 */
362 define nat44_ei_ha_get_failover_reply {
363   option deprecated;
364   u32 context;
365   i32 retval;
366   vl_api_ip4_address_t ip_address;
367   u16 port;
368   u32 session_refresh_interval;
369 };
370
371 /** \brief Flush the current HA data (for testing)
372     @param client_index - opaque cookie to identify the sender
373     @param context - sender context, to match reply w/ request
374 */
375 autoreply define nat44_ei_ha_flush {
376   option in_progress;
377   u32 client_index;
378   u32 context;
379 };
380
381 /** \brief Resync HA (resend existing sessions to new failover)
382     @param client_index - opaque cookie to identify the sender
383     @param context - sender context, to match reply w/ request
384     @param want_resync_event - resync completed event sent to the sender via
385                                nat44_ei_ha_resync_completed_event API message if
386                                non-zero
387     @param pid - sender's pid
388 */
389 autoreply define nat44_ei_ha_resync
390 {
391   option in_progress;
392   u32 client_index;
393   u32 context;
394   u8 want_resync_event;
395   u32 pid;
396 };
397
398 /** \brief Tell client about a HA resync completion event
399     @param client_index - opaque cookie to identify the sender
400     @param pid - client pid registered to receive notification
401     @param missed_count - number of missed (not ACKed) messages
402 */
403 define nat44_ei_ha_resync_completed_event
404 {
405   option in_progress;
406   u32 client_index;
407   u32 pid;
408   u32 missed_count;
409 };
410
411 service {
412   rpc nat44_ei_ha_resync returns nat44_ei_ha_resync_reply events nat44_ei_ha_resync_completed_event;
413 };
414
415 /** \brief Del NAT44 user
416     @param client_index - opaque cookie to identify the sender
417     @param context - sender context, to match reply w/ request
418     @param ip_address - IPv4 address
419     @param fib_index - FIB index
420 */
421 autoreply define nat44_ei_del_user {
422   option in_progress;
423   u32 client_index;
424   u32 context;
425   vl_api_ip4_address_t ip_address;
426   u32 fib_index;
427 };
428
429 /** \brief Add/del NAT44 address range
430     @param client_index - opaque cookie to identify the sender
431     @param context - sender context, to match reply w/ request
432     @param first_ip_address - first IPv4 address
433     @param last_ip_address - last IPv4 address
434     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
435     @param is_add - true if add, false if delete
436
437 */
438 autoreply define nat44_ei_add_del_address_range {
439   option in_progress;
440   u32 client_index;
441   u32 context;
442   vl_api_ip4_address_t first_ip_address;
443   vl_api_ip4_address_t last_ip_address;
444   u32 vrf_id;
445   bool is_add;
446 };
447
448 /** \brief Dump NAT44 addresses
449     @param client_index - opaque cookie to identify the sender
450     @param context - sender context, to match reply w/ request
451 */
452 define nat44_ei_address_dump {
453   option in_progress;
454   u32 client_index;
455   u32 context;
456 };
457
458 /** \brief NAT44 address details response
459     @param context - sender context, to match reply w/ request
460     @param ip_address - IPv4 address
461     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
462 */
463 define nat44_ei_address_details {
464   option in_progress;
465   u32 context;
466   vl_api_ip4_address_t ip_address;
467   u32 vrf_id;
468 };
469
470 /** \brief Enable/disable NAT44 feature on the interface
471     @param client_index - opaque cookie to identify the sender
472     @param context - sender context, to match reply w/ request
473     @param is_add - true if add, false if delete
474     @param flags - flag NAT_IS_INSIDE if interface is inside else
475                    interface is outside
476     @param sw_if_index - software index of the interface
477 */
478 autoreply define nat44_ei_interface_add_del_feature {
479   option in_progress;
480   u32 client_index;
481   u32 context;
482   bool is_add;
483   vl_api_nat44_ei_config_flags_t flags;
484   vl_api_interface_index_t sw_if_index;
485 };
486
487 /** \brief Dump interfaces with NAT44 feature
488     @param client_index - opaque cookie to identify the sender
489     @param context - sender context, to match reply w/ request
490 */
491 define nat44_ei_interface_dump {
492   option in_progress;
493   u32 client_index;
494   u32 context;
495 };
496
497 /** \brief NAT44 interface details response
498     @param context - sender context, to match reply w/ request
499     @param sw_if_index - software index of the interface
500     @param flags - flag NAT_IS_INSIDE if interface is inside,
501                    flag NAT_IS_OUTSIDE if interface is outside
502                    and if both flags are set the interface is
503                    both inside and outside
504 */
505 define nat44_ei_interface_details {
506   option in_progress;
507   u32 context;
508   vl_api_nat44_ei_config_flags_t flags;
509   vl_api_interface_index_t sw_if_index;
510 };
511
512 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
513            in2out translation)
514     @param client_index - opaque cookie to identify the sender
515     @param context - sender context, to match reply w/ request
516     @param is_add - true if add, false if delete
517     @param flags - flag NAT_IS_INSIDE if interface is inside else
518                    interface is outside
519     @param sw_if_index - software index of the interface
520 */
521 autoreply define nat44_ei_interface_add_del_output_feature {
522   option deprecated;
523   u32 client_index;
524   u32 context;
525   bool is_add;
526   vl_api_nat44_ei_config_flags_t flags;
527   vl_api_interface_index_t sw_if_index;
528 };
529
530 /** \brief Dump interfaces with NAT44 output feature
531     @param client_index - opaque cookie to identify the sender
532     @param context - sender context, to match reply w/ request
533 */
534 define nat44_ei_interface_output_feature_dump {
535   option deprecated;
536   u32 client_index;
537   u32 context;
538 };
539
540 /** \brief NAT44 interface with output feature details response
541     @param context - sender context, to match reply w/ request
542     @param flags - flag NAT_IS_INSIDE if interface is inside else
543                    interface is outside
544     @param sw_if_index - software index of the interface
545 */
546 define nat44_ei_interface_output_feature_details {
547   option deprecated;
548   u32 context;
549   vl_api_nat44_ei_config_flags_t flags;
550   vl_api_interface_index_t sw_if_index;
551 };
552
553 /** \brief add/del NAT output interface (postrouting
554            in2out translation)
555     @param client_index - opaque cookie to identify the sender
556     @param context - sender context, to match reply w/ request
557     @param is_add - true if add, false if delete
558     @param sw_if_index - software index of the interface
559 */
560 autoendian autoreply define nat44_ei_add_del_output_interface {
561   u32 client_index;
562   u32 context;
563   bool is_add;
564   vl_api_interface_index_t sw_if_index;
565 };
566
567 service {
568   rpc nat44_ei_output_interface_get returns nat44_ei_output_interface_get_reply
569     stream nat44_ei_output_interface_details;
570 };
571
572 define nat44_ei_output_interface_get
573 {
574   u32 client_index;
575   u32 context;
576   u32 cursor;
577 };
578
579 define nat44_ei_output_interface_get_reply
580 {
581   u32 context;
582   i32 retval;
583   u32 cursor;
584 };
585
586 define nat44_ei_output_interface_details
587 {
588   u32 context;
589   vl_api_interface_index_t sw_if_index;
590 };
591
592 /** \brief Add/delete NAT44 static mapping
593     @param client_index - opaque cookie to identify the sender
594     @param context - sender context, to match reply w/ request
595     @param is_add - true if add, false if delete
596     @param flags - flag NAT44_EI_IS_ADDR_ONLY if address only mapping
597     @param local_ip_address - local IPv4 address
598     @param external_ip_address - external IPv4 address
599     @param protocol - IP protocol, used only if addr_only=0
600     @param local_port - local port number, used only if addr_only=0
601     @param external_port - external port number, used only if addr_only=0
602     @param external_sw_if_index - external interface (if set
603                                   external_ip_address is ignored, ~0 means not
604                                   used)
605     @param vfr_id - VRF ID
606     @param tag - opaque string tag
607 */
608 autoreply define nat44_ei_add_del_static_mapping {
609   option in_progress;
610   u32 client_index;
611   u32 context;
612   bool is_add;
613   vl_api_nat44_ei_config_flags_t flags;
614   vl_api_ip4_address_t local_ip_address;
615   vl_api_ip4_address_t external_ip_address;
616   u8 protocol;
617   u16 local_port;
618   u16 external_port;
619   vl_api_interface_index_t external_sw_if_index;
620   u32 vrf_id;
621   string tag[64];
622 };
623
624 /** \brief Dump NAT44 static mappings
625     @param client_index - opaque cookie to identify the sender
626     @param context - sender context, to match reply w/ request
627 */
628 define nat44_ei_static_mapping_dump {
629   option in_progress;
630   u32 client_index;
631   u32 context;
632 };
633
634 /** \brief NAT44 static mapping details response
635     @param context - sender context, to match reply w/ request
636     @param flags - flag NAT44_EI_IS_ADDR_ONLY if address only mapping,
637     @param local_ip_address - local IPv4 address
638     @param external_ip_address - external IPv4 address
639     @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
640     @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
641     @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
642     @param external_sw_if_index - external interface
643     @param vfr_id - VRF ID
644     @param tag - opaque string tag
645 */
646 define nat44_ei_static_mapping_details {
647   option in_progress;
648   u32 context;
649   vl_api_nat44_ei_config_flags_t flags;
650   vl_api_ip4_address_t local_ip_address;
651   vl_api_ip4_address_t external_ip_address;
652   u8 protocol;
653   u16 local_port;
654   u16 external_port;
655   vl_api_interface_index_t external_sw_if_index;
656   u32 vrf_id;
657   string tag[64];
658 };
659
660 /** \brief Add/delete NAT44 identity mapping
661     @param client_index - opaque cookie to identify the sender
662     @param context - sender context, to match reply w/ request
663     @param is_add - true if add, false if delete
664     @param flags - flag NAT44_EI_IS_ADDR_ONLY if address only mapping
665     @param ip_address - IPv4 address
666     @param protocol - IP protocol
667     @param port - port number
668     @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
669                                     used)
670     @param vfr_id - VRF ID (if ~0 use default VRF)
671     @param tag - opaque string tag
672 */
673 autoreply define nat44_ei_add_del_identity_mapping {
674   option deprecated;
675   u32 client_index;
676   u32 context;
677   bool is_add;
678   vl_api_nat44_ei_config_flags_t flags;
679   vl_api_ip4_address_t ip_address;
680   u8 protocol;
681   u16 port;
682   vl_api_interface_index_t sw_if_index;
683   u32 vrf_id;
684   string tag[64];
685 };
686
687 /** \brief Dump NAT44 identity mappings
688     @param client_index - opaque cookie to identify the sender
689     @param context - sender context, to match reply w/ request
690 */
691 define nat44_ei_identity_mapping_dump {
692   option deprecated;
693   u32 client_index;
694   u32 context;
695 };
696
697 /** \brief NAT44 identity mapping details response
698     @param context - sender context, to match reply w/ request
699     @param flags - flag NAT44_EI_ADDR_ONLY if address only mapping
700     @param ip_address - IPv4 address
701     @param protocol - IP protocol
702     @param port - port number
703     @param sw_if_index - interface
704     @param vfr_id - VRF ID
705     @param tag - opaque string tag
706 */
707 define nat44_ei_identity_mapping_details {
708   option deprecated;
709   u32 context;
710   vl_api_nat44_ei_config_flags_t flags;
711   vl_api_ip4_address_t ip_address;
712   u8 protocol;
713   u16 port;
714   vl_api_interface_index_t sw_if_index;
715   u32 vrf_id;
716   string tag[64];
717 };
718
719 /** \brief Add/delete NAT44 pool address from specific interfce
720     @param client_index - opaque cookie to identify the sender
721     @param context - sender context, to match reply w/ request
722     @param is_add - true if add, false if delete
723     @param sw_if_index - software index of the interface
724     @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
725 */
726 autoreply define nat44_ei_add_del_interface_addr {
727   option deprecated;
728   u32 client_index;
729   u32 context;
730   bool is_add;
731   vl_api_interface_index_t sw_if_index;
732   vl_api_nat44_ei_config_flags_t flags;
733 };
734
735 /** \brief Dump NAT44 pool addresses interfaces
736     @param client_index - opaque cookie to identify the sender
737     @param context - sender context, to match reply w/ request
738 */
739 define nat44_ei_interface_addr_dump {
740   option deprecated;
741   u32 client_index;
742   u32 context;
743 };
744
745 /** \brief NAT44 pool addresses interfaces details response
746     @param context - sender context, to match reply w/ request
747     @param sw_if_index - software index of the interface
748
749 */
750 define nat44_ei_interface_addr_details {
751   option deprecated;
752   u32 context;
753   vl_api_interface_index_t sw_if_index;
754 };
755
756 /** \brief Dump NAT44 users
757     @param client_index - opaque cookie to identify the sender
758     @param context - sender context, to match reply w/ request
759 */
760 define nat44_ei_user_dump {
761   option in_progress;
762   u32 client_index;
763   u32 context;
764 };
765
766 /** \brief NAT44 users response
767     @param context - sender context, to match reply w/ request
768     @vrf_id - VRF ID
769     @param ip_address - IPv4 address
770     @param nsessions - number of dynamic sessions
771     @param nstaticsessions - number of static sessions
772 */
773 define nat44_ei_user_details {
774   option in_progress;
775   u32 context;
776   u32 vrf_id;
777   vl_api_ip4_address_t ip_address;
778   u32 nsessions;
779   u32 nstaticsessions;
780 };
781
782 /** \brief NAT44 user's sessions
783     @param client_index - opaque cookie to identify the sender
784     @param context - sender context, to match reply w/ request
785     @param ip_address - IPv4 address of the user to dump
786     @param vrf_id - VRF_ID
787 */
788 define nat44_ei_user_session_dump {
789   option in_progress;
790   u32 client_index;
791   u32 context;
792   vl_api_ip4_address_t ip_address;
793   u32 vrf_id;
794 };
795
796 /** \brief NAT44 user's sessions response
797     @param context - sender context, to match reply w/ request
798     @param outside_ip_address - outside IPv4 address
799     @param outside_port - outside port
800     @param inside_ip_address - inside IPv4 address
801     @param inside_port - inside port
802     @param protocol - protocol
803     @param flags - flag NAT_IS_STATIC if session is static
804     @param last_heard - last heard timer
805     @param total_bytes - count of bytes sent through session
806     @param total_pkts - count of pakets sent through session
807     @param ext_host_address - external host IPv4 address
808     @param ext_host_port - external host port
809 */
810 define nat44_ei_user_session_details {
811   option in_progress;
812   u32 context;
813   vl_api_ip4_address_t outside_ip_address;
814   u16 outside_port;
815   vl_api_ip4_address_t inside_ip_address;
816   u16 inside_port;
817   u16 protocol;
818   vl_api_nat44_ei_config_flags_t flags;
819   u64 last_heard;
820   u64 total_bytes;
821   u32 total_pkts;
822   vl_api_ip4_address_t ext_host_address;
823   u16 ext_host_port;
824 };
825
826 /** \brief Delete NAT44 session
827     @param client_index - opaque cookie to identify the sender
828     @param context - sender context, to match reply w/ request
829     @param ip_address - IPv4 address
830     @param protocol - IP protocol
831     @param port - port number
832     @param vfr_id - VRF ID
833     @param flags - flag NAT_IS_INSIDE if interface is inside or
834                    interface is outside,
835                    flag NAT_IS_EXT_HOST_VALID if external host address and
836                    port are valid
837     @param ext_host_address - external host IPv4 address
838     @param ext_host_port - external host port
839 */
840 autoreply define nat44_ei_del_session {
841   option in_progress;
842   u32 client_index;
843   u32 context;
844   vl_api_ip4_address_t address;
845   u8 protocol;
846   u16 port;
847   u32 vrf_id;
848   vl_api_nat44_ei_config_flags_t flags;
849   vl_api_ip4_address_t ext_host_address;
850   u16 ext_host_port;
851 };
852
853 /** \brief Enable/disable forwarding for NAT44
854     Forward packets which don't match existing translation
855     or static mapping instead of dropping them.
856     @param client_index - opaque cookie to identify the sender
857     @param context - sender context, to match reply w/ request
858     @param enable - true for enable, false for disable
859 */
860 autoreply define nat44_ei_forwarding_enable_disable {
861   option in_progress;
862   u32 client_index;
863   u32 context;
864   bool enable;
865 };
866
867 /** \brief Set NAT handoff frame queue options
868     @param client_index - opaque cookie to identify the sender
869     @param context - sender context, to match reply w/ request
870     @param frame_queue_nelts - number of worker handoff frame queue elements
871 */
872 autoreply define nat44_ei_set_fq_options {
873   option in_progress;
874   u32 client_index;
875   u32 context;
876   u32 frame_queue_nelts;
877 };
878
879 /** \brief Show NAT handoff frame queue options
880     @param client_index - opaque cookie to identify the sender
881     @param context - sender context, to match reply w/ request
882 */
883 define nat44_ei_show_fq_options
884 {
885   option in_progress;
886   u32 client_index;
887   u32 context;
888 };
889
890 /** \brief Show NAT handoff frame queue options reply
891     @param context - sender context, to match reply w/ request
892     @param retval - return code for the request
893     @param frame_queue_nelts - number of worker handoff frame queue elements
894 */
895 define nat44_ei_show_fq_options_reply
896 {
897   option in_progress;
898   u32 context;
899   i32 retval;
900   u32 frame_queue_nelts;
901 };