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
7 http://www.apache.org/licenses/LICENSE-2.0
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 ------------------------------------------- */
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.
20 // ==================================================
22 // ==================================================
25 // if set we use 64 BIT GS
28 // HOST NAME LENGTH FOR LOGGING
30 #define HOST_NAME_MAX 255
33 // STATISTICS LOGGING INTERVAL IN SECONDS
34 #define GSLOGINTERVAL 10
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
40 // Use blocking ringbuffer
41 #define BLOCKRINGBUFFER
43 //#define LOCALIP // restricts sockets to localhost IP
46 // maximume number of print streams
47 #define MAXPRINTFILES 16
49 // allows sampling on the schema level
52 // if defined outputs logs larger then that level to stderr
53 #define LOGSTDERR LOG_WARNING
56 // ==================================================
58 // ==================================================
60 // If POLLING is defined HFTA's poll the ring buffers every 100msec rather then
61 // block on a message receive
65 // ==================================================
67 // ==================================================
69 // ==================================================
71 // ==================================================
73 // BLOCK size for gdatcat
74 #define CATBLOCKSZ 200*1024*1024
76 // Enables bzip2 compression rather then gzip compression in gsgdatprint
79 // Uses the gzip library rather then forking a gzip process in gsgdaprint
83 // ==================================================
85 // ==================================================
87 #define MAXMSGSZ 10240
88 #define MAXTUPLESZ 10240
89 #define MAXRES MAXMSGSZ
91 #define MAXSZ (((MAXTUPLESZ+128)>MAXMSGSZ?MAXTUPLESZ+128:MAXMSGSZ))
93 #define SOCK_BUF_SZ 160*(MAXMSGSZ+4)
94 #define SOCKET_HASH_SZ 512
95 #define MAX_NUMBER_OF_SHM 64
97 //#define PRINTMSG // prints low level IPC messages for debugging VERY VERBOSE
99 /* maximum size of an FTA name */
100 #define MAXFTANAME 256
101 #define MAXPRINTSTRING 256
103 /* maximum size of a schema definition */
104 #define MAXSCHEMASZ (8*1024)
107 // ==================================================
108 // DAG related defines
109 // ==================================================
111 #define DAGMAXPACKETSZ 2*4096
112 #define DAGTIMEOUT 50 /* timeout in msec */
114 /* GPP record type defines has to match dagapi.h*/
116 #define TYPE_LEGACY 0
117 #define TYPE_HDLC_POS 1
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
134 //#define GTPONLY // then only the GTP parsing code gets compiled which saves a couple of milion cycles at high speeds.
138 #define VMETR // detailed RTS stats
140 #define DAGPOSCONFIGSTRING ""
141 #define DAGETHCONFIGSTRING ""
142 #define DAGATMAAL5CONFIGSTRING ""
144 // ==================================================
146 // ==================================================
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
154 // ==================================================
156 // ==================================================
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
162 // ==================================================
164 // ==================================================
166 #ifdef sun // make sure the code which uses variables with the name sun
167 // still works on a sun ....
173 #define AF_LOCAL AF_UNIX
178 #define SUN_LEN(su) \
179 (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
183 #include <sys/ioctl.h>
186 #define IPC_RALL 000444 /* read permission */
189 #define IPC_WALL 000222 /* write/alter permission */
192 #define IPC_R 000400 /* read permission */
195 #define IPC_W 000200 /* write/alter permission */
198 #define IPC_CREAT 001000 /* create entry if key does not exist */
202 #define ENOMSG EAGAIN /* for MacOSX */