FD.io VPP  v16.06
Vector Packet Processing
cnat_cli.h
Go to the documentation of this file.
1 /* *------------------------------------------------------------------
2  * cnat_cli.h - CLI definitions
3  *
4  * Copyright (c) 2007-2013 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *------------------------------------------------------------------
17  */
18 
19 #ifndef __CNAT_CLI_H__
20 #define __CNAT_CLI_H__
21 
22 #include "cnat_config_api.h"
23 #include "cnat_show_api.h"
24 
25 /* from iox cli error */
26 typedef enum {
32 #ifndef NO_BULK_LOGGING
35 #endif /* NO_BULK_LOGGING */
73 #ifdef CGSE_DS_LITE
74  CNAT_ERR_DS_LITE_ID_INVALID,
75 #endif /* CGSE_DS_LITE */
79 } cnat_errno_t;
80 
81 #define CNAT_TRUE 1
82 #define CNAT_FALSE 0
83 
84 
85 #define CNAT_DEBUG_NONE (0)
86 #define CNAT_DEBUG_GLOBAL_ERR (1 << 0)
87 #define CNAT_DEBUG_DROP_TCP (1 << 0)
88 #define CNAT_DEBUG_DROP_UDP (1 << 1)
89 #define CNAT_DEBUG_DROP_ICMP (1 << 2)
90 #define CNAT_DEBUG_ERR_TCP (1 << 3)
91 #define CNAT_DEBUG_ERR_UDP (1 << 4)
92 #define CNAT_DEBUG_ERR_ICMP (1 << 5)
93 #define CNAT_DEBUG_ERR_ALG (1 << 6)
94 #define CNAT_DEBUG_GLOBAL_ALL (1 << 7)
95 #define CNAT_DEBUG_FTP_ALG (1 << 8)
96 
97 
98 
99 #define CNAT_DEBUG_ALL 0x1FF /*all of above*/
100 #define CNAT_DEBUG_ERR_ALL 0x38
101 
102 #define CNAT_DB_CLEAR_SPECIFIC (0)
103 #define CNAT_DB_CLEAR_ALL (1 << 0)
104 #define CNAT_DB_CLEAR_VRF (1 << 1)
105 #define CNAT_DB_CLEAR_ADDR (1 << 2)
106 #define CNAT_DB_CLEAR_PROTO (1 << 3)
107 #define CNAT_DB_CLEAR_PORT (1 << 4)
108 
109 
110 #define MAX_UIDX 0x3fff /*the max svi app uidb index */
111 /* address mask per core */
112 #define ADDR_MASK_PER_CORE PLATFORM_ADDR_MASK_PER_CORE
113 #define ADDR_MASK_PER_CORE_PER_PARTITION \
114  PLATFORM_ADDR_MASK_PER_CORE_PER_PARTITION
115 
116 #define MAX_CORES PLATFORM_MAX_CORES
117 #define MAX_CORES_PER_PARTITION PLATFORM_MAX_CORES_PER_PARTITION
118 
119 /*
120  * Maximum pool size that is supported by platform
121  */
122 #define CNAT_MAX_ADDR_POOL_SIZE PLATFORM_CNAT_MAX_ADDR_POOL_SIZE
123 #define CNAT_MAX_ADDR_POOL_SIZE_PER_CORE \
124  (CNAT_MAX_ADDR_POOL_SIZE / MAX_CORES_PER_PARTITION)
125 
126 #define BOUNDARY_VALUE 256
127 
128 #define BOUNDARY_VALUE_MASK 0xff
129 
130 #define NUM_ADDR_IN_RANGE(range, value, instance) \
131  ((range / value) + ((instance % MAX_CORES_PER_PARTITION) < (range%value) ? 1 : 0))
132 
133 typedef enum {
164 
165 /*
166  * Don't use too small values for PATH MTU
167  */
168 #define MIN_NFV9_PATH_MTU 100
169 
170 extern u32 global_debug_flag;
171 extern u16 debug_i_vrf;
172 extern u32 debug_i_flag;
173 extern u32 debug_i_addr_start;
174 extern u32 debug_i_addr_end;
175 extern u16 debug_o_vrf;
176 extern u32 debug_o_flag;
177 extern u32 debug_o_addr_start;
178 extern u32 debug_o_addr_end;
181 
186 
187 extern u32 icmp_debug_flag;
188 extern u32 frag_debug_flag;
189 
191 
192 extern u32 config_debug_level;
193 extern u32 show_debug_level;
194 
195 
196 /* CLI API prototypes called from vcgn_classify.c */
198  vlib_main_t *vm);
201 extern void cnat_nat44_set_protocol_timeout_value(u16 active,
202  u16 init, u8 *proto, u8 reset, vlib_main_t *vm);
205 
206 #endif /* __CNAT_CLI_H__ */
u32 debug_o_addr_end
u32 udp_inside_checksum_disable
u32 debug_i_addr_start
u32 debug_o_addr_start
void cnat_v4_show_inside_entry_req_t_handler(spp_api_cnat_v4_show_inside_entry_req_t *mp, vlib_main_t *vm)
u32 icmp_debug_flag
cnat_errno_t
Definition: cnat_cli.h:26
u32 show_debug_level
u32 tcp_logging_enable_flag
void cnat_nat44_set_protocol_timeout_value(u16 active, u16 init, u8 *proto, u8 reset, vlib_main_t *vm)
void cnat_nat44_handle_show_stats(vlib_main_t *vm)
u32 udp_outside_checksum_disable
u16 debug_i_vrf
u32 debug_i_addr_end
u32 debug_o_flag
u32 udp_outside_packet_dump_enable
void cnat_nat44_handle_show_config(vlib_main_t *vm)
u32 config_debug_level
struct _spp_api_cnat_v4_add_vrf_map spp_api_cnat_v4_add_vrf_map_t
u16 debug_o_vrf
u32 nfv9_logging_debug_flag
unsigned int u32
Definition: types.h:88
struct _spp_api_cnat_v4_show_inside_entry_req spp_api_cnat_v4_show_inside_entry_req_t
u32 global_debug_flag
u32 debug_i_flag
u32 frag_debug_flag
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56
void cnat_nat44_add_vrf_map_t_handler(spp_api_cnat_v4_add_vrf_map_t *mp, vlib_main_t *vm)
u32 summary_stats_debug_flag
cnat_debug_variable_value
Definition: cnat_cli.h:133
u32 udp_inside_packet_dump_enable