]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1002 in SNORT/snort3 from sum_stuff to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Thu, 31 Aug 2017 16:53:59 +0000 (12:53 -0400)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Thu, 31 Aug 2017 16:53:59 +0000 (12:53 -0400)
Squashed commit of the following:

commit 322d34f0cc28f97723877caa123853b9c93929b8
Author: Russ Combs <rucombs@cisco.com>
Date:   Tue Aug 29 09:58:51 2017 -0400

    doc: add module usage and peg count type

commit fc9228831b4d5947e5f79470c5ce2aab1b178c16
Author: Russ Combs <rucombs@cisco.com>
Date:   Tue Aug 29 09:37:08 2017 -0400

    modules: add usage designating global, context, inspect, or detect policy applicability

commit 71854c80f788d5419488cd08329b12284c427a5a
Author: Russ Combs <rucombs@cisco.com>
Date:   Mon Aug 28 20:42:55 2017 -0400

    stats: use peg info to accumulate by type

commit 8ce4e18e7035c13101663aa429ae3004824bc7d5
Author: Russ Combs <rucombs@cisco.com>
Date:   Sun Aug 27 19:16:12 2017 -0400

    pegs: add count type to info

commit 84348164529f752b20e5cad3e507454192332e4b
Author: Russ Combs <rucombs@cisco.com>
Date:   Sat Aug 19 15:48:21 2017 -0400

    snort2lua: search_engine.split_any_any now defaults to true

commit 2b4a49c31e965c6d493c3683fc8a0f1283f45656
Author: Russ Combs <rucombs@cisco.com>
Date:   Sat Aug 19 15:23:14 2017 -0400

    snort: -T does not compile mpse; --mem-check does

209 files changed:
extra/src/inspectors/data_log/data_log.cc
extra/src/inspectors/dpx/dpx.cc
extra/src/ips_options/ips_pkt_num/ips_pkt_num.cc
extra/src/ips_options/ips_urg/ips_urg.cc
extra/src/loggers/alert_ex/alert_ex.cc
extra/src/loggers/alert_unixsock/alert_unixsock.cc
src/actions/act_react.cc
src/actions/act_reject.cc
src/actions/act_replace.cc
src/codecs/codec_module.h
src/codecs/ip/cd_icmp4.cc
src/codecs/ip/cd_icmp6.cc
src/codecs/ip/cd_ipv4.cc
src/codecs/ip/cd_tcp.cc
src/codecs/ip/cd_udp.cc
src/codecs/link/cd_mpls.cc
src/connectors/file_connector/file_connector_module.cc
src/connectors/file_connector/file_connector_module.h
src/connectors/file_connector/test/file_connector_module_test.cc
src/connectors/file_connector/test/file_connector_test.cc
src/connectors/tcp_connector/tcp_connector_module.cc
src/connectors/tcp_connector/tcp_connector_module.h
src/connectors/tcp_connector/test/tcp_connector_module_test.cc
src/connectors/tcp_connector/test/tcp_connector_test.cc
src/detection/fp_create.cc
src/file_api/file_log.cc
src/file_api/file_module.cc
src/file_api/file_module.h
src/flow/ha_module.cc
src/flow/ha_module.h
src/flow/session.h
src/framework/counts.h
src/framework/module.cc
src/framework/module.h
src/hash/lru_cache_shared.cc
src/host_tracker/host_cache_module.h
src/host_tracker/host_tracker_module.cc
src/host_tracker/host_tracker_module.h
src/ips_options/ips_ack.cc
src/ips_options/ips_asn1.cc
src/ips_options/ips_base64.cc
src/ips_options/ips_bufferlen.cc
src/ips_options/ips_byte_extract.cc
src/ips_options/ips_byte_jump.cc
src/ips_options/ips_byte_math.cc
src/ips_options/ips_byte_test.cc
src/ips_options/ips_classtype.cc
src/ips_options/ips_content.cc
src/ips_options/ips_cvs.cc
src/ips_options/ips_detection_filter.cc
src/ips_options/ips_dsize.cc
src/ips_options/ips_file_data.cc
src/ips_options/ips_file_type.cc
src/ips_options/ips_flags.cc
src/ips_options/ips_flow.cc
src/ips_options/ips_flowbits.cc
src/ips_options/ips_fragbits.cc
src/ips_options/ips_fragoffset.cc
src/ips_options/ips_gid.cc
src/ips_options/ips_hash.cc
src/ips_options/ips_icmp_id.cc
src/ips_options/ips_icmp_seq.cc
src/ips_options/ips_icode.cc
src/ips_options/ips_id.cc
src/ips_options/ips_ip_proto.cc
src/ips_options/ips_ipopts.cc
src/ips_options/ips_isdataat.cc
src/ips_options/ips_itype.cc
src/ips_options/ips_luajit.cc
src/ips_options/ips_metadata.cc
src/ips_options/ips_msg.cc
src/ips_options/ips_pcre.cc
src/ips_options/ips_pkt_data.cc
src/ips_options/ips_priority.cc
src/ips_options/ips_raw_data.cc
src/ips_options/ips_reference.cc
src/ips_options/ips_regex.cc
src/ips_options/ips_rem.cc
src/ips_options/ips_replace.cc
src/ips_options/ips_rev.cc
src/ips_options/ips_rpc.cc
src/ips_options/ips_sd_pattern.cc
src/ips_options/ips_seq.cc
src/ips_options/ips_service.cc
src/ips_options/ips_session.cc
src/ips_options/ips_sid.cc
src/ips_options/ips_so.cc
src/ips_options/ips_soid.cc
src/ips_options/ips_tag.cc
src/ips_options/ips_tos.cc
src/ips_options/ips_ttl.cc
src/ips_options/ips_window.cc
src/latency/latency_module.cc
src/latency/latency_module.h
src/loggers/alert_csv.cc
src/loggers/alert_fast.cc
src/loggers/alert_full.cc
src/loggers/alert_luajit.cc
src/loggers/alert_sf_socket.cc
src/loggers/alert_syslog.cc
src/loggers/log_codecs.cc
src/loggers/log_hext.cc
src/loggers/log_pcap.cc
src/loggers/unified2.cc
src/main/modules.cc
src/main/snort_config.h
src/main/snort_module.cc
src/managers/module_manager.cc
src/memory/memory_module.h
src/network_inspectors/appid/appid_module.cc
src/network_inspectors/appid/appid_module.h
src/network_inspectors/appid/ips_appid_option.cc
src/network_inspectors/arp_spoof/arp_module.h
src/network_inspectors/binder/bind_module.cc
src/network_inspectors/binder/bind_module.h
src/network_inspectors/normalize/norm.cc
src/network_inspectors/normalize/norm_module.cc
src/network_inspectors/normalize/norm_module.h
src/network_inspectors/packet_capture/capture_module.cc
src/network_inspectors/packet_capture/capture_module.h
src/network_inspectors/perf_monitor/base_tracker.cc
src/network_inspectors/perf_monitor/perf_module.h
src/network_inspectors/port_scan/ps_module.h
src/network_inspectors/reputation/reputation_inspect.cc
src/network_inspectors/reputation/reputation_module.h
src/packet_io/sfdaq_module.h
src/service_inspectors/back_orifice/back_orifice.cc
src/service_inspectors/dce_rpc/dce_http_proxy_module.cc
src/service_inspectors/dce_rpc/dce_http_proxy_module.h
src/service_inspectors/dce_rpc/dce_http_server_module.cc
src/service_inspectors/dce_rpc/dce_http_server_module.h
src/service_inspectors/dce_rpc/dce_smb_module.cc
src/service_inspectors/dce_rpc/dce_smb_module.h
src/service_inspectors/dce_rpc/dce_tcp_module.cc
src/service_inspectors/dce_rpc/dce_tcp_module.h
src/service_inspectors/dce_rpc/dce_udp_module.cc
src/service_inspectors/dce_rpc/dce_udp_module.h
src/service_inspectors/dce_rpc/ips_dce_iface.cc
src/service_inspectors/dce_rpc/ips_dce_opnum.cc
src/service_inspectors/dce_rpc/ips_dce_stub_data.cc
src/service_inspectors/dnp3/dnp3_module.cc
src/service_inspectors/dnp3/dnp3_module.h
src/service_inspectors/dnp3/ips_dnp3_data.cc
src/service_inspectors/dnp3/ips_dnp3_func.cc
src/service_inspectors/dnp3/ips_dnp3_ind.cc
src/service_inspectors/dnp3/ips_dnp3_obj.cc
src/service_inspectors/dns/dns.cc
src/service_inspectors/dns/dns_module.h
src/service_inspectors/ftp_telnet/ftp_data.cc
src/service_inspectors/ftp_telnet/ftp_module.cc
src/service_inspectors/ftp_telnet/ftp_module.h
src/service_inspectors/ftp_telnet/telnet_module.cc
src/service_inspectors/ftp_telnet/telnet_module.h
src/service_inspectors/gtp/gtp_module.cc
src/service_inspectors/gtp/gtp_module.h
src/service_inspectors/gtp/ips_gtp_info.cc
src/service_inspectors/gtp/ips_gtp_type.cc
src/service_inspectors/gtp/ips_gtp_version.cc
src/service_inspectors/http_inspect/http_module.h
src/service_inspectors/http_inspect/http_tables.cc
src/service_inspectors/http_inspect/ips_http.h
src/service_inspectors/imap/imap.cc
src/service_inspectors/imap/imap_module.h
src/service_inspectors/modbus/ips_modbus_data.cc
src/service_inspectors/modbus/ips_modbus_func.cc
src/service_inspectors/modbus/ips_modbus_unit.cc
src/service_inspectors/modbus/modbus_module.cc
src/service_inspectors/modbus/modbus_module.h
src/service_inspectors/pop/pop.cc
src/service_inspectors/pop/pop_module.h
src/service_inspectors/rpc_decode/rpc_module.cc
src/service_inspectors/rpc_decode/rpc_module.h
src/service_inspectors/sip/ips_sip.cc
src/service_inspectors/sip/ips_sip_method.cc
src/service_inspectors/sip/ips_sip_stat_code.cc
src/service_inspectors/sip/sip_module.cc
src/service_inspectors/sip/sip_module.h
src/service_inspectors/smtp/smtp.cc
src/service_inspectors/smtp/smtp_module.h
src/service_inspectors/ssh/ssh_module.cc
src/service_inspectors/ssh/ssh_module.h
src/service_inspectors/ssl/ips_ssl_state.cc
src/service_inspectors/ssl/ips_ssl_version.cc
src/service_inspectors/ssl/ssl_inspector.cc
src/service_inspectors/ssl/ssl_module.h
src/service_inspectors/wizard/wiz_module.h
src/service_inspectors/wizard/wizard.cc
src/side_channel/side_channel_module.cc
src/side_channel/side_channel_module.h
src/stream/base/stream_base.cc
src/stream/base/stream_module.h
src/stream/file/file_module.h
src/stream/icmp/icmp_module.cc
src/stream/icmp/icmp_module.h
src/stream/icmp/icmp_session.cc
src/stream/ip/ip_module.cc
src/stream/ip/ip_module.h
src/stream/ip/ip_session.cc
src/stream/tcp/ips_stream_reassemble.cc
src/stream/tcp/ips_stream_size.cc
src/stream/tcp/tcp_module.cc
src/stream/tcp/tcp_module.h
src/stream/tcp/tcp_normalizer.cc
src/stream/udp/udp_module.h
src/stream/udp/udp_session.cc
src/stream/user/user_module.cc
src/stream/user/user_module.h
src/utils/stats.cc
tools/snort2lua/config_states/config_detection.cc

index 05fdde8dedefc3ed5551141e8bfc220893acd801..978d3b14bd656ddc986221518b24f77925a4d7e2 100644 (file)
@@ -167,6 +167,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool set(const char*, Value& v, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 public:
     std::string key;
     unsigned long limit;
index 52c6720feff70edbe26469cbf971fd473f6d334a..80a517cf7eba1acc29f19a3f8832cadc46edd8d2 100644 (file)
@@ -120,6 +120,9 @@ public:
 
     bool set(const char*, Value& v, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 public:
     uint16_t port;
     uint16_t max;
index 1d51c8311af83fc9b3b1fbda8fa50ec525105af4..53f565537401000da5d4a30d3d52cd03a3502c90 100644 (file)
@@ -108,6 +108,10 @@ public:
     ProfileStats* get_profile() const override
     { return &pkt_num_perf_stats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 42c6e534f24fafd70be0d302aa85c9425362569d..1e155c1162f0d224db1242ff8f90013c9a7b119b 100644 (file)
@@ -114,6 +114,10 @@ public:
     ProfileStats* get_profile() const override
     { return &tcpUrgPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 9cc99ea7fa73b9ac4c5fe59147d567cdccfccd73..ca61ffbcb1c9ad3405412f19a6e01fcb73a53cec 100644 (file)
@@ -51,6 +51,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     bool upper;
 };
index a7a9de42e4659fd6457ce086cba39ffe3b59be7a..eb596a07d84832428266966212f4f5832c7d15a5 100644 (file)
@@ -102,6 +102,9 @@ public:
 
     bool set(const char*, Value&, SnortConfig*) override
     { return false; }
+
+    Usage get_usage() const override
+    { return CONTEXT; }
 };
 
 //-------------------------------------------------------------------------
index 882270fd8f979b01ee18627e4000322eb06e36c5..ff42b1f7fa401acc1df9da05b6ee5f039da9fb4a 100644 (file)
@@ -269,6 +269,10 @@ public:
     ProfileStats* get_profile() const override
     { return &reactPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     bool msg;
 };
 
index a2e53ce44fad70864827927921ab830b09ab7b09..63742cc1d14217a11e6e039fd3ddb0ccb58006fe 100644 (file)
@@ -146,6 +146,10 @@ public:
     ProfileStats* get_profile() const override
     { return &rejPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     uint32_t flags;
 };
 
index a9ab018f6b97b99bdaab7de0706e13c711b64f6c..3a2129e80d25f2417b2060ccc0f69eb1b2bddc27 100644 (file)
@@ -112,6 +112,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 public:
     bool disable_replace;
 };
index f75a1db2946dc0da07f42718898d94de884d4e05..14b1ae4f8dbe4887dbe17d11e860c83c586c996d 100644 (file)
@@ -231,6 +231,9 @@ public:
     { return GID_DECODE; }
 
     const RuleMap* get_rules() const override;
+
+    Usage get_usage() const override
+    { return CONTEXT; }
 };
 
 #endif
