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