FD.io VPP  v21.01.1
Vector Packet Processing
cnat.api
Go to the documentation of this file.
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
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:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 /** \file
18  This file defines the vpp control-plane API messages
19  used to control the ABF plugin
20 */
21 
22 option version = "0.1.0";
23 import "vnet/ip/ip_types.api";
24 import "vnet/fib/fib_types.api";
25 import "vnet/interface_types.api";
26 
28 {
30 };
31 
32 /* An enpoint is either
33  * An IP & a port
34  * An interface, an address familiy and a port */
35 typedef cnat_endpoint
36 {
37  vl_api_address_t addr;
38  vl_api_interface_index_t sw_if_index;
39  vl_api_address_family_t if_af;
41 };
42 
43 typedef cnat_endpoint_tuple
44 {
45  vl_api_cnat_endpoint_t dst_ep;
46  vl_api_cnat_endpoint_t src_ep;
47 };
48 
49 typedef cnat_translation
50 {
51  vl_api_cnat_endpoint_t vip;
53  vl_api_ip_proto_t ip_proto;
57  vl_api_cnat_endpoint_tuple_t paths[n_paths];
58 };
59 
61 {
64  vl_api_cnat_translation_t translation;
65 };
66 
67 define cnat_translation_update_reply
68 {
72 };
73 
74 autoreply define cnat_translation_del
75 {
79 };
80 
81 define cnat_translation_details
82 {
84  vl_api_cnat_translation_t translation;
85 };
86 
87 define cnat_translation_dump
88 {
91 };
92 
93 autoreply define cnat_session_purge
94 {
97 };
98 
99 typedef cnat_session
100 {
101  vl_api_cnat_endpoint_t src;
102  vl_api_cnat_endpoint_t dst;
103  vl_api_cnat_endpoint_t new;
104  vl_api_ip_proto_t ip_proto;
106 };
107 
108 define cnat_session_details
109 {
111  vl_api_cnat_session_t session;
112 };
113 
114 define cnat_session_dump
115 {
118 };
119 
120 autoreply define cnat_set_snat_addresses
121 {
124  vl_api_ip4_address_t snat_ip4;
125  vl_api_ip6_address_t snat_ip6;
126  vl_api_interface_index_t sw_if_index;
127 };
128 
129 define cnat_get_snat_addresses
130 {
133 };
134 
135 define cnat_get_snat_addresses_reply
136 {
140  vl_api_ip4_address_t snat_ip4;
141  vl_api_ip6_address_t snat_ip6;
142  vl_api_interface_index_t sw_if_index;
143 };
144 
145 autoreply define cnat_add_del_snat_prefix
146 {
150  vl_api_prefix_t prefix;
151 };
152 
153 /*
154  * fd.io coding-style-patch-verification: ON
155  *
156  * Local Variables:
157  * eval: (c-set-style "gnu")
158  * End:
159  */
vl_api_address_family_t if_af
Definition: cnat.api:39
u8 flags
Definition: cnat.api:55
typedef cnat_endpoint
Definition: cnat.api:36
typedef cnat_endpoint_tuple
Definition: cnat.api:44
vl_api_ip6_address_t snat_ip6
Definition: cnat.api:125
vl_api_cnat_endpoint_tuple_t paths[n_paths]
Definition: cnat.api:57
vl_api_interface_index_t sw_if_index
Definition: cnat.api:38
vl_api_address_t src
Definition: gre.api:54
typedef cnat_translation
Definition: cnat.api:50
vl_api_ip6_address_t snat_ip6
Definition: cnat.api:141
vhost_vring_addr_t addr
Definition: vhost_user.h:111
vl_api_ip_proto_t ip_proto
Definition: cnat.api:53
unsigned char u8
Definition: types.h:56
vl_api_cnat_translation_t translation
Definition: cnat.api:64
double f64
Definition: types.h:142
int cnat_session_purge(void)
Purge all the sessions.
Definition: cnat_session.c:142
vl_api_ip4_address_t snat_ip4
Definition: cnat.api:140
u32 id
Definition: cnat.api:52
vl_api_interface_index_t sw_if_index
Definition: cnat.api:142
unsigned int u32
Definition: types.h:88
vl_api_cnat_session_t session
Definition: cnat.api:111
u32 n_paths
Definition: cnat.api:56
f64 timestamp
Definition: cnat.api:105
unsigned short u16
Definition: types.h:57
u16 port
Definition: cnat.api:40
option version
Definition: cnat.api:22
signed int i32
Definition: types.h:77
vl_api_ip4_address_t snat_ip4
Definition: cnat.api:124
vl_api_cnat_endpoint_t dst
Definition: cnat.api:102
u32 cnat_translation_update(cnat_endpoint_t *vip, ip_protocol_t proto, cnat_endpoint_tuple_t *paths, u8 flags)
create or update a translation
u8 is_real_ip
Definition: cnat.api:54
vl_api_cnat_translation_t translation
Definition: cnat.api:84
cnat_translation_flags
Definition: cnat.api:27
vl_api_interface_index_t sw_if_index
Definition: cnat.api:126
typedef cnat_session
Definition: cnat.api:100
vl_api_cnat_endpoint_t src_ep
Definition: cnat.api:46