1 /* Hey Emacs use -*- mode: C -*- */
3 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 This file defines the vpp control-plane API messages
19 used to control the ABF plugin
22 option version = "0.2.0";
23 import "vnet/ip/ip_types.api";
24 import "vnet/fib/fib_types.api";
25 import "vnet/interface_types.api";
27 enum cnat_translation_flags:u8
29 CNAT_TRANSLATION_ALLOC_PORT = 1,
30 CNAT_TRANSLATION_NO_RETURN_SESSION = 4,
33 enum cnat_endpoint_tuple_flags:u8
35 /* Dont translate said endpoint tuple but
43 CNAT_LB_TYPE_DEFAULT = 0,
44 CNAT_LB_TYPE_MAGLEV = 1,
47 /* An enpoint is either
49 * An interface, an address familiy and a port */
52 vl_api_address_t addr;
53 vl_api_interface_index_t sw_if_index;
54 vl_api_address_family_t if_af;
58 typedef cnat_endpoint_tuple
60 vl_api_cnat_endpoint_t dst_ep;
61 vl_api_cnat_endpoint_t src_ep;
65 typedef cnat_translation
67 vl_api_cnat_endpoint_t vip;
69 vl_api_ip_proto_t ip_proto;
72 vl_api_cnat_lb_type_t lb_type;
74 vl_api_cnat_endpoint_tuple_t paths[n_paths];
77 define cnat_translation_update
81 vl_api_cnat_translation_t translation;
84 define cnat_translation_update_reply
91 autoreply define cnat_translation_del
98 define cnat_translation_details
101 vl_api_cnat_translation_t translation;
104 define cnat_translation_dump
110 autoreply define cnat_session_purge
118 vl_api_cnat_endpoint_t src;
119 vl_api_cnat_endpoint_t dst;
120 vl_api_cnat_endpoint_t new;
121 vl_api_ip_proto_t ip_proto;
126 define cnat_session_details
129 vl_api_cnat_session_t session;
132 define cnat_session_dump
138 autoreply define cnat_set_snat_addresses
142 vl_api_ip4_address_t snat_ip4;
143 vl_api_ip6_address_t snat_ip6;
144 vl_api_interface_index_t sw_if_index;
147 define cnat_get_snat_addresses
153 define cnat_get_snat_addresses_reply
158 vl_api_ip4_address_t snat_ip4;
159 vl_api_ip6_address_t snat_ip6;
160 vl_api_interface_index_t sw_if_index;
163 autoreply define cnat_snat_policy_add_del_exclude_pfx
168 vl_api_prefix_t prefix;
171 enum cnat_snat_policy_table:u8
173 CNAT_POLICY_INCLUDE_V4 = 0,
174 CNAT_POLICY_INCLUDE_V6 = 1,
176 CNAT_POLICY_HOST = 3,
179 autoreply define cnat_snat_policy_add_del_if
183 vl_api_interface_index_t sw_if_index;
185 vl_api_cnat_snat_policy_table_t table;
188 /* A snat policy controls what traffic is srcNATed */
189 enum cnat_snat_policies:u8
191 /* No filter applied, srcNAT everything */
192 CNAT_POLICY_NONE = 0,
193 /* Filter by interface list : snat_policy_add_del_if
194 * and prefix list : snat_policy_add_del_if */
195 CNAT_POLICY_IF_PFX = 1,
196 /* Kubernetes specific policy */
200 autoreply define cnat_set_snat_policy
204 vl_api_cnat_snat_policies_t policy;
208 * fd.io coding-style-patch-verification: ON
211 * eval: (c-set-style "gnu")