193
188
#define PARM_MIN_WEBPAGE_AUTOREFRESH_TIME 15
198
* For PARM_SSLWATCHDOG_WAITWOKE_LIMIT and PARM_SSLWATCHDOG_WAIT_INTERVAL,
199
* see below, after MAKE_WITH_SSLWATCHDOG is set
202
190
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
203
191
/* M A K E option items */
204
192
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
254
* MAKE_WITH_SCHED_YIELD is shorthand
256
#if ( defined(HAVE_SCHED_H) || defined(HAVE_SYS_SCHED_H) ) && defined(HAVE_SCHED_YIELD)
257
#define MAKE_WITH_SCHED_YIELD
259
#undef MAKE_WITH_SCHED_YIELD
263
* Do we have the stuff we need for i18n?
265
#ifdef MAKE_WITH_I18N
266
#if !defined(HAVE_LOCALE_H) || !defined(HAVE_LANGINFO_H)
267
#undef MAKE_WITH_I18N
272
242
* This flag indicates that fork() is implemented with copy-on-write.
273
243
* This means that the set of tables reported on in fork()ed processes
274
244
* will be complete and unchanged as of the instant of the fork.
501
467
/* #define SESSION_TRACE_DEBUG */
504
* SSLWATCHDOG_DEBUG causes webInterface.c to log the activities of the
505
* parent and child(watchdog) threads in exhaustive details.
507
* Note the code below (in derived settings) to undef this if the MAKE_WITH_SSLWATCHDOG
508
* option isn't enabled. Leave that alone!
511
/* #define SSLWATCHDOG_DEBUG */
513
469
/* STORAGE_DEBUG causes util.c to log the store/resurrection of host information,
514
470
* i.e. the -S command line parameter.
530
486
/* #define VENDOR_DEBUG */
532
488
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
533
/* SSLWATCHDOG - this crosses the line. */
534
/* If the required libraries exist (multithreaded, openSSL, pthreads and */
535
/* NOT WIN32, then the user can */
537
/* 1) request it at ./configure time (which should really be a */
538
/* HAVE_, but PARM_ seems closer to what we're telling ntop to do). */
539
/* 2) Build it for a run-time parameter (MAKE_) */
541
/* SSLWATCHDOG_DEBUG is used in webInterface.c to determine if we */
542
/* report stuff, but it's also used in globals-core.h to make or not-make */
545
/* Who needs that complexity in multiple places, so we put it all here! */
546
/* (since we're potentially unsetting SSLWATCHDOG_DEBUG, it has to go after */
547
/* the place to uncomment it...) */
549
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
551
#if defined(HAVE_OPENSSL) && defined(HAVE_PTHREAD_H) && defined(HAVE_SETJMP_H) && !defined(WIN32)
552
#define MAKE_WITH_SSLWATCHDOG
553
#ifdef MAKE_WITH_SSLWATCHDOG_COMPILETIME
554
/* Compile Time option */
555
#undef MAKE_WITH_SSLWATCHDOG_RUNTIME
557
/* Run time option */
558
#undef SSLWATCHDOG_DEBUG
559
#define MAKE_WITH_SSLWATCHDOG_RUNTIME
562
/* Neither - don't have the required headers */
563
#undef MAKE_WITH_SSLWATCHDOG
564
#undef MAKE_WITH_SSLWATCHDOG_COMPILETIME
565
#undef MAKE_WITH_SSLWATCHDOG_RUNTIME
566
#undef SSLWATCHDOG_DEBUG
570
* PARM_SSLWATCHDOG_WAITWOKE_LIMIT
571
* This is the number of times we'll allow ourselves to be woken up
572
* (for reasons other than the expiration of the watchdog interval
573
* or completion of the ssl accept).
575
* PARM_SSLWATCHDOG_WAIT_INTERVAL
576
* This is the number of seconds to wait in the watchdog for the
577
* ssl accept to finish.
579
#ifdef MAKE_WITH_SSLWATCHDOG
580
#define PARM_SSLWATCHDOG_WAITWOKE_LIMIT 5
581
#define PARM_SSLWATCHDOG_WAIT_INTERVAL 3
584
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
585
489
/* L E N, L I M, M A X items */
586
490
/* Some are with the CONST_ items, below too */
587
491
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
612
516
/* Maximum number of queued addresses waiting to be resolved */
613
517
#define MAX_NUM_QUEUED_ADDRESSES 16384
519
/* Maximum length of network delay statistics */
520
#define MAX_NUM_NET_DELAY_STATS 16
616
523
* Number of (optional) "AR - Address Resolution" threads,
617
524
* i.e. dequeueAddressThreadId[] and numDequeueThreads in myGlobals.
619
526
* You might increase this if you have really slow dns resolution and are running
622
#define MAX_NUM_DEQUEUE_ADDRESS_THREADS 3
529
#define MAX_NUM_DEQUEUE_ADDRESS_THREADS 3
625
532
#define CONST_HASH_INITIAL_SIZE 32*1024
534
/* Number of mutexes used for locking sessions */
535
#define NUM_SESSION_MUTEXES 8
628
538
* These change the break points for the "Network Traffic: xxxx" reports
629
539
* (e.g. dataHostTraffic.html et al). See getBgPctgColor() in reportUtils.c
635
545
#define CONST_PCTG_HIGH_COLOR "BGCOLOR=#FF3118"
638
* How long should we use an entry in the dnsCache database.
639
* Default (in seconds) is 24 hours
641
#define CONST_DNSCACHE_LIFETIME 24*3600
644
548
* The number of entries in the logView ring buffer - how many log messages
645
549
* we can display in the GUI.
732
636
#define NETFLOW_DEVICE_NAME "NetFlow-device"
733
637
#define SFLOW_DEVICE_NAME "sFlow-device"
638
#define CPACKET_DEVICE_NAME "cPacket-device"
736
641
* This defines the maximum number of entries in the ntop pwFile
737
642
* note that both 'users' and 'urls' are stored in here.
739
#define MAX_NUM_PWFILE_ENTRIES 32
644
#define MAX_NUM_PWFILE_ENTRIES 64
742
647
* This is an IPv4 convention - it's the upper port # that is "officially assigned" (reserved)
834
739
* It MUST be big enough to hold all of the addresses assigned to each interface, plus
835
740
* any additional values set by -m. Don't be stingy - it's 3 32bit integers per entry.
837
#define MAX_NUM_NETWORKS 32
742
#define MAX_NUM_NETWORKS 64
840
745
* This defines the # of entries in hostsCache[] in myGlobals.
986
880
* This is the URL to request the latest version information
988
882
#define CONST_VERSIONCHECK_SITE "version.ntop.org"
989
#define CONST_VERSIONCHECK_BACKUP_SITE "www.burtonstrauss.com"
990
883
#define CONST_VERSIONCHECK_DOCUMENT "version.xml"
991
884
#define CONST_VERSIONCHECK_URL CONST_VERSIONCHECK_SITE "/" CONST_VERSIONCHECK_DOCUMENT
1127
1024
#define CONST_DO_ADD_USER "doAddUser"
1128
1025
#define CONST_DO_CHANGE_FILTER "doChangeFilter"
1129
1026
#define CONST_DOMAIN_STATS_HTML "domainStats.html"
1130
#define CONST_CLUSTER_STATS_HTML "hostClusters.html"
1027
#define CONST_COMMUNITIES_STATS_HTML "hostCommunities.html"
1131
1028
#define CONST_DUMP_DATA_HTML "dumpData.html"
1132
1029
#define CONST_DUMP_HOSTS_INDEXES_HTML "dumpDataIndexes.html"
1133
1030
#define CONST_DUMP_NTOP_FLOWS_HTML "dumpFlows.html"
1181
1078
#define CONST_ACTIVE_TCP_SESSIONS_HTML "NetNetstat.html"
1182
1079
#define CONST_NETWORK_IMAGE_MAP "network_map.png"
1183
1080
#define CONST_CGI_HEADER "ntop-bin/"
1081
#define CONST_EMBEDDED_PYTHON_HEADER "python/"
1184
1082
#define CONST_MAN_NTOP_HTML "ntop.html"
1185
1083
#define CONST_NTOP_P3P "ntop.p3p"
1186
1084
#define CONST_PROBLEMRPT_HTML "ntopProblemReport.html"
1195
1093
#define CONST_PRIVACYFORCE_HTML "privacyFlagForce.html"
1196
1094
#define CONST_PRIVACYNOTICE_HTML "privacyNotice.html"
1197
1095
#define CONST_PURGE_HOST "purgeHost.html"
1096
#define CONST_HOST_MAP "hostMap.html"
1097
#define CONST_REGION_MAP "python/GeoPacketVisualizer.py"
1198
1098
#define CONST_RESET_STATS_HTML "resetStats.html"
1199
1099
#define CONST_SCSI_BYTES_HTML "ScsiBytes.html"
1200
1100
#define CONST_BAR_LUNSTATS_DIST "ScsiBytesLunDistribution"
1247
1147
#define CONST_MAILTO_OLIVIER "<a class=mailto href=\"mailto:olivier.festor@loria.fr\" title=\"Send email to Olivier Festor\">Olivier Festor</a>"
1248
1148
#define CONST_MAILTO_DINESH "<a class=mailto href=\"mailto:ddutt@cisco.com\" title=\"Send email to Dinesh G. Dutt\">Dinesh G. Dutt</a>"
1249
1149
#define CONST_MAILTO_BURTON "<a class=mailto href=\"mailto:burton@ntopsupport.com\" title=\"Send email to Burton Strauss\">Burton Strauss</a>"
1150
#define CONST_MAILTO_MEDICI "<a class=mailto href=\"mailto:gianluca_medici@tin.it\" title=\"Send email to Gianluca Medici\">Gianluca Medici</a>"
1252
1153
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1340
1241
* handleAddressLists() constants
1342
#define CONST_HANDLEADDRESSLISTS_MAIN 0
1343
#define CONST_HANDLEADDRESSLISTS_RRD 1
1344
#define CONST_HANDLEADDRESSLISTS_NETFLOW 2
1345
#define CONST_HANDLEADDRESSLISTS_CLUSTERS 3
1346
#define CONST_HANDLEADDRESSLISTS_COMMUNITY 4
1243
#define CONST_HANDLEADDRESSLISTS_MAIN 0
1244
#define CONST_HANDLEADDRESSLISTS_RRD 1
1245
#define CONST_HANDLEADDRESSLISTS_NETFLOW 2
1246
#define CONST_HANDLEADDRESSLISTS_COMMUNITIES 3
1349
1249
* Protocol types
1620
1520
#define CONST_IMG_FIBRECHANNEL_SWITCH "<img class=tooltip src=\"/switch.gif\" border=\"0\" alt=\"FibreChannel Switch\" title=\"FibreChannel Switch\">"
1621
1521
#define CONST_IMG_DHCP_CLIENT "<img class=tooltip src=\"/bulb.gif\" border=\"0\" alt=\"DHCP Client\" title=\"DHCP Client\">"
1622
1522
#define CONST_IMG_DHCP_SERVER "<img class=tooltip src=\"/antenna.gif\" border=\"0\" alt=\"DHCP Server\" title=\"DHCP Server\">"
1623
#define CONST_IMG_MULTIHOMED "<img class=tooltip src=\"/multihomed.gif\" border=\"0\" alt=\"Multihomed\" title=\"Multihomed\">"
1523
#define CONST_IMG_MULTIHOMED "<img class=tooltip src=\"/multihomed.png\" border=\"0\" alt=\"Multihomed\" title=\"Multihomed\">"
1624
1524
#define CONST_IMG_MULTIVLANED "<img class=tooltip src=\"/multivlaned.gif\"\" border=\"0\" alt=\"Multivlaned\" title=\"Multivlaned\">"
1625
1525
#define CONST_IMG_BRIDGE "<img class=tooltip src=\"/bridge.gif\" border=\"0\" alt=\"Bridge\" title=\"Bridge\">"
1626
1526
#define CONST_IMG_ROUTER "<img class=tooltip src=\"/router.gif\" border=\"0\" alt=\"Router\" title=\"Router\">"
1647
1547
#define CONST_IMG_SCSI_DISK "<img class=tooltip src=\"/disk.gif\" border=\"0\" alt=\"SCSI Block Device (disk)\" title=\"SCSI Block Device (disk)\">"
1649
1549
#define CONST_IMG_FC_VEN_BROCADE "<img class=tooltip src=\"/brocade.gif\" border=\"0\" alt=\"Brocade Communications Systems, Inc.\" title=\"Brocade Communications Systems, Inc.\">"
1650
#define CONST_IMG_FC_VEN_EMC "<img class=tooltip src=\"/emc.gif\" border=\"0\" alt=\"EMC Corporation\" title=\"EMC Corporation\">"
1651
1550
#define CONST_IMG_FC_VEN_EMULEX "<img class=tooltip src=\"/emulex.gif\" border=\"0\" alt=\"Emulex Corporation\" title=\"Emulex Corporation\">"
1652
1551
#define CONST_IMG_FC_VEN_JNI "<img class=tooltip src=\"/jni.gif\" border=\"0\" alt=\"JNI Corporation\" title=\"JNI Corporation\">"
1653
1552
#define CONST_IMG_FC_VEN_SEAGATE "<img class=tooltip src=\"/seagate.gif\" border=\"0\" alt=\"Seagate Technology\" title=\"Seagate Technology\">"
1655
#define CONST_IMG_ARROW_UP "<img class=tooltip src=\"/arrow_up.gif\" border=\"0\" alt=\"Ascending order, click to reverse\" title=\"Ascending order, click to reverse\">"
1656
#define CONST_IMG_ARROW_DOWN "<img class=tooltip src=\"/arrow_down.gif\" border=\"0\" alt=\"Descending order, click to reverse\" title=\"Descending order, click to reverse\">"
1554
#define CONST_IMG_ARROW_UP "<img class=tooltip src=\"/arrow_up.png\" border=\"0\" alt=\"Ascending order, click to reverse\" title=\"Ascending order, click to reverse\">"
1555
#define CONST_IMG_ARROW_DOWN "<img class=tooltip src=\"/arrow_down.png\" border=\"0\" alt=\"Descending order, click to reverse\" title=\"Descending order, click to reverse\">"
1658
1557
#define CONST_IMG_OS_WINDOWS "<img class=tooltip alt=\"OS: Windows\" title=\"OS: Windows\" align=\"middle\" src=\"/statsicons/os/windows.gif\">"
1659
1558
#define CONST_IMG_OS_IRIX "<img class=tooltip alt=\"OS: Irix\" title=\"OS: Irix\" align=\"middle\" src=\"/statsicons/os/irix.gif\">"
1749
1641
#define FLAG_HTTP_TYPE_P3P 10
1750
1642
#define FLAG_HTTP_TYPE_SVG 11
1751
1643
#define FLAG_HTTP_TYPE_JSON 12
1644
#define FLAG_HTTP_TYPE_PDF 13
1753
1646
#define BITFLAG_HTTP_IS_CACHEABLE (1<<0)
1754
1647
#define BITFLAG_HTTP_NO_CACHE_CONTROL (1<<1)
1803
1698
#define FLAG_HOST_TYPE_SVC_VOIP_CLIENT 29
1804
1699
#define FLAG_HOST_TYPE_SVC_VOIP_GATEWAY 30
1701
#define MAX_FLAG_HOST_TYPE FLAG_HOST_TYPE_SVC_VOIP_GATEWAY
1806
1703
/* Flags for possible error codes */
1807
1704
#define FLAG_HOST_WRONG_NETMASK 65
1808
1705
#define FLAG_HOST_DUPLICATED_MAC 66
1832
1729
#define FLAG_P2P_GNUTELLA 1
1833
1730
#define FLAG_P2P_KAZAA 2
1834
#define FLAG_P2P_WINMX 3
1835
#define FLAG_P2P_DIRECTCONNECT 4
1837
#define FLAG_P2P_EDONKEY 5
1838
#define FLAG_P2P_FASTTRACK 6
1839
#define FLAG_P2P_BITTORRENT 7
1840
#define FLAG_P2P_OTHER_PROTOCOL 8
1732
#define FLAG_P2P_EDONKEY 3
1733
#define FLAG_P2P_BITTORRENT 4
1734
#define FLAG_P2P_OTHER_PROTOCOL 5
1843
1737
#define UNKNOWN_P2P_FILE "<unknown file>"
1931
1825
#define FLAG_HOST_SYM_ADDR_TYPE_NETBIOS 27
1932
1826
#define FLAG_HOST_SYM_ADDR_TYPE_NAME 29
1933
1827
#define FLAG_HOST_SYM_ADDR_TYPE_MDNS 30 /* Multicast DNS */
1937
#ifdef MAKE_WITH_SSLWATCHDOG
1939
#define FLAG_SSLWATCHDOG_PARENT 0
1940
#define FLAG_SSLWATCHDOG_CHILD 1
1941
#define FLAG_SSLWATCHDOG_BOTH -1
1943
#define FLAG_SSLWATCHDOG_UNINIT 0 /* No child */
1944
#define FLAG_SSLWATCHDOG_WAITINGREQUEST 1 /* waiting for request */
1945
#define FLAG_SSLWATCHDOG_HTTPREQUEST 2 /* http request received */
1946
#define FLAG_SSLWATCHDOG_HTTPCOMPLETE 3 /* Parent done w/ http */
1947
#define FLAG_SSLWATCHDOG_FINISHED 9
1949
#define FLAG_SSLWATCHDOG_RETURN_LOCKED 1
1950
#define FLAG_SSLWATCHDOG_ENTER_LOCKED 2
1967
1843
#define FLAG_PHP_LANGUAGE 2
1968
1844
#define FLAG_XML_LANGUAGE 3
1969
1845
#define FLAG_PYTHON_LANGUAGE 4
1970
#define FLAG_NO_LANGUAGE 5
1846
#define FLAG_JSON_LANGUAGE 5
1847
#define FLAG_GOOGLE_LANGUAGE 6
1848
#define FLAG_NO_LANGUAGE 7
1971
1849
#define MAX_FLAG_LANGUGE FLAG_NO_LANGUAGE
1973
1851
#define FLAG_NO_PEER UINT_MAX
2069
1947
#define DEFAULT_NTOP_OTHER_PKT_DUMP 0 /* -j */
2070
1948
#define DEFAULT_NTOP_PCAP_LOG_FILENAME NULL /* -l */
2071
1949
#define DEFAULT_NTOP_LOCAL_SUBNETS NULL /* -m */
2072
#define DEFAULT_NTOP_NUMERIC_IP_ADDRESSES 0 /* -n */
1950
#define DEFAULT_NTOP_NUMERIC_IP_ADDRESSES dnsResolutionForAll /* -n */
2073
1951
#define DEFAULT_NTOP_DONT_TRUST_MAC_ADDR 0 /* -o */
2074
1952
#define DEFAULT_NTOP_PROTO_SPECS NULL /* -p */
2075
1953
#define DEFAULT_NTOP_SUSPICIOUS_PKT_DUMP 0 /* -q */
2113
1991
#define DEFAULT_TRACE_LEVEL 3
2115
1994
#define DEFAULT_NTOP_MAPPER_URL "http://www.ntop.org/cgi-bin/mapper.pl" /* -U -*/
2117
#ifdef MAKE_WITH_SCHED_YIELD
2118
#define DEFAULT_NTOP_SCHED_YIELD TRUE
1996
#define DEFAULT_NTOP_MAPPER_URL "http://geotool.servehttp.com/" /* -U -*/
2121
1999
#define DEFAULT_NTOP_FCNS_FILE NULL
2161
2039
/* #define MAX_HOSTS_PURGE_PER_CYCLE 512 */
2164
* TCP Wrapper defaults
2167
#ifdef MAKE_WITH_SYSLOG
2168
#define DEFAULT_TCPWRAP_ALLOW LOG_AUTHPRIV|LOG_INFO
2169
#define DEFAULT_TCPWRAP_DENY LOG_AUTHPRIV|LOG_WARNING
2171
#define DEFAULT_TCPWRAP_ALLOW 0
2172
#define DEFAULT_TCPWRAP_DENY 0
2177
2042
* Default port to use for netflow.
2179
2044
#define DEFAULT_NETFLOW_PORT_STR "2055"
2294
2164
* these ETHERTYPE_ constants aren't defined in <net/ethernet.h>
2296
2166
#ifndef ETHERTYPE_IPv6
2297
#define ETHERTYPE_IPv6 0x86DD
2167
#define ETHERTYPE_IPv6 0x86DD
2300
2170
#ifndef ETHERTYPE_802_1Q
2301
#define ETHERTYPE_802_1Q 0x8100
2171
#define ETHERTYPE_802_1Q 0x8100
2174
#ifndef ETHERTYPE_MPLS
2175
#define ETHERTYPE_MPLS 0x8847 /* MPLS protocol */
2178
#ifndef ETHERTYPE_MPLS_MULTI
2179
#define ETHERTYPE_MPLS_MULTI 0x8848 /* MPLS multicast packet */
2182
#define MAX_NUM_MPLS_LABELS 10
2183
#define MPLS_LABEL_LEN 3
2304
2185
#ifndef ETHERMTU
2305
#define ETHERMTU 1500
2186
#define ETHERMTU 1500
2308
2189
/* Additional ethertypes for FC */
2512
2393
#endif /* MAKE_NTOP_PACKETSZ_DECLARATIONS */
2515
#define HFIXEDSZ 12 /* #/bytes of fixed data in header */
2516
#define INT32SZ 4 /* for systems without 32-bit ints */
2517
#define INT16SZ 2 /* for systems without 16-bit ints */
2518
#define INADDRSZ 4 /* IPv4 T_A */
2519
#define IN6ADDRSZ 16 /* IPv6 T_AAAA */
2520
#endif /* INT16SZ */
2523
#define NS_INT16SZ sizeof(u_int16_t) /* #/bytes of data in a u_int16_t */
2526
#ifndef NS_CMPRSFLGS
2527
#define NS_CMPRSFLGS 0xc0
2530
#ifndef NS_MAXCDNAME
2531
#define NS_MAXCDNAME 255
2534
2395
/* End the <arpa/nameser_compat.h> stuff */
2536
2397
/* ******************************* */
2608
2469
#define IPPROTO_OSPF 89
2473
#define IPPROTO_GRE 47
2611
2476
/* Internet Group Management Protocol */
2612
2477
#ifndef IPPROTO_IGMP
2613
#define IPPROTO_IGMP 2
2478
#define IPPROTO_IGMP 2
2481
/* IPSec Encapsulating Security Protocol (ESP) */
2482
#ifndef IPPROTO_IPSEC_ESP
2483
#define IPPROTO_IPSEC_ESP 0x32
2486
/* IPSec Authentication Header (AH) */
2487
#ifndef IPPROTO_IPSEC_AH
2488
#define IPPROTO_IPSEC_AH 0x33
2616
2491
/* ******************************* */
2814
2689
#define IP_TCP_PORT_JETDIRECT 9100
2815
2690
#define IP_TCP_PORT_SKYPE 54045
2692
/* GeoIP - http://www.maxmind.com */
2693
#define GEO_IP_FILE "GeoLiteCity.dat"
2694
#define GEO_IP_ASN_FILE "GeoIPASNum.dat"
2817
2696
#define NULL_VALUE "(null)"
2819
2698
/* NTOP preference names */
2820
2699
#define NTOP_PREF_DEVICES "ntop.devices"
2821
#define NTOP_PREF_CAPFILE "ntop.rFileName"
2822
2700
#define NTOP_PREF_FILTER "ntop.currentFilterExpression"
2823
2701
#define NTOP_PREF_SAMPLING "ntop.sampleRate"
2824
2702
#define NTOP_PREF_WEBPORT "ntop.webPort"
2827
2705
#define NTOP_PREF_EN_PROTO_DECODE "ntop.enablePacketDecoding"
2828
2706
#define NTOP_PREF_FLOWSPECS "ntop.flowSpecs"
2829
2707
#define NTOP_PREF_LOCALADDR "ntop.localAddresses"
2708
#define NTOP_PREF_KNOWNSUBNETS "ntop.knownSubnetworks"
2830
2709
#define NTOP_PREF_SPOOLPATH "ntop.spoolPath"
2831
2710
#define NTOP_PREF_STICKY_HOSTS "ntop.stickyHosts"
2832
2711
#define NTOP_PREF_TRACK_LOCAL "ntop.trackOnlyLocalHosts"
2834
2713
#define NTOP_PREF_DAEMON "ntop.daemonMode"
2835
2714
#define NTOP_PREF_REFRESH_RATE "ntop.refreshRate"
2836
2715
#define NTOP_PREF_MAXLINES "ntop.maxNumLines"
2837
#define NTOP_PREF_PRINT_FCORIP "ntop.printFcOrIp"
2838
#define NTOP_PREF_NO_INVLUN "ntop.noInvalidLunDisplay"
2839
2716
#define NTOP_PREF_W3C "ntop.w3c"
2840
2717
#define NTOP_PREF_IPV4 "ntop.ipv4"
2841
2718
#define NTOP_PREF_IPV6 "ntop.ipv6"
2845
2722
#define NTOP_PREF_PROTOSPECS "ntop.protoSpecs"
2846
2723
#define NTOP_PREF_P3PCP "ntop.P3Pcp"
2847
2724
#define NTOP_PREF_P3PURI "ntop.P3Puri"
2848
2727
#define NTOP_PREF_WWN_MAP "ntop.fcNSCacheFile"
2728
#define NTOP_PREF_PRINT_FCORIP "ntop.printFcOrIp"
2729
#define NTOP_PREF_NO_INVLUN "ntop.noInvalidLunDisplay"
2849
2732
#define NTOP_PREF_MAXHASH "ntop.maxNumHashEntries"
2850
2733
#define NTOP_PREF_SQL_DB_CONFIG "ntop.sqlDbConfig"
2851
2734
#define NTOP_PREF_SQL_REC_LIFETIME "ntop.sqlRecDaysLifetime"
2852
2735
#define NTOP_PREF_SAVE_REC_INTO_DB "ntop.saveRecordsIntoDb"
2853
2736
#define NTOP_PREF_SAVE_SESSIONS_INTO_DB "ntop.saveSessionsIntoDb"
2854
2737
#define NTOP_PREF_MAXSESSIONS "ntop.maxNumSessions"
2738
#define NTOP_PREF_LIVE_MODE "ntop.liveMode"
2739
#define NTOP_PREF_NET_EFFICIENCY "ntop.netEfficiency"
2855
2740
#define NTOP_PREF_MERGEIF "ntop.mergeInterfaces"
2856
2741
#define NTOP_PREF_ENABLE_L7PROTO "ntop.enableL7Proto"
2857
2742
#define NTOP_PREF_NO_ISESS_PURGE "ntop.disableInstantSessionPurge"
2858
2743
#define NTOP_PREF_NO_TRUST_MAC "ntop.dontTrustMACaddr"
2859
2744
#define NTOP_PREF_PCAP_LOGBASE "ntop.pcapLogBasePath"
2860
#define NTOP_PREF_USE_SSLWATCH "ntop.useSSLwatchdog"
2861
#define NTOP_PREF_NO_SCHEDYLD "ntop.schedYield"
2862
2745
#define NTOP_PREF_DBG_MODE "ntop.debugMode"
2863
2746
#define NTOP_PREF_TRACE_LVL "ntop.traceLevel"
2864
2747
#define NTOP_PREF_DUMP_OTHER "ntop.enableOtherPacketDump"
2878
2761
#define NTOP_PREF_VALUE_AF_BOTH AF_UNSPEC
2880
2763
#define COMMUNITY_PREFIX "community."
2765
#define UNKNOWN_SUBNET_ID ((int8_t)-1)
2766
#define ALL_SUBNET_IDS ((int8_t)-2)
2768
/* *************************** */
2770
#define DEFAULT_NTOP_PLUGINS_INSTALL "/usr/local/lib/ntop/plugins"
2771
#define DEFAULT_NTOP_HTML_INSTALL "/usr/local/share/ntop"
2772
#define DEFAULT_NTOP_CFG_CONFIGFILE_DIR "/usr/local/etc/ntop"
2774
#define DOMAIN_VIEW 0
2775
#define NETWORK_VIEW 1
2777
#define AS_GRAPH_VIEW 3
2779
#define EVENTS_MASK "events.mask"
2780
#define EVENTS_LOG "events.log"
2782
/* *************************** */
2784
#define MAX_NUM_INTERFACE_NETWORKS 128
2786
#define quickLock(_a_, _b_) accessMutex(&myGlobals.device[_b_].counterMutex, "quickLock");
2787
#define quickUnlock(_a_, _b_) releaseMutex(&myGlobals.device[_b_].counterMutex);
2789
#define incrementHostTrafficCounter(_a_, _b_, _c_) { \
2790
quickLock(_a_, actualDeviceId); \
2791
if((myGlobals.numKnownSubnets > 0) && (_a_->known_subnet_id != UNKNOWN_SUBNET_ID)) \
2792
incrementTrafficCounter(&myGlobals.device[actualDeviceId].networkHost[_a_->known_subnet_id]._b_,_c_); \
2793
incrementTrafficCounter(&_a_->_b_, _c_); \
2794
quickUnlock(_a_, actualDeviceId); \
2797
#define allocHostTrafficCounterMemory(_a_, _b_, _c_) { \
2798
quickLock(_a_, actualDeviceId); \
2799
if((myGlobals.numKnownSubnets > 0) \
2800
&& (_a_->known_subnet_id != UNKNOWN_SUBNET_ID) \
2801
&& (myGlobals.device[actualDeviceId].networkHost[_a_->known_subnet_id]._b_ == NULL)) \
2802
myGlobals.device[actualDeviceId].networkHost[_a_->known_subnet_id]._b_ = calloc(_c_, 1); \
2803
if(_a_->_b_ == NULL) \
2804
_a_->_b_ = calloc(_c_, 1); \
2805
quickUnlock(_a_, actualDeviceId); \
2808
/* *************************** */