2 *------------------------------------------------------------------
3 * cnat_global.h - global definition and variables
4 * to be used by non cnat files
6 * Copyright (c) 2007-2012 Cisco and/or its affiliates.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at:
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *------------------------------------------------------------------
21 #ifndef __CNAT_GLOBAL_H__
22 #define __CNAT_GLOBAL_H__
24 /* gloable variables */
26 extern u8 cnat_db_init_done;
27 extern u32 cnat_current_time;
28 extern u64 in2out_drops_port_limit_exceeded;
29 extern u64 in2out_drops_system_limit_reached;
30 extern u64 in2out_drops_resource_depletion;
31 extern u64 no_translation_entry_drops;
32 extern u8 nfv9_configured;
33 extern u32 translation_create_count;
34 extern u32 translation_create_rate;
36 extern u32 translation_delete_count;
37 extern u32 translation_delete_rate;
39 extern u32 in2out_forwarding_count;
40 extern u32 in2out_forwarding_rate;
42 extern u32 out2in_forwarding_count;
43 extern u32 out2in_forwarding_rate;
45 extern u32 total_address_pool_allocated;
47 extern u32 nat44_active_translations;
50 extern u32 dslite_translation_create_rate;
51 extern u32 dslite_translation_delete_rate;
52 extern u32 dslite_translation_create_count;
53 extern u32 dslite_in2out_forwarding_count;
54 extern u32 dslite_in2out_forwarding_count;
55 extern u32 dslite_out2in_forwarding_rate;
57 /* sf/ctx allocation error collection declarations */
58 #define COLLECT_FREQ_FACTOR 100
59 #define NUM_SECONDS_TO_WAIT 10
60 #define COUNTER_BUFFER_SIZE 25
62 extern u32 null_enq_pkt;
63 extern u32 null_deq_pkt;
65 extern u32 null_enq_ctx;
66 extern u32 null_deq_ctx;
68 extern u32 null_enq_wqe;
69 extern u32 null_deq_wqe;
71 extern u32 ctx_alloc_errs;
72 extern u32 sf_alloc_errs;
74 extern u32 rcv_pkt_errs;
76 struct counter_array_t {
78 u32 ctx_error_counter;
82 #define COUNTER_BUFFER_SIZE 25
83 struct counter_array_t err_cnt_arr[COUNTER_BUFFER_SIZE];
85 //#define DISABLE_ICMP_THROTTLE_FOR_DEBUG_PURPOSE
87 #endif /*__CNAT_GLOBAL_H__*/