1 /* ------------------------------------------------
\r
2 Copyright 2014 AT&T Intellectual Property
\r
3 Licensed under the Apache License, Version 2.0 (the "License");
\r
4 you may not use this file except in compliance with the License.
\r
5 You may obtain a copy of the License at
\r
7 http://www.apache.org/licenses/LICENSE-2.0
\r
9 Unless required by applicable law or agreed to in writing, software
\r
10 distributed under the License is distributed on an "AS IS" BASIS,
\r
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
12 See the License for the specific language governing permissions and
\r
13 limitations under the License.
\r
14 ------------------------------------------- */
\r
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.
\r
20 // ==================================================
\r
22 // ==================================================
\r
25 // if set we use 64 BIT GS
\r
28 // HOST NAME LENGTH FOR LOGGING
\r
29 #ifndef HOST_NAME_MAX
\r
30 #define HOST_NAME_MAX 255
\r
33 // STATISTICS LOGGING INTERVAL IN SECONDS
\r
34 #define GSLOGINTERVAL 10
\r
36 // Start size of dynamiclly growing internal arrays
\r
37 // TODO: current implementation penalizes large initial size of the array with slow linear search, change the size to 1 for now
\r
38 #define STARTSZ 1 // T1024
\r
40 // Use blocking ringbuffer
\r
41 #define BLOCKRINGBUFFER
\r
43 //#define LOCALIP // restricts sockets to localhost IP
\r
46 // maximume number of print streams
\r
47 #define MAXPRINTFILES 16
\r
49 // allows sampling on the schema level
\r
50 //#define LOWSAMPLE 0
\r
52 // if defined outputs logs larger then that level to stderr
\r
53 #define LOGSTDERR LOG_WARNING
\r
56 // ==================================================
\r
58 // ==================================================
\r
60 // If POLLING is defined HFTA's poll the ring buffers every 100msec rather then
\r
61 // block on a message receive
\r
65 // ==================================================
\r
67 // ==================================================
\r
69 // ==================================================
\r
71 // ==================================================
\r
73 // BLOCK size for gdatcat
\r
74 #define CATBLOCKSZ 200*1024*1024
\r
76 // Enables bzip2 compression rather then gzip compression in gsgdatprint
\r
79 // Uses the gzip library rather then forking a gzip process in gsgdaprint
\r
83 // ==================================================
\r
85 // ==================================================
\r
87 #define MAXMSGSZ 10240
\r
88 #define MAXTUPLESZ 10240
\r
89 #define MAXRES MAXMSGSZ
\r
91 #define MAXSZ (((MAXTUPLESZ+128)>MAXMSGSZ?MAXTUPLESZ+128:MAXMSGSZ))
\r
93 #define SOCK_BUF_SZ 160*(MAXMSGSZ+4)
\r
94 #define SOCKET_HASH_SZ 512
\r
95 #define MAX_NUMBER_OF_SHM 64
\r
97 //#define PRINTMSG // prints low level IPC messages for debugging VERY VERBOSE
\r
99 /* maximum size of an FTA name */
\r
100 #define MAXFTANAME 256
\r
101 #define MAXPRINTSTRING 256
\r
103 /* maximum size of a schema definition */
\r
104 #define MAXSCHEMASZ (8*1024)
\r
107 // ==================================================
\r
108 // DAG related defines
\r
109 // ==================================================
\r
111 #define DAGMAXPACKETSZ 2*4096
\r
112 #define DAGTIMEOUT 50 /* timeout in msec */
\r
114 /* GPP record type defines has to match dagapi.h*/
\r
115 #ifndef TYPE_LEGACY
\r
116 #define TYPE_LEGACY 0
\r
117 #define TYPE_HDLC_POS 1
\r
120 #define TYPE_AAL5 4
\r
123 /* GSCP special types */
\r
124 #define TYPE_PPP_POS 5
\r
125 #define TYPE_ETH_PPP 6
\r
126 #define TYPE_CRS1_OC768_POS 7
\r
127 #define TYPE_ETH_VPLS_GRE 8
\r
128 #define TYPE_ETH_GTP 9
\r
134 //#define GTPONLY // then only the GTP parsing code gets compiled which saves a couple of milion cycles at high speeds.
\r
136 //#define DOUBLEHASH
\r
138 #define VMETR // detailed RTS stats
\r
140 #define DAGPOSCONFIGSTRING ""
\r
141 #define DAGETHCONFIGSTRING ""
\r
142 #define DAGATMAAL5CONFIGSTRING ""
\r
144 // ==================================================
\r
146 // ==================================================
\r
149 #define PCAPTIMEOUT 50 /* timeout in msec for calls to pcap_process_packets */
\r
150 #define PCAPMAXPACKETSZ 1560
\r
151 #define PCAPBATCHSZ 1000
\r
152 #define PCAPMINBATCHSZ 30
\r
154 // ==================================================
\r
156 // ==================================================
\r
158 #define PCAPINITDELAY 120 /* time we wait before processing packets */
\r
159 #define PCAPREPLAYBATCHSZ 1
\r
160 //#define REPLAYNOW // if defined timestamps in pcap file are ignored
\r
162 // ==================================================
\r
164 // ==================================================
\r
166 #ifdef sun // make sure the code which uses variables with the name sun
\r
167 // still works on a sun ....
\r
173 #define AF_LOCAL AF_UNIX
\r
178 #define SUN_LEN(su) \
\r
179 (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
\r
183 #include <sys/ioctl.h>
\r
186 #define IPC_RALL 000444 /* read permission */
\r
189 #define IPC_WALL 000222 /* write/alter permission */
\r
192 #define IPC_R 000400 /* read permission */
\r
195 #define IPC_W 000200 /* write/alter permission */
\r
198 #define IPC_CREAT 001000 /* create entry if key does not exist */
\r
202 #define ENOMSG EAGAIN /* for MacOSX */
\r