index 4c3357ac56d8d5ba05a0c333c5dab7e0f747743a..d3f4fac59fce0a1865a6b053d9ea3264132fc092 100644 (file)
@@ -37,8 +37,8 @@ namespace
 {
 const PegInfo pegs[]
 {
-    { "bad_checksum", "non-zero icmp checksums" },
-    { nullptr, nullptr }
+    { CountType::SUM, "bad_checksum", "non-zero icmp checksums" },
+    { CountType::END, nullptr, nullptr }
 };
 
 struct Stats
index 537aa76e906f5dda5ca1a743c40cd12d51d48682..34d648b29e2dbbc5b3a69a5ce6b4ee9a0486ba33 100644 (file)
@@ -39,8 +39,8 @@ namespace
 {
 const PegInfo pegs[]
 {
-    { "bad_icmp6_checksum", "nonzero icmp6 checksums" },
-    { nullptr, nullptr }
+    { CountType::SUM, "bad_icmp6_checksum", "nonzero icmp6 checksums" },
+    { CountType::END, nullptr, nullptr }
 };
 
 struct Stats
index 1542d4fa8af249a304d5eea45ffb0886c58d2ccc..ca8d99ad616d5d26b2b6259d4cf7e3bdcba71410 100644 (file)
@@ -44,8 +44,8 @@ namespace
 {
 const PegInfo pegs[]
 {
-    { "bad_checksum", "nonzero ip checksums" },
-    { nullptr, nullptr }
+    { CountType::SUM, "bad_checksum", "nonzero ip checksums" },
+    { CountType::END, nullptr, nullptr }
 };
 
 struct Stats
index 4dc12fd5f9ccd77ffe2ccd61b2fef677343c7684..5153cbb87b1a9152d692af2461a57b2886f8d620 100644 (file)
@@ -52,9 +52,9 @@ namespace
 {
 const PegInfo pegs[]
 {
-    { "bad_tcp4_checksum", "nonzero tcp over ip checksums" },
-    { "bad_tcp6_checksum", "nonzero tcp over ipv6 checksums" },
-    { nullptr, nullptr }
+    { CountType::SUM, "bad_tcp4_checksum", "nonzero tcp over ip checksums" },
+    { CountType::SUM, "bad_tcp6_checksum", "nonzero tcp over ipv6 checksums" },
+    { CountType::END, nullptr, nullptr }
 };
 
 struct Stats
index 870f85c4ad7cd8ea6ba24e1009a9a18192864058..0d3695673726ba67ed9c849d8de8ebdc5e30225d 100644 (file)
@@ -39,9 +39,9 @@ namespace
 {
 const PegInfo pegs[]
 {
-    { "bad_udp4_checksum", "nonzero udp over ipv4 checksums" },
-    { "bad_udp6_checksum", "nonzero udp over ipv6 checksums" },
-    { nullptr, nullptr }
+    { CountType::SUM, "bad_udp4_checksum", "nonzero udp over ipv4 checksums" },
+    { CountType::SUM, "bad_udp6_checksum", "nonzero udp over ipv6 checksums" },
+    { CountType::END, nullptr, nullptr }
 };
 
 struct Stats
index f46cadf2c72fa4b16ce7f72228f6ceaf9f0c20ac..97d3ec4df1a97a0cadd7354c46eb6483f393d4f0 100644 (file)
@@ -64,9 +64,9 @@ static const RuleMap mpls_rules[] =
 
 static const PegInfo mpls_pegs[] =
 {
-    { "total_packets", "total mpls labeled packets processed" },
-    { "total_bytes", "total mpls labeled bytes processed" },
-    { nullptr, nullptr }
+    { CountType::SUM, "total_packets", "total mpls labeled packets processed" },
+    { CountType::SUM, "total_bytes", "total mpls labeled bytes processed" },
+    { CountType::END, nullptr, nullptr }
 };
 
 struct MplsStats
index cf299c0a55f4222577d3ac8f9af2a9fc211f61d7..076bed1107ae631e9af6dfe6e8cb6231be97faba 100644 (file)
@@ -45,8 +45,8 @@ static const Parameter file_connector_params[] =
 
 static const PegInfo file_connector_pegs[] =
 {
-    { "messages", "total messages" },
-    { nullptr, nullptr }
+    { CountType::SUM, "messages", "total messages" },
+    { CountType::END, nullptr, nullptr }
 };
 
 extern THREAD_LOCAL SimpleStats file_connector_stats;
index bed674fcb43141b2b2abf19acd5b075fe9976c93..566095d17daa3015fbac0bd091927652950b6da5 100644 (file)
@@ -45,6 +45,9 @@ public:
 
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     FileConnectorConfig::FileConnectorConfigSet* config_set;
     FileConnectorConfig* config;
index f8db4e711b53a0744544ea56d2e8d5a574069edd..efbb65dde7318eec0823789cc5a9a3dbd5ebd333 100644 (file)
@@ -35,9 +35,7 @@ THREAD_LOCAL SimpleStats file_connector_stats;
 THREAD_LOCAL ProfileStats file_connector_perfstats;
 
 void show_stats(PegCount*, const PegInfo*, unsigned, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*, FILE*) { }
 
 #ifdef DEBUG_MSGS
index cd1ab15a005349c9dd7d77b034c07e76082ae8e8..6c2499612c204ed5ae1b04e4f07242a120647543 100644 (file)
@@ -49,9 +49,7 @@ Connector* connector_tb;
 Connector* connector_rb;
 
 void show_stats(PegCount*, const PegInfo*, unsigned, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*, FILE*) { }
 
 const char* get_instance_file(std::string& file, const char* name)
@@ -67,7 +65,8 @@ FileConnectorModule::FileConnectorModule() :
 
 FileConnectorConfig::FileConnectorConfigSet* FileConnectorModule::get_and_clear_config()
 {
-    FileConnectorConfig::FileConnectorConfigSet* config_set = new FileConnectorConfig::FileConnectorConfigSet;
+    FileConnectorConfig::FileConnectorConfigSet* config_set =
+        new FileConnectorConfig::FileConnectorConfigSet;
 
     return config_set;
 }
@@ -77,16 +76,12 @@ FileConnectorModule::~FileConnectorModule() { }
 ProfileStats* FileConnectorModule::get_profile() const { return nullptr; }
 
 bool FileConnectorModule::set(const char*, Value&, SnortConfig*) { return true; }
-
 bool FileConnectorModule::begin(const char*, int, SnortConfig*) { return true; }
-
 bool FileConnectorModule::end(const char*, int, SnortConfig*) { return true; }
 
 const PegInfo* FileConnectorModule::get_pegs() const { return nullptr; }
-
 PegCount* FileConnectorModule::get_counts() const { return nullptr; }
 
-
 TEST_GROUP(file_connector)
 {
     void setup()
index 41e409fb27440dac1d47cc9d74347cf6eafd0582..e7e126a0f433919737fc5058a76ad434e4af626e 100644 (file)
@@ -45,8 +45,8 @@ static const Parameter tcp_connector_params[] =
 
 static const PegInfo tcp_connector_pegs[] =
 {
-    { "messages", "total messages" },
-    { nullptr, nullptr }
+    { CountType::SUM, "messages", "total messages" },
+    { CountType::END, nullptr, nullptr }
 };
 
 extern THREAD_LOCAL SimpleStats tcp_connector_stats;
index ffa999739036ab9368cd2ea7471332760966fe71..9f7555e876757b34e3e8e342e86a97bf3c0330ca 100644 (file)
@@ -45,6 +45,9 @@ public:
 
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     TcpConnectorConfig::TcpConnectorConfigSet* config_set;
     TcpConnectorConfig* config;
index f4687f071ed195ba011493b95fec597f6f589833..479e70d0db92f9fbc537fe02f002f53864dbc256 100644 (file)
@@ -35,9 +35,7 @@ THREAD_LOCAL SimpleStats tcp_connector_stats;
 THREAD_LOCAL ProfileStats tcp_connector_perfstats;
 
 void show_stats(PegCount*, const PegInfo*, unsigned, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*, FILE*) { }
 
 #ifdef DEBUG_MSGS
index 4bcf2d6cecf747bf9c950d1dcc900ad7713df45c..9e6307e228909bb88e7ce1fb4b112e0c1579d597 100644 (file)
@@ -72,9 +72,7 @@ ConnectorCommon* connector_common;
 Connector* connector;
 
 void show_stats(PegCount*, const PegInfo*, unsigned, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*) { }
-
 void show_stats(PegCount*, const PegInfo*, IndexVec&, const char*, FILE*) { }
 
 unsigned get_instance_id()
@@ -184,13 +182,10 @@ TcpConnectorModule::~TcpConnectorModule() { }
 ProfileStats* TcpConnectorModule::get_profile() const { return nullptr; }
 
 bool TcpConnectorModule::set(const char*, Value&, SnortConfig*) { return true; }
-
 bool TcpConnectorModule::begin(const char*, int, SnortConfig*) { return true; }
-
 bool TcpConnectorModule::end(const char*, int, SnortConfig*) { return true; }
 
 const PegInfo* TcpConnectorModule::get_pegs() const { return nullptr; }
-
 PegCount* TcpConnectorModule::get_counts() const { return nullptr; }
 
 TEST_GROUP(tcp_connector)
index 8eefc3f17103d06fe5650063f27894899f5f2eae..094c858b274c8b257acdf461a87ed4656beecff8 100644 (file)
@@ -437,9 +437,10 @@ static int fpFinishPortGroup(
         {
             if (pg->mpse[i]->get_pattern_count() != 0)
             {
-                if (pg->mpse[i]->prep_patterns(sc) != 0)
+                if ( !sc->test_mode() or sc->mem_check() )
                 {
-                    FatalError("Failed to compile port group patterns.\n");
+                    if ( pg->mpse[i]->prep_patterns(sc) != 0 )
+                        FatalError("Failed to compile port group patterns.\n");
                 }
 
                 if (fp->get_debug_mode())
index 50f95e847902718e74ec2410fdbd2e9250881b04..55f7b63bae085de8dfc8e8c298ccadc3498f1c8f 100644 (file)
@@ -51,9 +51,8 @@ static THREAD_LOCAL FileLogStats fl_stats;
 
 static const PegInfo fl_pegs[] =
 {
-    { "total_events", "total file events" },
-
-    { nullptr, nullptr }
+    { CountType::SUM, "total_events", "total file events" },
+    { CountType::END, nullptr, nullptr }
 };
 
 //-------------------------------------------------------------------------
@@ -235,6 +234,9 @@ public:
 
     bool set(const char*, Value& v, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 public:
     FileLogConfig config;
 };
index e843b626eed1b05dce4c3aefd9eabc0de1c97a65..784ec46dca68cb661a00c3fd74e100f17e3faf57 100644 (file)
@@ -176,10 +176,10 @@ static const Parameter file_id_params[] =
 
 static const PegInfo file_pegs[] =
 {
-    { "total_files", "number of files processed" },
-    { "total_file_data", "number of file data bytes processed" },
-    { "cache_failures", "number of file cache add failures" },
-    { nullptr, nullptr }
+    { CountType::SUM, "total_files", "number of files processed" },
+    { CountType::SUM, "total_file_data", "number of file data bytes processed" },
+    { CountType::SUM, "cache_failures", "number of file cache add failures" },
+    { CountType::END, nullptr, nullptr }
 };
 
 FileIdModule::FileIdModule() : Module(FILE_ID_NAME, FILE_ID_HELP, file_id_params) { }
index c7838ad519ae25427499b33442ea630e6467383b..ec89f3e797b171d36ac167e6ae5138a63d3dcab8 100644 (file)
@@ -49,6 +49,9 @@ public:
 
     void load_config(FileConfig*& dst);
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     FileMagicRule rule;
     FileMagicData magic;
index 3da64abd48f07d00b04ff9345c86f7674b5acf34..6af7d921bec3392e7f30989fe0b9ec9140f3b792 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "ha.h"
 
-extern THREAD_LOCAL SimpleStats ha_stats;
 extern THREAD_LOCAL ProfileStats ha_perf_stats;
 
 //-------------------------------------------------------------------------
@@ -151,6 +150,3 @@ bool HighAvailabilityModule::end(const char* fqn, int idx, SnortConfig*)
     return true;
 }
 
-PegCount* HighAvailabilityModule::get_counts() const
-{ return (PegCount*)&ha_stats; }
-
index cef14a8288995cac03328ee7666dad40b1a6cd60..c60fe34dc5cb4f707cf1688af8ebda95c0806935 100644 (file)
@@ -51,9 +51,17 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
-    PegCount* get_counts() const override;
+    PegCount* get_counts() const override
+    { return (PegCount*)&ha_stats; }
+
+    const PegInfo* get_pegs() const override
+    { return simple_pegs; }
+
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     HighAvailabilityConfig config;
 };
index 4faea1b0e4ddcf2d8d652f26cecbd718ca6e1f6c..b7fc26914a3cf6818ca7b48d93e9abbdb0a3665a 100644 (file)
@@ -77,12 +77,12 @@ public:
  * Having these predefined stats improves consistency and provides convenience.
  */
 #define SESSION_PEGS(module) \
-    { "sessions", "total " module " sessions" }, \
-    { "max", "max " module " sessions" }, \
-    { "created", module " session trackers created" }, \
-    { "released", module " session trackers released" }, \
-    { "timeouts", module " session timeouts" }, \
-    { "prunes", module " session prunes" }
+    { CountType::SUM, "sessions", "total " module " sessions" }, \
+    { CountType::MAX, "max", "max " module " sessions" }, \
+    { CountType::SUM, "created", module " session trackers created" }, \
+    { CountType::SUM, "released", module " session trackers released" }, \
+    { CountType::SUM, "timeouts", module " session timeouts" }, \
+    { CountType::SUM, "prunes", module " session prunes" }
 
 // See above. Add to end of stats array.
 #define SESSION_STATS \
@@ -93,14 +93,6 @@ public:
     PegCount timeouts; \
     PegCount prunes
 
-#define SESSION_STAT_TYPES \
-    CountType sessions = CountType::SUM; \
-    CountType max = CountType::MAX; \
-    CountType created = CountType::SUM; \
-    CountType released = CountType::SUM; \
-    CountType timeouts = CountType::SUM; \
-    CountType prunes = CountType::SUM
-
 // Do not change the semantics of max. Max = the highest seen during the perf interval.
 // To obtain max over the entire run, determine the maximum of reported max pegs.
 #define SESSION_STATS_ADD(stats) \
index d78cf745d9edd2b640ac3ee2d10d7a8281a445a1..39e47f2616798e081ae48715b3c41567c46b15a3 100644 (file)
 
 // basic stats support - note that where these are used, the number of
 // elements in stats must be the same as the number of elements in the peg
-// info.
+// info (and in the same sequence).
 
 #include "main/snort_types.h"
 
 typedef uint64_t PegCount;
 
+enum CountType
+{
+    END,   // sentinel value
+    SUM,   // tracks cumulative total number of items seen (eg #events)
+    NOW,   // gives snapshot of current number of items (eg current #sessions)
+    MAX,   // tracks maximum value seen (eg max #sessions)
+};
+
 struct SimpleStats
 {
     PegCount total_packets;
@@ -36,17 +44,11 @@ struct SimpleStats
 
 struct PegInfo
 {
+    CountType type;
     const char* name;
     const char* help;
 };
 
-enum CountType
-{
-    SUM,   // Tracks cumulative total number of items seen.
-    NOW,   // Gives snapshot of current number of items.
-    MAX,   // Tracks maximum value seen.
-};
-
 SO_PUBLIC extern const struct PegInfo simple_pegs[];
 
 #define array_size(a) (sizeof(a)/sizeof(a[0]))
index 8dbf1c399614532336264bb0f8978370cf453627..267cb4b6630143de246ec89db34e035d750d0ee2 100644 (file)
@@ -84,16 +84,19 @@ bool Module::set(const char*, Value& v, SnortConfig*)
     return true;
 }
 
-void Module::sum_stats_helper(bool accumulate_now_stats, const CountType* const count_types)
+void Module::sum_stats(bool accumulate_now_stats)
 {
     if ( num_counts < 0 )
         reset_stats();
 
     PegCount* p = get_counts();
+    const PegInfo* q = get_pegs();
 
     if ( !p )
         return;
 
+    assert(q);
+
     if ( global_stats() )
     {
         for ( int i = 0; i < num_counts; i++ )
@@ -103,39 +106,29 @@ void Module::sum_stats_helper(bool accumulate_now_stats, const CountType* const
     {
         for ( int i = 0; i < num_counts; i++ )
         {
-            if(count_types)
-            {
-                switch (count_types[i])
-                {
-                case CountType::SUM:
-                    add_peg_count(i, p[i]);
-                    p[i] = 0;
-                    break;
-
-                case CountType::NOW:
-                    if(accumulate_now_stats)
-                        add_peg_count(i, p[i]);
-                    break;
-
-                case CountType::MAX:
-                    set_max_peg_count(i, p[i]);
-                    break;
-                }
-            }
-            else
+            switch ( q[i].type )
             {
+            case CountType::END:
+                break;
+
+            case CountType::SUM:
                 add_peg_count(i, p[i]);
                 p[i] = 0;
+                break;
+
+            case CountType::NOW:
+                if ( accumulate_now_stats )
+                    add_peg_count(i, p[i]);
+                break;
+
+            case CountType::MAX:
+                set_max_peg_count(i, p[i]);
+                break;
             }
         }
     }
 }
 
-void Module::sum_stats(bool)
-{
-    sum_stats_helper(false, nullptr);
-}
-
 void Module::show_interval_stats(IndexVec& peg_idxs, FILE* fh)
 {
     if ( num_counts > 0 )
@@ -150,7 +143,7 @@ void Module::show_stats()
 
 void Module::reset_stats()
 {
-    if( num_counts <= 0 )
+    if ( num_counts <= 0 )
     {
         num_counts = 0;
         const PegInfo* pegs = get_pegs();
@@ -190,7 +183,7 @@ bool Module::verified_end(const char* fqn, int idx, SnortConfig* c)
 
 const PegInfo simple_pegs[] =
 {
-    { "packets", "total packets" },
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "total packets" },
+    { CountType::END, nullptr, nullptr }
 };
 
index 09a698d02eb682c3b766b08c4078418312eea4db..c3a794305f7400907cd476d7239f51d1bf571459 100644 (file)
@@ -159,14 +159,22 @@ public:
     bool verified_set(const char*, Value&, SnortConfig*);
     bool verified_end(const char*, int, SnortConfig*);
 
+    enum Usage
+    {
+        GLOBAL,
+        CONTEXT,
+        INSPECT,
+        DETECT
+    };
+
+    virtual Usage get_usage() const
+    { return CONTEXT; }
+
 protected:
     Module(const char* name, const char* help);
     Module(const char* name, const char* help, const Parameter*,
         bool is_list = false, Trace* = nullptr);
 
-    void sum_stats_helper(bool accumulate_now_stats,
-        const CountType* const count_types);
-
 private:
     friend class ModuleManager;
     void init(const char*, const char* = nullptr);
index 22b6140c2e71d504bd4e30fad749aebd2694a03b..51353ceff0ddc11deb0ec78fd8b47bb86d5a38f8 100644 (file)
 
 const PegInfo lru_cache_shared_peg_names[] =
 {
-    { "lru_cache_adds", "lru cache added new entry" },
-    { "lru_cache_replaces", "lru cache replaced existing entry" },
-    { "lru_cache_prunes", "lru cache pruned entry to make space for new entry" },
-    { "lru_cache_find_hits", "lru cache found entry in cache" },
-    { "lru_cache_find_misses", "lru cache did not find entry in cache" },
-    { "lru_cache_removes", "lru cache found entry and removed it" },
-    { "lru_cache_clears", "lru cache clear API calls" },
-    { nullptr, nullptr },
+    { CountType::SUM, "lru_cache_adds", "lru cache added new entry" },
+    { CountType::SUM, "lru_cache_replaces", "lru cache replaced existing entry" },
+    { CountType::SUM, "lru_cache_prunes", "lru cache pruned entry to make space for new entry" },
+    { CountType::SUM, "lru_cache_find_hits", "lru cache found entry in cache" },
+    { CountType::SUM, "lru_cache_find_misses", "lru cache did not find entry in cache" },
+    { CountType::SUM, "lru_cache_removes", "lru cache found entry and removed it" },
+    { CountType::SUM, "lru_cache_clears", "lru cache clear API calls" },
+    { CountType::END, nullptr, nullptr },
 };
 
index 49b4aee4a4ae43295d48a10749dc4b40f8752659..4f9e271bb2d2f3feb94325ee350ddb8483c1a3e9 100644 (file)
@@ -44,6 +44,9 @@ public:
 
     void sum_stats(bool) override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     static const Parameter host_cache_params[];
     static const Parameter service_params[];
index 6166c967ebedd8bdfdddc3f9d57942a280897730..090fe2d5a316f6acecf7a2f1e0acfee0d889ca15 100644 (file)
 
 const PegInfo host_tracker_pegs[] =
 {
-    { "service_adds", "host service adds" },
-    { "service_finds", "host service finds" },
-    { "service_removes", "host service removes" },
-    { nullptr, nullptr },
+    { CountType::SUM, "service_adds", "host service adds" },
+    { CountType::SUM, "service_finds", "host service finds" },
+    { CountType::SUM, "service_removes", "host service removes" },
+    { CountType::END, nullptr, nullptr },
 };
 
 const Parameter HostTrackerModule::service_params[] =
index 0e39b25b563d483fe9ced2de0db5b5c2ec7351fa..7c2c43c098d7147515ca13ba3b36031068d9caea 100644 (file)
@@ -39,14 +39,10 @@ class HostTrackerModule : public Module
 {
 public:
     HostTrackerModule() : Module("host_tracker", host_tracker_help, host_tracker_params, true)
-    {
-        host = nullptr;
-    }
+    { host = nullptr; }
 
     ~HostTrackerModule()
-    {
-        assert(!host);
-    }
+    { assert(!host); }
 
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
@@ -55,6 +51,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     static const Parameter host_tracker_params[];
     static const Parameter service_params[];
index 7b7bdcedfabbcfbb07d195491a60901e0b2a5804..2b7aa9512cd42ecbf35e6b64a32d0c4fc125d05d 100644 (file)
@@ -115,6 +115,10 @@ public:
     ProfileStats* get_profile() const override
     { return &tcpAckPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index c75a20804119ea5ca0267cfe52b5a5934df1af32..a806102d893de418d46bfcf8ff64eb18010c0e46 100644 (file)
@@ -205,6 +205,10 @@ public:
     ProfileStats* get_profile() const override
     { return &asn1PerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     ASN1_CTXT data;
 };
 
index e9852fbdd318f3461117b85cb332862de8cb9d65..60a4a57600d0db60bc342b1721cbc59302bc1274 100644 (file)
@@ -187,6 +187,10 @@ public:
     ProfileStats* get_profile() const override
     { return &base64PerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     Base64DecodeData data;
 };
 
index e1106aec6af18c9cd055c0bf347d4913e2960cdc..4f076afa653151aa8ffa5ac62a8702a394f486b9 100644 (file)
@@ -114,6 +114,10 @@ public:
     ProfileStats* get_profile() const override
     { return &lenCheckPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 6565125764dd641be1192f8b1f0fcecf14b0c143..63d42ed2fb0fe7a751764234e7c686419cc9300d 100644 (file)
@@ -350,6 +350,10 @@ public:
     ProfileStats* get_profile() const override
     { return &byteExtractPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     ByteExtractData data;
 };
 
index da122af69c841e32670ebe55626f241c892f63b7..5c5b07d6e005a330d8704c5b8a6c869d559b5619 100644 (file)
@@ -380,6 +380,10 @@ public:
     ProfileStats* get_profile() const override
     { return &byteJumpPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     ByteJumpData data;
     string var;
 };
index f62a281cf94c88ccc2c3fadbf47edb9188f5bafa..fe0ed4c0d00eb1ce3c28f503791e03eb2937f2aa 100644 (file)
@@ -342,6 +342,10 @@ public:
     ProfileStats* get_profile() const override
     { return &byteMathPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     ByteMathData data;
     string rvalue_var;
     string off_var;
index 59ee43c04ff9d030645a3a8f22d24c3712679c39..bdc30a11482ad6b1f64dde511c15eda18b32ed6f 100644 (file)
@@ -498,6 +498,10 @@ public:
     ProfileStats* get_profile() const override
     { return &byteTestPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     ByteTestData data;
     string cmp_var;
     string off_var;
index e342fa97484669ebffddb7f25060e953ae8cd642..214dc84a156af1470595946821bbe21ed2f5b12f 100644 (file)
@@ -48,6 +48,11 @@ class ClassTypeModule : public Module
 public:
     ClassTypeModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     ClassType* type;
 };
 
index d13397f83d7cdde40778ef270f820498eeed1d1a..9bc4099d095c766bafc6904df0fe1da3bc5f826f 100644 (file)
@@ -644,6 +644,9 @@ public:
 
     ContentData* get_data();
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     ContentData* cd;
 };
index ad39204a9101d6e5042778f9ca8dc18fe091d46d..58737045fcd5bc6d4a435f7b8e675abf17b36ed1 100644 (file)
@@ -412,6 +412,10 @@ public:
     ProfileStats* get_profile() const override
     { return &cvsPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     CvsRuleOption data;
 };
 
index fc830a7a59d90d7d8e9daf71226971a10db0f1ec..9f1ca2841d218630d24c064b6e241a3c0aec39c4 100644 (file)
@@ -62,6 +62,10 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     THDX_STRUCT thdx;
     DetectionFilterConfig* dfc;
 };
index 595068e6fe79cc8a2536ac459a35fa1c2ef7bd01..4535d00705dc8331031c165d02a9aa74b2f71c6a 100644 (file)
@@ -123,6 +123,10 @@ public:
     ProfileStats* get_profile() const override
     { return &dsizePerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index b399434994cb6ae1c44f87f0de4fea9a68facaf6..3787da82ca1d541585af63e9128f2a31536ba75f 100644 (file)
@@ -78,6 +78,9 @@ public:
 
     ProfileStats* get_profile() const override
     { return &fileDataPerfStats; }
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 //-------------------------------------------------------------------------
index e27661d76bb3973d9b6c682ea97a1b3d61b862b6..085745172faf42ead62dac939719e0587e88ec24 100644 (file)
@@ -116,6 +116,10 @@ public:
     ProfileStats* get_profile() const override
     { return &fileTypePerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     TypeBitSet types;
 };
 
index 00a96e163a7a9de7d8e1fe8665ec8d36a6753460..b8e389a224e410d667037ff825f876ef86426b5d 100644 (file)
@@ -404,6 +404,10 @@ public:
     ProfileStats* get_profile() const override
     { return &tcpFlagsPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     TcpFlagCheckData data;
 };
 
index c05ebd67f01c4cdb2cda942ec89f2ebf8e459735..871a97bb6e910a8584e482f310af10b9b992877c 100644 (file)
@@ -335,6 +335,10 @@ public:
     ProfileStats* get_profile() const override
     { return &flowCheckPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     FlowCheckData data;
 };
 
index 054d2b9225691504984d9379602778c1ecb1cf73..c89b2ef4c79fd931536d0123acc5510c58672bbc 100644 (file)
@@ -1140,6 +1140,9 @@ public:
     ProfileStats* get_profile() const override
     { return &flowBitsPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 public:
     string args;
 };
index 84b5e8ff4899b4d4973ebf06b3740f968c931762..700677d27e5b34ae00a3630acb2097b1fadf9502 100644 (file)
@@ -367,6 +367,9 @@ public:
 
     FragBitsData get_fragBits_data();
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     FragBitsData fragBitsData;
 };
index fb130b54972ffd5a437f298bf3eb2aed81c99ec9..f62c2dfe726e90c51c0e92288ea2a4828f12b1f8 100644 (file)
@@ -118,6 +118,10 @@ public:
     ProfileStats* get_profile() const override
     { return &fragOffsetPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 56b2ab0f3f60bce9f4a5758810de1f94c7147444..a0cc1e3eb4e132c80d1a3f32abf21a1fb5c2b733 100644 (file)
@@ -49,6 +49,11 @@ class GidModule : public Module
 public:
     GidModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     int gid;
 };
 
index 2575b317968a2052d78be6c5e1c6bc419047e865..1407d634dde3987f126ea1b38bb1dab4f790a87a 100644 (file)
@@ -293,6 +293,9 @@ public:
 
     HashMatchData* get_data();
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     HashMatchData* hmd;
     HashPsIdx idx;
index 160f7601df47ada3ad7db485497fddf4e25b162d..6f13363d2252dd9667f473454c4d65d1008e2091 100644 (file)
@@ -148,6 +148,10 @@ public:
     ProfileStats* get_profile() const override
     { return &icmpIdPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 506ba1248dec6a37d4b2ed8591ffb7fd158e5d0e..8ad9bee7d2e6f6fb9d9bc8c119020f1f9cae8101 100644 (file)
@@ -149,6 +149,10 @@ public:
     ProfileStats* get_profile() const override
     { return &icmpSeqPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 5c07c5a290bd36372f6fe36cbc503865d10f6b37..56713c1ce1010d8c41f0736b8bf78401cbcb810d 100644 (file)
@@ -119,6 +119,10 @@ public:
     ProfileStats* get_profile() const override
     { return &icmpCodePerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 838f5b30ac91be9a1d25a3bd87648352204c8571..4cf1ad39c75da375e23e825b699a96e553d8d00b 100644 (file)
@@ -117,6 +117,10 @@ public:
     ProfileStats* get_profile() const override
     { return &ipIdPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 7be2ddc570703644e898c0ba1dc66493ec3af1af..67d0037f1bea09ab211be88af1b6c33aeb33b269 100644 (file)
@@ -235,6 +235,10 @@ public:
     ProfileStats* get_profile() const override
     { return &ipProtoPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     IpProtoData data;
 };
 
index 5f4b76b597f73e798554add6f678ffd453caf03f..fa7684fe21fcc24add2178a2eee8c09e44960cb8 100644 (file)
@@ -215,6 +215,10 @@ public:
     ProfileStats* get_profile() const override
     { return &ipOptionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     IpOptionData data;
 };
 
index c14e2722d4022062121a7631a2bbc4aebc92d235..a7522a79d35af62491e11fb1d4a07e4ddd93dcd3 100644 (file)
@@ -257,6 +257,10 @@ public:
     ProfileStats* get_profile() const override
     { return &isDataAtPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     IsDataAtData data;
 };
 
index 464476e73d8a096156afa2dc4a1ee6933d263726..d81d2ad2c7226fa0b4192fe5c46788e664441b5f 100644 (file)
@@ -120,6 +120,10 @@ public:
     ProfileStats* get_profile() const override
     { return &icmpTypePerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 251625457a98481a31e553364ffb72c880e09054..141792ce0284fb5dc3b9c6b39fd4d5196c77c896 100644 (file)
@@ -80,6 +80,9 @@ public:
     ProfileStats* get_profile() const override
     { return &luaIpsPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 public:
     std::string args;
 };
index 89405bb1234aa9425615c970b5e6b31bd52b9031..a0bf553c929b09250d4a80f8181dcd2a4b2adc3a 100644 (file)
@@ -49,6 +49,9 @@ class MetadataModule : public Module
 public:
     MetadataModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 bool MetadataModule::set(const char*, Value& v, SnortConfig*)
index 15f957e6900d42b937a48bd7102fde99cb9c633f..a06e91872f2856b8c165ba231ed3b4c22d9741e5 100644 (file)
@@ -50,6 +50,11 @@ class MsgModule : public Module
 public:
     MsgModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     std::string msg;
 };
 
index c1d1fbcdb03111496bde2c471262e431ebf4bf3e..8b72c0eb754a9b6ca2018610662f538834a8d83c 100644 (file)
@@ -683,6 +683,9 @@ public:
 
     PcreData* get_data();
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     PcreData* data;
 };
index 834795d9a445bca484fed3e282bb7c830d337253..238be290ce74f82c72ff34e63c1cc27c4c216d3a 100644 (file)
@@ -65,6 +65,9 @@ public:
 
     ProfileStats* get_profile() const override
     { return &pktDataPerfStats; }
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 //-------------------------------------------------------------------------
index 2334867bef94d8130e6ad645ec508a8754667250..ae18eedc60a6ac6070bee3aeb9986dfb8d528a6b 100644 (file)
@@ -49,6 +49,11 @@ class PriorityModule : public Module
 public:
     PriorityModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     int priority;
 };
 
index 54422e4c829c746a793398002b028f3194e4c779..345c4508c084536c2954bf86060654af3c81e37b 100644 (file)
@@ -65,6 +65,9 @@ public:
 
     ProfileStats* get_profile() const override
     { return &rawDataPerfStats; }
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 //-------------------------------------------------------------------------
index cc0dfdf929c59fc69665b2179d8f18b900fd424f..3e7f220bc18cabde875d78513c867b917cc3d374 100644 (file)
@@ -54,6 +54,10 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     std::string scheme;
     std::string id;
     SnortConfig* snort_config;
index 2eaebae50490d3e35a418095306ddaabc0b8ab27..378491e0dc2121a520beec8564b4dcf44a6687ef 100644 (file)
@@ -245,6 +245,9 @@ public:
         config.reset();
     }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     RegexConfig config;
 };
index 7814dd2dd5192540ddc6d48d7fea0172562bb580..60c79d04cb5da177d701b51ff1f6b3aedb13b295 100644 (file)
@@ -48,6 +48,9 @@ class RemModule : public Module
 public:
     RemModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 bool RemModule::set(const char*, Value& v, SnortConfig*)
index d10e126bfc3e80084a40547ebf0c817c2a9e6a1a..ae79d59385852a0833ad37f129292b695692610b 100644 (file)
@@ -207,6 +207,10 @@ public:
     ProfileStats* get_profile() const override
     { return &replacePerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     string data;
 };
 
index 508fe2a8afad9448949e13fbe7e42fe1f37fb84a..c97ad72ab40a86965f58ce58c0e7f4ebaccf7a60 100644 (file)
@@ -49,6 +49,11 @@ class RevModule : public Module
 public:
     RevModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     int rev;
 };
 
index a6f71ac4e890ad089e07a37ab86d7754dce5e8ac..1ffc40c844e8b6ac42cb720af4eca7a0f04c89a4 100644 (file)
@@ -251,6 +251,11 @@ public:
     { return &rpcCheckPerfStats; }
 
     bool set(Value&, uint32_t& field, int flag);
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RpcCheckData data;
 };
 
index 0d58f619d41fc044dfef051da60313d6b1ea2ac3..0b61cc7c14690fbff7f2aeb7da7b80afbd1b7ba1 100644 (file)
@@ -68,10 +68,10 @@ struct SdStats
 
 const PegInfo sd_pegs[] =
 {
-    { "below_threshold", "sd_pattern matched but missed threshold" },
-    { "pattern_not_found", "sd_pattern did not not match" },
-    { "terminated", "hyperscan terminated" },
-    { nullptr, nullptr }
+    { CountType::SUM, "below_threshold", "sd_pattern matched but missed threshold" },
+    { CountType::SUM, "pattern_not_found", "sd_pattern did not not match" },
+    { CountType::SUM, "terminated", "hyperscan terminated" },
+    { CountType::END, nullptr, nullptr }
 };
 
 static THREAD_LOCAL SdStats s_stats;
@@ -318,6 +318,9 @@ public:
     void get_data(SdPatternConfig& c)
     { c = config; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     SdPatternConfig config;
 };
index b3672551e0e24793eea813a55d7e40a9889b532a..55e7b5c946907b7db6c8da47ca2de19b9cd471d9 100644 (file)
@@ -117,6 +117,10 @@ public:
     ProfileStats* get_profile() const override
     { return &tcpSeqPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index c705003838a2918f6e622b5d9065e2e0e66ec3ff..fc012fac70796533d5e88347139472297243af7a 100644 (file)
@@ -55,6 +55,10 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     struct SnortConfig* snort_config;
     vector<string> services;
 };
index fe357e287612d18e3076bc2300a7b02882205924..71e86f40cd075b34a270b639b6bdd155d5f170a0 100644 (file)
@@ -324,6 +324,10 @@ public:
     ProfileStats* get_profile() const override
     { return &sessionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     SessionData data;
 };
 
index aa61e3d847246a054e2fa83cc54b84ce9deacfb0..e866c60ed2d8f27974f4d9d774d2764f91111cf2 100644 (file)
@@ -49,6 +49,11 @@ class SidModule : public Module
 public:
     SidModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     int sid;
 };
 
index 418143d0ed6eae60147f3b3914482160580ccf6f..b52f0689191d64225c2e049647af50f15d5b16f6 100644 (file)
@@ -124,6 +124,10 @@ public:
     ProfileStats* get_profile() const override
     { return &soPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     string name;
 };
 
index be8e1e28cc32fd94ede1146c5f6d3d8f66e8048e..f915b28a2af19b14dbc3379f75e10bb74c4cff1c 100644 (file)
@@ -50,6 +50,11 @@ class SoidModule : public Module
 public:
     SoidModule() : Module(s_name, s_help, s_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     std::string soid;
 };
 
index e9ee83328178d8117ed0ea2f4a79c15c426ac08f..ca7babf0fb2cc216d2582784c924f144cd533fd3 100644 (file)
@@ -66,6 +66,11 @@ public:
     bool end(const char*, int, SnortConfig*) override;
 
     TagData* get_data();
+
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     TagData* tag;
 };
 
index cd32c99a7d70f16503501fc4b57e46734d3acf4b..331ad73d73b8136d7d7249574c76ed3e3fc0bc61 100644 (file)
@@ -121,6 +121,10 @@ public:
     ProfileStats* get_profile() const override
     { return &ipTosPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index d5ad99641b5970e7c58cd7218f694e9eecbe27e7..98bb6533fe0219a750e7b062a1fb0d89307116d5 100644 (file)
@@ -118,6 +118,10 @@ public:
     ProfileStats* get_profile() const override
     { return &ttlCheckPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 5cfc23f8fbb80931a38971381642f342144109ab..3592803acbda4d0b4061fed9d173dd4b08775c46 100644 (file)
@@ -118,6 +118,10 @@ public:
     ProfileStats* get_profile() const override
     { return &tcpWinPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck data;
 };
 
index 9a09f7f34ab12f9a5e78587b77b3882cf09a67ad..61e75c6389980a451573afc8f665b0418aca376c 100644 (file)
@@ -100,14 +100,14 @@ THREAD_LOCAL LatencyStats latency_stats;
 
 static const PegInfo latency_pegs[] =
 {
-    { "total_packets", "total packets monitored" },
-    { "total_usecs", "total usecs elapsed" },
-    { "max_usecs", "maximum usecs elapsed" },
-    { "packet_timeouts", "packets that timed out" },
-    { "total_rule_evals", "total rule evals monitored" },
-    { "rule_eval_timeouts", "rule evals that timed out" },
-    { "rule_tree_enables", "rule tree re-enables" },
-    { nullptr, nullptr }
+    { CountType::SUM, "total_packets", "total packets monitored" },
+    { CountType::SUM, "total_usecs", "total usecs elapsed" },
+    { CountType::SUM, "max_usecs", "maximum usecs elapsed" },
+    { CountType::SUM, "packet_timeouts", "packets that timed out" },
+    { CountType::SUM, "total_rule_evals", "total rule evals monitored" },
+    { CountType::SUM, "rule_eval_timeouts", "rule evals that timed out" },
+    { CountType::SUM, "rule_tree_enables", "rule tree re-enables" },
+    { CountType::END, nullptr, nullptr }
 };
 
 // -----------------------------------------------------------------------------
index 0b579f8cd35833e0f1a3300da26c8bb9fd8b77f9..43f2d950e8f1eabfe4c61b49f1e3c080f49b5eb7 100644 (file)
@@ -35,6 +35,9 @@ public:
 
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
+
+    Usage get_usage() const override
+    { return CONTEXT; }
 };
 
 #endif
index 4d99ad2bd613ec494709bd49088d74d75f8cb4b6..2195fa51013ee0d127ed82257ec8f866248fd25a 100644 (file)
@@ -457,6 +457,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     bool file;
     string sep;
index a44687a0e936580c8b716457e18fcfeef73e36b5..9548ec48623cf14c08e596411dd715594e6d0d01 100644 (file)
@@ -96,6 +96,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     bool file;
     unsigned long limit;
index 95ee516ee0cc496cfed574bd97917df0f485dfdd..0aac4748d29459e4be4a58558cd23c554c2e1763 100644 (file)
@@ -83,6 +83,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     bool file;
     unsigned long limit;
index 488dcec039ec41f61835b631bf2a6d86fdcb2b8f..8bffbdd69bd24b74200c6e1619ca3f6f69b38b55 100644 (file)
@@ -120,6 +120,9 @@ public:
     ProfileStats* get_profile() const override
     { return &luaLogPerfStats; }
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     std::string args;
 };
index 085a4a47f2d6e57eb1e277927fe6446802dad81b..cfd958851edbf8ab1102657ddc360ed3e6ac9eaf 100644 (file)
@@ -97,6 +97,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     string file;
     RuleVector rulez;
index 24162926bbf946514ec8c3d8f71387825e7f482c..aff43e1114dd2beebec9b9f7057acc0a698fecec 100644 (file)
@@ -147,6 +147,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     int facility;
     int level;
index 7ac0a28aeb5c766059eeff5787ea22023977a935..a313baf8cc9be2dbb9c21f4b5b1ef1408c4bb76d 100644 (file)
@@ -64,6 +64,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     bool print_to_file;
     uint8_t flags;
index 0b4fe995580a25c781758774309689cf463a3458..6393656922cc65d9767adcb2c079e754f9a00b20 100644 (file)
@@ -123,6 +123,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     bool file;
     bool raw;
index 6754c41650d035344c89f00f80e080a20e228f03..2ed80ac207728fe47d85a0f27b53de9840673991 100644 (file)
@@ -90,6 +90,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     unsigned long limit;
 };
index fc8e0fbf5ecfdf0c05d4df209907d0286d7dbc6b..a72d8d342edeec3814c30e7889e0da4de20b9c6a 100644 (file)
@@ -811,6 +811,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool begin(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 public:
     unsigned limit;
     bool nostamp;
index b5f7153b49c3f097b32a35b83fb9d4cdcf94e6a8..fc1ebf0727d61559cd2ae11ff41cd075a8559339 100644 (file)
@@ -104,6 +104,9 @@ public:
 
     PegCount* get_counts() const override
     { return (PegCount*) &pc; }
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool DetectionModule::set(const char* fqn, Value& v, SnortConfig* sc)
@@ -162,6 +165,9 @@ class EventQueueModule : public Module
 public:
     EventQueueModule() : Module("event_queue", event_queue_help, event_queue_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return CONTEXT; }
 };
 
 bool EventQueueModule::set(const char*, Value& v, SnortConfig* sc)
@@ -244,7 +250,7 @@ static const Parameter search_engine_params[] =
     { "show_fast_patterns", Parameter::PT_BOOL, nullptr, "false",
       "print fast pattern info for each rule" },
 
-    { "split_any_any", Parameter::PT_BOOL, nullptr, "false",
+    { "split_any_any", Parameter::PT_BOOL, nullptr, "true",
       "evaluate any-any rules separately to save memory" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
@@ -257,14 +263,14 @@ THREAD_LOCAL PatMatQStat pmqs;
 
 const PegInfo mpse_pegs[] =
 {
-    { "max_queued", "maximum fast pattern matches queued for further evaluation" },
-    { "total_flushed", "fast pattern matches discarded due to overflow" },
-    { "total_inserts", "total fast pattern hits" },
-    { "total_unique", "total unique fast pattern hits" },
-    { "non_qualified_events", "total non-qualified events" },
-    { "qualified_events", "total qualified events" },
-    { "searched_bytes", "total bytes searched" },
-    { nullptr, nullptr }
+    { CountType::SUM, "max_queued", "maximum fast pattern matches queued for further evaluation" },
+    { CountType::SUM, "total_flushed", "fast pattern matches discarded due to overflow" },
+    { CountType::SUM, "total_inserts", "total fast pattern hits" },
+    { CountType::SUM, "total_unique", "total unique fast pattern hits" },
+    { CountType::SUM, "non_qualified_events", "total non-qualified events" },
+    { CountType::SUM, "qualified_events", "total qualified events" },
+    { CountType::SUM, "searched_bytes", "total bytes searched" },
+    { CountType::END, nullptr, nullptr }
 };
 
 class SearchEngineModule : public Module
@@ -278,6 +284,9 @@ public:
 
     PegCount* get_counts() const override
     { return (PegCount*)&pmqs; }
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool SearchEngineModule::set(const char*, Value& v, SnortConfig* sc)
@@ -457,6 +466,9 @@ class ProfilerModule : public Module
 public:
     ProfilerModule() : Module("profiler", profiler_help, profiler_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool ProfilerModule::set(const char* fqn, Value& v, SnortConfig* sc)
@@ -510,6 +522,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     string name;
     string text;
@@ -576,6 +591,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     string name;
     string url;
@@ -657,6 +675,9 @@ class AlertsModule : public Module
 public:
     AlertsModule() : Module("alerts", alerts_help, alerts_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool AlertsModule::set(const char*, Value& v, SnortConfig* sc)
@@ -765,6 +786,9 @@ class OutputModule : public Module
 public:
     OutputModule() : Module("output", output_help, output_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool OutputModule::set(const char*, Value& v, SnortConfig* sc)
@@ -846,6 +870,9 @@ class ActiveModule : public Module
 public:
     ActiveModule() : Module("active", active_help, active_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool ActiveModule::set(const char*, Value& v, SnortConfig* sc)
@@ -903,6 +930,9 @@ class PacketsModule : public Module
 public:
     PacketsModule() : Module("packets", packets_help, packets_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool PacketsModule::set(const char*, Value& v, SnortConfig* sc)
@@ -956,6 +986,9 @@ public:
     AttributeTableModule() :
         Module("attribute_table", attribute_table_help, attribute_table_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 bool AttributeTableModule::set(const char*, Value& v, SnortConfig* sc)
@@ -1024,6 +1057,9 @@ class NetworkModule : public Module
 public:
     NetworkModule() : Module("network", network_help, network_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return CONTEXT; }
 };
 
 bool NetworkModule::set(const char*, Value& v, SnortConfig* sc)
@@ -1096,6 +1132,9 @@ class IpsModule : public Module
 public:
     IpsModule() : Module("ips", ips_help, ips_params) { }
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 bool IpsModule::set(const char*, Value& v, SnortConfig*)
@@ -1178,6 +1217,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     int thread;
     CpuSet* cpuset;
@@ -1284,6 +1326,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     THDX_STRUCT thdx;
 };
@@ -1369,6 +1414,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     THDX_STRUCT thdx;
 };
@@ -1469,6 +1517,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     tSFRFConfigNode thdx;
 };
@@ -1555,6 +1606,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     RuleState state;
 };
@@ -1638,6 +1692,9 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     ApplicationEntry* app;
     HostAttributeEntry* host;
index 27712d83a5f85a7ee08650ebf3238b39caedcc61..75424a9edc202af82ea9956de9d78d13ccc4b2c7 100644 (file)
@@ -68,8 +68,9 @@ enum RunFlag
     RUN_FLAG__SHELL               = 0x00800000,
 #endif
 #ifdef PIGLET
-    RUN_FLAG__PIGLET              = 0x01000000
+    RUN_FLAG__PIGLET              = 0x01000000,
 #endif
+    RUN_FLAG__MEM_CHECK           = 0x02000000,
 };
 
 enum OutputFlag
@@ -442,6 +443,9 @@ public:
     static bool test_mode()
     { return snort_conf->run_flags & RUN_FLAG__TEST; }
 
+    static bool mem_check()
+    { return snort_conf->run_flags & RUN_FLAG__MEM_CHECK; }
+
     static bool daemon_mode()
     { return snort_conf->run_flags & RUN_FLAG__DAEMON; }
 
index 0cbf94fd2f19d68fbbd857ea18e4956c476d654b..5ecb472801fc667db18b288a3b93ed1730e80faa 100644 (file)
@@ -364,6 +364,9 @@ static const Parameter s_params[] =
     { "--max-packet-threads", Parameter::PT_INT, "0:", "1",
       "<count> configure maximum number of packet threads (same as -z)" },
 
+    { "--mem-check", Parameter::PT_IMPLIED, nullptr, nullptr,
+      "like -T but also compile search engines" },
+
     { "--nostamps", Parameter::PT_IMPLIED, nullptr, nullptr,
       "don't include timestamps in log file names" },
 
@@ -535,6 +538,9 @@ public:
     void sum_stats(bool) override
     { }  // accumulate externally
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     int instance_id;
 };
@@ -790,6 +796,9 @@ bool SnortModule::set(const char*, Value& v, SnortConfig* sc)
     else if ( v.is("--markup") )
         config_markup(sc, v.get_string());
 
+    else if ( v.is("--mem-check") )
+        sc->run_flags |= (RUN_FLAG__TEST | RUN_FLAG__MEM_CHECK);
+
     else if ( v.is("--nostamps") )
         sc->set_no_logging_timestamps(true);
 
index 49eebe3e5cfff7f90476ce739d4f98787346f769..0e4b19742f950c15f1be99ac150958048a9514dc 100644 (file)
@@ -900,6 +900,19 @@ static const char* mod_type(const BaseApi* api)
     return PluginManager::get_type_name(api->type);
 }
 
+static const char* mod_use(Module::Usage use)
+{
+    switch ( use )
+    {
+    case Module::GLOBAL : return "global";
+    case Module::CONTEXT: return "context";
+    case Module::INSPECT: return "inspect";
+    case Module::DETECT : return "detect";
+    }
+    assert(false);
+    return "error";
+}
+
 void ModuleManager::show_module(const char* name)
 {
     if ( !name || !*name )
@@ -924,6 +937,7 @@ void ModuleManager::show_module(const char* name)
             cout << endl << "What: " << Markup::escape(h) << endl;
 
         cout << endl << "Type: "  << mod_type(p->api) << endl;
+        cout << endl << "Usage: "  << mod_use(m->get_usage()) << endl;
 
         const Parameter* params = m->get_parameters();
         const Parameter* def_params = m->get_default_parameters();
@@ -1095,6 +1109,19 @@ void ModuleManager::show_gids(const char* pfx, bool exact)
         cout << "no match" << endl;
 }
 
+static const char* peg_op(CountType ct)
+{
+    switch ( ct )
+    {
+    case CountType::SUM: return " (sum)";
+    case CountType::NOW: return " (now)";
+    case CountType::MAX: return " (max)";
+    default: break;
+    }
+    assert(false);
+    return "error";
+}
+
 void ModuleManager::show_pegs(const char* pfx, bool exact)
 {
     s_modules.sort(comp_gids);
@@ -1121,6 +1148,7 @@ void ModuleManager::show_pegs(const char* pfx, bool exact)
             cout << "." << Markup::escape(pegs->name);
             cout << Markup::emphasis_off();
             cout << ": " << Markup::escape(pegs->help);
+            cout << Markup::escape(peg_op(pegs->type));
             cout << endl;
             ++pegs;
         }
index ffdfa7d20a8819b8d083fc35eef1c683f7f95a95..d892ff170af0ee9f57054a5c34b5b632381a26be 100644 (file)
@@ -29,6 +29,9 @@ public:
     MemoryModule();
 
     bool set(const char*, Value&, SnortConfig*) override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
 };
 
 #endif
index 7229abee22140763686e2406ed543cf1c14b88b3..a7c7088cc28c5ee6e6fb31720d470791213a6de1 100644 (file)
@@ -44,82 +44,83 @@ THREAD_LOCAL ProfileStats appidPerfStats;
 // FIXIT-M define and implement a flexible solution for maintaining protocol specific stats
 const PegInfo appid_pegs[] =
 {
-    { "packets", "count of packets received" },
-    { "processed_packets", "count of packets processed" },
-    { "ignored_packets", "count of packets ignored" },
-    { "aim_clients", "count of aim clients discovered" },
-    { "battlefield_flows", "count of battle field flows discovered" },
-    { "bgp_flows", "count of bgp flows discovered" },
-    { "bit_clients", "count of bittorrent clients discovered" },
-    { "bit_flows", "count of bittorrent flows discovered" },
-    { "bittracker_clients", "count of bittorrent tracker clients discovered" },
-    { "bootp_flows", "count of bootp flows discovered" },
-    { "dcerpc_tcp_flows", "count of dce rpc flows over tcp discovered" },
-    { "dcerpc_udp_flows", "count of dce rpc flows over udp discovered" },
-    { "direct_connect_flows", "count of direct connect flows discovered" },
-    { "dns_tcp_flows", "count of dns flows over tcp discovered" },
-    { "dns_udp_flows", "count of dns flows over udp discovered" },
-    { "ftp_flows", "count of ftp flows discovered" },
-    { "ftps_flows", "count of ftps flows discovered" },
-    { "http_flows", "count of http flows discovered" },
-    { "imap_flows", "count of imap service flows discovered" },
-    { "imaps_flows", "count of imap TLS service flows discovered" },
-    { "irc_flows", "count of irc service flows discovered" },
-    { "kerberos_clients", "count of kerberos clients discovered" },
-    { "kerberos_flows", "count of kerberos service flows discovered" },
-    { "kerberos_users", "count of kerberos users discovered" },
-    { "lpr_flows", "count of lpr service flows discovered" },
-    { "mdns_flows", "count of mdns service flows discovered" },
-    { "msn_clients", "count of msn clients discovered" },
-    { "mysql_flows", "count of mysql service flows discovered" },
-    { "netbios_dgm_flows", "count of netbios-dgm service flows discovered" },
-    { "netbios_ns_flows", "count of netbios-ns service flows discovered" },
-    { "netbios_ssn_flows", "count of netbios-ssn service flows discovered" },
-    { "nntp_flows", "count of nntp flows discovered" },
-    { "ntp_flows", "count of ntp flows discovered" },
-    { "pop_flows", "count of pop service flows discovered" },
-    { "pop3_clients", "count of pop3 clients discovered" },
-    { "pop3s_clients", "count of pop3s clients discovered" },
-    { "radius_flows", "count of radius flows discovered" },
-    { "rexec_flows", "count of rexec flows discovered" },
-    { "rfb_flows", "count of rfb flows discovered" },
-    { "rlogin_flows", "count of rlogin flows discovered" },
-    { "rpc_flows", "count of rpc flows discovered" },
-    { "rshell_flows", "count of rshell flows discovered" },
-    { "rsync_flows", "count of rsync service flows discovered" },
-    { "rtmp_flows", "count of rtmp flows discovered" },
-    { "rtp_clients", "count of rtp clients discovered" },
-    { "sip_clients", "count of SIP clients discovered" },
-    { "sip_flows", "count of SIP flows discovered" },
-    { "smtp_aol_clients", "count of AOL smtp clients discovered" },
-    { "smtp_applemail_clients", "count of Apple Mail smtp clients discovered" },
-    { "smtp_eudora_clients", "count of Eudora smtp clients discovered" },
-    { "smtp_eudora_pro_clients", "count of Eudora Pro smtp clients discovered" },
-    { "smtp_evolution_clients", "count of Evolution smtp clients discovered" },
-    { "smtp_kmail_clients", "count of KMail smtp clients discovered" },
-    { "smtp_lotus_notes_clients", "count of Lotus Notes smtp clients discovered" },
-    { "smtp_microsoft_outlook_clients", "count of Microsoft Outlook smtp clients discovered" },
-    { "smtp_microsoft_outlook_express_clients",
-      "count of Microsoft Outlook Express smtp clients discovered" },
-    { "smtp_microsoft_outlook_imo_clients",
-      "count of Microsoft Outlook IMO smtp clients discovered" },
-    { "smtp_mutt_clients", "count of Mutt smtp clients discovered" },
-    { "smtp_thunderbird_clients", "count of Thunderbird smtp clients discovered" },
-    { "smtp_flows", "count of smtp flows discovered" },
-    { "smtps_flows", "count of smtps flows discovered" },
-    { "snmp_flows", "count of snmp flows discovered" },
-    { "ssh_clients", "count of ssh clients discovered" },
-    { "ssh_flows", "count of ssh flows discovered" },
-    { "ssl_flows", "count of ssl flows discovered" },
-    { "telnet_flows", "count of telnet flows discovered" },
-    { "tftp_flows", "count of tftp flows discovered" },
-    { "timbuktu_clients", "count of timbuktu clients discovered" },
-    { "timbuktu_flows", "count of timbuktu flows discovered" },
-    { "tns_clients", "count of tns clients discovered" },
-    { "tns_flows", "count of tns flows discovered" },
-    { "vnc_clients", "count of vnc clients discovered" },
-    { "yahoo_messenger_clients", "count of Yahoo Messenger clients discovered" },
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "count of packets received" },
+    { CountType::SUM, "processed_packets", "count of packets processed" },
+    { CountType::SUM, "ignored_packets", "count of packets ignored" },
+    { CountType::SUM, "aim_clients", "count of aim clients discovered" },
+    { CountType::SUM, "battlefield_flows", "count of battle field flows discovered" },
+    { CountType::SUM, "bgp_flows", "count of bgp flows discovered" },
+    { CountType::SUM, "bit_clients", "count of bittorrent clients discovered" },
+    { CountType::SUM, "bit_flows", "count of bittorrent flows discovered" },
+    { CountType::SUM, "bittracker_clients", "count of bittorrent tracker clients discovered" },
+    { CountType::SUM, "bootp_flows", "count of bootp flows discovered" },
+    { CountType::SUM, "dcerpc_tcp_flows", "count of dce rpc flows over tcp discovered" },
+    { CountType::SUM, "dcerpc_udp_flows", "count of dce rpc flows over udp discovered" },
+    { CountType::SUM, "direct_connect_flows", "count of direct connect flows discovered" },
+    { CountType::SUM, "dns_tcp_flows", "count of dns flows over tcp discovered" },
+    { CountType::SUM, "dns_udp_flows", "count of dns flows over udp discovered" },
+    { CountType::SUM, "ftp_flows", "count of ftp flows discovered" },
+    { CountType::SUM, "ftps_flows", "count of ftps flows discovered" },
+    { CountType::SUM, "http_flows", "count of http flows discovered" },
+    { CountType::SUM, "imap_flows", "count of imap service flows discovered" },
+    { CountType::SUM, "imaps_flows", "count of imap TLS service flows discovered" },
+    { CountType::SUM, "irc_flows", "count of irc service flows discovered" },
+    { CountType::SUM, "kerberos_clients", "count of kerberos clients discovered" },
+    { CountType::SUM, "kerberos_flows", "count of kerberos service flows discovered" },
+    { CountType::SUM, "kerberos_users", "count of kerberos users discovered" },
+    { CountType::SUM, "lpr_flows", "count of lpr service flows discovered" },
+    { CountType::SUM, "mdns_flows", "count of mdns service flows discovered" },
+    { CountType::SUM, "msn_clients", "count of msn clients discovered" },
+    { CountType::SUM, "mysql_flows", "count of mysql service flows discovered" },
+    { CountType::SUM, "netbios_dgm_flows", "count of netbios-dgm service flows discovered" },
+    { CountType::SUM, "netbios_ns_flows", "count of netbios-ns service flows discovered" },
+    { CountType::SUM, "netbios_ssn_flows", "count of netbios-ssn service flows discovered" },
+    { CountType::SUM, "nntp_flows", "count of nntp flows discovered" },
+    { CountType::SUM, "ntp_flows", "count of ntp flows discovered" },
+    { CountType::SUM, "pop_flows", "count of pop service flows discovered" },
+    { CountType::SUM, "pop3_clients", "count of pop3 clients discovered" },
+    { CountType::SUM, "pop3s_clients", "count of pop3s clients discovered" },
+    { CountType::SUM, "radius_flows", "count of radius flows discovered" },
+    { CountType::SUM, "rexec_flows", "count of rexec flows discovered" },
+    { CountType::SUM, "rfb_flows", "count of rfb flows discovered" },
+    { CountType::SUM, "rlogin_flows", "count of rlogin flows discovered" },
+    { CountType::SUM, "rpc_flows", "count of rpc flows discovered" },
+    { CountType::SUM, "rshell_flows", "count of rshell flows discovered" },
+    { CountType::SUM, "rsync_flows", "count of rsync service flows discovered" },
+    { CountType::SUM, "rtmp_flows", "count of rtmp flows discovered" },
+    { CountType::SUM, "rtp_clients", "count of rtp clients discovered" },
+    { CountType::SUM, "sip_clients", "count of SIP clients discovered" },
+    { CountType::SUM, "sip_flows", "count of SIP flows discovered" },
+    { CountType::SUM, "smtp_aol_clients", "count of AOL smtp clients discovered" },
+    { CountType::SUM, "smtp_applemail_clients", "count of Apple Mail smtp clients discovered" },
+    { CountType::SUM, "smtp_eudora_clients", "count of Eudora smtp clients discovered" },
+    { CountType::SUM, "smtp_eudora_pro_clients", "count of Eudora Pro smtp clients discovered" },
+    { CountType::SUM, "smtp_evolution_clients", "count of Evolution smtp clients discovered" },
+    { CountType::SUM, "smtp_kmail_clients", "count of KMail smtp clients discovered" },
+    { CountType::SUM, "smtp_lotus_notes_clients", "count of Lotus Notes smtp clients discovered" },
+    { CountType::SUM,
+        "smtp_microsoft_outlook_clients", "count of Microsoft Outlook smtp clients discovered" },
+    { CountType::SUM, "smtp_microsoft_outlook_express_clients",
+        "count of Microsoft Outlook Express smtp clients discovered" },
+    { CountType::SUM, "smtp_microsoft_outlook_imo_clients",
+        "count of Microsoft Outlook IMO smtp clients discovered" },
+    { CountType::SUM, "smtp_mutt_clients", "count of Mutt smtp clients discovered" },
+    { CountType::SUM, "smtp_thunderbird_clients", "count of Thunderbird smtp clients discovered" },
+    { CountType::SUM, "smtp_flows", "count of smtp flows discovered" },
+    { CountType::SUM, "smtps_flows", "count of smtps flows discovered" },
+    { CountType::SUM, "snmp_flows", "count of snmp flows discovered" },
+    { CountType::SUM, "ssh_clients", "count of ssh clients discovered" },
+    { CountType::SUM, "ssh_flows", "count of ssh flows discovered" },
+    { CountType::SUM, "ssl_flows", "count of ssl flows discovered" },
+    { CountType::SUM, "telnet_flows", "count of telnet flows discovered" },
+    { CountType::SUM, "tftp_flows", "count of tftp flows discovered" },
+    { CountType::SUM, "timbuktu_clients", "count of timbuktu clients discovered" },
+    { CountType::SUM, "timbuktu_flows", "count of timbuktu flows discovered" },
+    { CountType::SUM, "tns_clients", "count of tns clients discovered" },
+    { CountType::SUM, "tns_flows", "count of tns flows discovered" },
+    { CountType::SUM, "vnc_clients", "count of vnc clients discovered" },
+    { CountType::SUM, "yahoo_messenger_clients", "count of Yahoo Messenger clients discovered" },
+    { CountType::END, nullptr, nullptr }
 };
 
 static const Parameter session_log_filter[] =
index 3b0880dad31a7d3741f6b6929a6654e75eec605c..bc0222561fc716bcbf8c215eabc534d744747ffb 100644 (file)
@@ -125,6 +125,9 @@ public:
 
     const AppIdModuleConfig* get_data();
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 private:
     AppIdModuleConfig* config;
 };
index 964f3379ddfb49bc6dcf0cebeab3e743c60f2b7d..c31cbe74f21d0a4814ad6ddf31c2501bf6a4d2f1 100644 (file)
@@ -210,6 +210,10 @@ public:
     ProfileStats* get_profile() const override
     { return &appidRuleOptionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     AppIdRuleOptionData opt_data;
 };
 
index b806bfa469a7f6dac88d13a7f534e69fa124be20..91cde03e1878fbb9d6fbd53fe85a0871fd3c37de 100644 (file)
@@ -72,6 +72,9 @@ public:
     const RuleMap* get_rules() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     ArpSpoofConfig* config;
     IPMacEntry host;
index 7100fc564219046ee508b785244b04d36532abb5..13ad488e0628db666cbdf69f6d480e92b3b44ced 100644 (file)
@@ -38,12 +38,12 @@ THREAD_LOCAL BindStats bstats;
 
 static const PegInfo bind_pegs[] =
 {
-    { "packets", "initial bindings" },
-    { "resets", "reset bindings" },
-    { "blocks", "block bindings" },
-    { "allows", "allow bindings" },
-    { "inspects", "inspect bindings" },
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "initial bindings" },
+    { CountType::SUM, "resets", "reset bindings" },
+    { CountType::SUM, "blocks", "block bindings" },
+    { CountType::SUM, "allows", "allow bindings" },
+    { CountType::SUM, "inspects", "inspect bindings" },
+    { CountType::END, nullptr, nullptr }
 };
 
 //-------------------------------------------------------------------------
index ad7252298aa4fbfe5f73b3c2ab390f3baac8319c..fd7014f97507be3992f7a7c73687ebb1146a0a13 100644 (file)
@@ -58,6 +58,9 @@ public:
 
     std::vector<Binding*>& get_data();
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     Binding* work;
     std::vector<Binding*> bindings;
index 2f0d4358e091ccceb1f9f933eafa73f8564a172e..d34ccb9c09197dd108cd77d6de0f257c2847ec00 100644 (file)
@@ -60,28 +60,29 @@ enum PegCounts
 
 const PegInfo norm_names[] =
 {
-    { "ip4_trim", "eth packets trimmed to datagram size" },
-    { "ip4_tos", "type of service normalizations" },
-    { "ip4_df", "don't frag bit normalizations" },
-    { "ip4_rf", "reserved flag bit clears" },
-    { "ip4_ttl", "time-to-live normalizations" },
-    { "ip4_opts", "ip4 options cleared" },
-    { "icmp4_echo", "icmp4 ping normalizations" },
-    { "ip6_hops", "ip6 hop limit normalizations" },
-    { "ip6_options", "ip6 options cleared" },
-    { "icmp6_echo", "icmp6 echo normalizations" },
-    { "tcp_syn_options", "SYN only options cleared from non-SYN packets" },
-    { "tcp_options", "packets with options cleared" },
-    { "tcp_padding", "packets with padding cleared" },
-    { "tcp_reserved", "packets with reserved bits cleared" },
-    { "tcp_nonce", "packets with nonce bit cleared" },
-    { "tcp_urgent_ptr", "packets without data with urgent pointer cleared" },
-    { "tcp_ecn_pkt", "packets with ECN bits cleared" },
-    { "tcp_ts_ecr", "timestamp cleared on non-ACKs" },
-    { "tcp_req_urg", "cleared urgent pointer when urgent flag is not set" },
-    { "tcp_req_pay", "cleared urgent pointer and urgent flag when there is no payload" },
-    { "tcp_req_urp", "cleared the urgent flag if the urgent pointer is not set" },
-    { nullptr, nullptr }
+    { CountType::SUM, "ip4_trim", "eth packets trimmed to datagram size" },
+    { CountType::SUM, "ip4_tos", "type of service normalizations" },
+    { CountType::SUM, "ip4_df", "don't frag bit normalizations" },
+    { CountType::SUM, "ip4_rf", "reserved flag bit clears" },
+    { CountType::SUM, "ip4_ttl", "time-to-live normalizations" },
+    { CountType::SUM, "ip4_opts", "ip4 options cleared" },
+    { CountType::SUM, "icmp4_echo", "icmp4 ping normalizations" },
+    { CountType::SUM, "ip6_hops", "ip6 hop limit normalizations" },
+    { CountType::SUM, "ip6_options", "ip6 options cleared" },
+    { CountType::SUM, "icmp6_echo", "icmp6 echo normalizations" },
+    { CountType::SUM, "tcp_syn_options", "SYN only options cleared from non-SYN packets" },
+    { CountType::SUM, "tcp_options", "packets with options cleared" },
+    { CountType::SUM, "tcp_padding", "packets with padding cleared" },
+    { CountType::SUM, "tcp_reserved", "packets with reserved bits cleared" },
+    { CountType::SUM, "tcp_nonce", "packets with nonce bit cleared" },
+    { CountType::SUM, "tcp_urgent_ptr", "packets without data with urgent pointer cleared" },
+    { CountType::SUM, "tcp_ecn_pkt", "packets with ECN bits cleared" },
+    { CountType::SUM, "tcp_ts_ecr", "timestamp cleared on non-ACKs" },
+    { CountType::SUM, "tcp_req_urg", "cleared urgent pointer when urgent flag is not set" },
+    { CountType::SUM, "tcp_req_pay",
+        "cleared urgent pointer and urgent flag when there is no payload" },
+    { CountType::SUM, "tcp_req_urp", "cleared the urgent flag if the urgent pointer is not set" },
+    { CountType::END, nullptr, nullptr }
 };
 
 static THREAD_LOCAL PegCount normStats[PC_MAX+PC_TCP_MAX][NORM_MODE_MAX];
index 2d746aad2a3ca50f63720a40cc5662b94d341994..5abb3504e0f7e92fea01cdc13c70ed123fcf379f 100644 (file)
@@ -387,6 +387,7 @@ void NormalizeModule::add_test_peg(const PegInfo& norm) const
     test_text.push_back(test_info);
     test.help = test_text.back()->c_str();
 
+    test.type = norm.type;
     test_pegs.push_back(test);
 }
 
index 97ac12709055cd592d87f5a68d58824c9fdb591b..d334c487c03f0faec5e4defd4eeb97946bec7008 100644 (file)
@@ -46,6 +46,9 @@ public:
     const NormalizerConfig* get_config()
     { return &config; }
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     bool set_ip4(const char*, Value&, SnortConfig*);
     bool set_tcp(const char*, Value&, SnortConfig*);
index e09b5723de5e8819d51c14ad165b4780111b49a5..6be2aaa93133872b6d11614373bad9db7f01cf9b 100644 (file)
@@ -37,9 +37,9 @@ static int disable(lua_State*);
 
 const PegInfo cap_names[] =
 {
-    { "processed", "packets processed against filter" },
-    { "captured", "packets matching dumped after matching filter" },
-    { nullptr, nullptr }
+    { CountType::SUM, "processed", "packets processed against filter" },
+    { CountType::SUM, "captured", "packets matching dumped after matching filter" },
+    { CountType::END, nullptr, nullptr }
 };
 
 static const Parameter s_capture[] =
index a62568e1c68efae08a8c510e76f0b62302387c58..da648c346f62f2866d34d36537fe80ce71c58637 100644 (file)
@@ -51,6 +51,9 @@ public:
 
     void get_config(CaptureConfig&);
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 private:
     CaptureConfig config;
 };
index a473857f032e6ed34c03c2a268d13286a8902bcb..a33f8e01ef4836e0e8ac67efdd2d5c0afc512e8c 100644 (file)
@@ -79,17 +79,20 @@ public:
 
     void real_sum_stats() { Module::sum_stats(false); }
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     PegCount* counts;
 
     PegInfo pegs[6] =
     {
-        { "zero", ""},
-        { "one", ""},
-        { "two", ""},
-        { "three", ""},
-        { "four", ""},
-        { nullptr, nullptr }
+        { CountType::SUM, "zero", ""},
+        { CountType::SUM, "one", ""},
+        { CountType::SUM, "two", ""},
+        { CountType::SUM, "three", ""},
+        { CountType::SUM, "four", ""},
+        { CountType::END, nullptr, nullptr }
     };
 };
 
index c1319249cc3b027040d6a06ab304131bf407284b..c7c1600d28070dada4bda290754281b1f73400ea 100644 (file)
@@ -89,6 +89,9 @@ public:
 
     void get_config(PerfConfig&);
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 private:
     PerfConfig config;
 
index 74b9817c74d0b0a16ca30be5426d27fb86e2bdb9..ed930792e7a87e5d3455174c123b6e176ad4a2e9 100644 (file)
@@ -154,6 +154,9 @@ public:
 
     PortscanConfig* get_data();
 
+    Usage get_usage() const override
+    { return CONTEXT; }
+
 private:
     PS_ALERT_CONF* get_alert_conf(const char* fqn);
 
index 36d1c97623fd46a5f2b07f669091ee9ff81390c5..59b4c83e2556b1dbb5ecb288974dbbe5b8b32796 100644 (file)
@@ -39,13 +39,13 @@ THREAD_LOCAL ReputationStats reputationstats;
 
 const PegInfo reputation_peg_names[] =
 {
-    { "packets", "total packets processed" },
-    { "blacklisted", "number of packets blacklisted" },
-    { "whitelisted", "number of packets whitelisted" },
-    { "monitored", "number of packets monitored" },
-    { "memory_allocated", "total memory allocated" },
+    { CountType::SUM, "packets", "total packets processed" },
+    { CountType::SUM, "blacklisted", "number of packets blacklisted" },
+    { CountType::SUM, "whitelisted", "number of packets whitelisted" },
+    { CountType::SUM, "monitored", "number of packets monitored" },
+    { CountType::SUM, "memory_allocated", "total memory allocated" },
 
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
 const char* NestedIPKeyword[] =
index b06df91a899815c8467f273c86976041b463eec7..277b08e7983b3700135e186fbd500a37ac255cb2 100644 (file)
@@ -61,6 +61,9 @@ public:
 
     ReputationConfig* get_data();
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     ReputationConfig* conf;
 };
index e4175125d9d699b9344f5e44899acb004b4dd532..90b8e9ceeba221ed3c47990c187f78aa4d9de450 100644 (file)
@@ -39,6 +39,10 @@ public:
 
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
+
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     SFDAQConfig* config;
     SFDAQInstanceConfig* instance_config;
index d5c0727aaf99262b01704a9589bd54e9ff33e9d4..0906523e4b2784952874b6ebba606f0089ba9bd0 100644 (file)
@@ -190,6 +190,9 @@ public:
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
+
+    Usage get_usage() const override
+    { return INSPECT; }
 };
 
 const PegInfo* BoModule::get_pegs() const
