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:
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.
17 * NAT44 endpoint independent plugin declarations
19 #ifndef __included_nat44_ei_h__
20 #define __included_nat44_ei_h__
22 int nat44_ei_plugin_enable ();
24 void nat44_ei_plugin_disable ();
27 * @brief Delete specific NAT44 EI user and his sessions
29 * @param addr IPv4 address
30 * @param fib_index FIB table index
32 int nat44_ei_user_del (ip4_address_t *addr, u32 fib_index);
35 * @brief Delete session for static mapping
37 * @param addr IPv4 address
38 * @param fib_index FIB table index
40 void nat44_ei_static_mapping_del_sessions (snat_main_t *sm,
41 snat_main_per_thread_data_t *tsm,
42 snat_user_key_t u_key,
43 int addr_only, ip4_address_t e_addr,
46 u32 nat44_ei_get_in2out_worker_index (ip4_header_t *ip0, u32 rx_fib_index0,
49 u32 nat44_ei_get_out2in_worker_index (vlib_buffer_t *b, ip4_header_t *ip0,
50 u32 rx_fib_index0, u8 is_output);
53 * @brief Set address and port assignment algorithm to default/standard
55 void nat44_ei_set_alloc_default (void);
58 * @brief Set address and port assignment algorithm for MAP-E CE
60 * @param psid Port Set Identifier value
61 * @param psid_offset number of offset bits
62 * @param psid_length length of PSID
64 void nat44_ei_set_alloc_mape (u16 psid, u16 psid_offset, u16 psid_length);
67 * @brief Set address and port assignment algorithm for port range
69 * @param start_port beginning of the port range
70 * @param end_port end of the port range
72 void nat44_ei_set_alloc_range (u16 start_port, u16 end_port);
74 #endif /* __included_nat44_ei_h__ */
76 * fd.io coding-style-patch-verification: ON
79 * eval: (c-set-style "gnu")