2 *------------------------------------------------------------------
3 * cnat_bulk_port_defs.h bulk port alloc definitions
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:
10 * http://www.apache.org/licenses/LICENSE-2.0
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 *------------------------------------------------------------------
20 #ifndef __CNAT_BULK_PORT_H__
21 #define __CNAT_BULK_PORT_H__
23 #ifndef NO_BULK_LOGGING
24 #include "cnat_bulk_port_defs.h"
27 cnat_dynamic_port_alloc_v2_bulk (
28 cnat_portmap_v2_t *pm,
30 port_pair_t pair_type,
34 u16 static_port_range,
35 cnat_user_db_entry_t *udb,
36 bulk_alloc_size_t bulk_size,
41 void cnat_update_bulk_range_cache(cnat_user_db_entry_t *udb, u16 o_port,
42 bulk_alloc_size_t bulk_size);
44 void cnat_port_free_v2_bulk (
45 cnat_portmap_v2_t *pm,
49 cnat_user_db_entry_t *udb,
50 u16 static_port_range,
51 bulk_alloc_size_t bulk_size,
54 cnat_errno_t cnat_static_port_alloc_v2_bulk (
55 cnat_portmap_v2_t *pm,
57 port_pair_t pair_type,
63 u16 static_port_range,
64 cnat_user_db_entry_t *udb,
65 bulk_alloc_size_t bulk_size,
70 cnat_errno_t cnat_dynamic_port_alloc_rtsp_bulk (
71 cnat_portmap_v2_t *pm,
73 port_pair_t pair_type,
78 u16 static_port_range,
79 cnat_user_db_entry_t *udb,
80 bulk_alloc_size_t bulk_size,
85 cnat_mapped_static_port_alloc_v2_bulk (
86 cnat_portmap_v2_t *pm,
91 cnat_user_db_entry_t *udb,
92 bulk_alloc_size_t bulk_size,
97 #else /* NO_BULK_LOGGING */
100 cnat_dynamic_port_alloc_v2_bulk (
101 cnat_vrfmap_t *vrf_map,
103 port_pair_t pair_type,
107 u16 static_port_range,
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);
117 inline void cnat_port_free_v2_bulk (
118 cnat_portmap_v2_t *pm,
122 cnat_user_db_entry_t *udb,
123 u16 static_port_range);
125 return cnat_port_free_v2(pm, index, ptype, base_port,
129 inline cnat_errno_t cnat_static_port_alloc_v2_bulk (
130 cnat_portmap_v2_t *pm,
132 port_pair_t pair_type,
138 u16 static_port_range)
140 return cnat_static_port_alloc_v2 (pm, atype, pair_type,
141 i_ipv4_address, i_port, index, o_ipv4_address, o_port);
145 cnat_mapped_static_port_alloc_v2_bulk (
146 cnat_portmap_v2_t *pm,
152 return cnat_mapped_static_port_alloc_v2(pm, atype, index
156 #endif /* NO_BULK_LOGGING */
157 #endif /* __CNAT_BULK_PORT_H__ */