index e35168f85d11892953ee1b488dbf998f85e584bc..586f0c1c484ba71653304a13bcc4abc04728c90e 100644 (file)
@@ -26,9 +26,9 @@
 
 static const PegInfo dce_http_proxy_pegs[] =
 {
-    { "http_proxy_sessions", "successful http proxy sessions" },
-    { "http_proxy_session_failures", "failed http proxy sessions" },
-    { nullptr, nullptr }
+    { CountType::SUM, "http_proxy_sessions", "successful http proxy sessions" },
+    { CountType::SUM, "http_proxy_session_failures", "failed http proxy sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
 DceHttpProxyModule::DceHttpProxyModule() : Module(DCE_HTTP_PROXY_NAME, DCE_HTTP_PROXY_HELP)
index bd9a9e3afc806aa3474234b2f96953d384b2bc97..4369b7aba1c10cf363cce692d397deca5376aa62 100644 (file)
@@ -40,6 +40,9 @@ public:
 
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
+
+    Usage get_usage() const override
+    { return INSPECT; }
 };
 
 #define DCE_HTTP_PROXY_NAME "dce_http_proxy"
index 1047f406ca3cef7ff5f9131e59d9d413688439ca..7c8e59c16d7c8a1357701a88b8be22aac744dabb 100644 (file)
@@ -26,9 +26,9 @@
 
 static const PegInfo dce_http_server_pegs[] =
 {
-    { "http_server_sessions", "successful http server sessions" },
-    { "http_server_session_failures", "failed http server sessions" },
-    { nullptr, nullptr }
+    { CountType::SUM, "http_server_sessions", "successful http server sessions" },
+    { CountType::SUM, "http_server_session_failures", "failed http server sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
 DceHttpServerModule::DceHttpServerModule() : Module(DCE_HTTP_SERVER_NAME, DCE_HTTP_SERVER_HELP)
index 9f64626354c0c08bcf055dfecdfd0b309f4f3c90..3ff8fccb188a13eeb6440c1aafe56543a0439797 100644 (file)
@@ -40,6 +40,9 @@ public:
 
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
+
+    Usage get_usage() const override
+    { return INSPECT; }
 };
 
 #define DCE_HTTP_SERVER_NAME "dce_http_server"
index 6db0c3e41d6960697200b380a8fc5afd0f7f6786..4e944a751a7f1e6dadf389a88e292ad58cf15c34 100644 (file)
@@ -34,55 +34,66 @@ using namespace std;
 
 static const PegInfo dce2_smb_pegs[] =
 {
-    { "events", "total events" },
-    { "pdus", "total connection-oriented PDUs" },
-    { "binds", "total connection-oriented binds" },
-    { "bind_acks", "total connection-oriented binds acks" },
-    { "alter_contexts", "total connection-oriented alter contexts" },
-    { "alter_context_responses", "total connection-oriented alter context responses" },
-    { "bind_naks", "total connection-oriented bind naks" },
-    { "requests", "total connection-oriented requests" },
-    { "responses", "total connection-oriented responses" },
-    { "cancels", "total connection-oriented cancels" },
-    { "orphaned", "total connection-oriented orphaned" },
-    { "faults", "total connection-oriented faults" },
-    { "auth3s", "total connection-oriented auth3s" },
-    { "shutdowns", "total connection-oriented shutdowns" },
-    { "rejects", "total connection-oriented rejects" },
-    { "ms_rpc_http_pdus", "total connection-oriented MS requests to send RPC over HTTP" },
-    { "other_requests", "total connection-oriented other requests" },
-    { "other_responses", "total connection-oriented other responses" },
-    { "request_fragments", "total connection-oriented request fragments" },
-    { "response_fragments", "total connection-oriented response fragments" },
-    { "client_max_fragment_size", "connection-oriented client maximum fragment size" },
-    { "client_min_fragment_size", "connection-oriented client minimum fragment size" },
-    { "client_segs_reassembled", "total connection-oriented client segments reassembled" },
-    { "client_frags_reassembled", "total connection-oriented client fragments reassembled" },
-    { "server_max_fragment_size", "connection-oriented server maximum fragment size" },
-    { "server_min_fragment_size", "connection-oriented server minimum fragment size" },
-    { "server_segs_reassembled", "total connection-oriented server segments reassembled" },
-    { "server_frags_reassembled", "total connection-oriented server fragments reassembled" },
-    { "sessions", "total smb sessions" },
-    { "packets", "total smb packets" },
-    { "ignored_bytes", "total ignored bytes" },
-    { "smb_client_segs_reassembled", "total smb client segments reassembled" },
-    { "smb_server_segs_reassembled", "total smb server segments reassembled" },
-    { "max_outstanding_requests", "total smb maximum outstanding requests" },
-    { "files_processed", "total smb files processed" },
-    { "smbv2_create", "total number of SMBv2 create packets seen" },
-    { "smbv2_write", "total number of SMBv2 write packets seen" },
-    { "smbv2_read", "total number of SMBv2 read packets seen" },
-    { "smbv2_set_info", "total number of SMBv2 set info packets seen" },
-    { "smbv2_tree_connect", "total number of SMBv2 tree connect packets seen" },
-    { "smbv2_tree_disconnect", "total number of SMBv2 tree disconnect packets seen" },
-    { "smbv2_close", "total number of SMBv2 close packets seen" },
-    { "concurrent_sessions", "total concurrent sessions" },
-    { "max_concurrent_sessions", "maximum concurrent sessions" },
-    { nullptr, nullptr }
+    { CountType::SUM, "events", "total events" },
+    { CountType::SUM, "pdus", "total connection-oriented PDUs" },
+    { CountType::SUM, "binds", "total connection-oriented binds" },
+    { CountType::SUM, "bind_acks", "total connection-oriented binds acks" },
+    { CountType::SUM, "alter_contexts", "total connection-oriented alter contexts" },
+    { CountType::SUM, "alter_context_responses",
+        "total connection-oriented alter context responses" },
+    { CountType::SUM, "bind_naks", "total connection-oriented bind naks" },
+    { CountType::SUM, "requests", "total connection-oriented requests" },
+    { CountType::SUM, "responses", "total connection-oriented responses" },
+    { CountType::SUM, "cancels", "total connection-oriented cancels" },
+    { CountType::SUM, "orphaned", "total connection-oriented orphaned" },
+    { CountType::SUM, "faults", "total connection-oriented faults" },
+    { CountType::SUM, "auth3s", "total connection-oriented auth3s" },
+    { CountType::SUM, "shutdowns", "total connection-oriented shutdowns" },
+    { CountType::SUM, "rejects", "total connection-oriented rejects" },
+    { CountType::SUM, "ms_rpc_http_pdus",
+        "total connection-oriented MS requests to send RPC over HTTP" },
+    { CountType::SUM, "other_requests", "total connection-oriented other requests" },
+    { CountType::SUM, "other_responses", "total connection-oriented other responses" },
+    { CountType::SUM, "request_fragments", "total connection-oriented request fragments" },
+    { CountType::SUM, "response_fragments", "total connection-oriented response fragments" },
+    { CountType::SUM, "client_max_fragment_size",
+        "connection-oriented client maximum fragment size" },
+    { CountType::SUM, "client_min_fragment_size",
+        "connection-oriented client minimum fragment size" },
+    { CountType::SUM, "client_segs_reassembled",
+        "total connection-oriented client segments reassembled" },
+    { CountType::SUM, "client_frags_reassembled",
+        "total connection-oriented client fragments reassembled" },
+    { CountType::SUM, "server_max_fragment_size",
+        "connection-oriented server maximum fragment size" },
+    { CountType::SUM, "server_min_fragment_size",
+        "connection-oriented server minimum fragment size" },
+    { CountType::SUM, "server_segs_reassembled",
+        "total connection-oriented server segments reassembled" },
+    { CountType::SUM, "server_frags_reassembled",
+        "total connection-oriented server fragments reassembled" },
+    { CountType::SUM, "sessions", "total smb sessions" },
+    { CountType::SUM, "packets", "total smb packets" },
+    { CountType::SUM, "ignored_bytes", "total ignored bytes" },
+    { CountType::SUM, "smb_client_segs_reassembled", "total smb client segments reassembled" },
+    { CountType::SUM, "smb_server_segs_reassembled", "total smb server segments reassembled" },
+    { CountType::SUM, "max_outstanding_requests", "total smb maximum outstanding requests" },
+    { CountType::SUM, "files_processed", "total smb files processed" },
+    { CountType::SUM, "smbv2_create", "total number of SMBv2 create packets seen" },
+    { CountType::SUM, "smbv2_write", "total number of SMBv2 write packets seen" },
+    { CountType::SUM, "smbv2_read", "total number of SMBv2 read packets seen" },
+    { CountType::SUM, "smbv2_set_info", "total number of SMBv2 set info packets seen" },
+    { CountType::SUM, "smbv2_tree_connect", "total number of SMBv2 tree connect packets seen" },
+    { CountType::SUM, "smbv2_tree_disconnect",
+        "total number of SMBv2 tree disconnect packets seen" },
+    { CountType::SUM, "smbv2_close", "total number of SMBv2 close packets seen" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
-static const char* dce2SmbFingerprintPolicyStrings[] = { "Disabled", "Client","Server",
-                                                         "Client and Server" };
+static const char* dce2SmbFingerprintPolicyStrings[] =
+{ "Disabled", "Client","Server", "Client and Server" };
 
 static const Parameter s_params[] =
 {
index 7f9c7f19003d5afff236c4500bc21a53459036b1..f5735c4a7a8baa04da18a1c20f47a240071675e2 100644 (file)
@@ -75,9 +75,7 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
 
     unsigned get_gid() const override
-    {
-        return GID_DCE2;
-    }
+    { return GID_DCE2; }
 
     const RuleMap* get_rules() const override;
     const PegInfo* get_pegs() const override;
@@ -85,6 +83,9 @@ public:
     ProfileStats* get_profile(unsigned, const char*&, const char*&) const override;
     void get_data(dce2SmbProtoConf&);
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     dce2SmbProtoConf config;
 };
index 883f5c49dcd055ab8a6ba473b6ac324d1a36a79b..2587c1b7c3065f59920eb106bcfaf2b388c5d7ff 100644 (file)
@@ -64,39 +64,49 @@ static const RuleMap dce2_tcp_rules[] =
 
 static const PegInfo dce2_tcp_pegs[] =
 {
-    { "events", "total events" },
-    { "pdus", "total connection-oriented PDUs" },
-    { "binds", "total connection-oriented binds" },
-    { "bind_acks", "total connection-oriented binds acks" },
-    { "alter_contexts", "total connection-oriented alter contexts" },
-    { "alter_context_responses", "total connection-oriented alter context responses" },
-    { "bind_naks", "total connection-oriented bind naks" },
-    { "requests", "total connection-oriented requests" },
-    { "responses", "total connection-oriented responses" },
-    { "cancels", "total connection-oriented cancels" },
-    { "orphaned", "total connection-oriented orphaned" },
-    { "faults", "total connection-oriented faults" },
-    { "auth3s", "total connection-oriented auth3s" },
-    { "shutdowns", "total connection-oriented shutdowns" },
-    { "rejects", "total connection-oriented rejects" },
-    { "ms_rpc_http_pdus", "total connection-oriented MS requests to send RPC over HTTP" },
-    { "other_requests", "total connection-oriented other requests" },
-    { "other_responses", "total connection-oriented other responses" },
-    { "request_fragments", "total connection-oriented request fragments" },
-    { "response_fragments", "total connection-oriented response fragments" },
-    { "client_max_fragment_size", "connection-oriented client maximum fragment size" },
-    { "client_min_fragment_size", "connection-oriented client minimum fragment size" },
-    { "client_segs_reassembled", "total connection-oriented client segments reassembled" },
-    { "client_frags_reassembled", "total connection-oriented client fragments reassembled" },
-    { "server_max_fragment_size", "connection-oriented server maximum fragment size" },
-    { "server_min_fragment_size", "connection-oriented server minimum fragment size" },
-    { "server_segs_reassembled", "total connection-oriented server segments reassembled" },
-    { "server_frags_reassembled", "total connection-oriented server fragments reassembled" },
-    { "tcp_sessions", "total tcp sessions" },
-    { "tcp_packets", "total tcp packets" },
-    { "concurrent_sessions", "total concurrent sessions" },
-    { "max_concurrent_sessions", "maximum concurrent sessions" },
-    { nullptr, nullptr }
+    { CountType::SUM, "events", "total events" },
+    { CountType::SUM, "pdus", "total connection-oriented PDUs" },
+    { CountType::SUM, "binds", "total connection-oriented binds" },
+    { CountType::SUM, "bind_acks", "total connection-oriented binds acks" },
+    { CountType::SUM, "alter_contexts", "total connection-oriented alter contexts" },
+    { CountType::SUM, "alter_context_responses",
+        "total connection-oriented alter context responses" },
+    { CountType::SUM, "bind_naks", "total connection-oriented bind naks" },
+    { CountType::SUM, "requests", "total connection-oriented requests" },
+    { CountType::SUM, "responses", "total connection-oriented responses" },
+    { CountType::SUM, "cancels", "total connection-oriented cancels" },
+    { CountType::SUM, "orphaned", "total connection-oriented orphaned" },
+    { CountType::SUM, "faults", "total connection-oriented faults" },
+    { CountType::SUM, "auth3s", "total connection-oriented auth3s" },
+    { CountType::SUM, "shutdowns", "total connection-oriented shutdowns" },
+    { CountType::SUM, "rejects", "total connection-oriented rejects" },
+    { CountType::SUM, "ms_rpc_http_pdus",
+        "total connection-oriented MS requests to send RPC over HTTP" },
+    { CountType::SUM, "other_requests", "total connection-oriented other requests" },
+    { CountType::SUM, "other_responses", "total connection-oriented other responses" },
+    { CountType::SUM, "request_fragments", "total connection-oriented request fragments" },
+    { CountType::SUM, "response_fragments", "total connection-oriented response fragments" },
+    { CountType::SUM, "client_max_fragment_size",
+        "connection-oriented client maximum fragment size" },
+    { CountType::SUM, "client_min_fragment_size",
+        "connection-oriented client minimum fragment size" },
+    { CountType::SUM, "client_segs_reassembled",
+        "total connection-oriented client segments reassembled" },
+    { CountType::SUM, "client_frags_reassembled",
+        "total connection-oriented client fragments reassembled" },
+    { CountType::SUM, "server_max_fragment_size",
+        "connection-oriented server maximum fragment size" },
+    { CountType::SUM, "server_min_fragment_size",
+        "connection-oriented server minimum fragment size" },
+    { CountType::SUM, "server_segs_reassembled",
+        "total connection-oriented server segments reassembled" },
+    { CountType::SUM, "server_frags_reassembled",
+        "total connection-oriented server fragments reassembled" },
+    { CountType::SUM, "tcp_sessions", "total tcp sessions" },
+    { CountType::SUM, "tcp_packets", "total tcp packets" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
 Dce2TcpModule::Dce2TcpModule() : Module(DCE2_TCP_NAME, DCE2_TCP_HELP, s_params)
index 7f6282cf82013bd2b29702fab838c3013082099b..79ede66e84a10934ca74da4dc9f9b71c3bb19955 100644 (file)
@@ -39,9 +39,7 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
 
     unsigned get_gid() const override
-    {
-        return GID_DCE2;
-    }
+    { return GID_DCE2; }
 
     const RuleMap* get_rules() const override;
     const PegInfo* get_pegs() const override;
@@ -49,6 +47,9 @@ public:
     ProfileStats* get_profile(unsigned, const char*&, const char*&) const override;
     void get_data(dce2TcpProtoConf&);
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     dce2TcpProtoConf config;
 };
index 95b8165ebff4ae5b298d20fd2fbcead87ce9b341..0dbf31bde793454e17d0b40acdb46179c7eff4b9 100644 (file)
@@ -50,30 +50,30 @@ static const RuleMap dce2_udp_rules[] =
 
 static const PegInfo dce2_udp_pegs[] =
 {
-    { "events", "total events" },
-    { "udp_sessions", "total udp sessions" },
-    { "udp_packets", "total udp packets" },
-    { "requests", "total connection-less requests" },
-    { "acks", "total connection-less acks" },
-    { "cancels", "total connection-less cancels" },
-    { "client_facks", "total connection-less client facks" },
-    { "ping", "total connection-less ping" },
-    { "responses", "total connection-less responses" },
-    { "rejects", "total connection-less rejects" },
-    { "cancel_acks", "total connection-less cancel acks" },
-    { "server_facks", "total connection-less server facks" },
-    { "faults", "total connection-less faults" },
-    { "no_calls", "total connection-less no calls" },
-    { "working", "total connection-less working" },
-    { "other_requests", "total connection-less other requests" },
-    { "other_responses", "total connection-less other responses" },
-    { "fragments", "total connection-less fragments" },
-    { "max_fragment_size", "connection-less maximum fragment size" },
-    { "frags_reassembled", "total connection-less fragments reassembled" },
-    { "max_seqnum", "max connection-less seqnum" },
-    { "concurrent_sessions", "total concurrent sessions" },
-    { "max_concurrent_sessions", "maximum concurrent sessions" },
-    { nullptr, nullptr }
+    { CountType::SUM, "events", "total events" },
+    { CountType::SUM, "udp_sessions", "total udp sessions" },
+    { CountType::SUM, "udp_packets", "total udp packets" },
+    { CountType::SUM, "requests", "total connection-less requests" },
+    { CountType::SUM, "acks", "total connection-less acks" },
+    { CountType::SUM, "cancels", "total connection-less cancels" },
+    { CountType::SUM, "client_facks", "total connection-less client facks" },
+    { CountType::SUM, "ping", "total connection-less ping" },
+    { CountType::SUM, "responses", "total connection-less responses" },
+    { CountType::SUM, "rejects", "total connection-less rejects" },
+    { CountType::SUM, "cancel_acks", "total connection-less cancel acks" },
+    { CountType::SUM, "server_facks", "total connection-less server facks" },
+    { CountType::SUM, "faults", "total connection-less faults" },
+    { CountType::SUM, "no_calls", "total connection-less no calls" },
+    { CountType::SUM, "working", "total connection-less working" },
+    { CountType::SUM, "other_requests", "total connection-less other requests" },
+    { CountType::SUM, "other_responses", "total connection-less other responses" },
+    { CountType::SUM, "fragments", "total connection-less fragments" },
+    { CountType::SUM, "max_fragment_size", "connection-less maximum fragment size" },
+    { CountType::SUM, "frags_reassembled", "total connection-less fragments reassembled" },
+    { CountType::SUM, "max_seqnum", "max connection-less seqnum" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
 Dce2UdpModule::Dce2UdpModule() : Module(DCE2_UDP_NAME, DCE2_UDP_HELP, s_params)
index f55972ddaf607ef0a97a0901f7be083db4cad239..eedb8986b19631cb9f1a54b38cc667e6a43d52a7 100644 (file)
@@ -49,9 +49,7 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
 
     unsigned get_gid() const override
-    {
-        return GID_DCE2;
-    }
+    { return GID_DCE2; }
 
     const RuleMap* get_rules() const override;
     const PegInfo* get_pegs() const override;
@@ -59,6 +57,9 @@ public:
     ProfileStats* get_profile(unsigned, const char*&, const char*&) const override;
     void get_data(dce2UdpProtoConf&);
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     dce2UdpProtoConf config;
 };
index 35bcdb544efe3f635e1272849965d0d6613561ff..0c6cd380fd280c5e43b3b29197c6b4d1f1ad96fb 100644 (file)
@@ -443,6 +443,10 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck version;
     bool any_frag;
     Uuid uuid;
index bc105acdc93e759ff3a193975783013313e7bdf5..7d664e088fa78d0325d163739f71226fd32c4a86 100644 (file)
@@ -467,6 +467,10 @@ public:
     ProfileStats* get_profile() const override;
     ~Dce2OpnumModule();
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     DCE2_Opnum opnum;
 };
 
index 5cd5851b138c0c91c423b26a9f6f65c91c8bb69e..7bb9e747269fb392e5c4637ad397340473ec9475 100644 (file)
@@ -105,6 +105,9 @@ class Dce2StubDataModule : public Module
 public:
     Dce2StubDataModule() : Module(s_name, s_help) { }
     ProfileStats* get_profile() const override;
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 ProfileStats* Dce2StubDataModule::get_profile() const
index 19904161e97eba51418060033475dc69502be083..0cf1c04fa37c5a46680e1a66e906c02af185ddf4 100644 (file)
@@ -51,15 +51,14 @@ static const RuleMap dnp3_rules[] =
 
 static const PegInfo dnp3_pegs[] =
 {
-    { "total_packets", "total packets" },
-    { "udp_packets", "total udp packets" },
-    { "tcp_pdus", "total tcp pdus" },
-    { "dnp3_link_layer_frames", "total dnp3 link layer frames" },
-    { "dnp3_application_pdus", "total dnp3 application pdus" },
-    { "concurrent_sessions", "total concurrent dnp3 sessions" },
-    { "max_concurrent_sessions", "maximum concurrent dnp3 sessions" },
-
-    { nullptr, nullptr }
+    { CountType::SUM, "total_packets", "total packets" },
+    { CountType::SUM, "udp_packets", "total udp packets" },
+    { CountType::SUM, "tcp_pdus", "total tcp pdus" },
+    { CountType::SUM, "dnp3_link_layer_frames", "total dnp3 link layer frames" },
+    { CountType::SUM, "dnp3_application_pdus", "total dnp3 application pdus" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent dnp3 sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent dnp3 sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
 Dnp3Module::Dnp3Module() : Module(DNP3_NAME, DNP3_HELP, s_params)
index 9f8582409e737cd7437cb17a9fe8ada65b5187b7..bee14cdb0d032ec9ecbacb337dbfd82e076393af 100644 (file)
@@ -39,15 +39,16 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
 
     unsigned get_gid() const override
-    {
-        return GID_DNP3;
-    }
+    { return GID_DNP3; }
 
     const RuleMap* get_rules() const override;
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
     void get_data(dnp3ProtoConf&);
 
 private:
index d780387079263fa45717b1d431eebc7bdcb6939b..8a641e1a8d64e1f7d9027a0e4e7a385a47e7ce74 100644 (file)
@@ -107,6 +107,9 @@ class Dnp3DataModule : public Module
 public:
     Dnp3DataModule() : Module(s_name, s_help) { }
     ProfileStats* get_profile() const override;
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 ProfileStats* Dnp3DataModule::get_profile() const
index 6c24b06b73220785fccf717f6c725848290ecbfd..93beb752771e91ed06c554cc4243a2980fd16885 100644 (file)
@@ -125,6 +125,10 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     uint16_t func;
 };
 
index 8923909c891aeb887c2083ca6683457f9bd31220..a732941932229a30b2f42ef2ebc474dbceda32cc 100644 (file)
@@ -127,6 +127,10 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     uint16_t flags;
 };
 
index 591d477a1846331d1cdb211128fb66640408953e..3b9fa9b178de659e5217b10ba1377c0fa6b9acdc 100644 (file)
@@ -169,6 +169,10 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     uint8_t group;
     uint8_t var;
 };
index b283c70bfbef364552cd49165ca14f010cf0ab2e..fe00ec09bca79d0310bfd05853d15b86110f3f84 100644 (file)
@@ -43,17 +43,15 @@ THREAD_LOCAL DnsStats dnsstats;
 
 const PegInfo dns_peg_names[] =
 {
-    { "packets", "total packets processed" },
-    { "requests", "total dns requests" },
-    { "responses", "total dns responses" },
-    { "concurrent_sessions", "total concurrent dns sessions" },
-    { "max_concurrent_sessions", "maximum concurrent dns sessions" },
+    { CountType::SUM, "packets", "total packets processed" },
+    { CountType::SUM, "requests", "total dns requests" },
+    { CountType::SUM, "responses", "total dns responses" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent dns sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent dns sessions" },
 
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
-
-
 /*
  * Function prototype(s)
  */
index d8e7c8b5712bbcb37c38a5c855bcb88838bdd6f8..19b72cfae5633306b10f2c18b0553dd4576396aa 100644 (file)
@@ -65,6 +65,9 @@ public:
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
+
+    Usage get_usage() const override
+    { return INSPECT; }
 };
 
 #endif
index 090e154f5994b3eeb0b8d97e9e84e073dd0b1955..0410cca4fe24b8ecbbe670a8ce7c0c11b3e62b56 100644 (file)
@@ -250,6 +250,9 @@ public:
 
     bool set(const char*, Value&, SnortConfig*) override
     { return false; }
+
+    Usage get_usage() const override
+    { return INSPECT; }
 };
 
 const PegInfo* FtpDataModule::get_pegs() const
index 5401022ed9526949d3bf829d2b50ec28ec872a26..035364957cb8eb5003f4b1301f14756a51f60bd1 100644 (file)
@@ -337,11 +337,11 @@ static const RuleMap ftp_server_rules[] =
 
 static const PegInfo ftp_pegs[] =
 {
-    { "total_packets", "total packets" },
-    { "concurrent_sessions", "total concurrent ftp sessions" },
-    { "max_concurrent_sessions", "maximum concurrent ftp sessions" },
+    { CountType::SUM, "total_packets", "total packets" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent ftp sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent ftp sessions" },
 
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
 //-------------------------------------------------------------------------
index 94f37556836a458e43cec5544a6f32e191a9efaf..35fb8abc410ab9534cc97438f64bdf66841bdb28 100644 (file)
@@ -66,6 +66,9 @@ public:
     FTP_CLIENT_PROTO_CONF* get_data();
     const BounceTo* get_bounce(unsigned idx);
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     FTP_CLIENT_PROTO_CONF* conf;
     std::vector<BounceTo*> bounce_to;
index 934f000640aa0e7564ba6071e36dd1ad8c05e926..02ff5619657b1ddfbf61ad30685858efb6d3d778 100644 (file)
@@ -58,11 +58,11 @@ static const Parameter s_params[] =
 
 static const PegInfo telnet_pegs[] =
 {
-    { "total_packets", "total packets" },
-    { "concurrent_sessions", "total concurrent telnet sessions" },
-    { "max_concurrent_sessions", "maximum concurrent telnet sessions" },
+    { CountType::SUM, "total_packets", "total packets" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent telnet sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent telnet sessions" },
 
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
 static const RuleMap telnet_rules[] =
index ebe2436724925f700661ee43ba4ab945dec058fa..983c2dc3b404550605ea718696bf6163026f9e2e 100644 (file)
@@ -57,6 +57,9 @@ public:
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
     TELNET_PROTO_CONF* get_data();
 
 private:
index cbcac2efb93b80e0c3fbf5083469cc745e7c1b9f..9c84cfa79027a3e5254002f1fa30d93c18161983 100644 (file)
@@ -42,14 +42,14 @@ THREAD_LOCAL ProfileStats gtp_inspect_prof;
 
 const PegInfo peg_names[] =
 {
-    { "sessions", "total sessions processed" },
-    { "concurrent_sessions", "total concurrent gtp sessions" },
-    { "max_concurrent_sessions", "maximum concurrent gtp sessions" },
-    { "events", "requests" },
-    { "unknown_types", "unknown message types" },
-    { "unknown_infos", "unknown information elements" },
-
-    { nullptr, nullptr }
+    { CountType::SUM, "sessions", "total sessions processed" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent gtp sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent gtp sessions" },
+    { CountType::SUM, "events", "requests" },
+    { CountType::SUM, "unknown_types", "unknown message types" },
+    { CountType::SUM, "unknown_infos", "unknown information elements" },
+
+    { CountType::END, nullptr, nullptr }
 };
 
 const PegInfo* GtpInspectModule::get_pegs() const
index 38cd225f55bf9c7822753f1d3f7c88f925069869..daa7089ed838a89e824e8d781a0d7a2dbbe31ae8 100644 (file)
@@ -62,6 +62,9 @@ public:
     ProfileStats* get_profile() const override
     { return &gtp_inspect_prof; }
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 public:
     GtpStuff stuff;
     std::vector<GtpStuff> temp;
index 8a2d53497c2a959175bee263c58d42b3c027b509..10af186119efeda0627205eef20752b6569ca032 100644 (file)
@@ -154,6 +154,10 @@ public:
     ProfileStats* get_profile() const override
     { return &gtp_info_prof; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     uint8_t types[MAX_GTP_VERSION_CODE + 1];
 };
 
index 408e5f4106795ccdb75801e0afe82c560469a041..aec4dae8d64c1cb3a3fb52ffb878617a3bf6a435 100644 (file)
@@ -144,6 +144,10 @@ public:
     ProfileStats* get_profile() const override
     { return &gtp_type_prof; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     ByteBitSet types[MAX_GTP_VERSION_CODE + 1];
 };
 
index b737dd1a998eb68dec63abc260567f73cb9e428c..5ccc4b63ea2f9e1a3088822d749c4b734deef7ae 100644 (file)
@@ -115,6 +115,10 @@ public:
     ProfileStats* get_profile() const override
     { return &gtp_ver_prof; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     uint8_t version;
 };
 
index 48f4b71f59af3bbfd1d57b9c500a03da31fe5789..4b212f542d69ca6a0cba14cd2e3ab9803280dd5b 100644 (file)
@@ -110,6 +110,9 @@ public:
     static PegCount get_peg_counts(HttpEnums::PEG_COUNT counter)
         { return peg_counts[counter]; }
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 #ifdef REG_TEST
     static const PegInfo* get_peg_names() { return peg_names; }
     static const PegCount* get_peg_counts() { return peg_counts; }
index 68c52af0db1643311533b3eb0c061319fbf4360d..b203f91de4296e23cc9ced27246c7a38f254c1c9 100644 (file)
@@ -383,29 +383,29 @@ const RuleMap HttpModule::http_events[] =
 
 const PegInfo HttpModule::peg_names[PEG_COUNT_MAX+1] =
 {
-    { "flows", "HTTP connections inspected" },
-    { "scans", "TCP segments scanned looking for HTTP messages" },
-    { "reassembles", "TCP segments combined into HTTP messages" },
-    { "inspections", "total message sections inspected" },
-    { "requests", "HTTP request messages inspected" },
-    { "responses", "HTTP response messages inspected" },
-    { "get_requests", "GET requests inspected" },
-    { "head_requests", "HEAD requests inspected" },
-    { "post_requests", "POST requests inspected" },
-    { "put_requests", "PUT requests inspected" },
-    { "delete_requests", "DELETE requests inspected" },
-    { "connect_requests", "CONNECT requests inspected" },
-    { "options_requests", "OPTIONS requests inspected" },
-    { "trace_requests", "TRACE requests inspected" },
-    { "other_requests", "other request methods inspected" },
-    { "request_bodies", "POST, PUT, and other requests with message bodies" },
-    { "chunked", "chunked message bodies" },
-    { "uri_normalizations", "URIs needing to be normalization" },
-    { "uri_path", "URIs with path problems" },
-    { "uri_coding", "URIs with character coding problems" },
-    { "concurrent_sessions", "total concurrent http sessions" },
-    { "max_concurrent_sessions", "maximum concurrent http sessions" },
-    { nullptr, nullptr }
+    { CountType::SUM, "flows", "HTTP connections inspected" },
+    { CountType::SUM, "scans", "TCP segments scanned looking for HTTP messages" },
+    { CountType::SUM, "reassembles", "TCP segments combined into HTTP messages" },
+    { CountType::SUM, "inspections", "total message sections inspected" },
+    { CountType::SUM, "requests", "HTTP request messages inspected" },
+    { CountType::SUM, "responses", "HTTP response messages inspected" },
+    { CountType::SUM, "get_requests", "GET requests inspected" },
+    { CountType::SUM, "head_requests", "HEAD requests inspected" },
+    { CountType::SUM, "post_requests", "POST requests inspected" },
+    { CountType::SUM, "put_requests", "PUT requests inspected" },
+    { CountType::SUM, "delete_requests", "DELETE requests inspected" },
+    { CountType::SUM, "connect_requests", "CONNECT requests inspected" },
+    { CountType::SUM, "options_requests", "OPTIONS requests inspected" },
+    { CountType::SUM, "trace_requests", "TRACE requests inspected" },
+    { CountType::SUM, "other_requests", "other request methods inspected" },
+    { CountType::SUM, "request_bodies", "POST, PUT, and other requests with message bodies" },
+    { CountType::SUM, "chunked", "chunked message bodies" },
+    { CountType::SUM, "uri_normalizations", "URIs needing to be normalization" },
+    { CountType::SUM, "uri_path", "URIs with path problems" },
+    { CountType::SUM, "uri_coding", "URIs with character coding problems" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent http sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent http sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
 const int8_t HttpEnums::as_hex[256] =
index 1a6438f763b3f6d5decad80cf0faf3a9916cbf9f..4aedd77832aca1e7a429792bdc78bc0319beb6ac 100644 (file)
@@ -47,6 +47,9 @@ public:
     bool set(const char*, Value&, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     friend class HttpIpsOption;
     static THREAD_LOCAL std::array<ProfileStats, PsIdx::PSI_MAX> http_ps;
index dda82f6cfba7cfaf0ccbf2a639ffb842eed321c4..7ee28031d5f0feb239dcf33d0f6f5717af912c44 100644 (file)
@@ -123,20 +123,20 @@ static THREAD_LOCAL IMAPSearchInfo imap_search_info;
 
 const PegInfo imap_peg_names[] =
 {
-    { "packets", "total packets processed" },
-    { "sessions", "total imap sessions" },
-    { "concurrent_sessions", "total concurrent imap sessions" },
-    { "max_concurrent_sessions", "maximum concurrent imap sessions" },
-    { "b64_attachments", "total base64 attachments decoded" },
-    { "b64_decoded_bytes", "total base64 decoded bytes" },
-    { "qp_attachments", "total quoted-printable attachments decoded" },
-    { "qp_decoded_bytes", "total quoted-printable decoded bytes" },
-    { "uu_attachments", "total uu attachments decoded" },
-    { "uu_decoded_bytes", "total uu decoded bytes" },
-    { "non_encoded_attachments", "total non-encoded attachments extracted" },
-    { "non_encoded_bytes", "total non-encoded extracted bytes" },
-
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "total packets processed" },
+    { CountType::SUM, "sessions", "total imap sessions" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent imap sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent imap sessions" },
+    { CountType::SUM, "b64_attachments", "total base64 attachments decoded" },
+    { CountType::SUM, "b64_decoded_bytes", "total base64 decoded bytes" },
+    { CountType::SUM, "qp_attachments", "total quoted-printable attachments decoded" },
+    { CountType::SUM, "qp_decoded_bytes", "total quoted-printable decoded bytes" },
+    { CountType::SUM, "uu_attachments", "total uu attachments decoded" },
+    { CountType::SUM, "uu_decoded_bytes", "total uu decoded bytes" },
+    { CountType::SUM, "non_encoded_attachments", "total non-encoded attachments extracted" },
+    { CountType::SUM, "non_encoded_bytes", "total non-encoded extracted bytes" },
+
+    { CountType::END, nullptr, nullptr }
 };
 
 ImapFlowData::ImapFlowData() : FlowData(inspector_id)
index 39164a17726471f059714d2c99628bf31d475c45..842d8f3c1f42c7ec151e98040d063e0e96cfa109 100644 (file)
@@ -59,6 +59,9 @@ public:
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
     IMAP_PROTO_CONF* get_data();
 
 private:
index 90b2371c8a9144db29637945559ee92843b65168..963c47e90998e6e9a2b0898b6c3c423a8bc2982a 100644 (file)
@@ -98,6 +98,9 @@ public:
 
     ProfileStats* get_profile() const override
     { return &modbus_data_prof; }
+
+    Usage get_usage() const override
+    { return DETECT; }
 };
 
 //-------------------------------------------------------------------------
index 6fc5e3b8d19bf884729042075b0df6a51039beb8..6ac092aaa1ee9e056fed590de3d701b531109158 100644 (file)
@@ -166,6 +166,9 @@ public:
     ProfileStats* get_profile() const override
     { return &modbus_func_prof; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 public:
     uint8_t func;
 };
index 2f51c9cd6d733089338413eb220464fe1ab25d02..0df1e83701ad7c52e0c4ada2acf38584d5981470 100644 (file)
@@ -118,6 +118,9 @@ public:
     ProfileStats* get_profile() const override
     { return &modbus_unit_prof; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 public:
     uint8_t unit;
 };
index 248f06a591cf8d8cb3fae8663bdf37b46ad9d557..0f4124cf7a4877984e0cb4f137c525dd0c382558 100644 (file)
@@ -36,12 +36,12 @@ THREAD_LOCAL ProfileStats modbus_prof;
 
 const PegInfo peg_names[] =
 {
-    { "sessions", "total sessions processed" },
-    { "frames", "total Modbus messages" },
-    { "concurrent_sessions", "total concurrent modbus sessions" },
-    { "max_concurrent_sessions", "maximum concurrent modbus sessions" },
+    { CountType::SUM, "sessions", "total sessions processed" },
+    { CountType::SUM, "frames", "total Modbus messages" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent modbus sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent modbus sessions" },
 
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
 const PegInfo* ModbusModule::get_pegs() const
index 33fc0523fada54319087024775efcec8ecca9808..c9c43cf9f893d097c35357693931186d3fd2fa3f 100644 (file)
@@ -49,6 +49,9 @@ public:
 
     ProfileStats* get_profile() const override
     { return &modbus_prof; }
+
+    Usage get_usage() const override
+    { return INSPECT; }
 };
 
 #endif
index 4f6a332dbe7d9360928e534ad85e871a8f50be87..f4ffa80e923c2119756091cfd1a961a4a45485a7 100644 (file)
@@ -78,20 +78,20 @@ static THREAD_LOCAL POPSearchInfo pop_search_info;
 
 const PegInfo pop_peg_names[] =
 {
-    { "packets", "total packets processed" },
-    { "sessions", "total pop sessions" },
-    { "concurrent_sessions", "total concurrent pop sessions" },
-    { "max_concurrent_sessions", "maximum concurrent pop sessions" },
-    { "b64_attachments", "total base64 attachments decoded" },
-    { "b64_decoded_bytes", "total base64 decoded bytes" },
-    { "qp_attachments", "total quoted-printable attachments decoded" },
-    { "qp_decoded_bytes", "total quoted-printable decoded bytes" },
-    { "uu_attachments", "total uu attachments decoded" },
-    { "uu_decoded_bytes", "total uu decoded bytes" },
-    { "non_encoded_attachments", "total non-encoded attachments extracted" },
-    { "non_encoded_bytes", "total non-encoded extracted bytes" },
-
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "total packets processed" },
+    { CountType::SUM, "sessions", "total pop sessions" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent pop sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent pop sessions" },
+    { CountType::SUM, "b64_attachments", "total base64 attachments decoded" },
+    { CountType::SUM, "b64_decoded_bytes", "total base64 decoded bytes" },
+    { CountType::SUM, "qp_attachments", "total quoted-printable attachments decoded" },
+    { CountType::SUM, "qp_decoded_bytes", "total quoted-printable decoded bytes" },
+    { CountType::SUM, "uu_attachments", "total uu attachments decoded" },
+    { CountType::SUM, "uu_decoded_bytes", "total uu decoded bytes" },
+    { CountType::SUM, "non_encoded_attachments", "total non-encoded attachments extracted" },
+    { CountType::SUM, "non_encoded_bytes", "total non-encoded extracted bytes" },
+
+    { CountType::END, nullptr, nullptr }
 };
 
 
index 4b9304613ca2de70c606843ef02f5ff98187fbc7..b9e76081f8efa859deb2c63019847f03afd58a45 100644 (file)
@@ -59,6 +59,9 @@ public:
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
     POP_PROTO_CONF* get_data();
 
 private:
index 73bca7112942c73bc15a74d791e08adcfb400a4d..e667d14d26d1810cea0820bebb3253b64de2e778 100644 (file)
@@ -60,11 +60,11 @@ static const RuleMap rpc_rules[] =
 
 static const PegInfo rpc_pegs[] =
 {
-    { "total_packets", "total packets" },
-    { "concurrent_sessions", "total concurrent rpc sessions" },
-    { "max_concurrent_sessions", "maximum concurrent rpc sessions" },
+    { CountType::SUM, "total_packets", "total packets" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent rpc sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent rpc sessions" },
 
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
 RpcDecodeModule::RpcDecodeModule() : Module(s_name, s_help, s_params)
index f396c1f36ed02929cc9b7a2b9c898339540fa016..1ef808f1a7d1df51b41d31ac03518713223b3a0e 100644 (file)
@@ -49,6 +49,9 @@ public:
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
+
+    Usage get_usage() const override
+    { return INSPECT; }
 };
 
 #endif
index fc48f1077b451a62d3f3c6e1136d72c837805101..fac0b8d039ac2a8c955d4840ed1f464521deaa9a 100644 (file)
@@ -57,6 +57,9 @@ public:
     ProfileStats* get_profile() const override
     { return &sip_ps[idx]; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
 private:
     SipIdx idx;
 };
index 6727d25c3ad27c4367378e21b88404ffd4bc2b0e..d9c706cd6bbd6e2d51d39a372c2b88221307744c 100644 (file)
@@ -143,6 +143,10 @@ public:
     ProfileStats* get_profile() const override
     { return &sipMethodRuleOptionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     SipMethodRuleOptData smod;
 
 private:
index 7680a7c503098ab567c819274c1ce135434a3097..43697fb3c681093f8dc27a4a7ab1dd00f5d7d517 100644 (file)
@@ -143,6 +143,10 @@ public:
     ProfileStats* get_profile() const override
     { return &sipStatCodeRuleOptionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     SipStatCodeRuleOptData ssod;
 
 private:
index 5311de2bd1120189128bbdcf7c5030e26f998294..8fc26e3e0ea64880060fbe59c817e36855c8f94c 100644 (file)
@@ -131,40 +131,40 @@ THREAD_LOCAL SipStats sip_stats;
 
 static const PegInfo sip_pegs[] =
 {
-    { "packets", "total packets" },
-    { "sessions", "total sessions" },
-    { "concurrent_sessions", "total concurrent sip sessions" },
-    { "max_concurrent_sessions", "maximum concurrent sip sessions" },
-    { "events", "events generated" },
-    { "dialogs", "total dialogs" },
-    { "ignored_channels", "total channels ignored" },
-    { "ignored_sessions", "total sessions ignored" },
-    { "total_requests", "total requests" },
-    { "invite", "invite" },
-    { "cancel", "cancel" },
-    { "ack", "ack" },
-    { "bye", "bye" },
-    { "register", "register" },
-    { "options", "options" },
-    { "refer", "refer" },
-    { "subscribe", "subscribe" },
-    { "update", "update" },
-    { "join", "join" },
-    { "info", "info" },
-    { "message", "message" },
-    { "notify", "notify" },
-    { "prack", "prack" },
-    { "total_responses", "total responses" },
-    { "code_1xx", "1xx" },
-    { "code_2xx", "2xx" },
-    { "code_3xx", "3xx" },
-    { "code_4xx", "4xx" },
-    { "code_5xx", "5xx" },
-    { "code_6xx", "6xx" },
-    { "code_7xx", "7xx" },
-    { "code_8xx", "8xx" },
-    { "code_9xx", "9xx" },
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "total packets" },
+    { CountType::SUM, "sessions", "total sessions" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent sip sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent sip sessions" },
+    { CountType::SUM, "events", "events generated" },
+    { CountType::SUM, "dialogs", "total dialogs" },
+    { CountType::SUM, "ignored_channels", "total channels ignored" },
+    { CountType::SUM, "ignored_sessions", "total sessions ignored" },
+    { CountType::SUM, "total_requests", "total requests" },
+    { CountType::SUM, "invite", "invite" },
+    { CountType::SUM, "cancel", "cancel" },
+    { CountType::SUM, "ack", "ack" },
+    { CountType::SUM, "bye", "bye" },
+    { CountType::SUM, "register", "register" },
+    { CountType::SUM, "options", "options" },
+    { CountType::SUM, "refer", "refer" },
+    { CountType::SUM, "subscribe", "subscribe" },
+    { CountType::SUM, "update", "update" },
+    { CountType::SUM, "join", "join" },
+    { CountType::SUM, "info", "info" },
+    { CountType::SUM, "message", "message" },
+    { CountType::SUM, "notify", "notify" },
+    { CountType::SUM, "prack", "prack" },
+    { CountType::SUM, "total_responses", "total responses" },
+    { CountType::SUM, "code_1xx", "1xx" },
+    { CountType::SUM, "code_2xx", "2xx" },
+    { CountType::SUM, "code_3xx", "3xx" },
+    { CountType::SUM, "code_4xx", "4xx" },
+    { CountType::SUM, "code_5xx", "5xx" },
+    { CountType::SUM, "code_6xx", "6xx" },
+    { CountType::SUM, "code_7xx", "7xx" },
+    { CountType::SUM, "code_8xx", "8xx" },
+    { CountType::SUM, "code_9xx", "9xx" },
+    { CountType::END, nullptr, nullptr }
 };
 
 //-------------------------------------------------------------------------
index 39f0afb260b4eb64478b5302f7e4dadad5fac511..ebdb69575a60fafd878acfcfe2b82b844fac902b 100644 (file)
@@ -81,6 +81,9 @@ public:
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
     SIP_PROTO_CONF* get_data();
 
 private:
index bb7a77603d4f7f7c0c79150cd32b6aaab055d941..cfb665045df4702b297f5b592e22349fdb5fb9cf 100644 (file)
@@ -156,20 +156,20 @@ static THREAD_LOCAL SMTPSearchInfo smtp_search_info;
 
 const PegInfo smtp_peg_names[] =
 {
-    { "packets", "total packets processed" },
-    { "sessions", "total smtp sessions" },
-    { "concurrent_sessions", "total concurrent smtp sessions" },
-    { "max_concurrent_sessions", "maximum concurrent smtp sessions" },
-    { "b64_attachments", "total base64 attachments decoded" },
-    { "b64_decoded_bytes", "total base64 decoded bytes" },
-    { "qp_attachments", "total quoted-printable attachments decoded" },
-    { "qp_decoded_bytes", "total quoted-printable decoded bytes" },
-    { "uu_attachments", "total uu attachments decoded" },
-    { "uu_decoded_bytes", "total uu decoded bytes" },
-    { "non_encoded_attachments", "total non-encoded attachments extracted" },
-    { "non_encoded_bytes", "total non-encoded extracted bytes" },
-
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "total packets processed" },
+    { CountType::SUM, "sessions", "total smtp sessions" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent smtp sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent smtp sessions" },
+    { CountType::SUM, "b64_attachments", "total base64 attachments decoded" },
+    { CountType::SUM, "b64_decoded_bytes", "total base64 decoded bytes" },
+    { CountType::SUM, "qp_attachments", "total quoted-printable attachments decoded" },
+    { CountType::SUM, "qp_decoded_bytes", "total quoted-printable decoded bytes" },
+    { CountType::SUM, "uu_attachments", "total uu attachments decoded" },
+    { CountType::SUM, "uu_decoded_bytes", "total uu decoded bytes" },
+    { CountType::SUM, "non_encoded_attachments", "total non-encoded attachments extracted" },
+    { CountType::SUM, "non_encoded_bytes", "total non-encoded extracted bytes" },
+
+    { CountType::END, nullptr, nullptr }
 };
 
 static void snort_smtp(SMTP_PROTO_CONF* GlobalConf, Packet* p);
index bd94b28b1c7de34cdeb6b9302d7397dc339004e6..507dbf456fd9dc282ad6d98e3859cc5358ac970c 100644 (file)
@@ -92,6 +92,9 @@ public:
     SMTP_PROTO_CONF* get_data();
     const SmtpCmd* get_cmd(unsigned idx);
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     void add_commands(Value&, uint32_t flags);
 
index a9703cbe8e8acbffa52e69a812304a0dad4eee1f..7effa5b903623112aabc0a422136e1ec91e98d1f 100644 (file)
@@ -69,10 +69,10 @@ static const RuleMap ssh_rules[] =
 
 const PegInfo ssh_pegs[] =
 {
-    { "packets", "total packets" },
-    { "concurrent_sessions", "total concurrent ssh sessions" },
-    { "max_concurrent_sessions", "maximum concurrent ssh sessions" },
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "total packets" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent ssh sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent ssh sessions" },
+    { CountType::END, nullptr, nullptr }
 };
 
 //-------------------------------------------------------------------------
index d16dec25136d188cb8c6a9c445e9f377a35a6135..6d7809c382e59f30532d384aa4a18499cb5579d8 100644 (file)
@@ -61,6 +61,9 @@ public:
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
     SSH_PROTO_CONF* get_data();
 
 private:
index 787d0f3c954184655d7d278a23800592a3959b56..392d6986ec98ffd8dfcc49d7be49009b0ee0677c 100644 (file)
@@ -166,6 +166,10 @@ public:
     ProfileStats* get_profile() const override
     { return &sslStateRuleOptionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     SslStateRuleOptionData ssod;
 };
 
index c32cf5ac982cb73c3a93a3de7710ce2366c2c2be..4bb564181f597d7e57c07e4db99c36e3a5eba186 100644 (file)
@@ -166,6 +166,10 @@ public:
     ProfileStats* get_profile() const override
     { return &sslVersionRuleOptionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     SslVersionRuleOptionData svod;
 };
 
index 60ef22142a4a2c0d06d084c8d1636a29252d0602..1a3723a5d13290b5a23bbb9062c961371d61e44d 100644 (file)
@@ -46,28 +46,28 @@ unsigned SslFlowData::inspector_id = 0;
 
 const PegInfo ssl_peg_names[] =
 {
-    { "packets", "total packets processed" },
-    { "decoded", "ssl packets decoded" },
-    { "client_hello", "total client hellos" },
-    { "server_hello", "total server hellos" },
-    { "certificate", "total ssl certificates" },
-    { "server_done", "total server done" },
-    { "client_key_exchange", "total client key exchanges" },
-    { "server_key_exchange", "total server key exchanges" },
-    { "change_cipher", "total change cipher records" },
-    { "finished", "total handshakes finished" },
-    { "client_application", "total client application records" },
-    { "server_application", "total server application records" },
-    { "alert", "total ssl alert records" },
-    { "unrecognized_records", "total unrecognized records" },
-    { "handshakes_completed", "total completed ssl handshakes" },
-    { "bad_handshakes", "total bad handshakes" },
-    { "sessions_ignored", "total sessions ignore" },
-    { "detection_disabled", "total detection disabled" },
-    { "concurrent_sessions", "total concurrent ssl sessions" },
-    { "max_concurrent_sessions", "maximum concurrent ssl sessions" },
-
-    { nullptr, nullptr }
+    { CountType::SUM, "packets", "total packets processed" },
+    { CountType::SUM, "decoded", "ssl packets decoded" },
+    { CountType::SUM, "client_hello", "total client hellos" },
+    { CountType::SUM, "server_hello", "total server hellos" },
+    { CountType::SUM, "certificate", "total ssl certificates" },
+    { CountType::SUM, "server_done", "total server done" },
+    { CountType::SUM, "client_key_exchange", "total client key exchanges" },
+    { CountType::SUM, "server_key_exchange", "total server key exchanges" },
+    { CountType::SUM, "change_cipher", "total change cipher records" },
+    { CountType::SUM, "finished", "total handshakes finished" },
+    { CountType::SUM, "client_application", "total client application records" },
+    { CountType::SUM, "server_application", "total server application records" },
+    { CountType::SUM, "alert", "total ssl alert records" },
+    { CountType::SUM, "unrecognized_records", "total unrecognized records" },
+    { CountType::SUM, "handshakes_completed", "total completed ssl handshakes" },
+    { CountType::SUM, "bad_handshakes", "total bad handshakes" },
+    { CountType::SUM, "sessions_ignored", "total sessions ignore" },
+    { CountType::SUM, "detection_disabled", "total detection disabled" },
+    { CountType::NOW, "concurrent_sessions", "total concurrent ssl sessions" },
+    { CountType::MAX, "max_concurrent_sessions", "maximum concurrent ssl sessions" },
+
+    { CountType::END, nullptr, nullptr }
 };
 
 SslFlowData::SslFlowData() : FlowData(inspector_id)
index dc938a1557b73820525d941421a790117e941d72..444da301b586d83d11aa6f03f596418e035a3616 100644 (file)
@@ -57,6 +57,9 @@ public:
     PegCount* get_counts() const override;
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
     SSL_PROTO_CONF* get_data();
 
 private:
index f7d743baf7907b0bbc58f84a8bcb2c508e2c28d5..32825abfece7485dcab79a4b5f80757641ed1ffb 100644 (file)
@@ -52,6 +52,9 @@ public:
     MagicBook* get_book(bool c2s, bool hex);
     CurseBook* get_curse_book();
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     void add_spells(MagicBook*, std::string&);
 
index aec9ba90cbb0b6b73a9172b27ed03b969740f54f..65ef3afa5dd3b5d0eadd335fbd7665f77e85a9ba 100644 (file)
@@ -48,13 +48,13 @@ struct WizStats
 
 const PegInfo wiz_pegs[] =
 {
-    { "tcp_scans", "tcp payload scans" },
-    { "tcp_hits", "tcp identifications" },
-    { "udp_scans", "udp payload scans" },
-    { "udp_hits", "udp identifications" },
-    { "user_scans", "user payload scans" },
-    { "user_hits", "user identifications" },
-    { nullptr, nullptr }
+    { CountType::SUM, "tcp_scans", "tcp payload scans" },
+    { CountType::SUM, "tcp_hits", "tcp identifications" },
+    { CountType::SUM, "udp_scans", "udp payload scans" },
+    { CountType::SUM, "udp_hits", "udp identifications" },
+    { CountType::SUM, "user_scans", "user payload scans" },
+    { CountType::SUM, "user_hits", "user identifications" },
+    { CountType::END, nullptr, nullptr }
 };
 
 THREAD_LOCAL WizStats tstats;
index 6277a9219a61a539ee418e0e5d6d14985c68319e..30715d2821edeba592daf91d676b315feb7e2d2d 100644 (file)
@@ -172,6 +172,3 @@ bool SideChannelModule::end(const char* fqn, int idx, SnortConfig*)
     return true;
 }
 
-PegCount* SideChannelModule::get_counts() const
-{ return (PegCount*)&sc_stats; }
-
index 95f1016b1fd412a6eeafea57cf80349468c0feb9..1cc8f59de62b79d3011367677d56b27882fbafc3 100644 (file)
@@ -46,9 +46,17 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
-    PegCount* get_counts() const override;
+    PegCount* get_counts() const override
+    { return (PegCount*)&sc_stats; }
+
+    const PegInfo* get_pegs() const override
+    { return simple_pegs; }
+
     ProfileStats* get_profile() const override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     SideChannelConfig* config = nullptr;
 };
index 9327413a8b384dd32f5953b15197d23f912b0f6b..65f37ff5c2a4adda77b3ef5edf34d650ba3b047e 100644 (file)
@@ -41,14 +41,14 @@ static BaseStats g_stats;
 THREAD_LOCAL BaseStats stream_base_stats;
 
 #define PROTO_PEGS(proto_str) \
-    { proto_str "_flows", "total " proto_str " sessions" }, \
-    { proto_str "_total_prunes", "total " proto_str " sessions pruned" }, \
-    { proto_str "_idle_prunes", proto_str " sessions pruned due to timeout" }, \
-    { proto_str "_excess_prunes", proto_str " sessions pruned due to excess" }, \
-    { proto_str "_uni_prunes", proto_str " uni sessions pruned" }, \
-    { proto_str "_preemptive_prunes", proto_str " sessions pruned during preemptive pruning" }, \
-    { proto_str "_memcap_prunes", proto_str " sessions pruned due to memcap" }, \
-    { proto_str "_ha_prunes", proto_str " sessions pruned by high availability sync" }
+    { CountType::SUM, proto_str "_flows", "total " proto_str " sessions" }, \
+    { CountType::SUM, proto_str "_total_prunes", "total " proto_str " sessions pruned" }, \
+    { CountType::SUM, proto_str "_idle_prunes", proto_str " sessions pruned due to timeout" }, \
+    { CountType::SUM, proto_str "_excess_prunes", proto_str " sessions pruned due to excess" }, \
+    { CountType::SUM, proto_str "_uni_prunes", proto_str " uni sessions pruned" }, \
+    { CountType::SUM, proto_str "_preemptive_prunes", proto_str " sessions pruned during preemptive pruning" }, \
+    { CountType::SUM, proto_str "_memcap_prunes", proto_str " sessions pruned due to memcap" }, \
+    { CountType::SUM, proto_str "_ha_prunes", proto_str " sessions pruned by high availability sync" }
 
 #define SET_PROTO_COUNTS(proto, pkttype) \
     stream_base_stats.proto ## _flows = flow_con->get_flows(PktType::pkttype); \
@@ -75,7 +75,7 @@ const PegInfo base_pegs[] =
     PROTO_PEGS("udp"),
     PROTO_PEGS("user"),
     PROTO_PEGS("file"),
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
 // FIXIT-L dependency on stats define in another file
index acda69e01e561848f255d9a8c7d453c98f5e488b..080a6c8d49ea4fe280cc4da18fec085f06f072dc 100644 (file)
@@ -88,6 +88,9 @@ public:
     void show_stats() override;
     void reset_stats() override;
 
+    Usage get_usage() const override
+    { return GLOBAL; }
+
 private:
     StreamModuleConfig config;
 };
index 14c8c0d84382881ea6a538adaa22161c61f1b388..21e3236bc820f3682299de6d33b349c4e481d815 100644 (file)
@@ -44,6 +44,10 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool set(const char*, Value&, SnortConfig*) override;
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
+public:
     bool upload;
 };
 
index dd48a71a312730f7fe98c66d110d713bdaf56df3..f4dcb0e1ccf57df7d5296073732fa8881d9a9430 100644 (file)
@@ -94,13 +94,3 @@ const PegInfo* StreamIcmpModule::get_pegs() const
 PegCount* StreamIcmpModule::get_counts() const
 { return (PegCount*)&icmpStats; }
 
-void StreamIcmpModule::sum_stats(bool accumulate_now_stats)
-{
-    assert(sizeof(IcmpStats)/sizeof(PegCount) == sizeof(IcmpStatTypes)/sizeof(CountType));
-
-    static const IcmpStatTypes icmp_stat_types;
-    static const CountType* const count_types = (const CountType*)&icmp_stat_types;
-
-    sum_stats_helper(accumulate_now_stats, count_types);
-}
-
index 19a02caf5ea836c60b4b4d48fa14774a3e74dcf5..38f202df639dc7d6f938ea276f0c56830bcd248b 100644 (file)
@@ -35,13 +35,6 @@ struct IcmpStats
     SESSION_STATS;
 };
 
-struct IcmpStatTypes
-{
-    SESSION_STAT_TYPES;
-
-    IcmpStatTypes() {}
-};
-
 //-------------------------------------------------------------------------
 // stream_icmp module
 //-------------------------------------------------------------------------
@@ -62,7 +55,9 @@ public:
     ProfileStats* get_profile(unsigned, const char*&, const char*&) const override;
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
-    void sum_stats(bool) override;
+
+    Usage get_usage() const override
+    { return INSPECT; }
 
     StreamIcmpConfig* get_data();
 
index b9853696c28c495af91d39761444fbed9d1c9a17..92fd261276ddd08961c9c80ea92a8436c72b1106 100644 (file)
@@ -39,7 +39,7 @@
 const PegInfo icmp_pegs[] =
 {
     SESSION_PEGS("icmp"),
-    { nullptr, nullptr }
+    { CountType::END, nullptr, nullptr }
 };
 
 THREAD_LOCAL IcmpStats icmpStats;
index f2bddcddd5bb736abf9762ba2a088234e93a0172..4e05eff4f13ed76545df478b6baa6bfb70876b84 100644 (file)
@@ -217,13 +217,3 @@ const PegInfo* StreamIpModule::get_pegs() const
 PegCount* StreamIpModule::get_counts() const
 { return (PegCount*)&ip_stats; }
 
-void StreamIpModule::sum_stats(bool accumulate_now_stats)
-{
-    assert(sizeof(IpStats)/sizeof(PegCount) == sizeof(IpStatTypes)/sizeof(CountType));
-
-    static const IpStatTypes ip_stat_types;
-    static const CountType* const count_types = (const CountType*)&ip_stat_types;
-
-    sum_stats_helper(accumulate_now_stats, count_types);
-}
-
index 036800eb9a7113fc98c18c5c0a63f0aaf0b42853..e6e5835dd642480e6c514b68605141676221a07c 100644 (file)
@@ -78,35 +78,6 @@ struct IpStats
     PegCount fragmented_bytes;  // total_ipfragmented_bytes
 };
 
-struct IpStatTypes
-{
-    SESSION_STAT_TYPES;
-    CountType total = CountType::SUM;
-    CountType current_frags = CountType::NOW;
-
-    // FIXIT-M max_frags appears to be unused.
-    CountType max_frags = CountType::SUM;
-
-    CountType reassembles = CountType::SUM;
-    CountType discards = CountType::SUM;
-    CountType frag_timeouts = CountType::SUM;
-    CountType overlaps = CountType::SUM;
-    CountType anomalies = CountType::SUM;
-    CountType alerts = CountType::SUM;
-    CountType drops = CountType::SUM;
-    CountType trackers_created = CountType::SUM;
-    CountType trackers_released = CountType::SUM;
-    CountType trackers_cleared = CountType::SUM;
-    CountType trackers_completed = CountType::SUM;
-    CountType nodes_created = CountType::SUM;
-    CountType nodes_released = CountType::SUM;
-    CountType mem_in_use = CountType::NOW;
-    CountType reassembled_bytes = CountType::SUM;
-    CountType fragmented_bytes = CountType::SUM;
-
-    IpStatTypes() {}
-};
-
 extern const PegInfo ip_pegs[];
 extern THREAD_LOCAL struct IpStats ip_stats;
 extern THREAD_LOCAL ProfileStats ip_perf_stats;
@@ -138,12 +109,14 @@ public:
     ProfileStats* get_profile(unsigned, const char*&, const char*&) const override;
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
-    void sum_stats(bool) override;
     StreamIpConfig* get_data();
 
     unsigned get_gid() const override
     { return GID_DEFRAG; }
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     StreamIpConfig* config;
 };
index 1ceadb5dedc54390c746cdadff6135f03cdd357e..a31c81d7d9b53e4389aa81f831e812b77f78b317 100644 (file)
 const PegInfo ip_pegs[] =
 {
     SESSION_PEGS("ip"),
-    { "total_frags", "total fragments" },
-    { "current_frags", "current fragments" },
-    { "max_frags", "max fragments" },
-    { "reassembled", "reassembled datagrams" },
-    { "discards", "fragments discarded" },
-    { "frag_timeouts", "datagrams abandoned" },
-    { "overlaps", "overlapping fragments" },
-    { "anomalies", "anomalies detected" },
-    { "alerts", "alerts generated" },
-    { "drops", "fragments dropped" },
-    { "trackers_added", "datagram trackers created" },
-    { "trackers_freed", "datagram trackers released" },
-    { "trackers_cleared", "datagram trackers cleared" },
-    { "trackers_completed", "datagram trackers completed" },
-    { "nodes_inserted", "fragments added to tracker" },
-    { "nodes_deleted", "fragments deleted from tracker" },
-    { "memory_used", "current memory usage in bytes" },
-    { "reassembled_bytes", "total reassembled bytes" },
-    { "fragmented_bytes", "total fragmented bytes" },
-    { nullptr, nullptr }
+    { CountType::SUM, "total_frags", "total fragments" },
+    { CountType::NOW, "current_frags", "current fragments" },
+    { CountType::SUM, "max_frags", "max fragments" },
+    { CountType::SUM, "reassembled", "reassembled datagrams" },
+    { CountType::SUM, "discards", "fragments discarded" },
+    { CountType::SUM, "frag_timeouts", "datagrams abandoned" },
+    { CountType::SUM, "overlaps", "overlapping fragments" },
+    { CountType::SUM, "anomalies", "anomalies detected" },
+    { CountType::SUM, "alerts", "alerts generated" },
+    { CountType::SUM, "drops", "fragments dropped" },
+    { CountType::SUM, "trackers_added", "datagram trackers created" },
+    { CountType::SUM, "trackers_freed", "datagram trackers released" },
+    { CountType::SUM, "trackers_cleared", "datagram trackers cleared" },
+    { CountType::SUM, "trackers_completed", "datagram trackers completed" },
+    { CountType::SUM, "nodes_inserted", "fragments added to tracker" },
+    { CountType::SUM, "nodes_deleted", "fragments deleted from tracker" },
+    { CountType::NOW, "memory_used", "current memory usage in bytes" },
+    { CountType::SUM, "reassembled_bytes", "total reassembled bytes" },
+    { CountType::SUM, "fragmented_bytes", "total fragmented bytes" },
+    { CountType::END, nullptr, nullptr }
 };
 
 THREAD_LOCAL IpStats ip_stats;
index 793d1ffcaf253a5381fdff161b7c46fb3b72a823..1e1634fb85ee5b489adaf2ccea71964eb7a23b74 100644 (file)
@@ -196,6 +196,10 @@ public:
     ProfileStats* get_profile() const override
     { return &streamReassembleRuleOptionPerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     StreamReassembleRuleOptionData srod;
 };
 
index ef716bc8acc6c2117b16f09bab15ad30f77e583e..a09813d4463a8e2a07ea5316b9198257099ef0bc 100644 (file)
@@ -186,6 +186,10 @@ public:
     ProfileStats* get_profile() const override
     { return &streamSizePerfStats; }
 
+    Usage get_usage() const override
+    { return DETECT; }
+
+public:
     RangeCheck ssod;
     int direction;
 };
index ad574db2341c68cc1171356c9fcdc9963a720104..77d4a1b17d544affe7f4bea083a875bbef991c20 100644 (file)
@@ -44,38 +44,42 @@ THREAD_LOCAL ProfileStats s5TcpBuildPacketPerfStats;
 const PegInfo tcp_pegs[] =
 {
     SESSION_PEGS("tcp"),
-    { "resyns", "SYN received on established session" },
-    { "discards", "tcp packets discarded" },
-    { "events", "events generated" },
-    { "ignored", "tcp packets ignored" },
-    { "untracked", "tcp packets not tracked" },
-    { "syn_trackers", "tcp session tracking started on syn" },
-    { "syn_ack_trackers", "tcp session tracking started on syn-ack" },
-    { "three_way_trackers", "tcp session tracking started on ack" },
-    { "data_trackers", "tcp session tracking started on data" },
-    { "segs_queued", "total segments queued" },
-    { "segs_released", "total segments released" },
-    { "segs_split", "tcp segments split when reassembling PDUs" },
-    { "segs_used", "queued tcp segments applied to reassembled PDUs" },
-    { "rebuilt_packets", "total reassembled PDUs" },
-    { "rebuilt_buffers", "rebuilt PDU sections" },
-    { "rebuilt_bytes", "total rebuilt bytes" },
-    { "overlaps", "overlapping segments queued" },
-    { "gaps", "missing data between PDUs" },
-    { "exceeded_max_segs", "number of times the maximum queued segment limit was reached" },
-    { "exceeded_max_bytes", "number of times the maximum queued byte limit was reached" },
-    { "internal_events", "135:X events generated" },
-    { "client_cleanups", "number of times data from server was flushed when session released" },
-    { "server_cleanups", "number of times data from client was flushed when session released" },
-    { "memory", "current memory in use" },
-    { "initializing", "number of sessions currently initializing" },
-    { "established", "number of sessions currently established" },
-    { "closing", "number of sessions currently closing" },
-    { "syns", "number of syn packets" },
-    { "syn_acks", "number of syn-ack packets" },
-    { "resets", "number of reset packets" },
-    { "fins", "number of fin packets"},
-    { nullptr, nullptr }
+    { CountType::SUM, "resyns", "SYN received on established session" },
+    { CountType::SUM, "discards", "tcp packets discarded" },
+    { CountType::SUM, "events", "events generated" },
+    { CountType::SUM, "ignored", "tcp packets ignored" },
+    { CountType::SUM, "untracked", "tcp packets not tracked" },
+    { CountType::SUM, "syn_trackers", "tcp session tracking started on syn" },
+    { CountType::SUM, "syn_ack_trackers", "tcp session tracking started on syn-ack" },
+    { CountType::SUM, "three_way_trackers", "tcp session tracking started on ack" },
+    { CountType::SUM, "data_trackers", "tcp session tracking started on data" },
+    { CountType::SUM, "segs_queued", "total segments queued" },
+    { CountType::SUM, "segs_released", "total segments released" },
+    { CountType::SUM, "segs_split", "tcp segments split when reassembling PDUs" },
+    { CountType::SUM, "segs_used", "queued tcp segments applied to reassembled PDUs" },
+    { CountType::SUM, "rebuilt_packets", "total reassembled PDUs" },
+    { CountType::SUM, "rebuilt_buffers", "rebuilt PDU sections" },
+    { CountType::SUM, "rebuilt_bytes", "total rebuilt bytes" },
+    { CountType::SUM, "overlaps", "overlapping segments queued" },
+    { CountType::SUM, "gaps", "missing data between PDUs" },
+    { CountType::SUM, "exceeded_max_segs",
+        "number of times the maximum queued segment limit was reached" },
+    { CountType::SUM, "exceeded_max_bytes",
+        "number of times the maximum queued byte limit was reached" },
+    { CountType::SUM, "internal_events", "135:X events generated" },
+    { CountType::SUM, "client_cleanups",
+        "number of times data from server was flushed when session released" },
+    { CountType::SUM, "server_cleanups",
+        "number of times data from client was flushed when session released" },
+    { CountType::NOW, "memory", "current memory in use" },
+    { CountType::NOW, "initializing", "number of sessions currently initializing" },
+    { CountType::NOW, "established", "number of sessions currently established" },
+    { CountType::NOW, "closing", "number of sessions currently closing" },
+    { CountType::SUM, "syns", "number of syn packets" },
+    { CountType::SUM, "syn_acks", "number of syn-ack packets" },
+    { CountType::SUM, "resets", "number of reset packets" },
+    { CountType::SUM, "fins", "number of fin packets"},
+    { CountType::END, nullptr, nullptr }
 };
 
 THREAD_LOCAL TcpStats tcpStats;
@@ -363,13 +367,3 @@ const PegInfo* StreamTcpModule::get_pegs() const
 PegCount* StreamTcpModule::get_counts() const
 { return (PegCount*)&tcpStats; }
 
-void StreamTcpModule::sum_stats(bool accumulate_now_stats)
-{
-    assert(sizeof(TcpStats)/sizeof(PegCount) == sizeof(TcpStatTypes)/sizeof(CountType));
-
-    static const TcpStatTypes tcp_stat_types;
-    static const CountType* const count_types = (const CountType*)&tcp_stat_types;
-
-    sum_stats_helper(accumulate_now_stats, count_types);
-}
-
index 02315e29ae40dd62e1e4947d702f318675a8f968..d9aaf5c484fc613fdf2f4b5776d7055aae1aa067 100644 (file)
@@ -97,44 +97,6 @@ struct TcpStats
     PegCount fins;
 };
 
-struct TcpStatTypes
-{
-    SESSION_STAT_TYPES;
-    CountType resyns = CountType::SUM;
-    CountType discards = CountType::SUM;
-    CountType events = CountType::SUM;
-    CountType ignored = CountType::SUM;
-    CountType no_pickups = CountType::SUM;
-    CountType sessions_on_syn = CountType::SUM;
-    CountType sessions_on_syn_ack = CountType::SUM;
-    CountType sessions_on_3way = CountType::SUM;
-    CountType sessions_on_data = CountType::SUM;
-    CountType segs_queued = CountType::SUM;
-    CountType segs_released = CountType::SUM;
-    CountType segs_split = CountType::SUM;
-    CountType segs_used = CountType::SUM;
-    CountType rebuilt_packets = CountType::SUM;
-    CountType rebuilt_buffers = CountType::SUM;
-    CountType rebuilt_bytes = CountType::SUM;
-    CountType overlaps = CountType::SUM;
-    CountType gaps = CountType::SUM;
-    CountType exceeded_max_segs = CountType::SUM;
-    CountType exceeded_max_bytes = CountType::SUM;
-    CountType internalEvents = CountType::SUM;
-    CountType s5tcp1 = CountType::SUM;
-    CountType s5tcp2 = CountType::SUM;
-    CountType mem_in_use = CountType::NOW;
-    CountType sessions_initializing = CountType::NOW;
-    CountType sessions_established = CountType::NOW;
-    CountType sessions_closing = CountType::NOW;
-    CountType syns = CountType::SUM;
-    CountType syn_acks = CountType::SUM;
-    CountType resets = CountType::SUM;
-    CountType fins = CountType::SUM;
-
-    TcpStatTypes() {}
-};
-
 extern THREAD_LOCAL struct TcpStats tcpStats;
 
 inline void inc_tcp_discards()
@@ -164,15 +126,15 @@ public:
     const RuleMap* get_rules() const override;
 
     unsigned get_gid() const override
-    {
-        return GID_STREAM_TCP;
-    }
+    { return GID_STREAM_TCP; }
 
     TcpStreamConfig* get_data();
     ProfileStats* get_profile(unsigned, const char*&, const char*&) const override;
     const PegInfo* get_pegs() const override;
     PegCount* get_counts() const override;
-    void sum_stats(bool) override;
+
+    Usage get_usage() const override
+    { return INSPECT; }
 
 private:
     TcpStreamConfig* config;
index c9a24fa8faa2ce5eda21440ccc1632cf637f8d8b..6f4a067ff37c3716ecedaff2c44abcee701e61c4 100644 (file)
@@ -32,27 +32,17 @@ THREAD_LOCAL PegCount tcp_norm_stats[PC_TCP_MAX][NORM_MODE_MAX];
 
 static const PegInfo pegName[] =
 {
-    { "tcp_trim_syn", "tcp segments trimmed on SYN" },
-    { "tcp_trim_rst", "RST packets with data trimmed" },
-    { "tcp_trim_win", "data trimmed to window" },
-    { "tcp_trim_mss", "data trimmed to MSS" },
-    { "tcp_ecn_session", "ECN bits cleared" },
-    { "tcp_ts_nop", "timestamp options cleared" },
-    { "tcp_ips_data", "normalized segments" },
-    { "tcp_block", "blocked segments" },
-    { nullptr, nullptr }
+    { CountType::SUM, "tcp_trim_syn", "tcp segments trimmed on SYN" },
+    { CountType::SUM, "tcp_trim_rst", "RST packets with data trimmed" },
+    { CountType::SUM, "tcp_trim_win", "data trimmed to window" },
+    { CountType::SUM, "tcp_trim_mss", "data trimmed to MSS" },
+    { CountType::SUM, "tcp_ecn_session", "ECN bits cleared" },
+    { CountType::SUM, "tcp_ts_nop", "timestamp options cleared" },
+    { CountType::SUM, "tcp_ips_data", "normalized segments" },
+    { CountType::SUM, "tcp_block", "blocked segments" },
+    { CountType::END, nullptr, nullptr }
 };
 
-#if 0
-static inline int SetupOK(const TcpStreamTracker* st)
-{
-    return ((st->s_mgr.sub_state & SUB_SETUP_OK) == SUB_SETUP_OK);
-}
-
-int strip = ( SetupOK(peer_tracker) && SetupOK(tracker) );
-DebugMessage(DEBUG_STREAM_STATE, "listener not doing timestamps...\n");
-#endif
-
 TcpNormalizer::TcpNormalizer(StreamPolicy os_policy, TcpSession* session,
     TcpStreamTracker* tracker) :
     os_policy(os_policy), session(session), tracker(tracker)
index 303ca61806c854e600a8eab5e7943897e60f7617..db22941e21cf28139f22e2755130d096ad2bfa6b 100644 (file)
@@ -58,6 +58,9 @@ public:
     PegCount* get_counts() const override;
     StreamUdpConfig* get_data();
 
+    Usage get_usage() const override
+    { return INSPECT; }
+
 private:
     StreamUdpConfig* config;
 };
index 76dbd519366d842153603e5b677f37d51053832e..3a9a5af461941ff5b7aa146f8be0df969728a9a2 100644 (file)
@@ -38,8 +38,8 @@
 const PegInfo udp_pegs[] =
 {
     SESSION_PEGS("udp"),
-    { "ignored", "udp packets ignored" },
-    { nullptr, nullptr }
+    { CountType::SUM, "ignored", "udp packets ignored" },
+    { CountType::END, nullptr, nullptr }
 };
 
 THREAD_LOCAL UdpStats udpStats;
index 6dd4f8fd954032eb70b18c37056f534d95d8c28d..c3c605054af6943112a074385913a599456276cd 100644 (file)
@@ -84,11 +84,3 @@ bool StreamUserModule::end(const char*, int, SnortConfig*)
     return true;
 }
 
-#if 0
-const PegInfo* StreamUserModule::get_pegs() const
-{ return user_pegs; }
-
-PegCount* StreamUserModule::get_counts() const
-{ return (PegCount*)&user_stats; }
-#endif
-
index ac3a07288e929732c1cc5edeb2789d2d1d8d7d29..504449743b88cda233511a7723d7ca3a7d4d1e6c 100644 (file)
 
 struct SnortConfig;
 
-#if 0
-extern const PegInfo user_pegs[];
-extern THREAD_LOCAL struct UserStats user_stats;
-#endif
-
 extern THREAD_LOCAL ProfileStats user_perf_stats;
 
 extern Trace TRACE_NAME(stream_user);
@@ -52,10 +47,8 @@ public:
     bool begin(const char*, int, SnortConfig*) override;
     bool end(const char*, int, SnortConfig*) override;
 
-#if 0
-    const PegInfo* get_pegs() const override;
-    PegCount* get_counts() const override;
-#endif
+    Usage get_usage() const override
+    { return INSPECT; }
 
     StreamUserConfig* get_data();
 
index 5d6a2f99a2e670ae8df9d9ca950cad49897e1593..713132136ba9b8fc8be3156394579c9858ee74e9 100644 (file)
@@ -164,66 +164,68 @@ static void timing_stats()
 
 const PegInfo daq_names[] =
 {
-    { "pcaps", "total files and interfaces processed" },
-    { "received", "total packets received from DAQ" },
-    { "analyzed", "total packets analyzed from DAQ" },
-    { "dropped", "packets dropped" },
-    { "filtered", "packets filtered out" },
-    { "outstanding", "packets unprocessed" },
-    { "injected", "active responses or replacements" },
-    { "allow", "total allow verdicts" },
-    { "block", "total block verdicts" },
-    { "replace", "total replace verdicts" },
-    { "whitelist", "total whitelist verdicts" },
-    { "blacklist", "total blacklist verdicts" },
-    { "ignore", "total ignore verdicts" },
+    { CountType::SUM, "pcaps", "total files and interfaces processed" },
+    { CountType::SUM, "received", "total packets received from DAQ" },
+    { CountType::SUM, "analyzed", "total packets analyzed from DAQ" },
+    { CountType::SUM, "dropped", "packets dropped" },
+    { CountType::SUM, "filtered", "packets filtered out" },
+    { CountType::SUM, "outstanding", "packets unprocessed" },
+    { CountType::SUM, "injected", "active responses or replacements" },
+    { CountType::SUM, "allow", "total allow verdicts" },
+    { CountType::SUM, "block", "total block verdicts" },
+    { CountType::SUM, "replace", "total replace verdicts" },
+    { CountType::SUM, "whitelist", "total whitelist verdicts" },
+    { CountType::SUM, "blacklist", "total blacklist verdicts" },
+    { CountType::SUM, "ignore", "total ignore verdicts" },
 
     // FIXIT-L these are not exactly DAQ counts - but they are related
-    { "internal_blacklist", "packets blacklisted internally due to lack of DAQ support" },
-    { "internal_whitelist", "packets whitelisted internally due to lack of DAQ support" },
-    { "skipped", "packets skipped at startup" },
-    { "idle", "attempts to acquire from DAQ without available packets" },
-    { "rx_bytes", "total bytes received" },
-    { nullptr, nullptr }
+    { CountType::SUM, "internal_blacklist",
+        "packets blacklisted internally due to lack of DAQ support" },
+    { CountType::SUM, "internal_whitelist",
+        "packets whitelisted internally due to lack of DAQ support" },
+    { CountType::SUM, "skipped", "packets skipped at startup" },
+    { CountType::SUM, "idle", "attempts to acquire from DAQ without available packets" },
+    { CountType::SUM, "rx_bytes", "total bytes received" },
+    { CountType::END, nullptr, nullptr }
 };
 
 const PegInfo pc_names[] =
 {
-    { "analyzed", "packets sent to detection" },
-    { "hard_evals", "non-fast pattern rule evaluations" },
-    { "raw_searches", "fast pattern searches in raw packet data" },
-    { "cooked_searches", "fast pattern searches in cooked packet data" },
-    { "pkt_searches", "fast pattern searches in packet data" },
-    { "alt_searches", "alt fast pattern searches in packet data" },
-    { "key_searches", "fast pattern searches in key buffer" },
-    { "header_searches", "fast pattern searches in header buffer" },
-    { "body_searches", "fast pattern searches in body buffer" },
-    { "file_searches", "fast pattern searches in file buffer" },
-    { "offloads", "fast pattern searches that were offloaded" },
-    { "alerts", "alerts not including IP reputation" },
-    { "total_alerts", "alerts including IP reputation" },
-    { "logged", "logged packets" },
-    { "passed", "passed packets" },
-    { "match_limit", "fast pattern matches not processed" },
-    { "queue_limit", "events not queued because queue full" },
-    { "log_limit", "events queued but not logged" },
-    { "event_limit", "events filtered" },
-    { "alert_limit", "events previously triggered on same PDU" },
-    { nullptr, nullptr }
+    { CountType::SUM, "analyzed", "packets sent to detection" },
+    { CountType::SUM, "hard_evals", "non-fast pattern rule evaluations" },
+    { CountType::SUM, "raw_searches", "fast pattern searches in raw packet data" },
+    { CountType::SUM, "cooked_searches", "fast pattern searches in cooked packet data" },
+    { CountType::SUM, "pkt_searches", "fast pattern searches in packet data" },
+    { CountType::SUM, "alt_searches", "alt fast pattern searches in packet data" },
+    { CountType::SUM, "key_searches", "fast pattern searches in key buffer" },
+    { CountType::SUM, "header_searches", "fast pattern searches in header buffer" },
+    { CountType::SUM, "body_searches", "fast pattern searches in body buffer" },
+    { CountType::SUM, "file_searches", "fast pattern searches in file buffer" },
+    { CountType::SUM, "offloads", "fast pattern searches that were offloaded" },
+    { CountType::SUM, "alerts", "alerts not including IP reputation" },
+    { CountType::SUM, "total_alerts", "alerts including IP reputation" },
+    { CountType::SUM, "logged", "logged packets" },
+    { CountType::SUM, "passed", "passed packets" },
+    { CountType::SUM, "match_limit", "fast pattern matches not processed" },
+    { CountType::SUM, "queue_limit", "events not queued because queue full" },
+    { CountType::SUM, "log_limit", "events queued but not logged" },
+    { CountType::SUM, "event_limit", "events filtered" },
+    { CountType::SUM, "alert_limit", "events previously triggered on same PDU" },
+    { CountType::END, nullptr, nullptr }
 };
 
 const PegInfo proc_names[] =
 {
-    { "local_commands", "total local commands processed" },
-    { "remote_commands", "total remote commands processed" },
-    { "signals", "total signals processed" },
-    { "conf_reloads", "number of times configuration was reloaded" },
-    { "policy_reloads", "number of times policies were reloaded" },
-    { "inspector_deletions", "number of times inspectors were deleted" },
-    { "daq_reloads", "number of times daq configuration was reloaded" },
-    { "attribute_table_reloads", "number of times hosts table was reloaded" },
-    { "attribute_table_hosts", "total number of hosts in table" },
-    { nullptr, nullptr }
+    { CountType::SUM, "local_commands", "total local commands processed" },
+    { CountType::SUM, "remote_commands", "total remote commands processed" },
+    { CountType::SUM, "signals", "total signals processed" },
+    { CountType::SUM, "conf_reloads", "number of times configuration was reloaded" },
+    { CountType::SUM, "policy_reloads", "number of times policies were reloaded" },
+    { CountType::SUM, "inspector_deletions", "number of times inspectors were deleted" },
+    { CountType::SUM, "daq_reloads", "number of times daq configuration was reloaded" },
+    { CountType::SUM, "attribute_table_reloads", "number of times hosts table was reloaded" },
+    { CountType::SUM, "attribute_table_hosts", "total number of hosts in table" },
+    { CountType::END, nullptr, nullptr }
 };
 
 //-------------------------------------------------------------------------
index aff3c1fd6e639c6be3be9add7cf22ae4009f1a38..1d3a1a18aaa7ea0f4c86185b4b06c5969b178eed 100644 (file)
@@ -40,6 +40,7 @@ public:
 bool Detection::convert(std::istringstream& data_stream)
 {
     bool retval = true;
+    bool split_set = false;
     std::string args;
 
     table_api.open_table("search_engine");
@@ -72,6 +73,7 @@ bool Detection::convert(std::istringstream& data_stream)
         {
             table_api.add_diff_option_comment("split-any-any", "split_any_any");
             tmpval = table_api.add_option("split_any_any", true);
+            split_set = true;
         }
         else if (!keyword.compare("bleedover-warnings-enabled"))
         {
@@ -232,6 +234,7 @@ bool Detection::convert(std::istringstream& data_stream)
                 table_api.add_diff_option_comment("ac-split", "ac_full");
                 bool tmpval2 = table_api.add_option("split_any_any", true);
                 bool tmpval1 = table_api.add_option("search_method", "ac_full");
+                split_set = true;
                 tmpval = tmpval1 && tmpval2;
 
                 if (!table_api.add_option("split_any_any", true))
@@ -248,6 +251,11 @@ bool Detection::convert(std::istringstream& data_stream)
         if (retval && !tmpval)
             retval = false;
     }
+    if ( !split_set )
+    {
+        table_api.add_diff_option_comment("split-any-any", "split_any_any = true by default");
+        table_api.add_option("split_any_any", false);
+    }
 
     return retval;
 }