FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
cnat_bulk_port.h
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * cnat_bulk_port_defs.h bulk port alloc definitions
4  *
5  * Copyright (c) 2011-2013 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #ifndef __CNAT_BULK_PORT_H__
21 #define __CNAT_BULK_PORT_H__
22 
23 #ifndef NO_BULK_LOGGING
24 #include "cnat_bulk_port_defs.h"
25 
29  port_alloc_t atype,
30  port_pair_t pair_type,
31  u32 *index,
32  u32 *o_ipv4_address,
33  u16 *o_port,
34  u16 static_port_range,
36  bulk_alloc_size_t bulk_size,
37  int *nfv9_log_req,
38  u16 ip_n_to_1,
39  u32 *rseed_ip);
40 
42  bulk_alloc_size_t bulk_size);
43 
46  int index,
47  port_pair_t ptype,
48  u16 base_port,
50  u16 static_port_range,
51  bulk_alloc_size_t bulk_size,
52  int *nfv9_log_req);
53 
56  port_alloc_t atype,
57  port_pair_t pair_type,
58  u32 i_ipv4_address,
59  u16 i_port,
60  u32 *index,
61  u32 *o_ipv4_address,
62  u16 *o_port,
63  u16 static_port_range,
65  bulk_alloc_size_t bulk_size,
66  int *nfv9_log_req,
67  u16 ip_n_to_1
68  );
69 
72  port_alloc_t atype,
73  port_pair_t pair_type,
74  u16 i_port,
75  u32 *index,
76  u32 *o_ipv4_address,
77  u16 *o_port,
78  u16 static_port_range,
80  bulk_alloc_size_t bulk_size,
81  int *nfv9_log_req,
82  u32 *rseed_ip);
83 
87  port_alloc_t atype,
88  u32 *index,
89  u32 ipv4_address,
90  u16 port,
92  bulk_alloc_size_t bulk_size,
93  int *nfv9_log_req,
94  u16 ip_n_to_1
95  );
96 
97 #else /* NO_BULK_LOGGING */
98 /* use older code */
99 inline cnat_errno_t
101  cnat_vrfmap_t *vrf_map,
102  port_alloc_t atype,
103  port_pair_t pair_type,
104  u32 *index,
105  u32 *o_ipv4_address,
106  u16 *o_port,
107  u16 static_port_range,
108  u16 ip_n_to_1,
109  u32 *rseed_ip
110  )
111 {
112  return cnat_dynamic_port_alloc_v2(vrf_map->portmap_list, atype,
113  pair_type, index, o_ipv4_address, o_port, static_port_range,
114  ip_n_to_1, rseed_ip);
115 }
116 
117 inline void cnat_port_free_v2_bulk (
118  cnat_portmap_v2_t *pm,
119  int index,
120  port_pair_t ptype,
121  u16 base_port,
122  cnat_user_db_entry_t *udb,
123  u16 static_port_range);
124 {
125  return cnat_port_free_v2(pm, index, ptype, base_port,
126  static_port_range);
127 }
128 
130  cnat_portmap_v2_t *pm,
131  port_alloc_t atype,
132  port_pair_t pair_type,
133  u32 i_ipv4_address,
134  u16 i_port,
135  u32 *index,
136  u32 *o_ipv4_address,
137  u16 *o_port,
138  u16 static_port_range)
139 {
140  return cnat_static_port_alloc_v2 (pm, atype, pair_type,
141  i_ipv4_address, i_port, index, o_ipv4_address, o_port);
142 }
143 
144 inline cnat_errno_t
146  cnat_portmap_v2_t *pm,
147  port_alloc_t atype,
148  u32 *index,
149  u32 ipv4_address,
150  u16 port)
151 {
152  return cnat_mapped_static_port_alloc_v2(pm, atype, index
153  ipv4_address, port);
154 }
155 
156 #endif /* NO_BULK_LOGGING */
157 #endif /* __CNAT_BULK_PORT_H__ */
cnat_errno_t cnat_static_port_alloc_v2_bulk(cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 i_ipv4_address, u16 i_port, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1)
void cnat_update_bulk_range_cache(cnat_user_db_entry_t *udb, u16 o_port, bulk_alloc_size_t bulk_size)
cnat_errno_t
Definition: cnat_cli.h:26
cnat_portmap_v2_t * portmap_list
Definition: cnat_db.h:430
cnat_errno_t cnat_static_port_alloc_v2(cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 i_ipv4_address, u16 i_port, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1)
Definition: cnat_ports.c:135
void cnat_port_free_v2(cnat_portmap_v2_t *pm, int index, port_pair_t pair_type, u16 base_port, u16 static_port_range)
Definition: cnat_ports.c:1037
cnat_errno_t cnat_dynamic_port_alloc_rtsp_bulk(cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u16 i_port, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u32 *rseed_ip)
cnat_errno_t cnat_dynamic_port_alloc_v2(cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1, u32 *rseed_ip)
Definition: cnat_ports.c:554
Definition: cnat_db.h:285
void cnat_port_free_v2_bulk(cnat_portmap_v2_t *pm, int index, port_pair_t ptype, u16 base_port, cnat_user_db_entry_t *udb, u16 static_port_range, bulk_alloc_size_t bulk_size, int *nfv9_log_req)
unsigned int u32
Definition: types.h:88
port_alloc_t
Definition: cnat_ports.h:96
port_pair_t
Definition: cnat_ports.h:82
unsigned short u16
Definition: types.h:57
bulk_alloc_size_t
cnat_errno_t cnat_mapped_static_port_alloc_v2(cnat_portmap_v2_t *pm, port_alloc_t atype, u32 *index, u32 ipv4_address, u16 port, int *nfv9_log_req, bulk_alloc_size_t bulk_size, u16 ip_n_to_1)
Definition: cnat_ports.c:932
cnat_errno_t cnat_dynamic_port_alloc_v2_bulk(cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1, u32 *rseed_ip)
cnat_errno_t cnat_mapped_static_port_alloc_v2_bulk(cnat_portmap_v2_t *pm, port_alloc_t atype, u32 *index, u32 ipv4_address, u16 port, cnat_user_db_entry_t *udb, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1)