2 * Copyright (c) 2021 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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 option version = "0.1.1";
18 import "vnet/interface_types.api";
19 import "vnet/ip/ip_types.api";
27 PNAT_COPY_BYTE = 0x10,
28 PNAT_CLEAR_BYTE = 0x20,
31 enum pnat_attachment_point
35 PNAT_ATTACHMENT_POINT_MAX,
38 typedef pnat_match_tuple
40 vl_api_ip4_address_t src;
41 vl_api_ip4_address_t dst;
42 vl_api_ip_proto_t proto;
45 vl_api_pnat_mask_t mask;
48 typedef pnat_rewrite_tuple
50 vl_api_ip4_address_t src;
51 vl_api_ip4_address_t dst;
54 vl_api_pnat_mask_t mask; // needed?
60 autoendian define pnat_binding_add
64 vl_api_pnat_match_tuple_t match;
65 vl_api_pnat_rewrite_tuple_t rewrite;
68 autoendian define pnat_binding_add_reply
75 autoendian autoreply define pnat_binding_del
82 autoendian autoreply define pnat_binding_attach
86 vl_api_interface_index_t sw_if_index;
87 vl_api_pnat_attachment_point_t attachment;
91 autoendian autoreply define pnat_binding_detach
95 vl_api_interface_index_t sw_if_index;
96 vl_api_pnat_attachment_point_t attachment;
101 rpc pnat_bindings_get returns pnat_bindings_get_reply
102 stream pnat_bindings_details;
103 rpc pnat_interfaces_get returns pnat_interfaces_get_reply
104 stream pnat_interfaces_details;
107 define pnat_bindings_get
114 define pnat_bindings_get_reply
121 define pnat_bindings_details
124 vl_api_pnat_match_tuple_t match;
125 vl_api_pnat_rewrite_tuple_t rewrite;
128 define pnat_interfaces_get
135 define pnat_interfaces_get_reply
142 define pnat_interfaces_details
145 vl_api_interface_index_t sw_if_index;
146 bool enabled[2]; /* PNAT_ATTACHMENT_POINT_MAX */
147 vl_api_pnat_mask_t lookup_mask[2]; /* PNAT_ATTACHMENT_POINT_MAX */
155 description "successfully rewritten";
162 description "rewrite failed";
168 description "packet too short for rewrite";
173 "/err/pnat-input" "pnat";
174 "/err/pnat-output" "pnat";