session svm: fix fifo migration
[vpp.git] / src / plugins / nat / nat44-ei / nat44_ei.h
1 /*
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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 /**
16  * @file nat44_ei.h
17  * NAT44 endpoint independent plugin declarations
18  */
19 #ifndef __included_nat44_ei_h__
20 #define __included_nat44_ei_h__
21
22 int nat44_ei_plugin_enable ();
23
24 void nat44_ei_plugin_disable ();
25
26 /**
27  * @brief Delete specific NAT44 EI user and his sessions
28  *
29  * @param addr         IPv4 address
30  * @param fib_index    FIB table index
31  */
32 int nat44_ei_user_del (ip4_address_t *addr, u32 fib_index);
33
34 /**
35  * @brief Delete session for static mapping
36  *
37  * @param addr         IPv4 address
38  * @param fib_index    FIB table index
39  */
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,
44                                            u16 e_port);
45
46 u32 nat44_ei_get_in2out_worker_index (ip4_header_t *ip0, u32 rx_fib_index0,
47                                       u8 is_output);
48
49 u32 nat44_ei_get_out2in_worker_index (vlib_buffer_t *b, ip4_header_t *ip0,
50                                       u32 rx_fib_index0, u8 is_output);
51
52 /**
53  * @brief Set address and port assignment algorithm to default/standard
54  */
55 void nat44_ei_set_alloc_default (void);
56
57 /**
58  * @brief Set address and port assignment algorithm for MAP-E CE
59  *
60  * @param psid        Port Set Identifier value
61  * @param psid_offset number of offset bits
62  * @param psid_length length of PSID
63  */
64 void nat44_ei_set_alloc_mape (u16 psid, u16 psid_offset, u16 psid_length);
65
66 /**
67  * @brief Set address and port assignment algorithm for port range
68  *
69  * @param start_port beginning of the port range
70  * @param end_port   end of the port range
71  */
72 void nat44_ei_set_alloc_range (u16 start_port, u16 end_port);
73
74 #endif /* __included_nat44_ei_h__ */
75 /*
76  * fd.io coding-style-patch-verification: ON
77  *
78  * Local Variables:
79  * eval: (c-set-style "gnu")
80  * End:
81  */