/* * * (C) 2013-23 - ntop.org * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #ifndef _NTOP_DEFINES_H_ #define _NTOP_DEFINES_H_ #include "ntop_flow.h" #define NUM_ROOTS 512 /* ***************************************************** */ #ifndef ETHERTYPE_IP #define ETHERTYPE_IP 0x0800 /* IP protocol */ #endif #ifndef ETHERTYPE_VLAN #define ETHERTYPE_VLAN 0x8100 #endif #ifndef ETHERTYPE_IPV6 #define ETHERTYPE_IPV6 0x86DD /* IPv6 protocol */ #endif #ifndef ETHERTYPE_MPLS #define ETHERTYPE_MPLS 0x8847 /* MPLS protocol */ #endif #ifndef ETHERTYPE_MPLS_MULTI #define ETHERTYPE_MPLS_MULTI 0x8848 /* MPLS multicast packet */ #endif #ifndef ETHERTYPE_ARP #define ETHERTYPE_ARP 0x0806 /* Address Resolution Protocol */ #endif #ifndef ETHERTYPE_PPPoE #define ETHERTYPE_PPPoE 0x8864 #endif #ifndef IPPROTO_ICMPV6 #define IPPROTO_ICMPV6 58 /* ICMPv6 */ #endif /* should be defined in linux/if_ether.h */ #ifndef ETH_P_ERSPAN2 #define ETH_P_ERSPAN2 0x22EB /* ERSPAN version 2 (type III) */ #endif #ifndef ETH_P_ERSPAN #define ETH_P_ERSPAN 0x88BE /* ERSPAN type II */ #endif #ifndef IPPROTO_IP_IN_IP #define IPPROTO_IP_IN_IP 0x04 #endif /* BSD AF_ values. */ #define BSD_AF_INET 2 #define BSD_AF_INET6_BSD 24 /* OpenBSD (and probably NetBSD), BSD/OS */ #define BSD_AF_INET6_FREEBSD 28 #define BSD_AF_INET6_DARWIN 30 #ifndef SPEED_UNKNOWN #define SPEED_UNKNOWN -1 #endif /* ***************************************************** */ #ifndef min_val #define min_val(a, b) ((a > b) ? b : a) #endif #ifndef max_val #define max_val(a, b) ((a > b) ? a : b) #endif /* ********************************************* */ #ifdef WIN32 #define likely(x) (x) #define unlikely(x) (x) #else #define likely(x) __builtin_expect((x), 1) #define unlikely(x) __builtin_expect((x), 0) #endif /* ***************************************************** */ #ifdef WIN32 #undef PACKAGE_OSNAME #ifdef _WIN64 #define PACKAGE_OSNAME "Win64" #else #define PACKAGE_OSNAME "Win32" #endif #endif #define ZMQ_COMPATIBILITY_MSG_VERSION 1 #define ZMQ_MSG_VERSION 2 #define ZMQ_MSG_VERSION_TLV 3 #define LOGIN_URL "/lua/login.lua" #define LOCALE_URL "/lua/locale.lua" #define LOGOUT_URL "/lua/ntopng_logout.lua" #define CAPTIVE_PORTAL_URL "/lua/captive_portal.lua" #define CAPTIVE_PORTAL_LOGOUT_URL "/lua/logout.lua" #define CAPTIVE_PORTAL_INFO_URL "/lua/info_portal.lua" #define PLEASE_WAIT_URL "/lua/please_wait.lua" #define AUTHORIZE_URL "/authorize.html" #define AUTHORIZE_CAPTIVE_LUA_URL "/lua/authorize_captive.lua" #define HOTSPOT_DETECT_URL "/hotspot-detect.html" /* iOS */ #define KINDLE_WIFISTUB_URL "/kindle-wifi/wifistub.html" /* Kindle */ #define HOTSPOT_DETECT_LUA_URL "/lua/hotspot-detect.lua" #define CHANGE_PASSWORD_ULR "/lua/change_password.lua" #define LIVE_TRAFFIC_URL "/lua/rest/v2/get/pcap/live_traffic.lua" #define POOL_MEMBERS_ASSOC_URL "/lua/admin/manage_pool_members.lua" #define REST_API_PREFIX "/lua/rest/" #define REST_API_PRO_PREFIX "/lua/pro/rest/" #define INTERFACE_DATA_URL "/lua/rest/get/interface/data.lua" #define MAX_PASSWORD_LEN 32 + 1 /* \0 */ #define HTTP_SESSION_DURATION 43200 // 12h #define HTTP_SESSION_MIDNIGHT_EXPIRATION false #define EXTENDED_HTTP_SESSION_DURATION 604800 // 7d #define CONST_HTTPS_CERT_NAME "ntopng-cert.pem" #define CONST_HTTPS_AUTHCA_FILE "ntopng-ca.crt" #define CONST_NTOP_INTERFACE "ntop_interface" #define PCAP_MAGIC 0xa1b2c3d4 #define PCAP_NSEC_MAGIC 0xa1b23c4d #define NO_UID ((u_int32_t)-1) #define NO_PID ((u_int32_t)-1) #define NO_NDPI_PROTOCOL ((u_int)-1) #define NDPI_MIN_NUM_PACKETS 12 #define GTP_U_V1_PORT 2152 #define TZSP_PORT 37008 #define VXLAN_PORT 4789 #define CAPWAP_DATA_PORT 5247 #define MAX_NUM_INTERFACE_HOSTS 131072 #define MAX_NUM_VIEW_INTERFACES 8 #define LIMITED_NUM_INTERFACES 8 #define LIMITED_NUM_HOST_POOLS \ 5 /* 3 pools plus the NO_HOST_POOL_ID plus the Jailed hosts pool */ #define LIMITED_NUM_PROFILES 16 #define LIMITED_NUM_POOL_MEMBERS 8 #define LIMITED_MAX_ZMQ_SUBSCRIBERS 32 #define UNLIMITED_NUM_INTERFACES 64 #define UNLIMITED_NUM_HOST_POOLS 128 #define UNLIMITED_NUM_PROFILES 128 #define UNLIMITED_MAX_ZMQ_SUBSCRIBERS 256 #ifndef NTOPNG_PRO #define MAX_NUM_DEFINED_INTERFACES LIMITED_NUM_INTERFACES #define MAX_NUM_HOST_POOLS LIMITED_NUM_HOST_POOLS #define MAX_NUM_PROFILES LIMITED_NUM_PROFILES #define MAX_NUM_POOL_MEMBERS LIMITED_NUM_POOL_MEMBERS #define MAX_ZMQ_SUBSCRIBERS LIMITED_MAX_ZMQ_SUBSCRIBERS #else /* Max number of ZMQ endpoints that can be configured to connect to the probes * Note: when running as server/collector the max number of clients/subscribers * is not limited (tested up to 256) */ #define MAX_ZMQ_SUBSCRIBERS UNLIMITED_MAX_ZMQ_SUBSCRIBERS #endif #define ZMQ_PROBE_EXPIRATION_TIME 10 /* seconds */ #define MAX_INTERFACE_NAME_LEN 512 #define MAX_USER_NETS_VAL_LEN 255 #define NUM_HOSTS_RESOLVED_BITS 2 << 19 /* ~1 million */ #define HOST_FAMILY_ID ((u_int16_t)-1) #define FLOW_PURGE_FREQUENCY 1 /* sec */ #define HOST_PURGE_FREQUENCY 3 /* sec */ #define OTHER_PURGE_FREQUENCY 5 /* sec - Other = ASs, MAC, Countries, VLANs */ #define MAX_TCP_FLOW_IDLE \ 15 /* sec - how long to wait before idling a TCP flow with FIN/RST set or \ with incomplete TWH */ #define MAX_FLOW_IDLE 60 /* sec */ #define MAX_LOCAL_HOST_IDLE 300 /* sec */ #define MAX_REMOTE_HOST_IDLE 60 /* sec */ #define MAX_HASH_ENTRY_IDLE \ 60 /* sec - Generic idle time for hash entries different from hosts and \ flows (i.e., ASes and Macs) */ #define MAX_RRD_QUEUE_LEN 200000 /* timeseries in the queue */ #define MIN_NUM_IDLE_ENTRIES_IF 5000 #define INTF_RRD_RAW_DAYS 1 #define INTF_RRD_1MIN_DAYS 30 #define INTF_RRD_1H_DAYS 100 #define INTF_RRD_1D_DAYS 365 #define OTHER_RRD_RAW_DAYS 1 #define OTHER_RRD_1MIN_DAYS 30 #define OTHER_RRD_1H_DAYS 100 #define OTHER_RRD_1D_DAYS 365 #define CONST_DEFAULT_TOP_TALKERS_ENABLED false #define PURGE_FRACTION 60 /* check 1/60 of hashes per iteration */ #define MIN_NUM_VISITED_ENTRIES 1024 #define MAX_NUM_QUEUED_ADDRS \ 500 /* Maximum number of queued address for resolution */ #define MAX_NUM_QUEUED_CONTACTS 25000 #define NTOP_COPYRIGHT "(C) 1998-23 ntop.org" #define DEFAULT_PID_PATH "/var/run/ntopng.pid" #define SYSTEM_INTERFACE_NAME "__system__" #define SYSTEM_INTERFACE_ID -1 #define INVALID_INTERFACE_ID -2 #define DOMAIN_CATEGORY "ntopng.domain.category" #define DOMAIN_TO_CATEGORIZE "ntopng.domain.tocategorize" #define DOMAIN_WHITELIST_CAT "ntopng.domain.whitelist" #define DNS_CACHE "ntopng.dns.cache" #define DHCP_CACHE "ntopng.dhcp.%d.cache.%s" #define DHCP_STORM_QUEUE_NAME "ntopng.dhcp.storm.%d" #define ASSET_SERVICE_KEY "ntopng.asset.%d.%s" /* ifId.host */ #define DHCP_STORM_PPS_THSHOLD 2048 #define NTOPNG_TRACE "ntopng.trace" #define TRACES_PER_LOG_FILE_HIGH_WATERMARK 10000 #define MAX_NUM_NTOPNG_LOG_FILES 5 #define MAX_NUM_NTOPNG_TRACES 32 #define PCAP_DUMP_INTERFACES_DELETE_HASH \ "ntopng.prefs.delete_pcap_dump_interfaces_data" #define CUSTOM_NDPI_PROTOCOLS_ASSOCIATIONS_HASH \ "ntop.prefs.custom_nDPI_proto_categories" #define TRAFFIC_FILTERING_CACHE "ntopng.trafficfiltering.cache" #define TRAFFIC_FILTERING_TO_RESOLVE "ntopng.trafficfiltering.toresolve" #define PREFS_CHANGED "ntopng.cache.prefs_changed" #define DROP_HOST_TRAFFIC "ntopng.prefs.drop_host_traffic" #define HOST_TRAFFIC_QUOTA "ntopng.prefs.hosts_quota" #define HTTP_ACL_MANAGEMENT_PORT "ntopng.prefs.http_acl_management_port" #define TEMP_ADMIN_PASSWORD "ntopng.prefs.temp_admin_password" #define LAST_RESET_TIME "ntopng.prefs.last_reset_time" #define NTOPNG_VLAN_ALIASES "ntopng.vlan_aliases" #define TRAFFIC_FILTERING_CACHE_DURATION 43200 /* 12 h */ #define DNS_CACHE_DURATION 3600 /* 1 h */ #define LOCAL_HOSTS_CACHE_DURATION 3600 /* 1 h */ #define HOST_LABEL_NAMES_KEY "ntopng.cache.host_labels.%s" #define IFACE_DHCP_RANGE_KEY "ntopng.prefs.ifid_%u.dhcp_ranges" #define HOST_SERIALIZED_KEY "ntopng.serialized_hosts.ifid_%u_%s@%d" #define MAC_SERIALIZED_KEY "ntopng.serialized_macs.ifid_%u_%s" /* /lua/enterprise/get_inactive_macs_data.lua */ #define IP_MAC_ASSOCIATION "ntopng.ip_to_mac.ifid_%u_%s@%d" #define HOST_PREF_MUD_RECORDING "ntopng.prefs.iface_%d.mud.recording.%s" #define MUD_RECORDING_GENERAL_PURPOSE "general_purpose" #define MUD_RECORDING_SPECIAL_PURPOSE "special_purpose" #define MUD_RECORDING_DISABLED "disabled" #define MUD_RECORDING_DEFAULT "default" #define HOST_BY_MAC_SERIALIZED_KEY "ntopng.serialized_hostsbymac.ifid_%u_%s" #define HOST_POOL_SERIALIZED_KEY "ntopng.serialized_host_pools.ifid_%u" #define VLAN_SERIALIZED_KEY "ntopng.serialized_vlan.ifid_%u_vlan_%u" #define AS_SERIALIZED_KEY "ntopng.serialized_as.ifid_%u_as_%u" #define COUNTRY_SERIALIZED_KEY "ntopng.serialized_as.ifid_%u_country_%s" #define OBS_POINT_SERIALIZED_KEY "ntopng.serialized_as.ifid_%u_obs_point_%u" #define SYSLOG_PRODUCERS_MAP_KEY "ntopng.syslog.ifid_%u.producers_map" #define NTOPNG_PREFS_PREFIX "ntopng.prefs" #define NTOPNG_CACHE_PREFIX "ntopng.cache" #define NTOPNG_USER_PREFIX "ntopng.user" #define NTOPNG_API_TOKEN_PREFIX "ntopng.api_tokens" #define MAC_CUSTOM_DEVICE_TYPE NTOPNG_PREFS_PREFIX ".device_types.%s" #define NTOP_HOSTS_SERIAL "ntopng.host_serial" #define MAX_NUM_INTERFACE_IDS 256 #define DUMMY_BRIDGE_INTERFACE_ID 1 /* Anything but zero */ #define MAX_FAILED_LOGIN_ATTEMPTS 5 #define FAILED_LOGIN_ATTEMPTS_INTERVAL 300 /* seconds */ #define CONST_STR_FAILED_LOGIN_KEY "ntopng.cache.failed_logins.%s" #define CONST_STR_RELOAD_LISTS \ "ntopng.cache.reload_lists_utils" /* sync with lists_utils.lua */ #define NTOP_NOLOGIN_USER "nologin" #define NTOP_DEFAULT_USER_LANG "en" #define MAX_OPTIONS 24 #define CONST_ADMINISTRATOR_USER "administrator" #define CONST_UNPRIVILEGED_USER "unprivileged" #define CONST_DEFAULT_PASSWORD_CHANGED \ NTOPNG_PREFS_PREFIX ".admin_password_changed" #define CONST_STR_NEDGE_LICENSE "nedge.license" #define CONST_STR_NEDGE_KEY "nedge.key" #define CONST_STR_NTOPNG_LICENSE "ntopng.license" #define CONST_STR_NTOPNG_KEY "ntopng.key" #define CONST_STR_PRODUCT_NAME_KEY "ntopng.product_name" #define CONST_STR_USER_GROUP NTOPNG_USER_PREFIX ".%s.group" #define CONST_STR_USER_DATE_FORMAT NTOPNG_USER_PREFIX ".%s.date_format" #define CONST_STR_USER_ID NTOPNG_USER_PREFIX ".%s.user_id" #define CONST_STR_USER_FULL_NAME NTOPNG_USER_PREFIX ".%s.full_name" #define CONST_STR_USER_PASSWORD NTOPNG_USER_PREFIX ".%s.password" #define CONST_STR_USER_THEME NTOPNG_USER_PREFIX ".%s.theme" #define CONST_STR_USER_NETS NTOPNG_USER_PREFIX ".%s.allowed_nets" #define CONST_STR_USER_ALLOWED_IFNAME NTOPNG_USER_PREFIX ".%s.allowed_ifname" #define CONST_STR_USER_HOST_POOL_ID NTOPNG_USER_PREFIX ".%s.host_pool_id" #define CONST_STR_USER_LANGUAGE NTOPNG_USER_PREFIX ".%s.language" #define CONST_STR_USER_ALLOW_PCAP NTOPNG_USER_PREFIX ".%s.allow_pcap" #define CONST_STR_USER_ALLOW_HISTORICAL_FLOW \ NTOPNG_USER_PREFIX ".%s.allow_historical_flow" #define CONST_STR_USER_ALLOW_ALERTS NTOPNG_USER_PREFIX ".%s.allow_alerts" #define CONST_STR_USER_EXPIRE NTOPNG_USER_PREFIX ".%s.expire" #define CONST_STR_USER_CAPABILITIES NTOPNG_USER_PREFIX ".%s.capabilities" #define CONST_STR_USER_API_TOKEN NTOPNG_USER_PREFIX ".%s.api_token" #define CONST_ALLOWED_NETS "allowed_nets" #define CONST_ALLOWED_IFNAME "allowed_ifname" #define CONST_USER_LANGUAGE "language" #define CONST_USER "user" #define CONST_INTERFACE_TYPE_PCAP "pcap" #define CONST_INTERFACE_TYPE_PCAP_DUMP "pcap dump" #define CONST_INTERFACE_TYPE_ZMQ "zmq" #define CONST_INTERFACE_TYPE_KAFKA "kafka" #define CONST_INTERFACE_TYPE_SYSLOG "syslog" #define CONST_INTERFACE_TYPE_VLAN "Dynamic VLAN" #define CONST_INTERFACE_TYPE_FLOW "Dynamic Flow Collection" #define CONST_INTERFACE_TYPE_VIEW "view" #define CONST_INTERFACE_TYPE_PF_RING "PF_RING" #define CONST_INTERFACE_TYPE_NETFILTER "netfilter" #define CONST_INTERFACE_TYPE_DIVERT "divert" #define CONST_INTERFACE_TYPE_DUMMY "dummy" #define CONST_INTERFACE_TYPE_ZC_FLOW "ZC-flow" #define CONST_INTERFACE_TYPE_CUSTOM "custom" #define CONST_INTERFACE_TYPE_UNKNOWN "unknown" #define CONST_DEMO_MODE_DURATION 600 /* 10 min */ #define CONST_MAX_DUMP_DURATION 300 /* 5 min */ #define CONST_MAX_NUM_PACKETS_PER_LIVE 100000 /* live captures via HTTP */ #define CONST_MAX_DUMP 500000000 #define CONST_MAX_NUM_LIVE_EXTRACTIONS 2 #define CONST_MAX_EXTR_PCAP_BYTES \ NTOPNG_PREFS_PREFIX ".max_extracted_pcap_bytes" #define CONST_DEFAULT_MAX_EXTR_PCAP_BYTES (100 * 1024 * 1024) #define MIN_CONNTRACK_UPDATE 3 /* sec */ #define MIN_NETFILTER_UPDATE 30 /* sec */ #define CONST_EST_MAX_FLOWS 200000 #define CONST_EST_MAX_HOSTS 200000 #define MIN_HOST_RESOLUTION_FREQUENCY 60 /* 1 min */ #define NDPI_TRAFFIC_BEHAVIOR_REFRESH 60 /* 1 min */ #define HOST_SITES_REFRESH 300 /* 5 min */ #define IFACE_BEHAVIOR_REFRESH 300 /* 5 min */ #define MIN_IFACE_BEHAVIOR_REFRESH 60 /* 5 min */ #define ASES_BEHAVIOR_REFRESH 300 /* 5 min */ #define NETWORK_BEHAVIOR_REFRESH 300 /* 5 min */ #define HOST_SITES_TOP_NUMBER 10 #define HOST_MAX_SERIALIZED_LEN \ 1048576 /* 1MB, use only when allocating memory in the heap */ #define POOL_MAX_SERIALIZED_LEN 32768 /* bytes */ #define POOL_MAX_NAME_LEN 33 /* Characters */ #define HOST_MAX_SCORE 500 #define FLOW_MAX_SCORE_BREAKDOWN \ 8 /* Maximum number of alerts for the flow score breadkown. Additional \ alerts will fall under 'other' */ #define CONST_MAX_NUM_NETWORKS 1024 #define CONST_MAX_NUM_CHECKPOINTS 4 #define HOST_IS_DHCP_SERVER 0x01 #define HOST_IS_DNS_SERVER 0x02 #define HOST_IS_NTP_SERVER 0x03 #define HOST_IS_SMTP_SERVER 0x04 #define HOST_IS_IMAP_SERVER 0x05 #define HOST_IS_POP_SERVER 0x06 #define MAX_DYNAMIC_STATS_VALUES 12 // ICMP #ifndef ICMP_TIMESTAMP #define ICMP_TIMESTAMP 13 #endif #ifndef ICMP_TIMESTAMPREPLY #define ICMP_TIMESTAMPREPLY 14 #endif #ifndef ICMP_INFO_REQUEST #define ICMP_INFO_REQUEST 15 #endif #ifndef ICMP_INFO_REPLY #define ICMP_INFO_REPLY 16 #endif #ifndef ICMP_HOST_UNREACH #define ICMP_HOST_UNREACH 1 #endif #ifndef ICMP_PORT_UNREACH #define ICMP_PORT_UNREACH 3 #endif #ifndef ICMP_DEST_UNREACH #define ICMP_DEST_UNREACH 3 #endif // ICMP6 #ifndef ICMP6_WRUREQUEST #define ICMP6_WRUREQUEST 139 #endif #ifndef ICMP6_WRUREPLY #define ICMP6_WRUREPLY 140 #endif #ifndef ICMP6_DEST_UNREACH #define ICMP6_DEST_UNREACH 1 #endif #ifndef ICMP6_PORT_UNREACH #define ICMP6_PORT_UNREACH 4 #endif #ifndef TH_FIN #define TH_FIN 0x01 #endif #ifndef TH_SYN #define TH_SYN 0x02 #endif #ifndef TH_RST #define TH_RST 0x04 #endif #ifndef TH_PUSH #define TH_PUSH 0x08 #endif #ifndef TH_ACK #define TH_ACK 0x10 #endif #ifndef TH_URG #define TH_URG 0x20 #endif #ifndef TH_ECE #define TH_ECE 0x40 #endif #ifndef TH_CWR #define TH_CWR 0x80 #endif /* Prepare a mask to only consider flags SYN-ACK-FIN-RST-PSH-URG as certain scanners set higher bits such as ECE or CRW. For example we have seen scans with SYN set along with ECE and CWR */ #define TCP_SCAN_MASK \ 0xFF & (TH_FIN | TH_SYN | TH_RST | TH_PUSH | TH_ACK | TH_URG) /* Prepare a mask used when analyzing tcp twh. Currently, it is necessary to exclude ECE and CWR bits as they may be contained in the handshake as explained in https://github.com/ntop/ntopng/issues/3255 */ #define TCP_3WH_MASK 0xFF & ~(TH_ECE | TH_CWR) #define MAX_NUM_DB_SPINS 5 /* sec */ #ifdef WIN32 #define ICMP_ECHO 8 /* Echo Request */ #define ICMP_ECHOREPLY 0 /* Echo Reply */ /* #ifndef ICMP6_ECHO_REQUEST #define ICMP6_ECHO_REQUEST 128 #endif #ifndef ICMP6_ECHO_REPLY #define ICMP6_ECHO_REPLY 129 #endif */ #endif #ifndef MAX_PATH #define MAX_PATH 256 #endif // #define DEMO_WIN32 1 #define MAX_NUM_PACKETS 5000 /* Hanldes ad most 4096 interfaces across all sFlow devices. Considering 48 devices with 48 interfaces each as an upper bound, this number is reasonable. */ #define NUM_IFACE_STATS_HASH 4096 #define MAX_NUM_VLAN 4096 #define MAX_NUM_VIRTUAL_INTERFACES 32 #define PASS_ALL_SHAPER_ID 0 #define DROP_ALL_SHAPER_ID 1 #define DEFAULT_SHAPER_ID PASS_ALL_SHAPER_ID #define NEDGE_USER_DEFAULT_POLICY_SHAPER_ID \ 4 /* see shaper_utils.nedge_shapers default */ #define NO_ROUTING_TABLE_ID 0 #define DEFAULT_ROUTING_TABLE_ID 1 #define NUM_TRAFFIC_SHAPERS 16 #define NUM_TC_TRAFFIC_SHAPERS 8 #define MAX_SHAPER_RATE_KBPS 10240 #define HOUSEKEEPING_FREQUENCY 5 #define MAX_NUM_HOST_CONTACTS 16 #define CONST_DEFAULT_NTOP_PORT 3000 #define CONST_DEFAULT_MYSQL_PORT 3306 #define CONST_DEFAULT_CLICKHOUSE_TCP_PORT 9000 #define CONST_DEFAULT_CLICKHOUSE_MYSQL_PORT 9004 #define CONST_DB_DUMP_FREQUENCY 300 #define CONST_NUM_OPEN_DB_CACHE 8 #define CONST_NUM_CONTACT_DBS 8 #define MAX_SYSLOG_SUBSCRIBERS 8 #define MAX_ZMQ_POLL_WAIT_MS 1000 /* 1 sec */ #define MAX_ZMQ_POLLS_BEFORE_PURGE 1000 #define MAX_SYSLOG_POLL_WAIT_MS MAX_ZMQ_POLL_WAIT_MS #define MAX_SYSLOG_POLLS_BEFORE_PURGE MAX_ZMQ_POLLS_BEFORE_PURGE #define CONST_MAX_NUM_FIND_HITS 10 #define CONST_MAX_NUM_HITS 32768 /* Decrease it for small installations */ /* Controls for periodic_stats_update (avoid executing it too often, or when not * necessary) */ #define PERIODIC_STATS_UPDATE_MIN_REFRESH_BYTES 10 * (2 << 19 /* MB */) #define PERIODIC_STATS_UPDATE_MIN_REFRESH_MS 5000 #define SCANNERS_ADDRESS_TREE_HIGH_WATERMARK 1024 #define SCANNERS_ADDRESS_TREE_LOW_WATERMARK 512 /* NOTE: keep in sync with nf_config.lua */ #define DNS_MAPPING_PORT 3003 #define CAPTIVE_PORTAL_PORT 3004 #define CONST_LUA_FLOW_CREATE "flowCreate" #define CONST_LUA_FLOW_DELETE "flowDelete" #define CONST_LUA_FLOW_UPDATE "flowUpdate" #define CONST_LUA_FLOW_NDPI_DETECT "flowProtocolDetected" #ifdef WIN32 #define CONST_PATH_SEP '\\' #else #define CONST_PATH_SEP '/' #endif #define CONST_DEFAULT_FILE_MODE 0600 /* rw */ #define CONST_DEFAULT_DIR_MODE 0700 /* rwx */ #define CONST_MAX_REDIS_CONN_RETRIES 16 #define CONST_MAX_LEN_REDIS_KEY 256 #define CONST_MAX_LEN_REDIS_VALUE 2 * 65526 #define NTOPNG_NDPI_OS_PROTO_ID \ (NDPI_LAST_IMPLEMENTED_PROTOCOL + NDPI_MAX_NUM_CUSTOM_PROTOCOLS - 2) #define CONST_DEFAULT_HOME_NET "192.168.1.0/24" #define CONST_OLD_DEFAULT_DATA_DIR "/var/tmp/ntopng" #define CONST_DEFAULT_MAX_UI_STRLEN 24 #define CONST_DEFAULT_IS_AUTOLOGOUT_ENABLED 1 #define CONST_DEFAULT_PACKETS_DROP_PERCENTAGE_ALERT 5 #define CONST_DEFAULT_IS_ACTIVE_LOCAL_HOSTS_CACHE_ENABLED 0 #define CONST_DEFAULT_ACTIVE_LOCAL_HOSTS_CACHE_INTERVAL \ 3600 /* Every hour by default */ #define HASHKEY_TOP_SITES_SERIALIZATION_KEY ".serialized_current_top_sites." #define HASHKEY_TOP_OS_SERIALIZATION_KEY ".serialized_current_top_os." #define HASHKEY_LOCAL_HOSTS_TOP_SITES_KEYS "ntopng.cache.top_sites" #define HASHKEY_LOCAL_HOSTS_TOP_SITES_HOUR_KEYS_PUSHED \ "ntopng.cache.top_sites_hour_done" #define HASHKEY_LOCAL_HOSTS_TOP_SITES_DAY_KEYS_PUSHED \ "ntopng.cache.top_sites_day_done" #define HASHKEY_IFACE_TOP_OS "ntopng.cache.top_os" #define HASHKEY_IFACE_TOP_OS_HOUR_KEYS_PUSHED "ntopng.cache.top_os_hour_done" #define HASHKEY_IFACE_TOP_OS_DAY_KEYS_PUSHED "ntopng.cache.top_os_day_done" #define HASHKEY_LOCALHOST_RX_ONLY "ntopng.cache.localhost_host_rx_only" #define CONST_DEFAULT_DOCS_DIR "httpdocs" #define CONST_DEFAULT_SCRIPTS_DIR "scripts" #define CONST_DEFAULT_CALLBACKS_DIR "scripts/callbacks" #ifdef NTOPNG_PRO #define CONST_DEFAULT_PRO_CALLBACKS_DIR "pro/scripts/callbacks" #endif #define CONST_DEFAULT_USERS_FILE "ntopng-users.conf" #define CONST_DEFAULT_INSTALL_DIR (DATA_DIR "/ntopng") #if defined(__FreeBSD__) #define CONST_BIN_DIR "/usr/local/bin" #define CONST_SHARE_DIR "/usr/local/share" #define CONST_SHARE_DIR_2 "/usr/share" #define CONST_ETC_DIR "/usr/local/etc" #define CONST_DEFAULT_DATA_DIR "/var/db/ntopng" #else #define CONST_BIN_DIR "/usr/bin" #define CONST_SHARE_DIR "/usr/share" #define CONST_SHARE_DIR_2 "/usr/local/share" #define CONST_ETC_DIR "/etc" #define CONST_DEFAULT_DATA_DIR "/var/lib/ntopng" #endif #define CONST_ALT_INSTALL_DIR CONST_SHARE_DIR "/ntopng" #define CONST_ALT2_INSTALL_DIR CONST_SHARE_DIR_2 "/usr/share/ntopng" #define CONST_HTTP_PREFIX_STRING "@HTTP_PREFIX@" #define CONST_NTOP_STARTUP_EPOCH "@NTOP_STARTUP_EPOCH@" #define CONST_NTOP_PRODUCT_NAME "@NTOP_PRODUCT_NAME@" #define CONST_OLD_DEFAULT_NTOP_USER "nobody" #define CONST_DEFAULT_NTOP_USER "ntopng" #define CONST_TOO_EARLY "TooEarly" #define CONST_LABELS_LOG_FILE "labels.log" #define CONST_LUA_OK 1 #define CONST_LUA_ERROR 0 #define CONST_LUA_PARAM_ERROR -1 #define CONST_MAX_NUM_SYN_PER_SECOND \ 25 /* keep in sync with alert_utils.lua \ */ #define CONST_MAX_NEW_FLOWS_SECOND 25 /* keep in sync with alert_utils.lua */ #define CONST_ALERT_GRACE_PERIOD 60 /* No more than 1 alert/min */ #define CONST_CONTACTED_BY "contacted_by" #define CONST_CONTACTS "contacted_peers" /* Peers contacted by this host */ #define CONST_HISTORICAL_OK 1 #define CONST_HISTORICAL_FILE_ERROR 0 #define CONST_HISTORICAL_OPEN_ERROR -1 #define CONST_HISTORICAL_ROWS_LIMIT 20960 #define CONST_AGGREGATIONS "aggregations" #define CONST_HOST_CONTACTS "host_contacts" #define USER_SCRIPTS_RUN_CALLBACK "runScripts" #define USER_SCRIPTS_RELEASE_ALERTS_CALLBACK "releaseAlerts" /* Maximum line lenght for the line protocol to write timeseries */ #define LINE_PROTOCOL_MAX_LINE 512 #define CONST_DEVICES_LEARNING_TIME 7200 /* 2 hours */ #define CONST_IEC104_LEARNING_TIME 21600 /* 6 hours */ #define CONST_MODBUS_LEARNING_TIME 3600 /* 1 hour */ #define CONST_INFLUXDB_KEY_EXPORTED_POINTS \ "ntopng.cache.influxdb.num_exported_points" #define CONST_INFLUXDB_FLUSH_TIME 10 /* sec */ #define CONST_INFLUXDB_MAX_DUMP_SIZE 4194304 /* 4 MB */ #define CONST_FLOW_ALERT_EVENT_QUEUE \ "ntopng.cache.ifid_%d.flow_alerts_events_queue" #define SQLITE_ALERTS_QUEUE_SIZE 8192 #define ALERTS_NOTIFICATIONS_QUEUE_SIZE 8192 #define MAX_NUM_RECIPIENTS \ 64 /* keep in sync with Recipients.lua recipients.MAX_NUM_RECIPIENTS */ #define INTERNAL_ALERTS_QUEUE_SIZE 1024 #define CONST_REMOTE_TO_REMOTE_MAX_QUEUE 32 #define CONST_SQL_QUEUE "ntopng.sql_queue" #define CONST_SQL_BATCH_SIZE 32 #define CONST_MAX_SQL_QUERY_LEN 8192 #define CONST_DEFAULT_MIRRORED_TRAFFIC false #define CONST_DEFAULT_SMART_RECORDING false #define CONST_DEFAULT_SHOW_DYN_IFACE_TRAFFIC false #define CONST_DEFAULT_PUSH_HOST_FILTERS false #define CONST_DEFAULT_LBD_SERIALIZE_AS_MAC false #define CONST_DEFAULT_DISCARD_PROBING_TRAFFIC false #define CONST_DEFAULT_FLOWS_ONLY_INTERFACE false #define CONST_ALERT_DISABLED_PREFS \ NTOPNG_PREFS_PREFIX ".disable_alerts_generation" #define CONST_PREFS_ENABLE_ACCESS_LOG NTOPNG_PREFS_PREFIX ".enable_access_log" #define CONST_PREFS_ENABLE_SQL_LOG NTOPNG_PREFS_PREFIX ".enable_sql_log" #define CONST_TOP_TALKERS_ENABLED NTOPNG_PREFS_PREFIX ".host_top_sites_creation" #define CONST_FLOW_TABLE_TIME NTOPNG_PREFS_PREFIX ".flow_table_time" #define CONST_FLOW_TABLE_PROBE_ORDER \ NTOPNG_PREFS_PREFIX ".flow_table_probe_order" #define CONST_MIRRORED_TRAFFIC_PREFS \ NTOPNG_PREFS_PREFIX ".ifid_%d.is_traffic_mirrored" #define CONST_SMART_RECORDING_PREFS \ NTOPNG_PREFS_PREFIX ".ifid_%d.smart_traffic_recording.enabled" #define CONST_SMART_RECORDING_INSTANCE_PREFS \ NTOPNG_PREFS_PREFIX ".ifid_%d.smart_traffic_recording.instance" #define CONST_SHOW_DYN_IFACE_TRAFFIC_PREFS \ NTOPNG_PREFS_PREFIX ".ifid_%d.show_dynamic_interface_traffic" #define CONST_PUSH_HOST_FILTERS_PREFS \ NTOPNG_PREFS_PREFIX ".ifid_%d.push_host_filters_to_pfring" #define CONST_DISABLED_FLOW_DUMP_PREFS \ NTOPNG_PREFS_PREFIX ".ifid_%d.is_flow_dump_disabled" #define CONST_LBD_SERIALIZATION_PREFS \ NTOPNG_PREFS_PREFIX ".ifid_%d.serialize_local_broadcast_hosts_as_macs" #define CONST_DISCARD_PROBING_TRAFFIC \ NTOPNG_PREFS_PREFIX ".ifid_%d.discard_probing_traffic" #define CONST_FLOWS_ONLY_INTERFACE \ NTOPNG_PREFS_PREFIX ".ifid_%d.debug.flows_only_interface" #define CONST_NBOX_USER NTOPNG_PREFS_PREFIX ".nbox_user" #define CONST_NBOX_PASSWORD NTOPNG_PREFS_PREFIX ".nbox_password" #define CONST_IFACE_ID_PREFS NTOPNG_PREFS_PREFIX ".iface_id" #define CONST_IFACE_SCALING_FACTOR_PREFS \ NTOPNG_PREFS_PREFIX ".iface_%d.scaling_factor" #define CONST_IFACE_HIDE_FROM_TOP_PREFS \ NTOPNG_PREFS_PREFIX ".iface_%d.hide_from_top" #define CONST_IFACE_GW_MACS_PREFS NTOPNG_PREFS_PREFIX ".iface_%d.gw_macs" #define CONST_IFACE_COMPANIONS_SET \ NTOPNG_PREFS_PREFIX ".companion_interface.ifid_%d.companion_of" #define CONST_IFACE_DYN_IFACE_MODE_PREFS \ NTOPNG_PREFS_PREFIX ".dynamic_sub_interfaces.ifid_%d.mode" #define CONST_REMOTE_HOST_IDLE_PREFS \ NTOPNG_PREFS_PREFIX ".non_local_host_max_idle" #define CONST_FLOW_MAX_IDLE_PREFS NTOPNG_PREFS_PREFIX ".flow_max_idle" #define CONST_INTF_RRD_RAW_DAYS NTOPNG_PREFS_PREFIX ".intf_rrd_raw_days" #define CONST_INTF_RRD_1MIN_DAYS NTOPNG_PREFS_PREFIX ".intf_rrd_1min_days" #define CONST_INTF_RRD_1H_DAYS NTOPNG_PREFS_PREFIX ".intf_rrd_1h_days" #define CONST_INTF_RRD_1D_DAYS NTOPNG_PREFS_PREFIX ".intf_rrd_1d_days" #define CONST_OTHER_RRD_RAW_DAYS NTOPNG_PREFS_PREFIX ".other_rrd_raw_days" #define CONST_OTHER_RRD_1MIN_DAYS NTOPNG_PREFS_PREFIX ".other_rrd_1min_days" #define CONST_OTHER_RRD_1H_DAYS NTOPNG_PREFS_PREFIX ".other_rrd_1h_days" #define CONST_OTHER_RRD_1D_DAYS NTOPNG_PREFS_PREFIX ".other_rrd_1d_days" #define CONST_SAFE_SEARCH_DNS NTOPNG_PREFS_PREFIX ".safe_search_dns" #define CONST_GLOBAL_DNS NTOPNG_PREFS_PREFIX ".global_dns" #define CONST_SECONDARY_DNS NTOPNG_PREFS_PREFIX ".secondary_dns" #define CONST_MAX_NUM_SECS_ALERTS_BEFORE_DEL \ NTOPNG_PREFS_PREFIX ".max_num_secs_before_delete_alert" #define CONST_ALERT_PAGE_REFRESH_RATE \ NTOPNG_PREFS_PREFIX ".alert_page_refresh_rate" #define CONST_MAX_ENTITY_ALERTS NTOPNG_PREFS_PREFIX ".max_entity_alerts" #define CONST_PROFILES_PREFS NTOPNG_PREFS_PREFIX ".profiles" #define CONST_PROFILES_COUNTERS "ntopng.profiles_counters.ifid_%i" #define CONST_PREFS_CAPTIVE_PORTAL NTOPNG_PREFS_PREFIX ".enable_captive_portal" #define CONST_PREFS_VLAN_TRUNK_MODE_ENABLED \ NTOPNG_PREFS_PREFIX ".enable_vlan_trunk_bridge" #define CONST_PREFS_MAC_CAPTIVE_PORTAL \ NTOPNG_PREFS_PREFIX ".mac_based_captive_portal" #define CONST_PREFS_INFORM_CAPTIVE_PORTAL \ NTOPNG_PREFS_PREFIX ".enable_informative_captive_portal" #define CONST_PREFS_INFORM_URL \ NTOPNG_PREFS_PREFIX ".informative_captive_portal_url" #define CONST_PREFS_DEFAULT_L7_POLICY NTOPNG_PREFS_PREFIX ".default_l7_policy" #define CONST_PREFS_GLOBAL_DNS_FORGING_ENABLED \ NTOPNG_PREFS_PREFIX ".global_dns_forging" #define HOST_POOL_IDS_KEY NTOPNG_PREFS_PREFIX ".host_pools.pool_ids" #define HOST_POOL_MEMBERS_KEY NTOPNG_PREFS_PREFIX ".host_pools.members.%s" #define HOST_POOL_SHAPERS_KEY NTOPNG_PREFS_PREFIX ".%u.l7_policies.%s" #define HOST_POOL_DETAILS_KEY NTOPNG_PREFS_PREFIX ".host_pools.details.%u" #define CONST_SUBINTERFACES_PREFS NTOPNG_PREFS_PREFIX ".%u.sub_interfaces" #define CONST_PREFS_CLIENT_X509_AUTH \ NTOPNG_PREFS_PREFIX ".is_client_x509_auth_enabled" #define CONST_PREFS_EMIT_FLOW_ALERTS NTOPNG_PREFS_PREFIX ".emit_flow_alerts" #define CONST_PREFS_EMIT_HOST_ALERTS NTOPNG_PREFS_PREFIX ".emit_host_alerts" #define CONST_PREFS_COLLECT_BLACKLISTSTATS NTOPNG_PREFS_PREFIX ".collect_blacklist_stats" #define CONST_BLACKLIST_DAILY_STATS NTOPNG_CACHE_PREFIX ".bl_hosts.%s" #define CONST_PREFS_BROADCAST_DOMAIN_TOO_LARGE \ NTOPNG_PREFS_PREFIX ".is_broadcast_domain_too_large_enabled" #define CONST_PREFS_ASN_BEHAVIOR_ANALYSIS \ NTOPNG_PREFS_PREFIX ".is_asn_behavior_analysis_enabled" #define CONST_PREFS_NETWORK_BEHAVIOR_ANALYSIS \ NTOPNG_PREFS_PREFIX ".is_network_behavior_analysis_enabled" #define CONST_PREFS_IFACE_L7_BEHAVIOR_ANALYSIS \ NTOPNG_PREFS_PREFIX ".is_iface_l7_behavior_analysis_enabled" #define CONST_PREFS_BEHAVIOUR_ANALYSIS \ NTOPNG_PREFS_PREFIX ".is_behaviour_analysis_enabled" #define CONST_PREFS_BEHAVIOUR_ANALYSIS_LEARNING_PERIOD \ NTOPNG_PREFS_PREFIX ".behaviour_analysis_learning_period" #define CONST_PREFS_BEHAVIOUR_ANALYSIS_STATUS_DURING_LEARNING \ NTOPNG_PREFS_PREFIX ".behaviour_analysis_learning_status_during_learning" #define CONST_PREFS_BEHAVIOUR_ANALYSIS_STATUS_POST_LEARNING \ NTOPNG_PREFS_PREFIX ".behaviour_analysis_learning_status_post_learning" #define CONST_PREFS_IEC60870_ANALYSIS_LEARNING_PERIOD \ NTOPNG_PREFS_PREFIX ".iec60870_learning_period" #define CONST_PREFS_MODBUS_ANALYSIS_LEARNING_PERIOD \ NTOPNG_PREFS_PREFIX ".modbus_learning_period" #define CONST_PREFS_DEVICES_ANALYSIS_LEARNING_PERIOD \ NTOPNG_PREFS_PREFIX ".devices_learning_period" #define CONST_DEFAULT_BEHAVIOUR_ANALYSIS_LEARNING_PERIOD \ 7200 // 2 hours by default #define CONST_PREFS_USE_MAC_IN_FLOW_KEY \ NTOPNG_PREFS_PREFIX ".use_mac_in_flow_key" #define CONST_USER_GROUP_ADMIN "administrator" #define CONST_USER_GROUP_UNPRIVILEGED "unprivileged" #define CONST_USER_GROUP_CAPTIVE_PORTAL "captive_portal" #define CONST_CAPTIVE_PORTAL_INFORM_SECS 86400 #define CONST_AUTH_SESSION_DURATION_PREFS \ NTOPNG_PREFS_PREFIX ".auth_session_duration" #define CONST_AUTH_SESSION_MIDNIGHT_EXP_PREFS \ NTOPNG_PREFS_PREFIX ".auth_session_midnight_expiration" #define CONST_LOCAL_HOST_CACHE_DURATION_PREFS \ NTOPNG_PREFS_PREFIX ".local_host_cache_duration" #define CONST_LOCAL_HOST_IDLE_PREFS NTOPNG_PREFS_PREFIX ".local_host_max_idle" #define CONST_RUNTIME_MAX_UI_STRLEN NTOPNG_PREFS_PREFIX ".max_ui_strlen" #define CONST_RUNTIME_PREFS_TS_DRIVER NTOPNG_PREFS_PREFIX ".timeseries_driver" #define CONST_RUNTIME_IS_AUTOLOGOUT_ENABLED \ NTOPNG_PREFS_PREFIX ".is_autologon_enabled" #define CONST_RUNTIME_IS_INTERFACE_NAME_ONLY \ NTOPNG_PREFS_PREFIX ".is_interface_name_only" #define CONST_RUNTIME_IS_GEO_MAP_SCORE_ENABLED \ NTOPNG_PREFS_PREFIX ".is_geo_map_score_enabled" #define CONST_MAX_AGGREGATED_FLOWS_UPPERBOUND \ NTOPNG_PREFS_PREFIX ".max_aggregated_flows_upperbound" #define CONST_MAX_AGGREGATED_FLOWS_TRAFFIC_UPPERBOUND \ NTOPNG_PREFS_PREFIX ".max_aggregated_flows_traffic_upperbound" #define CONST_RUNTIME_IS_GEO_MAP_ASNAME_ENABLED \ NTOPNG_PREFS_PREFIX ".is_geo_map_asname_enabled" #define CONST_RUNTIME_IS_GEO_MAP_ALERTED_FLOWS_ENABLED \ NTOPNG_PREFS_PREFIX ".is_geo_map_alerted_flows_enabled" #define CONST_RUNTIME_IS_GEO_MAP_BLACKLISTED_FLOWS_ENABLED \ NTOPNG_PREFS_PREFIX ".is_geo_map_blacklisted_flows_enabled" #define CONST_RUNTIME_IS_GEO_MAP_HOST_NAME_ENABLED \ NTOPNG_PREFS_PREFIX ".is_geo_map_host_name_enabled" #define CONST_RUNTIME_IS_GEO_MAP_RXTX_DATA_ENABLED \ NTOPNG_PREFS_PREFIX ".is_geo_map_rxtx_data_enabled" #define CONST_RUNTIME_IS_GEO_MAP_NUM_FLOWS_ENABLED \ NTOPNG_PREFS_PREFIX ".is_geo_map_num_flows_enabled" #define CONST_RUNTIME_ACTIVE_LOCAL_HOSTS_CACHE_ENABLED \ NTOPNG_PREFS_PREFIX ".is_active_local_host_cache_enabled" #define CONST_RUNTIME_ACTIVE_LOCAL_HOSTS_CACHE_INTERVAL \ NTOPNG_PREFS_PREFIX ".active_local_host_cache_interval" #define CONST_RUNTIME_PREFS_LOG_TO_FILE NTOPNG_PREFS_PREFIX ".log_to_file" #define CONST_RUNTIME_PREFS_HOUSEKEEPING_FREQ \ NTOPNG_PREFS_PREFIX ".housekeeping_freq" #define CONST_RUNTIME_PREFS_OBSERVATION_POINTS_RRD_CREATION \ NTOPNG_PREFS_PREFIX ".observation_points_rrd_creation" /* 0 / 1 */ #define CONST_RUNTIME_PREFS_INTRANET_TRAFFIC_RRD_CREATION \ NTOPNG_PREFS_PREFIX ".intranet_traffic_rrd_creation" /* 0 / 1 */ #define CONST_RUNTIME_PREFS_FLOW_DEVICE_PORT_RRD_CREATION \ NTOPNG_PREFS_PREFIX ".flow_device_port_rrd_creation" /* 0 / 1 */ #define CONST_RUNTIME_PREFS_THPT_CONTENT \ NTOPNG_PREFS_PREFIX ".thpt_content" /* bps / pps */ #define CONST_RUNTIME_PREFS_HOSTS_ALERTS_CONFIG \ NTOPNG_PREFS_PREFIX ".alerts_global.min.local_hosts" #define CONST_PREFS_ENABLE_DEVICE_PROTOCOL_POLICIES \ NTOPNG_PREFS_PREFIX ".device_protocols_policing" #define CONST_PREFS_ENABLE_RUNTIME_FLOWS_DUMP \ NTOPNG_PREFS_PREFIX ".enable_runtime_flows_dump" #define CONST_HOST_SYN_ATTACKER_ALERT_THRESHOLD_KEY "syn_attacker_threshold" #define CONST_HOST_SYN_VICTIM_ALERT_THRESHOLD_KEY "syn_victim_threshold" #define CONST_HOST_FLOW_ATTACKER_ALERT_THRESHOLD_KEY "flow_attacker_threshold" #define CONST_HOST_FLOW_VICTIM_ALERT_THRESHOLD_KEY "flow_victim_threshold" #define CONST_RUNTIME_PREFS_NBOX_INTEGRATION \ NTOPNG_PREFS_PREFIX ".nbox_integration" /* 0 / 1 */ #define CONST_RUNTIME_PREFS_LOGGING_LEVEL NTOPNG_PREFS_PREFIX ".logging_level" #define CONST_RUNTIME_PREFS_SNMP_PROTO_VERSION \ NTOPNG_PREFS_PREFIX ".default_snmp_version" #define CONST_RUNTIME_PREFS_IFACE_FLOW_COLLECTION \ NTOPNG_PREFS_PREFIX \ ".dynamic_flow_collection_mode" /* {"none", "vlan", \ "probe_ip","ingress_iface_idx"} */ #define CONST_RUNTIME_PREFS_IGNORED_INTERFACES \ NTOPNG_PREFS_PREFIX ".ignored_interfaces" #define CONST_RUNTIME_PREFS_ENABLE_MAC_NDPI_STATS \ NTOPNG_PREFS_PREFIX ".l2_device_ndpi_timeseries_creation" #define DISAGGREGATION_PROBE_IP "probe_ip" #define DISAGGREGATION_IFACE_ID "iface_idx" #define DISAGGREGATION_INGRESS_IFACE_ID "ingress_iface_idx" #define DISAGGREGATION_INGRESS_PROBE_IP_AND_IFACE_ID \ "probe_ip_and_ingress_iface_idx" #define DISAGGREGATION_INGRESS_VRF_ID "ingress_vrf_id" #define DISAGGREGATION_VLAN "vlan" #define DISAGGREGATION_NONE "none" #define CONST_ACTIVITIES_DEBUG_ENABLED \ NTOPNG_PREFS_PREFIX ".periodic_activities_stats_to_stdout" #define CONST_FIELD_MAP_CACHE_KEY \ NTOPNG_CACHE_PREFIX ".ifid_%d.field_map.pen_%u" #define CONST_FIELD_VALUE_MAP_CACHE_KEY \ NTOPNG_CACHE_PREFIX ".ifid_%d.field_value_map.pen_%u.field_%u" #ifdef NTOPNG_PRO #define MAX_NUM_CUSTOM_APPS 128 #define CONST_RUNTIME_PREFS_DAILY_REPORTS \ NTOPNG_PREFS_PREFIX ".daily_reports" /* 0 / 1 */ #endif #define CONST_RUNTIME_PREFS_HOSTMASK NTOPNG_PREFS_PREFIX ".host_mask" #define CONST_RUNTIME_PREFS_AUTO_ASSIGNED_POOL_ID \ NTOPNG_PREFS_PREFIX ".auto_assigned_pool_id" #define CONST_ALERT_EXCLUSIONS_KEY \ NTOPNG_PREFS_PREFIX \ ".alert_exclusions" /* Keep in sync with hosts_control.lua */ #define CONST_MAX_ALERT_MSG_QUEUE_LEN 8192 #define CONST_MAX_ES_MSG_QUEUE_LEN 8192 #define CONST_MAX_MYSQL_QUEUE_LEN 8192 #define CONST_MAX_NUM_READ_ALERTS 32 #define CONST_MAX_ACTIVITY_DURATION 86400 /* sec */ #define CONST_TREND_TIME_GRANULARITY 1 /* sec */ #define CONST_DEFAULT_PRIVATE_NETS \ "192.168.0.0/16,172.16.0.0/12,10.0.0.0/8,127.0.0.0/8,169.254.0.0/16" #define CONST_DEFAULT_LOCAL_NETS "127.0.0.0/8,fe80::/10" #define CONST_DEFAULT_ALL_NETS "0.0.0.0/0,::/0" #define CONST_NUM_RESOLVERS 2 #define PAGE_NOT_FOUND \ "
" \
"Script "%s" returned an error:\n