Added quantiling UDAFs
[com/gs-lite.git] / include / gsconfig.h
index 73ad9b8..4bb974f 100644 (file)
-/* ------------------------------------------------
- Copyright 2014 AT&T Intellectual Property
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ------------------------------------------- */
-#ifndef GSCONFIG
-#define GSCONFIG
-
-// 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.
-
-// ==================================================
-// General defines
-// ==================================================
-
-
-// if set we use 64 BIT GS
-#define GS64
-
-// HOST NAME LENGTH FOR LOGGING
-#ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX 255
-#endif
-
-// STATISTICS LOGGING INTERVAL IN SECONDS
-#define GSLOGINTERVAL 10
-
-// Start size of dynamiclly growing internal arrays
-// TODO: current implementation penalizes large initial size of the array with slow linear search, change the size to 1 for now
-#define STARTSZ 1       // T1024
-
-// Use blocking ringbuffer
-#define BLOCKRINGBUFFER
-
-//#define LOCALIP // restricts sockets to localhost IP
-
-
-// maximume number of print streams
-#define MAXPRINTFILES 16
-
-// allows sampling on the schema level
-//#define LOWSAMPLE 0
-
-// if defined outputs logs larger then that level to stderr
-#define LOGSTDERR LOG_WARNING
-
-
-// ==================================================
-// Callback  stuff
-// ==================================================
-
-// If POLLING is defined HFTA's poll the ring buffers every 100msec rather then
-// block on a message receive
-#define POLLING
-
-
-// ==================================================
-// LAP  stuff
-// ==================================================
-
-// ==================================================
-// Tool  stuff
-// ==================================================
-
-// BLOCK size for gdatcat
-#define CATBLOCKSZ 200*1024*1024
-
-// Enables bzip2 compression rather then gzip compression in gsgdatprint
-//#define GSBZIP2
-
-// Uses the gzip library rather then forking a gzip process in gsgdaprint
-//#define ZLIB
-
-
-// ==================================================
-// IPC  stuff
-// ==================================================
-
-#define MAXMSGSZ 10240
-#define MAXTUPLESZ 10240
-#define MAXRES MAXMSGSZ
-
-#define MAXSZ (((MAXTUPLESZ+128)>MAXMSGSZ?MAXTUPLESZ+128:MAXMSGSZ))
-
-#define SOCK_BUF_SZ 160*(MAXMSGSZ+4)
-#define SOCKET_HASH_SZ 512
-#define MAX_NUMBER_OF_SHM 64
-
-//#define PRINTMSG // prints low level IPC messages for debugging VERY VERBOSE
-
-/* maximum size of an FTA name */
-#define MAXFTANAME 256
-#define MAXPRINTSTRING 256
-
-/* maximum size of a schema definition */
-#define MAXSCHEMASZ (8*1024)
-
-
-// ==================================================
-// DAG related defines
-// ==================================================
-
-#define DAGMAXPACKETSZ 2*4096
-#define DAGTIMEOUT 50 /* timeout in msec  */
-
-/* GPP record type defines  has to match dagapi.h*/
-#ifndef TYPE_LEGACY
-#define TYPE_LEGACY       0
-#define TYPE_HDLC_POS     1
-#define TYPE_ETH          2
-#define TYPE_ATM          3
-#define TYPE_AAL5     4
-#endif
-
-/* GSCP special types */
-#define TYPE_PPP_POS 5
-#define TYPE_ETH_PPP 6
-#define TYPE_CRS1_OC768_POS 7
-#define TYPE_ETH_VPLS_GRE 8
-#define TYPE_ETH_GTP 9
-
-//#define DAGDEBUG
-
-//#define LLDUPREM
-
-//#define GTPONLY // then only the GTP parsing code gets compiled which saves a couple of milion cycles at high speeds.
-
-//#define DOUBLEHASH
-
-#define VMETR // detailed RTS stats
-
-#define DAGPOSCONFIGSTRING ""
-#define DAGETHCONFIGSTRING ""
-#define DAGATMAAL5CONFIGSTRING ""
-
-// ==================================================
-// PCAP  stuff
-// ==================================================
-
-
-#define PCAPTIMEOUT 50 /* timeout in msec for calls to pcap_process_packets */
-#define PCAPMAXPACKETSZ 1560
-#define PCAPBATCHSZ 1000
-#define PCAPMINBATCHSZ 30
-
-// ==================================================
-// REPLAY  stuff
-// ==================================================
-
-#define PCAPINITDELAY 120 /* time we wait before processing packets */
-#define PCAPREPLAYBATCHSZ 1
-//#define REPLAYNOW // if defined timestamps in pcap file are ignored
-
-// ==================================================
-// system stuff
-// ==================================================
-
-#ifdef sun // make sure the code which uses variables with the name sun
-// still works on a sun ....
-#undef sun
-#endif
-
-#ifndef AF_LOCAL
-#ifdef AF_UNIX
-#define AF_LOCAL AF_UNIX
-#endif
-#endif
-
-#ifndef SUN_LEN
-#define SUN_LEN(su) \
-(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
-#endif
-
-#ifdef __linux__
-#include <sys/ioctl.h>
-#endif
-#ifndef IPC_RALL
-#define IPC_RALL           000444 /* read permission */
-#endif
-#ifndef IPC_WALL
-#define IPC_WALL           000222  /* write/alter permission */
-#endif
-#ifndef IPC_R
-#define IPC_R           000400  /* read permission */
-#endif
-#ifndef IPC_W
-#define IPC_W           000200  /* write/alter permission */
-#endif
-#ifndef IPC_CREAT
-#define IPC_CREAT       001000  /* create entry if key does not exist */
-#endif
-
-#ifndef ENOMSG
-#define ENOMSG EAGAIN  /* for MacOSX */
-#endif
-
-#endif
-
+/* ------------------------------------------------\r
+ Copyright 2014 AT&T Intellectual Property\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ ------------------------------------------- */\r
+#ifndef GSCONFIG\r
+#define GSCONFIG\r
+\r
+// 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
+\r
+// ==================================================\r
+// General defines\r
+// ==================================================\r
+\r
+\r
+// if set we use 64 BIT GS\r
+#define GS64\r
+\r
+// HOST NAME LENGTH FOR LOGGING\r
+#ifndef HOST_NAME_MAX\r
+#define HOST_NAME_MAX 255\r
+#endif\r
+\r
+// STATISTICS LOGGING INTERVAL IN SECONDS\r
+#define GSLOGINTERVAL 10\r
+\r
+// Start size of dynamiclly growing internal arrays\r
+// TODO: current implementation penalizes large initial size of the array with slow linear search, change the size to 1 for now\r
+#define STARTSZ 1       // T1024\r
+\r
+// Use blocking ringbuffer\r
+#define BLOCKRINGBUFFER\r
+\r
+//#define LOCALIP // restricts sockets to localhost IP\r
+\r
+\r
+// maximume number of print streams\r
+#define MAXPRINTFILES 16\r
+\r
+// allows sampling on the schema level\r
+//#define LOWSAMPLE 0\r
+\r
+// if defined outputs logs larger then that level to stderr\r
+#define LOGSTDERR LOG_WARNING\r
+\r
+\r
+// ==================================================\r
+// Callback  stuff\r
+// ==================================================\r
+\r
+// If POLLING is defined HFTA's poll the ring buffers every 100msec rather then\r
+// block on a message receive\r
+#define POLLING\r
+\r
+\r
+// ==================================================\r
+// LAP  stuff\r
+// ==================================================\r
+\r
+// ==================================================\r
+// Tool  stuff\r
+// ==================================================\r
+\r
+// BLOCK size for gdatcat\r
+#define CATBLOCKSZ 200*1024*1024\r
+\r
+// Enables bzip2 compression rather then gzip compression in gsgdatprint\r
+//#define GSBZIP2\r
+\r
+// Uses the gzip library rather then forking a gzip process in gsgdaprint\r
+//#define ZLIB\r
+\r
+\r
+// ==================================================\r
+// IPC  stuff\r
+// ==================================================\r
+\r
+#define MAXMSGSZ 10240\r
+#define MAXTUPLESZ 10240\r
+#define MAXRES MAXMSGSZ\r
+\r
+#define MAXSZ (((MAXTUPLESZ+128)>MAXMSGSZ?MAXTUPLESZ+128:MAXMSGSZ))\r
+\r
+#define SOCK_BUF_SZ 160*(MAXMSGSZ+4)\r
+#define SOCKET_HASH_SZ 512\r
+#define MAX_NUMBER_OF_SHM 64\r
+\r
+//#define PRINTMSG // prints low level IPC messages for debugging VERY VERBOSE\r
+\r
+/* maximum size of an FTA name */\r
+#define MAXFTANAME 256\r
+#define MAXPRINTSTRING 256\r
+\r
+/* maximum size of a schema definition */\r
+#define MAXSCHEMASZ (8*1024)\r
+\r
+\r
+// ==================================================\r
+// DAG related defines\r
+// ==================================================\r
+\r
+#define DAGMAXPACKETSZ 2*4096\r
+#define DAGTIMEOUT 50 /* timeout in msec  */\r
+\r
+/* GPP record type defines  has to match dagapi.h*/\r
+#ifndef TYPE_LEGACY\r
+#define TYPE_LEGACY       0\r
+#define TYPE_HDLC_POS     1\r
+#define TYPE_ETH          2\r
+#define TYPE_ATM          3\r
+#define TYPE_AAL5     4\r
+#endif\r
+\r
+/* GSCP special types */\r
+#define TYPE_PPP_POS 5\r
+#define TYPE_ETH_PPP 6\r
+#define TYPE_CRS1_OC768_POS 7\r
+#define TYPE_ETH_VPLS_GRE 8\r
+#define TYPE_ETH_GTP 9\r
+\r
+//#define DAGDEBUG\r
+\r
+//#define LLDUPREM\r
+\r
+//#define GTPONLY // then only the GTP parsing code gets compiled which saves a couple of milion cycles at high speeds.\r
+\r
+//#define DOUBLEHASH\r
+\r
+#define VMETR // detailed RTS stats\r
+\r
+#define DAGPOSCONFIGSTRING ""\r
+#define DAGETHCONFIGSTRING ""\r
+#define DAGATMAAL5CONFIGSTRING ""\r
+\r
+// ==================================================\r
+// PCAP  stuff\r
+// ==================================================\r
+\r
+\r
+#define PCAPTIMEOUT 50 /* timeout in msec for calls to pcap_process_packets */\r
+#define PCAPMAXPACKETSZ 1560\r
+#define PCAPBATCHSZ 1000\r
+#define PCAPMINBATCHSZ 30\r
+\r
+// ==================================================\r
+// REPLAY  stuff\r
+// ==================================================\r
+\r
+#define PCAPINITDELAY 120 /* time we wait before processing packets */\r
+#define PCAPREPLAYBATCHSZ 1\r
+//#define REPLAYNOW // if defined timestamps in pcap file are ignored\r
+\r
+// ==================================================\r
+// system stuff\r
+// ==================================================\r
+\r
+#ifdef sun // make sure the code which uses variables with the name sun\r
+// still works on a sun ....\r
+#undef sun\r
+#endif\r
+\r
+#ifndef AF_LOCAL\r
+#ifdef AF_UNIX\r
+#define AF_LOCAL AF_UNIX\r
+#endif\r
+#endif\r
+\r
+#ifndef SUN_LEN\r
+#define SUN_LEN(su) \\r
+(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))\r
+#endif\r
+\r
+#ifdef __linux__\r
+#include <sys/ioctl.h>\r
+#endif\r
+#ifndef IPC_RALL\r
+#define IPC_RALL           000444 /* read permission */\r
+#endif\r
+#ifndef IPC_WALL\r
+#define IPC_WALL           000222  /* write/alter permission */\r
+#endif\r
+#ifndef IPC_R\r
+#define IPC_R           000400  /* read permission */\r
+#endif\r
+#ifndef IPC_W\r
+#define IPC_W           000200  /* write/alter permission */\r
+#endif\r
+#ifndef IPC_CREAT\r
+#define IPC_CREAT       001000  /* create entry if key does not exist */\r
+#endif\r
+\r
+#ifndef ENOMSG\r
+#define ENOMSG EAGAIN  /* for MacOSX */\r
+#endif\r
+\r
+#endif\r
+\r