nat: Final NAT44 EI/ED split patch
[vpp.git] / src / plugins / nat / nat66 / nat66.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.0.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/lib/nat_types.api";
20
21 /** \brief Enable/disable NAT66 feature on the interface
22     @param client_index - opaque cookie to identify the sender
23     @param context - sender context, to match reply w/ request
24     @param is_add - true if add, false if delete
25     @param flags - flag NAT_IS_INSIDE if interface is inside or
26                    interface is outside,
27     @param sw_if_index - software index of the interface
28 */
29 autoreply define nat66_add_del_interface {
30   u32 client_index;
31   u32 context;
32   bool is_add;
33   vl_api_nat_config_flags_t flags;
34   vl_api_interface_index_t sw_if_index;
35 };
36
37 /** \brief Dump interfaces with NAT66 feature
38     @param client_index - opaque cookie to identify the sender
39     @param context - sender context, to match reply w/ request
40 */
41 define nat66_interface_dump {
42   u32 client_index;
43   u32 context;
44 };
45
46 /** \brief NAT66 interface details response
47     @param context - sender context, to match reply w/ request
48     @param flags - flag NAT_IS_INSIDE if interface is inside or
49                    interface is outside,
50     @param sw_if_index - software index of the interface
51 */
52 define nat66_interface_details {
53   u32 context;
54   vl_api_nat_config_flags_t flags;
55   vl_api_interface_index_t sw_if_index;
56 };
57
58 /** \brief Add/delete 1:1 NAT66
59     @param client_index - opaque cookie to identify the sender
60     @param context - sender context, to match reply w/ request
61     @param is_add - true if add, false if delete
62     @param local_ip_address - local IPv6 address
63     @param external_ip_address - external IPv6 address
64     @param vrf_id - VRF id of tenant
65 */
66 autoreply define nat66_add_del_static_mapping {
67   u32 client_index;
68   u32 context;
69   bool is_add;
70   vl_api_ip6_address_t local_ip_address;
71   vl_api_ip6_address_t external_ip_address;
72   u32 vrf_id;
73 };
74
75 /** \brief Dump NAT66 static mappings
76     @param client_index - opaque cookie to identify the sender
77     @param context - sender context, to match reply w/ request
78 */
79 define nat66_static_mapping_dump {
80   u32 client_index;
81   u32 context;
82 };
83
84 /** \brief NAT66 static mapping details response
85     @param context - sender context, to match reply w/ request
86     @param local_ip_address - local IPv6 address
87     @param external_ip_address - external IPv6 address
88     @param vrf_id - VRF id of tenant
89     @param total_bytes - count of bytes sent through static mapping
90     @param total_pkts - count of pakets sent through static mapping
91 */
92 define nat66_static_mapping_details {
93   u32 context;
94   vl_api_ip6_address_t local_ip_address;
95   vl_api_ip6_address_t external_ip_address;
96   u32 vrf_id;
97   u64 total_bytes;
98   u64 total_pkts;
99 };