Change the default size of hash table to smaller value
[com/gs-lite.git] / include / gsconfig.h
1 /* ------------------------------------------------
2  Copyright 2014 AT&T Intellectual Property
3  Licensed under the Apache License, Version 2.0 (the "License");
4  you may not use this file except in compliance with the License.
5  You may obtain a copy of the License at
6  
7  http://www.apache.org/licenses/LICENSE-2.0
8  
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14  ------------------------------------------- */
15 #ifndef GSCONFIG
16 #define GSCONFIG
17
18 // Contains all defines etc... . As we don't have a proper configure script yet at least that way all the defines are in one place.
19
20 // ==================================================
21 // General defines
22 // ==================================================
23
24
25 // if set we use 64 BIT GS
26 #define GS64
27
28 // HOST NAME LENGTH FOR LOGGING
29 #ifndef HOST_NAME_MAX
30 #define HOST_NAME_MAX 255
31 #endif
32
33 // STATISTICS LOGGING INTERVAL IN SECONDS
34 #define GSLOGINTERVAL 10
35
36 // Start size of dynamiclly growing internal arrays
37 // TODO: current implementation penalizes large initial size of the array with slow linear search, change the size to 1 for now
38 #define STARTSZ 1       // T1024
39
40 // Use blocking ringbuffer
41 #define BLOCKRINGBUFFER
42
43 //#define LOCALIP // restricts sockets to localhost IP
44
45
46 // maximume number of print streams
47 #define MAXPRINTFILES 16
48
49 // allows sampling on the schema level
50 //#define LOWSAMPLE 0
51
52 // if defined outputs logs larger then that level to stderr
53 #define LOGSTDERR LOG_WARNING
54
55
56 // ==================================================
57 // Callback  stuff
58 // ==================================================
59
60 // If POLLING is defined HFTA's poll the ring buffers every 100msec rather then
61 // block on a message receive
62 #define POLLING
63
64
65 // ==================================================
66 // LAP  stuff
67 // ==================================================
68
69 // ==================================================
70 // Tool  stuff
71 // ==================================================
72
73 // BLOCK size for gdatcat
74 #define CATBLOCKSZ 200*1024*1024
75
76 // Enables bzip2 compression rather then gzip compression in gsgdatprint
77 //#define GSBZIP2
78
79 // Uses the gzip library rather then forking a gzip process in gsgdaprint
80 //#define ZLIB
81
82
83 // ==================================================
84 // IPC  stuff
85 // ==================================================
86
87 #define MAXMSGSZ 10240
88 #define MAXTUPLESZ 10240
89 #define MAXRES MAXMSGSZ
90
91 #define MAXSZ (((MAXTUPLESZ+128)>MAXMSGSZ?MAXTUPLESZ+128:MAXMSGSZ))
92
93 #define SOCK_BUF_SZ 160*(MAXMSGSZ+4)
94 #define SOCKET_HASH_SZ 512
95 #define MAX_NUMBER_OF_SHM 64
96
97 //#define PRINTMSG // prints low level IPC messages for debugging VERY VERBOSE
98
99 /* maximum size of an FTA name */
100 #define MAXFTANAME 256
101 #define MAXPRINTSTRING 256
102
103 /* maximum size of a schema definition */
104 #define MAXSCHEMASZ (8*1024)
105
106
107 // ==================================================
108 // DAG related defines
109 // ==================================================
110
111 #define DAGMAXPACKETSZ 2*4096
112 #define DAGTIMEOUT 50 /* timeout in msec  */
113
114 /* GPP record type defines  has to match dagapi.h*/
115 #ifndef TYPE_LEGACY
116 #define TYPE_LEGACY       0
117 #define TYPE_HDLC_POS     1
118 #define TYPE_ETH          2
119 #define TYPE_ATM          3
120 #define TYPE_AAL5     4
121 #endif
122
123 /* GSCP special types */
124 #define TYPE_PPP_POS 5
125 #define TYPE_ETH_PPP 6
126 #define TYPE_CRS1_OC768_POS 7
127 #define TYPE_ETH_VPLS_GRE 8
128 #define TYPE_ETH_GTP 9
129
130 //#define DAGDEBUG
131
132 //#define LLDUPREM
133
134 //#define GTPONLY // then only the GTP parsing code gets compiled which saves a couple of milion cycles at high speeds.
135
136 //#define DOUBLEHASH
137
138 #define VMETR // detailed RTS stats
139
140 #define DAGPOSCONFIGSTRING ""
141 #define DAGETHCONFIGSTRING ""
142 #define DAGATMAAL5CONFIGSTRING ""
143
144 // ==================================================
145 // PCAP  stuff
146 // ==================================================
147
148
149 #define PCAPTIMEOUT 50 /* timeout in msec for calls to pcap_process_packets */
150 #define PCAPMAXPACKETSZ 1560
151 #define PCAPBATCHSZ 1000
152 #define PCAPMINBATCHSZ 30
153
154 // ==================================================
155 // REPLAY  stuff
156 // ==================================================
157
158 #define PCAPINITDELAY 120 /* time we wait before processing packets */
159 #define PCAPREPLAYBATCHSZ 1
160 //#define REPLAYNOW // if defined timestamps in pcap file are ignored
161
162 // ==================================================
163 // system stuff
164 // ==================================================
165
166 #ifdef sun // make sure the code which uses variables with the name sun
167 // still works on a sun ....
168 #undef sun
169 #endif
170
171 #ifndef AF_LOCAL
172 #ifdef AF_UNIX
173 #define AF_LOCAL AF_UNIX
174 #endif
175 #endif
176
177 #ifndef SUN_LEN
178 #define SUN_LEN(su) \
179 (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
180 #endif
181
182 #ifdef __linux__
183 #include <sys/ioctl.h>
184 #endif
185 #ifndef IPC_RALL
186 #define IPC_RALL           000444 /* read permission */
187 #endif
188 #ifndef IPC_WALL
189 #define IPC_WALL           000222  /* write/alter permission */
190 #endif
191 #ifndef IPC_R
192 #define IPC_R           000400  /* read permission */
193 #endif
194 #ifndef IPC_W
195 #define IPC_W           000200  /* write/alter permission */
196 #endif
197 #ifndef IPC_CREAT
198 #define IPC_CREAT       001000  /* create entry if key does not exist */
199 #endif
200
201 #ifndef ENOMSG
202 #define ENOMSG EAGAIN  /* for MacOSX */
203 #endif
204
205 #endif
206