More janitorial work
[vpp.git] / plugins / plugins / vcgn / cnat_global.h
1 /* 
2  *------------------------------------------------------------------
3  * cnat_global.h - global definition and variables
4  * to be used by non cnat files
5  *
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:
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
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  *------------------------------------------------------------------
19  */
20
21 #ifndef __CNAT_GLOBAL_H__
22 #define __CNAT_GLOBAL_H__
23
24 /* gloable variables */
25
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;
35
36 extern u32 translation_delete_count;
37 extern u32 translation_delete_rate;
38
39 extern u32 in2out_forwarding_count;
40 extern u32 in2out_forwarding_rate;
41
42 extern u32 out2in_forwarding_count;
43 extern u32 out2in_forwarding_rate;
44
45 extern u32 total_address_pool_allocated;
46
47 extern u32 nat44_active_translations;
48
49 #if 1 //DSLITE_DEF
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;
56 #endif
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
61
62 extern u32 null_enq_pkt;
63 extern u32 null_deq_pkt;
64
65 extern u32 null_enq_ctx;
66 extern u32 null_deq_ctx;
67
68 extern u32 null_enq_wqe;
69 extern u32 null_deq_wqe;
70
71 extern u32 ctx_alloc_errs;
72 extern u32 sf_alloc_errs;
73
74 extern u32 rcv_pkt_errs;
75
76 struct counter_array_t {
77         u32     sf_error_counter;
78         u32     ctx_error_counter;
79         u32     timestamp;
80 } counter_array_t;
81
82 #define COUNTER_BUFFER_SIZE 25
83 struct counter_array_t err_cnt_arr[COUNTER_BUFFER_SIZE];
84
85 //#define DISABLE_ICMP_THROTTLE_FOR_DEBUG_PURPOSE
86
87 #endif  /*__CNAT_GLOBAL_H__*/