cnat: Destination based NAT
[vpp.git] / src / plugins / cnat / cnat.api
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
26 enum cnat_translation_flags:u8
27 {
28   CNAT_TRANSLATION_ALLOC_PORT = 1,
29 };
30
31 typedef cnat_endpoint
32 {
33   vl_api_address_t addr;
34   u16 port;
35 };
36
37 typedef cnat_endpoint_tuple
38 {
39   vl_api_cnat_endpoint_t dst_ep;
40   vl_api_cnat_endpoint_t src_ep;
41 };
42
43 typedef cnat_translation
44 {
45   vl_api_cnat_endpoint_t vip;
46   u32 id;
47   vl_api_ip_proto_t ip_proto;
48   u8 is_real_ip;
49   u8 flags;
50   u8 n_paths;
51   vl_api_cnat_endpoint_tuple_t paths[n_paths];
52 };
53
54 define cnat_translation_update
55 {
56   u32 client_index;
57   u32 context;
58   vl_api_cnat_translation_t translation;
59 };
60
61 define cnat_translation_update_reply
62 {
63   u32 context;
64   i32 retval;
65   u32 id;
66 };
67
68 autoreply define cnat_translation_del
69 {
70   u32 client_index;
71   u32 context;
72   u32 id;
73 };
74
75 define cnat_translation_details
76 {
77   u32 context;
78   vl_api_cnat_translation_t translation;
79 };
80
81 define cnat_translation_dump
82 {
83   u32 client_index;
84   u32 context;
85 };
86
87 autoreply define cnat_session_purge
88 {
89   u32 client_index;
90   u32 context;
91 };
92
93 typedef cnat_session
94 {
95   vl_api_cnat_endpoint_t src;
96   vl_api_cnat_endpoint_t dst;
97   vl_api_cnat_endpoint_t new;
98   vl_api_ip_proto_t ip_proto;
99   f64 timestamp;
100 };
101
102 define cnat_session_details
103 {
104   u32 context;
105   vl_api_cnat_session_t session;
106 };
107
108 define cnat_session_dump
109 {
110   u32 client_index;
111   u32 context;
112 };
113
114 autoreply define cnat_set_snat_addresses
115 {
116   u32 client_index;
117   u32 context;
118   vl_api_ip4_address_t snat_ip4;
119   vl_api_ip6_address_t snat_ip6;
120 };
121
122 autoreply define cnat_add_del_snat_prefix
123 {
124   u32 client_index;
125   u32 context;
126   u8 is_add;
127   vl_api_prefix_t prefix;
128 };
129
130 /*
131  * fd.io coding-style-patch-verification: ON
132  *
133  * Local Variables:
134  * eval: (c-set-style "gnu")
135  * End:
136  */