]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
added brief help to module
authorRuss Combs <rucombs@cisco.com>
Fri, 5 Sep 2014 16:35:00 +0000 (12:35 -0400)
committerRuss Combs <rucombs@cisco.com>
Fri, 5 Sep 2014 16:35:00 +0000 (12:35 -0400)
116 files changed:
ChangeLog
src/actions/act_react.cc
src/actions/act_reject.cc
src/actions/act_replace.cc
src/codecs/decode_module.h
src/codecs/ip/cd_auth.cc
src/codecs/ip/cd_esp.cc
src/codecs/ip/cd_gre.cc
src/codecs/ip/cd_icmp4.cc
src/codecs/ip/cd_icmp6.cc
src/codecs/ip/cd_igmp.cc
src/codecs/ip/cd_ipv4.cc
src/codecs/ip/cd_ipv6.cc
src/codecs/ip/cd_pgm.cc
src/codecs/ip/cd_tcp.cc
src/codecs/ip/cd_udp.cc
src/codecs/link/cd_arp.cc
src/codecs/link/cd_eapol.cc
src/codecs/link/cd_erspan2.cc
src/codecs/link/cd_erspan3.cc
src/codecs/link/cd_mpls.cc
src/codecs/link/cd_pppoe.cc
src/codecs/link/cd_vlan.cc
src/codecs/misc/cd_gtp.cc
src/codecs/root/cd_eth.cc
src/codecs/root/cd_wlan.cc
src/codecs/template_module.h
src/framework/module.cc
src/framework/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_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_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_http.cc
src/ips_options/ips_http_header.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_rem.cc
src/ips_options/ips_replace.cc
src/ips_options/ips_rev.cc
src/ips_options/ips_rpc.cc
src/ips_options/ips_seq.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/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/alert_test.cc
src/loggers/alert_unixsock.cc
src/loggers/log_tcpdump.cc
src/loggers/unified2.cc
src/main/help.cc
src/main/help.h
src/main/modules.cc
src/main/snort_module.cc
src/managers/module_manager.cc
src/managers/module_manager.h
src/network_inspectors/arp_spoof/arp_module.cc
src/network_inspectors/binder/bind_module.cc
src/network_inspectors/normalize/norm_module.cc
src/network_inspectors/perf_monitor/perf_module.cc
src/network_inspectors/port_scan/ps_module.cc
src/service_inspectors/back_orifice/back_orifice.cc
src/service_inspectors/ftp_telnet/ftp_data.cc
src/service_inspectors/ftp_telnet/ftp_module.cc
src/service_inspectors/ftp_telnet/telnet_module.cc
src/service_inspectors/http_inspect/hi_module.cc
src/service_inspectors/nhttp_inspect/nhttp_module.h
src/service_inspectors/rpc_decode/rpc_module.cc
src/service_inspectors/wizard/wiz_module.cc
src/stream/base/stream_module.cc
src/stream/icmp/icmp_module.cc
src/stream/ip/ip_module.cc
src/stream/tcp/ips_stream_reassemble.cc
src/stream/tcp/ips_stream_size.cc
src/stream/tcp/tcp_module.cc
src/stream/udp/udp_module.cc
src/time/ppm_module.cc

index 50c41cf3ce2a2bc10c6114ba9e12427bb2d741c9..9c415efea27bd31f33f3e38dee5c07e7263b18fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 118
 -- fixed bind action
 -- tweaked main loop
+-- added module 1-line help
 
 117
 -- added --stdin-rules
index fc97821c64e4f42ec4023b86e63476324e5ae652..7ff4f95bcdeb5671aeaa00ef676a9af504510bf0 100644 (file)
@@ -261,10 +261,13 @@ static const Parameter react_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* react_help =
+    "send response to client and terminate session";
+
 class ReactModule : public Module
 {
 public:
-    ReactModule() : Module(s_name, react_params) { };
+    ReactModule() : Module(s_name, react_help, react_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index adb782a0d28d87aa6800b2b2dea6e1be3fa147f4..deab2c8971f9334dfd7565758806e2ca65d68e1b 100644 (file)
@@ -146,10 +146,13 @@ static const Parameter rej_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* rej_help =
+    "terminate session with TCP reset or ICMP unreachable";
+
 class RejectModule : public Module
 {
 public:
-    RejectModule() : Module(s_name, rej_params) { };
+    RejectModule() : Module(s_name, rej_help, rej_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
index 3cba768eab51f833c80d2f155c9db00f37ec8b60..6cabb26ea62f74c48051b65bbcfdd44431f6cf18 100644 (file)
@@ -105,10 +105,13 @@ static const Parameter rep_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* rep_help =
+    "overwrite packet contents";
+
 class ReplaceModule : public Module
 {
 public:
-    ReplaceModule() : Module(s_name, rep_params) { };
+    ReplaceModule() : Module(s_name, rep_help, rep_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
index d1eddc94e33fb1c94be17cab99e1520d78c12552..926de8e4d618d515b23d97473225c24edff7791f 100644 (file)
@@ -213,11 +213,11 @@ enum CodecSid {
 class DecodeModule : public Module
 {
 public:
-    DecodeModule(const char* s) : Module(s)
+    DecodeModule(const char* s, const char* h) : Module(s, h)
     { };
 
-    DecodeModule(const char* s, const Parameter* p, bool is_list = false)
-    : Module(s, p, is_list) { };
+    DecodeModule(const char* s, const char* h, const Parameter* p, bool is_list = false)
+    : Module(s, h, p, is_list) { };
 
     unsigned get_gid() const
     { return GID_DECODE; };
index 50341a13d6106843cbeb9bbed9f401ad02095b9f..32ef1b989e82b310d567ab41ce9504c9150444f4 100644 (file)
@@ -44,10 +44,13 @@ static const RuleMap auth_rules[] =
     { 0, nullptr }
 };
 
+static const char* s_help =
+    "support for IP authentication header";
+
 class AuthModule : public DecodeModule
 {
 public:
-    AuthModule() : DecodeModule(CD_AUTH_NAME) {}
+    AuthModule() : DecodeModule(CD_AUTH_NAME, s_help) {}
 
     const RuleMap* get_rules() const
     { return auth_rules; }
@@ -58,7 +61,6 @@ public:
 // auth module
 //-------------------------------------------------------------------------
 
-
 class AuthCodec : public Codec
 {
 public:
index 3c576f4d2369b0f6bea677044fac43810091a29e..1a86c049deec8cc4e8bd6ea2648968c5d74797e6 100644 (file)
@@ -52,11 +52,13 @@ static const Parameter esp_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* esp_help =
+    "support for encapsulating security payload";
 
 class EspModule : public DecodeModule
 {
 public:
-    EspModule() : DecodeModule(CD_ESP_NAME, esp_params) {}
+    EspModule() : DecodeModule(CD_ESP_NAME, esp_help, esp_params) {}
 
     const RuleMap* get_rules() const
     { return esp_rules; }
index 1fa7df200a58e6cbb943b146d66c7ed3296e724f..0949d26b7c72b6074327c28cefa2b8615aa8bcbd 100644 (file)
@@ -47,20 +47,18 @@ static const RuleMap gre_rules[] =
     { 0, nullptr }
 };
 
+static const char* gre_help =
+    "support for generic routing encapsulation";
 
 class GreModule : public DecodeModule
 {
 public:
-    GreModule() : DecodeModule(CD_GRE_NAME) {}
+    GreModule() : DecodeModule(CD_GRE_NAME, gre_help) {}
 
     const RuleMap* get_rules() const
     { return gre_rules; }
 };
 
-
-
-
-
 class GreCodec : public Codec
 {
 public:
index 89de5a60b60896b8a874c5ab00fcc23f4421235f..4d7b0dea97cd9b3b38d3a195d33af4b5214be3c3 100644 (file)
@@ -71,17 +71,18 @@ static const RuleMap icmp4_rules[] =
     { 0, nullptr }
 };
 
+static const char* icmp4_help =
+    "support for internet control message protocol v4";
+
 class Icmp4Module : public DecodeModule
 {
 public:
-    Icmp4Module() : DecodeModule(CD_ICMP4_NAME) {}
+    Icmp4Module() : DecodeModule(CD_ICMP4_NAME, icmp4_help) {}
 
     const RuleMap* get_rules() const
     { return icmp4_rules; }
 };
 
-
-
 class Icmp4Codec : public Codec{
 
 public:
index d7caf87956c4ddff85d406307638a8d0b1fc293a..6ede9d1feb2bdd6e4ba298fc7d5b6a705c6cc3a9 100644 (file)
@@ -59,10 +59,13 @@ static const RuleMap icmp6_rules[] =
     { 0, nullptr }
 };
 
+static const char* icmp6_help =
+    "support for internet control message protocol v6";
+
 class Icmp6Module : public DecodeModule
 {
 public:
-    Icmp6Module() : DecodeModule(CD_ICMP6_NAME) {}
+    Icmp6Module() : DecodeModule(CD_ICMP6_NAME, icmp6_help) {}
 
     const RuleMap* get_rules() const
     { return icmp6_rules; }
index e15d94fa57ff5fa4d007d0792d7487430695ec24..677fc231ae804f68b638e6e2ee6fdab0a2547712 100644 (file)
@@ -43,11 +43,13 @@ static const RuleMap igmp_rules[] =
     { 0, nullptr }
 };
 
+static const char* igmp_help =
+    "support for internet group management protocol";
 
 class IgmpModule : public DecodeModule
 {
 public:
-    IgmpModule() : DecodeModule(CD_IGMP_NAME) {}
+    IgmpModule() : DecodeModule(CD_IGMP_NAME, igmp_help) {}
 
     const RuleMap* get_rules() const
     { return igmp_rules; }
index ed5f05e315d729df91133d0148a7633801ea6e82..d9abc8ab66bf67186e5ca952a907b1dfbd903634 100644 (file)
@@ -84,17 +84,18 @@ static const RuleMap ipv4_rules[] =
     { 0, nullptr }
 };
 
+static const char* ipv4_help =
+    "support for internet protocol v4";
+
 class Ipv4Module : public DecodeModule
 {
 public:
-    Ipv4Module() : DecodeModule(CD_IPV4_NAME) {}
+    Ipv4Module() : DecodeModule(CD_IPV4_NAME, ipv4_help) {}
 
     const RuleMap* get_rules() const
     { return ipv4_rules; }
 };
 
-
-
 class Ipv4Codec : public Codec
 {
 public:
index 3f6b2b2ed78782935c43e288e0dd748dcae8c464..ac4a10b4a2dd3670428ba50dcacfe8c34ab24a23 100644 (file)
@@ -71,11 +71,13 @@ static const RuleMap ipv6_rules[] =
     { 0, nullptr }
 };
 
+static const char* ipv6_help =
+    "support for internet protocol v6";
 
 class Ipv6Module : public DecodeModule
 {
 public:
-    Ipv6Module() : DecodeModule(CD_IPV6_NAME) {}
+    Ipv6Module() : DecodeModule(CD_IPV6_NAME, ipv6_help) {}
 
     const RuleMap* get_rules() const
     { return ipv6_rules; }
index aaf0b781735830abe4626ae73b9992d805826bec..0fcdac164e3d6c7adc81d589ae543893ff1fa4c8 100644 (file)
@@ -42,11 +42,13 @@ static const RuleMap pgm_rules[] =
     { 0, nullptr }
 };
 
+static const char* pgm_help =
+    "support for pragmatic general multicast";
 
 class PgmModule : public DecodeModule
 {
 public:
-    PgmModule() : DecodeModule(CD_PGM_NAME) {}
+    PgmModule() : DecodeModule(CD_PGM_NAME, pgm_help) {}
 
     const RuleMap* get_rules() const
     { return pgm_rules; }
index 5bbf58fbf32262ead3536d76dc23600d2bfd43c1..7e0ba42e4bfab91a71a01b7993a0c59e2f37f7b8 100644 (file)
@@ -79,18 +79,18 @@ static const RuleMap tcp_rules[] =
     { 0, nullptr }
 };
 
+static const char* tcp_help =
+    "support for transmission control protocol";
 
 class TcpModule : public DecodeModule
 {
 public:
-    TcpModule() : DecodeModule(CD_TCP_NAME) {}
+    TcpModule() : DecodeModule(CD_TCP_NAME, tcp_help) {}
 
     const RuleMap* get_rules() const
     { return tcp_rules; }
 };
 
-
-
 class TcpCodec : public Codec
 {
 public:
index 8ac7397d64a10e3d292f0e2cdde8e36c511c608e..1d1eb63877911b1b56287ad844d08bb1d8d668c8 100644 (file)
@@ -83,10 +83,13 @@ static const RuleMap udp_rules[] =
     { 0, nullptr }
 };
 
+static const char* udp_help =
+    "support for user datagram protocol";
+
 class UdpModule : public DecodeModule
 {
 public:
-    UdpModule() : DecodeModule(CD_UDP_NAME, udp_params) {}
+    UdpModule() : DecodeModule(CD_UDP_NAME, udp_help, udp_params) {}
 
     const RuleMap* get_rules() const
     { return udp_rules; }
index 1c794adb4c64f498b791f5c3c4ea340e9acbfc35..5bb51c6b1e2512413bccba7cccd5679ac398989b 100644 (file)
 */
 // cd_arp.cc author Josh Rosenbaum <jrosenba@cisco.com>
 
-
-
-
-
-
 #include "framework/codec.h"
 #include "codecs/decode_module.h"
 #include "codecs/codec_events.h"
@@ -43,11 +38,13 @@ static const RuleMap arp_rules[] =
     { 0, nullptr }
 };
 
+static const char* arp_help =
+    "support for address resolution protocol";
 
 class ArpModule : public DecodeModule
 {
 public:
-    ArpModule() : DecodeModule(CD_ARP_NAME) {}
+    ArpModule() : DecodeModule(CD_ARP_NAME, arp_help) {}
 
     const RuleMap* get_rules() const
     { return arp_rules; }
index eda308871859db1758f8e1227b39ca349dfb3351..1a6c12da42e175b92c37eda864d0ab0ff61c8a06 100644 (file)
@@ -44,10 +44,13 @@ static const RuleMap eapol_rules[] =
     { 0, nullptr }
 };
 
+static const char* eapol_help =
+    "support for extensible authentication protocol over LAN";
+
 class EapolModule : public DecodeModule
 {
 public:
-    EapolModule() : DecodeModule(CD_EAPOL_NAME) {}
+    EapolModule() : DecodeModule(CD_EAPOL_NAME, eapol_help) {}
 
     const RuleMap* get_rules() const
     { return eapol_rules; }
index ec6250ed46c05466214b2ffc4310a5821b676e81..e4c54380dc2030a342b4c515b5d8f41824f8a19c 100644 (file)
@@ -39,10 +39,13 @@ static const RuleMap erspan2_rules[] =
     { 0, nullptr }
 };
 
+static const char* erspan2_help =
+    "support for encapsulated remote switched port analyzer - type 2";
+
 class Erspan2Module : public DecodeModule
 {
 public:
-    Erspan2Module() : DecodeModule(CD_ERSPAN2_NAME) {}
+    Erspan2Module() : DecodeModule(CD_ERSPAN2_NAME, erspan2_help) {}
 
     const RuleMap* get_rules() const
     { return erspan2_rules; }
index bd0fd34744b2efea091310f9f5a01517c8abd97f..faa7a54a1e017e5926001644144ff55f403ad7f4 100644 (file)
@@ -40,10 +40,13 @@ static const RuleMap erspan3_rules[] =
     { 0, nullptr }
 };
 
+static const char* erspan3_help =
+    "support for encapsulated remote switched port analyzer - type 3";
+
 class Erspan3Module : public DecodeModule
 {
 public:
-    Erspan3Module() : DecodeModule(CD_ERSPAN3_NAME) {}
+    Erspan3Module() : DecodeModule(CD_ERSPAN3_NAME, erspan3_help) {}
 
     const RuleMap* get_rules() const
     { return erspan3_rules; }
index cc69a8990dbf75f1537f3da12d8cf4a420e8a621..2f208b70fb494369d6d5de89a1646fe714a77432 100644 (file)
@@ -71,10 +71,13 @@ static const RuleMap mpls_rules[] =
     { 0, nullptr }
 };
 
+static const char* mpls_help =
+    "support for multiprotocol label switching";
+
 class MplsModule : public DecodeModule
 {
 public:
-    MplsModule() : DecodeModule(CD_MPLS_NAME, mpls_params) {};
+    MplsModule() : DecodeModule(CD_MPLS_NAME, mpls_help, mpls_params) {};
 
     const RuleMap* get_rules() const
     { return mpls_rules; }
index 8e59c6e2441c05a4b1cdc0a2fa2b5f29322cfdf1..aa149cae2cadca7eda7a1d0cf25d2e7ff490b9ed 100644 (file)
@@ -64,10 +64,13 @@ static const RuleMap pppoe_rules[] =
     { 0, nullptr }
 };
 
+static const char* pppoe_help =
+    "support for point-to-point protocol over ethernet";
+
 class PPPoEModule : public DecodeModule
 {
 public:
-    PPPoEModule() : DecodeModule(CD_PPPOE_NAME) {}
+    PPPoEModule() : DecodeModule(CD_PPPOE_NAME, pppoe_help) {}
 
     const RuleMap* get_rules() const
     { return pppoe_rules; }
index d90ff13240a78116bd1403b4d468e6aac6e142f1..d58fa99b1bff1eb5f9a234a76288690f7b8d7dce 100644 (file)
@@ -45,10 +45,13 @@ static const RuleMap vlan_rules[] =
     { 0, nullptr }
 };
 
+static const char* vlan_help =
+    "support for virtual local area network";
+
 class VlanModule : public DecodeModule
 {
 public:
-    VlanModule() : DecodeModule(CD_VLAN_NAME) {}
+    VlanModule() : DecodeModule(CD_VLAN_NAME, vlan_help) {}
 
     const RuleMap* get_rules() const
     { return vlan_rules; }
index 5626ae5d8e202084c5f41b9012458d6800211408..19fbde7cc976380738f9b8d0b4710c2a0fc47d3a 100644 (file)
@@ -47,10 +47,13 @@ static const RuleMap gtp_rules[] =
     { 0, nullptr }
 };
 
+static const char* gtp_help =
+    "support for general-packet-radio-service tunnelling protocol";
+
 class GtpModule : public DecodeModule
 {
 public:
-    GtpModule() : DecodeModule(CD_GTP_NAME) {};
+    GtpModule() : DecodeModule(CD_GTP_NAME, gtp_help) {};
 
     const RuleMap* get_rules() const
     { return gtp_rules; }
index 97dd53468193d7252962a36c91bcce9bcd158789..4ca173d5218a16b4a4f955a45f4a65810211c576 100644 (file)
@@ -42,10 +42,13 @@ static const RuleMap eth_rules[] =
     { 0, nullptr }
 };
 
+static const char* eth_help =
+    "support for ethernet protocol";
+
 class EthModule : public DecodeModule
 {
 public:
-    EthModule() : DecodeModule(CD_ETH_NAME) {}
+    EthModule() : DecodeModule(CD_ETH_NAME, eth_help) {}
 
     const RuleMap* get_rules() const
     { return eth_rules; }
index c8332dfad1d6b25f834edc638fbb9aa6bcb4bdf1..794c3d349ed2524e332a70dd48dac0322f3a6320 100644 (file)
@@ -48,10 +48,13 @@ static const RuleMap wlan_rules[] =
     { 0, nullptr }
 };
 
+static const char* wlan_help =
+    "support for wireless local area network protocol";
+
 class WlanCodecModule : public DecodeModule
 {
 public:
-    WlanCodecModule() : DecodeModule(CD_WLAN_NAME) {}
+    WlanCodecModule() : DecodeModule(CD_WLAN_NAME, wlan_help) {}
 
     const RuleMap* get_rules() const
     { return wlan_rules; }
index 09baa2032e0aebf0f3d86ed8856fd7db50145d2b..4bd633e33c16e8b1b8b42b85c3b99291bbb0605e 100644 (file)
@@ -27,6 +27,9 @@
 
 #define CODEC_NAME "name"
 
+static const char* name_help =
+    "support for name protocol";
+
 // inherit from DecodeModule rather than Module so the GID for
 // all codecs are identical. Additionally, all of the SIDS are
 // defined in DecodeModule. So, when creating new events, you
@@ -34,7 +37,7 @@
 class NameModule : public DecodeModule
 {
 public:
-    NameModule();
+    NameModule() : Module("name", name_help) { };
 
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
index 60d5e2e8fc7e0768bf5b07a244192a2128e6b31d..940eb5a5f554175c9ad92ea67f51db76730fefa2 100644 (file)
@@ -27,9 +27,10 @@ static const Parameter null_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-void Module::init(const char* s)
+void Module::init(const char* s, const char* h)
 {
     name = s;
+    help = h;
     params = null_params;
     list = false;
     cmds = nullptr;
@@ -37,12 +38,12 @@ void Module::init(const char* s)
     num_counts = -1;
 }
 
-Module::Module(const char* s)
-{ init(s); }
+Module::Module(const char* s, const char* h)
+{ init(s, h); }
 
-Module::Module(const char* s, const Parameter* p, bool is_list)
+Module::Module(const char* s, const char* h, const Parameter* p, bool is_list)
 {
-    init(s);
+    init(s, h);
     params = p;
     list = is_list;
 }
index 8684336a570013698cc3d1983bbfd11b7bdbc583..36e4a6679e684cf21832134fd59cd5a628a24afd 100644 (file)
@@ -93,6 +93,9 @@ public:
             return params->type;
     };
 
+    const char* get_help() const
+    { return help; };
+
     const Parameter* get_parameters() const
     { return params; };
 
@@ -117,23 +120,30 @@ public:
         unsigned /*index*/, const char*& /*name*/, const char*& /*parent*/) const
     { return nullptr; };
 
+    virtual const char* get_defaults() const
+    { return nullptr; };
+
     virtual void sum_stats();
     virtual void show_stats();
     virtual void reset_stats();
 
 protected:
-    Module(const char*);
-    Module(const char*, const Parameter*, bool is_list = false);
+    Module(const char* name, const char* help);
+    Module(const char* name, const char* help, const Parameter*, bool is_list = false);
 
 private:
     friend class ModuleManager;
-    void init(const char* s);
+    void init(const char*, const char* = nullptr);
 
-    bool list;
     const char* name;
+    const char* help;
+
     const Parameter* params;
+    bool list;
+
     const Command* cmds;
     const RuleMap* rules;
+
     std::vector<PegCount> counts;
     int num_counts;
 };
index 87f5bfacd6432d6e9ce9fca3c5570ae1bf32c445..171dabf43c6e0aeadd7bb075beb57373ede2ee89 100644 (file)
@@ -110,7 +110,7 @@ int TcpAckOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter ack_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "check if packet payload size is min<>max | <max | >min" },
@@ -118,10 +118,13 @@ static const Parameter ack_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to match on TCP ack numbers";
+
 class AckModule : public Module
 {
 public:
-    AckModule() : Module(s_name, ack_params) { };
+    AckModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 2af08c40fef592651c043caee88dac3c34bbb4ce..e35224f25e5e890f9ca653865689dbf5bbf005ad 100644 (file)
@@ -191,7 +191,7 @@ int Asn1Option::eval(Cursor& c, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter asn1_params[] =
+static const Parameter s_params[] =
 {
     { BITSTRING_OPT, Parameter::PT_IMPLIED, nullptr, nullptr,
       "Detects invalid bitstring encodings that are known to be remotely exploitable." },
@@ -214,10 +214,13 @@ static const Parameter asn1_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option for asn1 detection";
+
 class Asn1Module : public Module
 {
 public:
-    Asn1Module() : Module(s_name, asn1_params) { };
+    Asn1Module() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index ff15d4f54902874017fbfa6f9d575a069da62265..8fc3aee1858ae81ec50952b331dc3276b4d82fa6 100644 (file)
@@ -185,7 +185,7 @@ int Base64DecodeOption::eval(Cursor& c, Packet*)
 // decode module
 //-------------------------------------------------------------------------
 
-static const Parameter decode_params[] =
+static const Parameter s_params[] =
 {
     { "bytes", Parameter::PT_INT, "1:", nullptr,
       "Number of base64 encoded bytes to decode." },
@@ -199,10 +199,13 @@ static const Parameter decode_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to decode base64 data - must be used with base64_data option";
+
 class B64DecodeModule : public Module
 {
 public:
-    B64DecodeModule() : Module(s_name, decode_params) { };
+    B64DecodeModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 29fe21bce3e4c5085af5d838cb92ad7c40c0e312..026452dbe4df6c910a19b5006fdd554b14d80cfa 100644 (file)
@@ -104,7 +104,7 @@ int LenOption::eval(Cursor& c, Packet*)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter len_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "min<>max | <max | >min" },
@@ -112,10 +112,13 @@ static const Parameter len_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check length of current buffer";
+
 class LenModule : public Module
 {
 public:
-    LenModule() : Module(s_name, len_params) { };
+    LenModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 10f454c21ba7f61e6fccf7a371554130f46ac48d..cdd6ab3b2816d2305ea32b5b750583edfd531d8d 100644 (file)
@@ -380,7 +380,7 @@ static bool ByteExtractVerify(ByteExtractData *data)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter extract_params[] =
+static const Parameter s_params[] =
 {
     { "~count", Parameter::PT_INT, "1:10", nullptr,
       "number of bytes to pick up from the buffer" },
@@ -424,10 +424,13 @@ static const Parameter extract_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to convert data to an integer variable";
+
 class ExtractModule : public Module
 {
 public:
-    ExtractModule() : Module(s_name, extract_params) { };
+    ExtractModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
index 5943ef620b19eb71865384ecbc0f01a6c1a77d97..8b4c9d8aab7c5e57fab7a7e8d5a2851844860077 100644 (file)
@@ -304,7 +304,7 @@ int ByteJumpOption::eval(Cursor& c, Packet*)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter jump_params[] =
+static const Parameter s_params[] =
 {
     { "~count", Parameter::PT_INT, "1:10", nullptr,
       "number of bytes to pick up from the buffer" },
@@ -351,10 +351,13 @@ static const Parameter jump_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to move the detection cursor";
+
 class ByteJumpModule : public Module
 {
 public:
-    ByteJumpModule() : Module(s_name, jump_params) { };
+    ByteJumpModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
index c64c1d64e985364baef9b2bbbf7e8a099d29ba73..6b226f4ea03c1cffc96556f5793709d544240125 100644 (file)
@@ -441,7 +441,7 @@ static void parse_operator(const char* cptr, ByteTestData& idx)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter jump_params[] =
+static const Parameter s_params[] =
 {
     { "~count", Parameter::PT_INT, "1:10", nullptr,
       "number of bytes to pick up from the buffer" },
@@ -482,10 +482,13 @@ static const Parameter jump_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to convert data to integer and compare";
+
 class ByteTestModule : public Module
 {
 public:
-    ByteTestModule() : Module(s_name, jump_params) { };
+    ByteTestModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
index 1fd2fd908825f51d604db28ba4bf54b70ab3e71a..0f3a02fb3f1328a1df02c63d4787bcba394c9a75 100644 (file)
@@ -42,7 +42,7 @@ static const char* s_name = "classtype";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter classtype_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_STRING, nullptr, nullptr,
       "classification for this rule" },
@@ -50,10 +50,13 @@ static const Parameter classtype_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "general rule option for rule classification";
+
 class ClassTypeModule : public Module
 {
 public:
-    ClassTypeModule() : Module(s_name, classtype_params) { };
+    ClassTypeModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     ClassType* type;
 };
index 62e79fa15e9518e59b7e599bb2cfb5068015fe7d..af316b7d574f9ab11df9a4d83e32a37282278f5f 100644 (file)
@@ -679,7 +679,7 @@ static void parse_within(PatternMatchData* pmd, const char *data)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter content_params[] =
+static const Parameter s_params[] =
 {
     { "~data", Parameter::PT_STRING, nullptr, nullptr,
       "data to match" },
@@ -711,10 +711,13 @@ static const Parameter content_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "payload rule option for basic pattern matching";
+
 class ContentModule : public Module
 {
 public:
-    ContentModule() : Module(s_name, content_params)
+    ContentModule() : Module(s_name, s_help, s_params)
     { pmd = nullptr; };
 
     ~ContentModule()
index dc67f3ab78f2e2ecc46ee0a9c9ce4ba311ad810c..72dfc6222a1e10a3d9fdad938efa75587bd177ee 100644 (file)
@@ -429,7 +429,7 @@ static void CvsGetEOL(const uint8_t *ptr, const uint8_t *end,
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter cvs_params[] =
+static const Parameter s_params[] =
 {
     { CVS_CONF_INVALID_ENTRY_STR, Parameter::PT_IMPLIED, nullptr, nullptr,
       "looks for an invalid Entry string" },
@@ -437,10 +437,13 @@ static const Parameter cvs_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "payload rule option for detecting specific attacks";
+
 class CvsModule : public Module
 {
 public:
-    CvsModule() : Module(s_name, cvs_params) { };
+    CvsModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 24f880f73b8ff531bef963d722864e4a05afd2b9..97a8739d303f4103850c686dd978d8f91a52645a 100644 (file)
@@ -47,7 +47,7 @@ static const char* s_name = "detection_filter";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter detection_filter_params[] =
+static const Parameter s_params[] =
 {
     { "track", Parameter::PT_ENUM, "by_src | by_dst", nullptr,
       "track hits by source or destination IP address" },
@@ -61,10 +61,13 @@ static const Parameter detection_filter_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to require multiple hits before a rule generates an event";
+
 class DetectionFilterModule : public Module
 {
 public:
-    DetectionFilterModule() : Module(s_name, detection_filter_params) { };
+    DetectionFilterModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
 
index 88017ec69d485aec5ce8f59dc2a5d29b74d6abb2..2f2759334d86e6a4c3f3015e8f15ee81fe9f75d5 100644 (file)
@@ -122,7 +122,7 @@ int DsizeOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter dsize_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "check if packet payload size is min<>max | <max | >min" },
@@ -130,10 +130,13 @@ static const Parameter dsize_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to test payload size";
+
 class DsizeModule : public Module
 {
 public:
-    DsizeModule() : Module(s_name, dsize_params) { };
+    DsizeModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index ac1453a537bca9b294c356a77f4f40a2a6558d46..df70d960fcceca4654e6643a75727d6461a09fda 100644 (file)
@@ -86,10 +86,13 @@ int FileDataOption::eval(Cursor& c, Packet*)
 // module
 //-------------------------------------------------------------------------
 
+static const char* s_help =
+    "rule option to set detection cursor to file data";
+
 class FileDataModule : public Module
 {
 public:
-    FileDataModule() : Module(s_name) { };
+    FileDataModule() : Module(s_name, s_help) { };
 
     ProfileStats* get_profile() const
     { return &fileDataPerfStats; };
index 7f0efbee32473e573f99cdcf53314ad570f16691..9ab82acaf491a22d82e092c72e6c74c68430a337 100644 (file)
@@ -398,7 +398,7 @@ static void flags_parse_mask(const char *rule, TcpFlagCheckData *idx)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter flags_params[] =
+static const Parameter s_params[] =
 {
     { "~test_flags", Parameter::PT_STRING, nullptr, nullptr,
       "these flags are tested" },
@@ -409,10 +409,13 @@ static const Parameter flags_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to test TCP control flags";
+
 class FlagsModule : public Module
 {
 public:
-    FlagsModule() : Module(s_name, flags_params) { };
+    FlagsModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index da02b010b2dd68e3152a1a0b3fbd6864d8c298b2..28f20c9c2490ecc2a02a54290e045980dcd97d02 100644 (file)
@@ -331,7 +331,7 @@ static void flow_verify(FlowCheckData* fcd)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter flow_params[] =
+static const Parameter s_params[] =
 {
     { "to_client", Parameter::PT_IMPLIED, nullptr, nullptr,
       "match on server responses" },
@@ -369,10 +369,13 @@ static const Parameter flow_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check session properties";
+
 class FlowModule : public Module
 {
 public:
-    FlowModule() : Module(s_name, flow_params) { };
+    FlowModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 9e99a4291873ee405fffb73f958aef923cf68d15..0be05fd1cd68dc9c8f3d87c2ebeb03d4e9b29d7d 100644 (file)
@@ -1128,7 +1128,7 @@ static void flowbits_gterm(SnortConfig*)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter flowbits_params[] =
+static const Parameter s_params[] =
 {
     { "~command", Parameter::PT_STRING, nullptr, nullptr,
       "set|reset|isset|etc." },
@@ -1142,10 +1142,13 @@ static const Parameter flowbits_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to set and test arbitrary boolean flags";
+
 class FlowbitsModule : public Module
 {
 public:
-    FlowbitsModule() : Module(s_name, flowbits_params) { };
+    FlowbitsModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 66a4148fa0697ee6de70dc474379e2883e85ef7a..97f0ea95b68e40b93fce3ac36d0901d820d3f077 100644 (file)
@@ -299,7 +299,7 @@ void fragbits_parse(const char *data, FragBitsData *ds_ptr)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter fragbits_params[] =
+static const Parameter s_params[] =
 {
     { "~flags", Parameter::PT_STRING, nullptr, nullptr,
       "these flags are tested" },
@@ -307,10 +307,13 @@ static const Parameter fragbits_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to test IP frag flags";
+
 class FragBitsModule : public Module
 {
 public:
-    FragBitsModule() : Module(s_name, fragbits_params) { };
+    FragBitsModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 6b8fc0b1321218ada10300a00916d2b2a6b16104..053946c6c01a1c95cb83466ab36051829d858312 100644 (file)
@@ -112,7 +112,7 @@ int FragOffsetOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter fragoff_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "check if packet payload size is min<>max | <max | >min" },
@@ -120,10 +120,13 @@ static const Parameter fragoff_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to test IP frag offset";
+
 class FragOffsetModule : public Module
 {
 public:
-    FragOffsetModule() : Module(s_name, fragoff_params) { };
+    FragOffsetModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 1d494ca134ce4e48eb697499a1bdc87a88320b03..c995fd5f54a1df338a350465e3ff2ac8dbaf574d 100644 (file)
@@ -39,7 +39,7 @@ static const char* s_name = "gid";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter gid_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_INT, "1:", nullptr,
       "generator id" },
@@ -47,10 +47,13 @@ static const Parameter gid_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option specifying rule generator";
+
 class GidModule : public Module
 {
 public:
-    GidModule() : Module(s_name, gid_params) { };
+    GidModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     int gid;
 };
index b37984e1ee2e1cf4be832fca4d645410f4b95962..e9576d2df4724f4e7bb21297e5ee8fe78b7fb3f4 100644 (file)
@@ -41,8 +41,8 @@
 class HttpCursorModule : public Module
 {
 public:
-    HttpCursorModule(const char* s, ProfileStats& p) :
-        Module(s), ps(p) { };
+    HttpCursorModule(const char* s, const char* h, ProfileStats& p) :
+        Module(s, h), ps(p) { };
 
     ProfileStats* get_profile() const
     { return &ps; };
@@ -114,11 +114,14 @@ int HttpIpsOption::eval(Cursor& c, Packet* p)
 #undef IPS_OPT
 #define IPS_OPT "http_uri"
 
+static const char* uri_help =
+    "rule option to set the detection cursor to the normalized URI buffer";
+
 static THREAD_LOCAL ProfileStats uri_ps;
 
 static Module* uri_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, uri_ps);
+    return new HttpCursorModule(IPS_OPT, uri_help, uri_ps);
 }
 
 static IpsOption* uri_opt_ctor(Module*, OptTreeNode*)
@@ -154,16 +157,19 @@ static const IpsApi uri_api =
 #undef IPS_OPT
 #define IPS_OPT "http_client_body"
 
-static THREAD_LOCAL ProfileStats client_body_ps;
+static const char* cb_help =
+    "rule option to set the detection cursor to the request body";
+
+static THREAD_LOCAL ProfileStats cb_ps;
 
 static Module* client_body_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, client_body_ps);
+    return new HttpCursorModule(IPS_OPT, cb_help, cb_ps);
 }
 
 static IpsOption* client_body_opt_ctor(Module*, OptTreeNode*)
 {
-    return new HttpIpsOption(IPS_OPT, client_body_ps, CAT_SET_BODY);
+    return new HttpIpsOption(IPS_OPT, cb_ps, CAT_SET_BODY);
 }
 
 static const IpsApi client_body_api =
@@ -194,16 +200,19 @@ static const IpsApi client_body_api =
 #undef IPS_OPT
 #define IPS_OPT "http_method"
 
-static THREAD_LOCAL ProfileStats method_ps;
+static const char* meth_help =
+    "rule option to set the detection cursor to the HTTP request method";
+
+static THREAD_LOCAL ProfileStats meth_ps;
 
 static Module* method_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, method_ps);
+    return new HttpCursorModule(IPS_OPT, meth_help, meth_ps);
 }
 
 static IpsOption* method_opt_ctor(Module*, OptTreeNode*)
 {
-    return new HttpIpsOption(IPS_OPT, method_ps);
+    return new HttpIpsOption(IPS_OPT, meth_ps);
 }
 
 static const IpsApi method_api =
@@ -234,11 +243,14 @@ static const IpsApi method_api =
 #undef IPS_OPT
 #define IPS_OPT "http_cookie"
 
+static const char* cookie_help = 
+    "rule option to set the detection cursor to the HTTP cookie";
+
 static THREAD_LOCAL ProfileStats cookie_ps;
 
 static Module* cookie_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, cookie_ps);
+    return new HttpCursorModule(IPS_OPT, cookie_help, cookie_ps);
 }
 
 static IpsOption* cookie_opt_ctor(Module*, OptTreeNode*)
@@ -274,11 +286,14 @@ static const IpsApi cookie_api =
 #undef IPS_OPT
 #define IPS_OPT "http_stat_code"
 
+static const char* stat_code_help = 
+    "rule option to set the detection cursor to the HTTP status code";
+
 static THREAD_LOCAL ProfileStats stat_code_ps;
 
 static Module* stat_code_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, stat_code_ps);
+    return new HttpCursorModule(IPS_OPT, stat_code_help, stat_code_ps);
 }
 
 static IpsOption* stat_code_opt_ctor(Module*, OptTreeNode*)
@@ -314,11 +329,14 @@ static const IpsApi stat_code_api =
 #undef IPS_OPT
 #define IPS_OPT "http_stat_msg"
 
+static const char* stat_msg_help = 
+    "rule option to set the detection cursor to the HTTP status message";
+
 static THREAD_LOCAL ProfileStats stat_msg_ps;
 
 static Module* stat_msg_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, stat_msg_ps);
+    return new HttpCursorModule(IPS_OPT, stat_msg_help, stat_msg_ps);
 }
 
 static IpsOption* stat_msg_opt_ctor(Module*, OptTreeNode*)
@@ -354,11 +372,14 @@ static const IpsApi stat_msg_api =
 #undef IPS_OPT
 #define IPS_OPT "http_raw_uri"
 
+static const char* raw_uri_help = 
+    "rule option to set the detection cursor to the unnormalized URI";
+
 static THREAD_LOCAL ProfileStats raw_uri_ps;
 
 static Module* raw_uri_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, raw_uri_ps);
+    return new HttpCursorModule(IPS_OPT, raw_uri_help, raw_uri_ps);
 }
 
 static IpsOption* raw_uri_opt_ctor(Module*, OptTreeNode*)
@@ -394,11 +415,14 @@ static const IpsApi raw_uri_api =
 #undef IPS_OPT
 #define IPS_OPT "http_raw_header"
 
+static const char* raw_header_help = 
+    "rule option to set the detection cursor to the unnormalized headers";
+
 static THREAD_LOCAL ProfileStats raw_header_ps;
 
 static Module* raw_header_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, raw_header_ps);
+    return new HttpCursorModule(IPS_OPT, raw_header_help, raw_header_ps);
 }
 
 static IpsOption* raw_header_opt_ctor(Module*, OptTreeNode*)
@@ -434,11 +458,14 @@ static const IpsApi raw_header_api =
 #undef IPS_OPT
 #define IPS_OPT "http_raw_cookie"
 
+static const char* raw_cookie_help = 
+    "rule option to set the detection cursor to the unnormalized cookie";
+
 static THREAD_LOCAL ProfileStats raw_cookie_ps;
 
 static Module* raw_cookie_mod_ctor()
 {
-    return new HttpCursorModule(IPS_OPT, raw_cookie_ps);
+    return new HttpCursorModule(IPS_OPT, raw_cookie_help, raw_cookie_ps);
 }
 
 static IpsOption* raw_cookie_opt_ctor(Module*, OptTreeNode*)
index f9f12258c4185a77dcfa2009b6ba81be91b2c1d9..11d201b214871b19131b5cbe2e592dababfab8eb 100644 (file)
@@ -41,7 +41,7 @@ static const char* s_name = "http_header";
 
 static THREAD_LOCAL ProfileStats httpHeaderPerfStats;
 
-static const Parameter hh_params[] =
+static const Parameter s_params[] =
 {
     { "~name", Parameter::PT_STRING, nullptr, nullptr,
       "restrict to given header" },
@@ -53,10 +53,13 @@ static const Parameter hh_params[] =
 // module
 //-------------------------------------------------------------------------
 
+static const char* s_help =
+    "rule option to set the detection cursor to the normalized header(s)";
+
 class HttpHeaderModule : public Module
 {
 public:
-    HttpHeaderModule() : Module(s_name, hh_params) { };
+    HttpHeaderModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 123bac74f88d255851b77579eccc700994a76423..8b28aaa89f03a6bbd495c4837dfe36ee1de9f81f 100644 (file)
@@ -134,18 +134,21 @@ int IcmpIdOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter icmp_id_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
-      "check if packet payload size is min<>max | <max | >min" },
+      "check if icmp id is min<>max | <max | >min" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check ICMP ID";
+
 class IcmpIdModule : public Module
 {
 public:
-    IcmpIdModule() : Module(s_name, icmp_id_params) { };
+    IcmpIdModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 8554279562ec238a933700a94d93e346bc1ccac8..7538d4645848000ed8dd27533af4223ef05dcf64 100644 (file)
@@ -136,18 +136,21 @@ int IcmpSeqOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter icmp_id_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
-      "check if packet payload size is min<>max | <max | >min" },
+      "check if icmp sequence number is min<>max | <max | >min" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check ICMP sequence number";
+
 class IcmpSeqModule : public Module
 {
 public:
-    IcmpSeqModule() : Module(s_name, icmp_id_params) { };
+    IcmpSeqModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index e7b7f850b2f27256ecac70186ebdce0f835e2255..0679ea5c0b44a9d33e034e45668a417d2ea3258e 100644 (file)
@@ -108,18 +108,21 @@ int IcodeOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter icmp_id_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
-      "check if packet payload size is min<>max | <max | >min" },
+      "check if ICMP code is min<>max | <max | >min" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check ICMP code";
+
 class IcodeModule : public Module
 {
 public:
-    IcodeModule() : Module(s_name, icmp_id_params) { };
+    IcodeModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index e466e2938c742d3068fb84dcf382b84c9d1cce1f..4f36755ad1998ed97b1a388ec6076272d239b2e5 100644 (file)
@@ -104,18 +104,21 @@ int IpIdOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter ip_id_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
-      "check if packet payload size is min<>max | <max | >min" },
+      "check if the IP ID is min<>max | <max | >min" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check the IP ID field";
+
 class IpIdModule : public Module
 {
 public:
-    IpIdModule() : Module(s_name, ip_id_params) { };
+    IpIdModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 3349c29b5c7b9f98531419603b7a21c4ff362e39..f6180a4279ec4db09414580bc48dda6d493e47e8 100644 (file)
@@ -284,7 +284,7 @@ static void ip_proto_parse(const char* data, IpProtoData* ds_ptr)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter ip_proto_params[] =
+static const Parameter s_params[] =
 {
     { "~proto", Parameter::PT_STRING, nullptr, nullptr, 
       "[!|>|<] name or number" },
@@ -292,10 +292,13 @@ static const Parameter ip_proto_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check the IP protocol number";
+
 class IpProtoModule : public Module
 {
 public:
-    IpProtoModule() : Module(s_name, ip_proto_params) { };
+    IpProtoModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 95551e96cf44be3489a21a4ead8ef0eb5b976b72..39ccaf55569afef643531918fed8aa66a47edc58 100644 (file)
@@ -211,7 +211,7 @@ static void ipopts_parse(const char* data, IpOptionData* ds_ptr)
 static const char* s_opts =
     "rr|eol|nop|ts|sec|esec|lsrr|lsrre|ssrr|satid|any";
 
-static const Parameter ipopt_params[] =
+static const Parameter s_params[] =
 {
     { "~opt", Parameter::PT_SELECT, s_opts, nullptr,
       "output format" },
@@ -219,10 +219,13 @@ static const Parameter ipopt_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check for IP options";
+
 class IpOptModule : public Module
 {
 public:
-    IpOptModule() : Module(s_name, ipopt_params) { };
+    IpOptModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 993633481f907d5a5c52cefc8b7f03dcee02a8f7..20e7959b06b0cf7f5386911959986ec8064f5a1c 100644 (file)
@@ -243,7 +243,7 @@ static void isdataat_parse(const char *data, IsDataAtData *idx)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter isdataat_params[] =
+static const Parameter s_params[] =
 {
     { "~length", Parameter::PT_STRING, nullptr, nullptr,
       "num | !num" },
@@ -254,10 +254,13 @@ static const Parameter isdataat_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check for the presence of payload data";
+
 class IsDataAtModule : public Module
 {
 public:
-    IsDataAtModule() : Module(s_name, isdataat_params) { };
+    IsDataAtModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index a81fc4f50f55830998b94fe75a7a7340325ff06c..589c8f8edccbeb54d98f1f289626277aad1140a1 100644 (file)
@@ -105,18 +105,21 @@ int IcmpTypeOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter itype_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
-      "check if packet payload size is min<>max | <max | >min" },
+      "check if icmp type is min<>max | <max | >min" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check ICMP type";
+
 class ItypeModule : public Module
 {
 public:
-    ItypeModule() : Module(s_name, itype_params) { };
+    ItypeModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index df69c2b89834827c968fb2efca9ad73046d1a769..e29111ba6c64c64da58c6dc1eb2b0c17a4487d29 100644 (file)
@@ -69,7 +69,7 @@ SO_PUBLIC const SnortBuffer* get_buffer()
 // module stuff
 //-------------------------------------------------------------------------
 
-static const Parameter luajit_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_STRING, nullptr, nullptr,
       "luajit arguments" },
@@ -77,10 +77,13 @@ static const Parameter luajit_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option for detecting with Lua scripts";
+
 class LuaJitModule : public Module
 {
 public:
-    LuaJitModule(const char* name) : Module(name, luajit_params)
+    LuaJitModule(const char* name) : Module(name, s_help, s_params)
     { };
 
     bool begin(const char*, int, SnortConfig*);
index 01aa145f9dfb24f832e11cf9ace92a9c4201873b..711113d036893b5a8ad1e6e761ad22e460b697b1 100644 (file)
@@ -41,7 +41,7 @@ static const char* s_name = "metadata";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter metadata_params[] =
+static const Parameter s_params[] =
 {
     { "service", Parameter::PT_STRING, nullptr, nullptr,
       "service name" },
@@ -52,10 +52,13 @@ static const Parameter metadata_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option for conveying arbitrary name, value data within the rule text";
+
 class MetadataModule : public Module
 {
 public:
-    MetadataModule() : Module(s_name, metadata_params)
+    MetadataModule() : Module(s_name, s_help, s_params)
     { snort_config = nullptr; };
 
     bool set(const char*, Value&, SnortConfig*);
index b3de3ae7c460b055c7883b96de9ee14396be0ead..ae10eddec718d0679d03edb88536019270159d1d 100644 (file)
@@ -41,7 +41,7 @@ static const char* s_name = "msg";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter msg_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_STRING, nullptr, nullptr,
       "message describing rule" },
@@ -49,10 +49,13 @@ static const Parameter msg_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option summarizing rule purpose output with events";
+
 class MsgModule : public Module
 {
 public:
-    MsgModule() : Module(s_name, msg_params) { };
+    MsgModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     std::string msg;
 };
index 817a7970f310d13b47f4778f0f8251f6c7148bcd..2ba4b31cdddb87b498bcd437569ee07cae108267 100644 (file)
@@ -627,7 +627,7 @@ bool pcre_next(PcreData* pcre)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter pcre_params[] =
+static const Parameter s_params[] =
 {
     { "~regex", Parameter::PT_STRING, nullptr, nullptr,
       "Snort regular expression" },
@@ -635,10 +635,13 @@ static const Parameter pcre_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option for matching payload data with regex";
+
 class PcreModule : public Module
 {
 public:
-    PcreModule() : Module(s_name, pcre_params)
+    PcreModule() : Module(s_name, s_help, s_params)
     { data = nullptr; };
 
     ~PcreModule()
index b11e63369e758ec624642cf29065b81c946cb21a..171675e9abed1be58691213395dfec943742ea5c 100644 (file)
@@ -63,10 +63,13 @@ int PktDataOption::eval(Cursor& c, Packet* p)
 // module
 //-------------------------------------------------------------------------
 
+static const char* s_help =
+    "rule option to set the detection cursor to the normalized packet data";
+
 class PktDataModule : public Module
 {
 public:
-    PktDataModule() : Module(s_name) { };
+    PktDataModule() : Module(s_name, s_help) { };
 
     ProfileStats* get_profile() const
     { return &pktDataPerfStats; };
index 6270a99407992ba8593a02f4cdc4659138ff7f1e..3e42712819911a2b71d6df8946b35fd8e58121a0 100644 (file)
@@ -39,7 +39,7 @@ static const char* s_name = "priority";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter priority_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_INT, "1:", nullptr,
       "generator id" },
@@ -47,10 +47,13 @@ static const Parameter priority_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option for prioritizing events";
+
 class PriorityModule : public Module
 {
 public:
-    PriorityModule() : Module(s_name, priority_params) { };
+    PriorityModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     int priority;
 };
index a0557fcc9e92ed948140396bba03ddd8eb060288..19334fe0d3b8a19a7b58baf32dbf662057f3f3b7 100644 (file)
@@ -63,10 +63,13 @@ int RawDataOption::eval(Cursor& c, Packet* p)
 // module
 //-------------------------------------------------------------------------
 
+static const char* s_help =
+    "rule option to set the detection cursor to the raw packet data";
+
 class RawDataModule : public Module
 {
 public:
-    RawDataModule() : Module(s_name) { };
+    RawDataModule() : Module(s_name, s_help) { };
 
     ProfileStats* get_profile() const
     { return &rawDataPerfStats; };
index c44dce96a3abeae56d08860f9fb8e84c58daabcc..8838e2b49d37a81546f602bec0172333ac073d6c 100644 (file)
@@ -39,7 +39,7 @@ static const char* s_name = "reference";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter reference_params[] =
+static const Parameter s_params[] =
 {
     { "~scheme", Parameter::PT_STRING, nullptr, nullptr,
       "reference scheme" },
@@ -50,10 +50,13 @@ static const Parameter reference_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to indicate relevant attack indentification system";
+
 class ReferenceModule : public Module
 {
 public:
-    ReferenceModule() : Module(s_name, reference_params) { };
+    ReferenceModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
 
index ef8240a62a7fe1e70ecbb543a4926128c75ce03b..04aec68d89c7a69b00a5a291a2ace8dc30ffd6e9 100644 (file)
@@ -38,7 +38,7 @@ static const char* s_name = "rem";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter rem_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_STRING, nullptr, nullptr,
       "comment" },
@@ -46,10 +46,13 @@ static const Parameter rem_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to convey an arbitrary comment in the rule body";
+
 class RemModule : public Module
 {
 public:
-    RemModule() : Module(s_name, rem_params) { };
+    RemModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
index 9070f4a8876995372eb66df28744764b391d0fc7..259ae958eb90cbe89ba1a2786ef0858877ef60e9 100644 (file)
@@ -193,7 +193,7 @@ void ReplaceOption::action(Packet*)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter repl_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_STRING, nullptr, nullptr,
       "byte code to replace with" },
@@ -201,10 +201,13 @@ static const Parameter repl_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to overwrite payload data; use with rewrite action";
+
 class ReplModule : public Module
 {
 public:
-    ReplModule() : Module(s_name, repl_params) { };
+    ReplModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 7aac51a7e4a0392ff96e539e91149f896e1bf7c7..4f93b8bb81d224fe9f8442067f1c713f466bcec0 100644 (file)
@@ -37,7 +37,7 @@ static const char* s_name = "rev";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter rev_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_INT, "1:", nullptr,
       "revision" },
@@ -45,10 +45,13 @@ static const Parameter rev_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to indicate current revision of signature";
+
 class RevModule : public Module
 {
 public:
-    RevModule() : Module(s_name, rev_params) { };
+    RevModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     int rev;
 };
index e3632801801104c45346c46a432b598d1a2f26b3..e53c77db2c74618e1546b3fca57db041c99d183f 100644 (file)
@@ -245,7 +245,7 @@ int RpcOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter rpc_params[] =
+static const Parameter s_params[] =
 {
     { "~app", Parameter::PT_STRING, nullptr, nullptr,
       "application number" },
@@ -259,10 +259,13 @@ static const Parameter rpc_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check SUNRPC CALL parameters";
+
 class RpcModule : public Module
 {
 public:
-    RpcModule() : Module(s_name, rpc_params) { };
+    RpcModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 516108d4ee4ea7bd2cb2f41e8c70f43cbfd7904d..0bec802e1c07390871fdd0c912c958e8cb1ff903 100644 (file)
@@ -102,7 +102,7 @@ int TcpSeqOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter seq_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "check if packet payload size is min<>max | <max | >min" },
@@ -110,10 +110,13 @@ static const Parameter seq_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check TCP sequence number";
+
 class SeqModule : public Module
 {
 public:
-    SeqModule() : Module(s_name, seq_params) { };
+    SeqModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 453bde0a13551500c8cc74f7fee8cf97bb46a49e..96dc1ca5beec7d3974a93eb4d4c003f17fa3cbf8 100644 (file)
@@ -318,7 +318,7 @@ static void DumpSessionData(FILE *fp, Packet *p, SessionData *sessionData)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter ssn_params[] =
+static const Parameter s_params[] =
 {
     { "~mode", Parameter::PT_ENUM, "printable|binary|all", nullptr,
       "output format" },
@@ -326,10 +326,13 @@ static const Parameter ssn_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check user data from TCP sessions";
+
 class SsnModule : public Module
 {
 public:
-    SsnModule() : Module(s_name, ssn_params) { };
+    SsnModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index d9cd16d970241c77cbcc22a6903232b8fae5a5f0..1d3530c9c04a81d8d76c70700393e74732d61179 100644 (file)
@@ -37,7 +37,7 @@ static const char* s_name = "sid";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter sid_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_INT, "1:", nullptr,
       "signature id" },
@@ -45,10 +45,13 @@ static const Parameter sid_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to indicate signature number";
+
 class SidModule : public Module
 {
 public:
-    SidModule() : Module(s_name, sid_params) { };
+    SidModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     int sid;
 };
index 414912a98bd3fee5f59b9ab1d43b0ef48616f435..0de77e20332ee9e85a1f493a4b49f13922d3ac01 100644 (file)
@@ -109,7 +109,7 @@ int SoOption::eval(Cursor&, Packet* p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter so_params[] =
+static const Parameter s_params[] =
 {
     { "~func", Parameter::PT_STRING, nullptr, nullptr,
       "name of eval function" },
@@ -117,10 +117,13 @@ static const Parameter so_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to call custom eval function";
+
 class SoModule : public Module
 {
 public:
-    SoModule() : Module(s_name, so_params) { };
+    SoModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index a00649430ad551092d29e61e6c943b2fac122a85..5fd45e29777cb5e1be53b3f02aad0a9708256807 100644 (file)
@@ -42,7 +42,7 @@ static const char* s_name = "soid";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter soid_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_STRING, nullptr, nullptr,
       "SO rule ID has <gid>|<sid> format, like 3|12345" },
@@ -50,10 +50,13 @@ static const Parameter soid_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to specify a shared object rule ID";
+
 class SoidModule : public Module
 {
 public:
-    SoidModule() : Module(s_name, soid_params) { };
+    SoidModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     std::string soid;
 };
index 4b2fda96a5a99945b049fa8652c7342f621c6238..33234a1f7f08d2a8971d70948d37642876e2ae68 100644 (file)
@@ -41,7 +41,7 @@ static const char* s_name = "tag";
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter tag_params[] =
+static const Parameter s_params[] =
 {
     { "~", Parameter::PT_ENUM, "session|host_src|host_dst", nullptr,
       "log all packets in session or all packets to or from host" },
@@ -58,10 +58,13 @@ static const Parameter tag_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to log additional packets";
+
 class TagModule : public Module
 {
 public:
-    TagModule() : Module(s_name, tag_params)
+    TagModule() : Module(s_name, s_help, s_params)
     { tag = nullptr; };
 
     bool set(const char*, Value&, SnortConfig*);
index 9ad60763309c2e42b1d0e4319532d79c1de42144..8d67bd7b84772033b3f57cf4e14ec83a1f8400c7 100644 (file)
@@ -105,7 +105,7 @@ int IpTosOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter tos_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "check if packet payload size is min<>max | <max | >min" },
@@ -113,10 +113,13 @@ static const Parameter tos_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check type of service field";
+
 class TosModule : public Module
 {
 public:
-    TosModule() : Module(s_name, tos_params) { };
+    TosModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 5527a07c6093d731b4f6e34b3731fec684ef45f8..ab90a2cdb793d4ecbc59fe2382d4e5dfc6176cf7 100644 (file)
@@ -104,7 +104,7 @@ int TtlOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter ttl_params[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "check if packet payload size is min<>max | <max | >min" },
@@ -112,10 +112,13 @@ static const Parameter ttl_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check time to live field";
+
 class TtlModule : public Module
 {
 public:
-    TtlModule() : Module(s_name, ttl_params) { };
+    TtlModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 9070adcf8bbf145b31512f7a2973fc8d07db9764..75f98434d717697f4e96456309c19bbded9afe21 100644 (file)
@@ -102,7 +102,7 @@ int TcpWinOption::eval(Cursor&, Packet *p)
 // module
 //-------------------------------------------------------------------------
 
-static const Parameter window[] =
+static const Parameter s_params[] =
 {
     { "~range", Parameter::PT_STRING, nullptr, nullptr,
       "check if packet payload size is min<>max | <max | >min" },
@@ -110,10 +110,13 @@ static const Parameter window[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "rule option to check TCP window field";
+
 class WindowModule : public Module
 {
 public:
-    WindowModule() : Module(s_name, window) { };
+    WindowModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
index 46a0871fee793e7ad4cab94f69419d30c745f76a..85866cf9a59d38d15bb97ae605bf042ad7ae858c 100644 (file)
@@ -46,6 +46,8 @@
 
 static THREAD_LOCAL TextLog* csv_log;
 
+static const char* s_name = "alert_csv";
+
 using namespace std;
 
 //-------------------------------------------------------------------------
@@ -64,7 +66,7 @@ static const char* csv_range =
 static const char* csv_deflt =
     "timestamp gid sid rev src_addr src_port dst_addr dst_port";
 
-static const Parameter csv_params[] =
+static const Parameter s_params[] =
 {
     // FIXIT-M provide PT_FILE and PT_PATH and enforce no
     // path chars in file (outputs file must be in instance dir)
@@ -84,10 +86,13 @@ static const Parameter csv_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event in csv format";
+
 class CsvModule : public Module
 {
 public:
-    CsvModule() : Module("alert_csv", csv_params) { };
+    CsvModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -416,7 +421,7 @@ static LogApi csv_api
 {
     {
         PT_LOGGER,
-        "alert_csv",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 4dc1b3c3144fe19419b364a5f1e2aa5647cbaaba..f967e4ec362765d6341d3b6fb7db578f6bd3fa02 100644 (file)
@@ -72,11 +72,13 @@ static THREAD_LOCAL TextLog* fast_log = nullptr;
 
 using namespace std;
 
+static const char* s_name = "alert_fast";
+
 //-------------------------------------------------------------------------
 // module stuff
 //-------------------------------------------------------------------------
 
-static const Parameter fast_params[] =
+static const Parameter s_params[] =
 {
     { "file", Parameter::PT_STRING, nullptr, "stdout",
       "name of alert file" },
@@ -93,10 +95,13 @@ static const Parameter fast_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event with brief text format";
+
 class FastModule : public Module
 {
 public:
-    FastModule() : Module("alert_fast", fast_params) { };
+    FastModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -273,7 +278,7 @@ static LogApi fast_api
 {
     {
         PT_LOGGER,
-        "alert_fast",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 1c8b576a858b26db9440beab22add961592ed201..e4f425b8f09348713e5b75c1596195788d2eaa21 100644 (file)
@@ -64,11 +64,13 @@ static THREAD_LOCAL TextLog* full_log = nullptr;
 
 using namespace std;
 
+static const char* s_name = "alert_full";
+
 //-------------------------------------------------------------------------
 // module stuff
 //-------------------------------------------------------------------------
 
-static const Parameter full_params[] =
+static const Parameter s_params[] =
 {
     { "file", Parameter::PT_STRING, nullptr, nullptr,
       "name of alert file" },
@@ -82,10 +84,13 @@ static const Parameter full_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event with full packet dump";
+
 class FullModule : public Module
 {
 public:
-    FullModule() : Module("alert_full", full_params) { };
+    FullModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -266,7 +271,7 @@ static LogApi full_api
 {
     {
         PT_LOGGER,
-        "alert_full",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 2b72442e75ecc9398cc23d5bf6fe9655ca1a7e9b..1cb91ff0f2be95c68285f46ecd729d01e0f8efb9 100644 (file)
@@ -84,7 +84,7 @@ SO_PUBLIC const SnortEvent* get_event()
 // module stuff
 //-------------------------------------------------------------------------
 
-static const Parameter luajit_params[] =
+static const Parameter s_params[] =
 {
     { "args", Parameter::PT_STRING, nullptr, nullptr,
       "luajit logger arguments" },
@@ -92,10 +92,13 @@ static const Parameter luajit_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event from custom Lua script";
+
 class LuaLogModule : public Module
 {
 public:
-    LuaLogModule(const char* name) : Module(name, luajit_params)
+    LuaLogModule(const char* name) : Module(name, s_help, s_params)
     { };
 
     bool begin(const char*, int, SnortConfig*)
@@ -220,7 +223,7 @@ static const LogApi log_lua_api =
 {
     {
         PT_LOGGER,
-        "tbd",
+        "luajit",
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index b674f087534901822cacc63cfc12cf08d3d817f0..1b5814c6df9197e4347f89b5076f9a1861d99ccc 100644 (file)
@@ -66,6 +66,8 @@ static THREAD_LOCAL SfSock context;
 using namespace std;
 typedef vector<RuleId> RuleVector;
 
+static const char* s_name = "alert_sfsocket";
+
 //-------------------------------------------------------------------------
 // alert_sfsocket module
 //-------------------------------------------------------------------------
@@ -81,7 +83,7 @@ static const Parameter rule_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const Parameter sfsocket_params[] =
+static const Parameter s_params[] =
 {
     { "file", Parameter::PT_STRING, nullptr, nullptr,
       "name of unix socket file" },
@@ -92,10 +94,13 @@ static const Parameter sfsocket_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event over socket";
+
 class SfSocketModule : public Module
 {
 public:
-    SfSocketModule() : Module("alert_sfsocket", sfsocket_params) { };
+    SfSocketModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -398,7 +403,7 @@ static LogApi sf_sock_api
 {
     {
         PT_LOGGER,
-        "alert_sfsocket",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index f2628ef90d711f206e6cc46c321cfe6754316127..5e2f29782c85196455d03e788aabf98eb76743a4 100644 (file)
@@ -51,6 +51,8 @@
 
 using namespace std;
 
+static const char* s_name = "alert_syslog";
+
 //-------------------------------------------------------------------------
 // translation stuff
 //-------------------------------------------------------------------------
@@ -125,7 +127,7 @@ static int get_options(const char* s)
 // module stuff
 //-------------------------------------------------------------------------
 
-static const Parameter syslog_params[] =
+static const Parameter s_params[] =
 {
     { "facility", Parameter::PT_ENUM, syslog_facilities, "auth",
       "part of priority applied to each message" },
@@ -139,10 +141,13 @@ static const Parameter syslog_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event to syslog";
+
 class SyslogModule : public Module
 {
 public:
-    SyslogModule() : Module("alert_syslog", syslog_params) { };
+    SyslogModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -344,7 +349,7 @@ static LogApi syslog_api
 {
     {
         PT_LOGGER,
-        "alert_syslog",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 6075cf2744cf0a8cf81d9251544b99164f8f1077..f962fb78c5dbce0e10508b6647273f8d3834469a 100644 (file)
@@ -57,11 +57,13 @@ static THREAD_LOCAL TextLog* test_file = nullptr;
 
 using namespace std;
 
+static const char* s_name = "alert_test";
+
 //-------------------------------------------------------------------------
 // alert_test module
 //-------------------------------------------------------------------------
 
-static const Parameter test_params[] =
+static const Parameter s_params[] =
 {
     { "file", Parameter::PT_STRING, nullptr, "stdout",
       "name of tsv alert file or 'stdout'" },
@@ -78,10 +80,13 @@ static const Parameter test_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event in custom tsv format";
+
 class TestModule : public Module
 {
 public:
-    TestModule() : Module("alert_test", test_params) { };
+    TestModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -222,7 +227,7 @@ static LogApi test_api
 {
     {
         PT_LOGGER,
-        "alert_test",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 9ed9a1b8f256f12fb7451811660c06357f1ff2b4..32b62d0eaadca7ba3a066a2e8544e8eba2704b78 100644 (file)
@@ -96,21 +96,26 @@ struct UnixSock
 
 static THREAD_LOCAL UnixSock us;
 
+static const char* s_name = "alert_unixsock";
+
 //-------------------------------------------------------------------------
 // alert_unixsock module
 //-------------------------------------------------------------------------
 
-static const Parameter unixsock_params[] =
+static const Parameter s_params[] =
 {
     // FIXIT-L add name param?
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "output event over unix socket";
+
 class UnixSockModule : public Module
 {
 public:
-    UnixSockModule() : Module("alert_unixsock", unixsock_params) { };
+    UnixSockModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*) { return false; };
 };
 
@@ -285,7 +290,7 @@ static LogApi unix_sock_api
 {
     {
         PT_LOGGER,
-        "alert_unixsock",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 638c7d17fef6a412236e2c8bafe40b307678b6e3..952b430f4f96798b64a45c4d1e64d66524683944 100644 (file)
@@ -83,11 +83,13 @@ static THREAD_LOCAL LtdContext context;
 
 static void TcpdumpRollLogFile(LtdConfig*);
 
+static const char* s_name = "log_tcpdump";
+
 //-------------------------------------------------------------------------
 // module stuff
 //-------------------------------------------------------------------------
 
-static const Parameter tcpdump_params[] =
+static const Parameter s_params[] =
 {
     { "file", Parameter::PT_STRING, nullptr, "snort.pcap",
       "name of alert file" },
@@ -101,10 +103,13 @@ static const Parameter tcpdump_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "log packet in pcap format";
+
 class TcpdumpModule : public Module
 {
 public:
-    TcpdumpModule() : Module("log_tcpdump", tcpdump_params) { };
+    TcpdumpModule() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -233,14 +238,14 @@ static void TcpdumpInitLogFile(LtdConfig* data, int /*nostamps?*/)
         pcap = pcap_open_dead(dlt, DAQ_GetSnapLen());
 
         if ( !pcap )
-            FatalError("log_tcpdump: can't get pcap context\n");
+            FatalError("%s: can't get pcap context\n", s_name);
 
         context.dumpd = pcap ? pcap_dump_open(pcap, file.c_str()) : NULL;
 
         if(context.dumpd == NULL)
         {
-            FatalError("log_tcpdump: can't open %s: %s\n",
-                file.c_str(), pcap_geterr(pcap));
+            FatalError("%s: can't open %s: %s\n",
+                s_name, file.c_str(), pcap_geterr(pcap));
         }
         pcap_close(pcap);
     }
@@ -372,7 +377,7 @@ static LogApi tcpdump_api
 {
     {
         PT_LOGGER,
-        "log_tcpdump",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 808f741f9df8210415daad00473b1b2368319402..9f0905e0729bb69a9648a37b25b7d1721b316443 100644 (file)
@@ -67,6 +67,8 @@
 
 using namespace std;
 
+static const char* s_name = "unified2";
+
 /* ------------------ Data structures --------------------------*/
 typedef struct _Unified2Config
 {
@@ -1026,7 +1028,7 @@ static void Unified2Write(uint8_t *buf, uint32_t buf_len, Unified2Config *config
 // unified2 module
 //-------------------------------------------------------------------------
 
-static const Parameter u2_params[] =
+static const Parameter s_params[] =
 {
     { "file", Parameter::PT_STRING, nullptr, "unified2.log",
       "name of alert file" },
@@ -1049,10 +1051,13 @@ static const Parameter u2_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "ouput event and packet in unified2 format file";
+
 class U2Module : public Module
 {
 public:
-    U2Module() : Module("unified2", u2_params) { };
+    U2Module() : Module(s_name, s_help, s_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -1245,7 +1250,7 @@ static LogApi u2_api
 {
     {
         PT_LOGGER,
-        "unified2",
+        s_name,
         LOGAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 29aa83d1087bc84de3b808ad5f00959043be1132..fabf633a872c529f553a01d4ccc7c7c476992f8d 100644 (file)
@@ -139,7 +139,8 @@ void help_signals(SnortConfig*, const char*)
 
 enum HelpType {
     HT_CFG, HT_CMD, HT_GID, HT_IPS, HT_MOD,
-    HT_BUF, HT_LST, HT_PLG, HT_DDR, HT_DBR
+    HT_BUF, HT_LST, HT_PLG, HT_DDR, HT_DBR,
+    HT_SHO
 };
 
 static void show_help(SnortConfig* sc, const char* val, HelpType ht)
@@ -180,6 +181,9 @@ static void show_help(SnortConfig* sc, const char* val, HelpType ht)
     case HT_DBR:
         ModuleManager::dump_rules(val);
         break;
+    case HT_SHO:
+        ModuleManager::show_modules();
+        break;
     }
     ModuleManager::term();
     PluginManager::release_plugins();
@@ -222,6 +226,11 @@ void help_module(SnortConfig* sc, const char* val)
     show_help(sc, val, HT_MOD);
 }
 
+void help_modules(SnortConfig* sc, const char* val)
+{
+    show_help(sc, val, HT_SHO);
+}
+
 void list_modules(SnortConfig* sc, const char* val)
 {
     show_help(sc, val, HT_LST);
index f1e19061f435468ff24e2eb6f7e4292e535ae421..8853bac5cd3d0782ec65035ac5e320f75b392f20 100644 (file)
@@ -36,6 +36,7 @@ void help_gids(SnortConfig* sc, const char*);
 void help_buffers(SnortConfig* sc, const char*);
 void help_builtin(SnortConfig* sc, const char*);
 void help_module(SnortConfig* sc, const char*);
+void help_modules(SnortConfig* sc, const char*);
 void help_version(SnortConfig*, const char*);
 
 void list_modules(SnortConfig* sc, const char*);
index 4b1f7e829183a55b598cd5bdcf6933e37b18bbf8..1b0e01ae0c955346254dc346d1a41b2da8fab4f3 100644 (file)
@@ -80,10 +80,13 @@ static const Parameter detection_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* detection_help =
+    "configure general IPS rule processing parameters";
+
 class DetectionModule : public Module
 {
 public:
-    DetectionModule() : Module("detection", detection_params) { };
+    DetectionModule() : Module("detection", detection_help, detection_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -133,10 +136,13 @@ static const Parameter event_queue_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* event_queue_help =
+    "configure event queue parameters";
+
 class EventQueueModule : public Module
 {
 public:
-    EventQueueModule() : Module("event_queue", event_queue_params) { };
+    EventQueueModule() : Module("event_queue", event_queue_help, event_queue_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -223,10 +229,13 @@ static const Parameter search_engine_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* search_engine_help =
+    "configure fast pattern matcher";
+
 class SearchEngineModule : public Module
 {
 public:
-    SearchEngineModule() : Module("search_engine", search_engine_params) { };
+    SearchEngineModule() : Module("search_engine", search_engine_help, search_engine_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -342,10 +351,13 @@ static const Parameter profile_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* profile_help =
+    "configure profiling of rules and/or modules";
+
 class ProfileModule : public Module
 {
 public:
-    ProfileModule() : Module("profile", profile_params) { };
+    ProfileModule() : Module("profile", profile_help, profile_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
 };
@@ -395,6 +407,9 @@ bool ProfileModule::set(const char* fqn, Value& v, SnortConfig* sc)
 // FIXIT-L signature.{h,cc} has type and name confused
 // the keys here make more sense
 
+static const char* classifications_help =
+    "define rule categories with priority";
+
 static const Parameter classification_params[] =
 {
     { "name", Parameter::PT_STRING, nullptr, nullptr,
@@ -413,7 +428,7 @@ class ClassificationsModule : public Module
 {
 public:
     ClassificationsModule() : 
-        Module("classifications", classification_params, true) { };
+        Module("classifications", classifications_help, classification_params, true) { };
 
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
@@ -460,13 +475,14 @@ bool ClassificationsModule::set(const char*, Value& v, SnortConfig*)
 //-------------------------------------------------------------------------
 // reference module
 //-------------------------------------------------------------------------
-// FIXIT-L signature.{h,cc} has type and name confused
-// the keys here make more sense
+
+static const char* reference_help =
+    "define reference systems used in rules";
 
 static const Parameter reference_params[] =
 {
     { "name", Parameter::PT_STRING, nullptr, nullptr,
-      "name used with classtype rule option" },
+      "name used with reference rule option" },
 
     { "url", Parameter::PT_STRING, nullptr, nullptr,
       "where this reference is defined" },
@@ -478,7 +494,7 @@ class ReferencesModule : public Module
 {
 public:
     ReferencesModule() : 
-        Module("references", reference_params, true) { };
+        Module("references", reference_help, reference_params, true) { };
 
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
@@ -559,10 +575,13 @@ static const Parameter alerts_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* alerts_help =
+    "configure alerts";
+
 class AlertsModule : public Module
 {
 public:
-    AlertsModule() : Module("alerts", alerts_params) { };
+    AlertsModule() : Module("alerts", alerts_help, alerts_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -663,10 +682,13 @@ static const Parameter output_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* output_help =
+    "configure general output parameters";
+
 class OutputModule : public Module
 {
 public:
-    OutputModule() : Module("output", output_params) { };
+    OutputModule() : Module("output", output_help, output_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -759,10 +781,13 @@ static const Parameter active_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* active_help =
+    "configure responses";
+
 class ActiveModule : public Module
 {
 public:
-    ActiveModule() : Module("active", active_params) { };
+    ActiveModule() : Module("active", active_help, active_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -816,10 +841,13 @@ static const Parameter packets_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* packets_help =
+    "configure basic packet handling";
+
 class PacketsModule : public Module
 {
 public:
-    PacketsModule() : Module("packets", packets_params) { };
+    PacketsModule() : Module("packets", packets_help, packets_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -883,10 +911,13 @@ static const Parameter daq_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* daq_help =
+    "configure packet acquisition interface";
+
 class DaqModule : public Module
 {
 public:
-    DaqModule() : Module("daq", daq_params) { };
+    DaqModule() : Module("daq", daq_help, daq_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -941,10 +972,14 @@ static const Parameter attribute_table_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+const char* attribute_table_help = 
+    "configure hosts loading";
+
 class AttributeTableModule : public Module
 {
 public:
-    AttributeTableModule() : Module("attribute_table", attribute_table_params) { };
+    AttributeTableModule() : 
+        Module("attribute_table", attribute_table_help, attribute_table_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -998,10 +1033,13 @@ static const Parameter network_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* network_help =
+    "configure basic network parameters";
+
 class NetworkModule : public Module
 {
 public:
-    NetworkModule() : Module("network", network_params) { };
+    NetworkModule() : Module("network", network_help, network_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -1060,10 +1098,13 @@ static const Parameter ips_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* ips_help =
+    "configure IPS rule processing";
+
 class IpsModule : public Module
 {
 public:
-    IpsModule() : Module("ips", ips_params) { };
+    IpsModule() : Module("ips", ips_help, ips_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -1122,10 +1163,13 @@ static const Parameter process_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* process_help =
+    "configure basic process setup";
+
 class ProcessModule : public Module
 {
 public:
-    ProcessModule() : Module("process", process_params) { };
+    ProcessModule() : Module("process", process_help, process_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -1164,37 +1208,6 @@ bool ProcessModule::set(const char*, Value& v, SnortConfig* sc)
     return true;
 }
 
-//-------------------------------------------------------------------------
-// vars module
-//-------------------------------------------------------------------------
-// FIXIT-L signature.{h,cc} has type and name confused
-// the keys here make more sense
-
-static const Parameter vars_params[] =
-{
-    { nullptr, Parameter::PT_STRING, nullptr, nullptr,
-      "port, ip, or path variable" },
-
-    { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
-};
-
-class VarsModule : public Module
-{
-public:
-    VarsModule() : 
-        Module("vars", vars_params, true) { };
-
-    bool set(const char*, Value&, SnortConfig*);
-};
-
-#include <iostream>
-bool VarsModule::set(const char* fqn, Value& v, SnortConfig*)
-{
-    cout << fqn << " = " << v.get_name() << endl;
-
-    return true;
-}
-
 //-------------------------------------------------------------------------
 // file_id module
 //-------------------------------------------------------------------------
@@ -1229,10 +1242,13 @@ static const Parameter file_id_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* file_id_help =
+    "configure file identification";
+
 class FileIdModule : public Module
 {
 public:
-    FileIdModule() : Module("file_id", file_id_params) { };
+    FileIdModule() : Module("file_id", file_id_help, file_id_params) { };
     bool set(const char*, Value&, SnortConfig*);
 };
 
@@ -1293,10 +1309,13 @@ static const Parameter suppress_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* suppress_help =
+    "configure event suppressions";
+
 class SuppressModule : public Module
 {
 public:
-    SuppressModule() : Module("suppress", suppress_params, true) { };
+    SuppressModule() : Module("suppress", suppress_help, suppress_params, true) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -1372,10 +1391,14 @@ static const Parameter event_filter_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* event_filter_help =
+    "configure thresholding of events";
+
 class EventFilterModule : public Module
 {
 public:
-    EventFilterModule() : Module("event_filter", event_filter_params, true) { };
+    EventFilterModule() : 
+        Module("event_filter", event_filter_help, event_filter_params, true) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -1467,10 +1490,13 @@ static const Parameter rate_filter_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* rate_filter_help =
+    "configure rate filters (which change rule actions)";
+
 class RateFilterModule : public Module
 {
 public:
-    RateFilterModule() : Module("rate_filter", rate_filter_params, true) { };
+    RateFilterModule() : Module("rate_filter", rate_filter_help, rate_filter_params, true) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -1543,10 +1569,13 @@ static const Parameter rule_state_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* rule_state_help =
+    "enable/disable specific IPS rules";
+
 class RuleStateModule : public Module
 {
 public:
-    RuleStateModule() : Module("rule_state", rule_state_params) { };
+    RuleStateModule() : Module("rule_state", rule_state_help, rule_state_params) { };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*);
@@ -1629,10 +1658,13 @@ static const Parameter hosts_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* hosts_help =
+    "configure hosts";
+
 class HostsModule : public Module
 {
 public:
-    HostsModule() : Module("hosts", hosts_params, true) { };
+    HostsModule() : Module("hosts", hosts_help, hosts_params, true) { };
     ~HostsModule() { assert(!host && !app); };
 
     bool set(const char*, Value&, SnortConfig*);
@@ -1727,10 +1759,13 @@ static const Parameter xxx_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* _help =
+    "configure ";
+
 class XXXModule : public Module
 {
 public:
-    XXXModule() : Module("xxx", xxx_params) { };
+    XXXModule() : Module("xxx", xxx_help, xxx_params) { };
     const RuleMap* get_rules() { return xxx_rules; };
     bool set(const char*, Value&, SnortConfig*);
     bool begin(const char*, int, SnortConfig*);
@@ -1757,34 +1792,8 @@ bool XXXModule::end(const char*, int, SnortConfig*)
 {
     return true;
 }
-
-static const Parameter xxx_params[] =
-{
-    { "name", Parameter::PT_INT, "range", "deflt",
-      "help" },
-
-    { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
-};
-
-class XXXModule : public Module
-{
-public:
-    XXXModule() : Module("xxx", xxx_params) { };
-    bool set(const char*, Value&, SnortConfig*);
-};
-
-bool XXXModule::set(const char*, Value& v, SnortConfig* sc)
-{
-    if ( v.is("name") )
-        sc->pkt_cnt = v.get_long();
-
-    else
-        return false;
-
-    return true;
-}
-
 #endif
+
 //-------------------------------------------------------------------------
 // module manager stuff - move to framework/module_manager.cc
 //-------------------------------------------------------------------------
@@ -1828,7 +1837,6 @@ void module_init()
     ModuleManager::add_module(new EventFilterModule);
     ModuleManager::add_module(new RateFilterModule);
     ModuleManager::add_module(new SuppressModule);
-    ModuleManager::add_module(new VarsModule);
 
     // these are preliminary policies
     ModuleManager::add_module(new NetworkModule);
index fd17f5bdba8632b137c4afedbe95d64ad74353af..14c8a4e7e7b40631b2e8ef8aba9bcfa472d48375 100644 (file)
@@ -72,7 +72,7 @@ static const Command snort_cmds[] =
 // parameters
 //-------------------------------------------------------------------------
 
-static const Parameter snort_params[] =
+static const Parameter s_params[] =
 {
     { "-?", Parameter::PT_IMPLIED, nullptr, nullptr,
       "list command line options (same as --help)" },
@@ -257,6 +257,9 @@ static const Parameter snort_params[] =
     { "--help-module", Parameter::PT_STRING, nullptr, nullptr,
       "<module> output description of given module" },
 
+    { "--help-modules", Parameter::PT_IMPLIED, nullptr, nullptr,
+      "list all modules with brief help" },
+
     { "--help-options", Parameter::PT_STRING, "(optional)", nullptr,
       "<option prefix> output matching command line option quick help" },
 
@@ -370,10 +373,15 @@ static const Parameter snort_params[] =
 // module
 //-------------------------------------------------------------------------
 
+static const char* s_name = "snort";
+
+static const char* s_help =
+    "command line configuration and shell commands";
+
 class SnortModule : public Module
 {
 public:
-    SnortModule() : Module("snort", snort_params)
+    SnortModule() : Module(s_name, s_help, s_params)
     { };
 
     const Command* get_commands() const
@@ -568,6 +576,9 @@ bool SnortModule::set(const char*, Value& v, SnortConfig* sc)
     else if ( v.is("--help-module") )
         help_module(sc, v.get_string());
 
+    else if ( v.is("--help-modules") )
+        help_modules(sc, v.get_string());
+
     else if ( v.is("--help-options") )
         help_options(sc, v.get_string());
 
index 8598d2606680870d40f695f45a7fbb685fba2cd6..f4b711c7e18dfa445673d7a8247c7ffbb01ef5f7 100644 (file)
@@ -479,6 +479,14 @@ void ModuleManager::list_modules()
         LogMessage("%s\n", p->mod->get_name());
 }
 
+void ModuleManager::show_modules()
+{
+    s_modules.sort(comp_mods);
+
+    for ( auto* p : s_modules )
+        LogMessage("%s: %s\n", p->mod->get_name(), p->mod->get_help());
+}
+
 void ModuleManager::dump_modules()
 {
     s_modules.sort(comp_mods);
@@ -515,32 +523,36 @@ void ModuleManager::show_module(const char* name)
             continue;
 
         cout << endl << Markup::head() << name << endl << endl;
-        cout << "Type: "  << mod_type(p->api) << endl << endl;
+
+        if ( const char* h = m->get_help() )
+            cout << "What: " << h << endl;
+
+        cout << "Type: "  << mod_type(p->api) << endl;
 
         if ( const Parameter* p = m->get_parameters() )
         {
             if ( p->type < Parameter::PT_MAX )
             {
-                cout << endl << "Configuration: "  << endl << endl;
+                cout << endl << "Configuration: " << endl;
                 show_configs(name, true);
             }
         }
 
         if ( m->get_commands() )
         {
-            cout << endl << "Commands: "  << endl << endl;
+            cout << endl << "Commands: " << endl;
             show_commands(name);
         }
 
         if ( m->get_rules() )
         {
-            cout << endl << "Rules: "  << endl << endl;
+            cout << endl << "Rules: " << endl;
             show_rules(name);
         }
 
         if ( m->get_pegs() )
         {
-            cout << endl << "Peg counts: "  << endl << endl;
+            cout << endl << "Peg counts: " << endl;
             show_pegs(name);
         }
     }
index 1d3628a64c347ff8c846522115c8a4ce7d8250f7..67a38a4f2a32b6e2b5f99ec1deacc9fe550e07f7 100644 (file)
@@ -37,6 +37,7 @@ public:
 
     static void list_modules();
     static void dump_modules();
+    static void show_modules();
 
     static void show_module(const char*);
     static void show_configs(const char* = nullptr, bool exact = false);
index 49c5fe7f8bfc991917467155661234abce36d990..90d4fc63eccfbdedbf1d42beee25b23ace721a2a 100644 (file)
 
 #include "arp_module.h"
 
-static const char* mod_name = "arp_spoof";
+static const char* s_name = MOD_NAME;
+
+static const char* s_help = 
+    "detect ARP attacks and anomalies";
 
 #define ARPSPOOF_UNICAST_ARP_REQUEST_STR \
     "(arp_spoof) Unicast ARP request"
@@ -49,7 +52,7 @@ static const Parameter arp_spoof_hosts_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const Parameter arp_spoof_params[] =
+static const Parameter s_params[] =
 {
     { "hosts", Parameter::PT_LIST, arp_spoof_hosts_params, nullptr,
       "configure ARP cache overwrite attacks" },
@@ -57,7 +60,7 @@ static const Parameter arp_spoof_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const RuleMap arp_spoof_rules[] =
+static const RuleMap s_rules[] =
 {
     { ARPSPOOF_UNICAST_ARP_REQUEST,
         ARPSPOOF_UNICAST_ARP_REQUEST_STR },
@@ -79,7 +82,7 @@ static const RuleMap arp_spoof_rules[] =
 //-------------------------------------------------------------------------
 
 ArpSpoofModule::ArpSpoofModule() : 
-    Module(mod_name, arp_spoof_params)
+    Module(s_name, s_help, s_params)
 {
     config = new ArpSpoofConfig;
     config->check_overwrite = false;
@@ -92,7 +95,7 @@ ArpSpoofModule::~ArpSpoofModule()
 }
 
 const RuleMap* ArpSpoofModule::get_rules() const
-{ return arp_spoof_rules; }
+{ return s_rules; }
 
 ProfileStats* ArpSpoofModule::get_profile() const
 { return &arpPerfStats; }
index a419498fc2137d61fae972268e89f2f585dbab03..39ace58092548c029be836c86c877185a09cf0d0 100644 (file)
@@ -41,6 +41,11 @@ static const char* bind_pegs[] =
     nullptr
 };
 
+static const char* s_name = "binder";
+
+static const char* s_help =
+    "configure processing based on CIDRs, ports, services, etc.";
+
 //-------------------------------------------------------------------------
 // binder module
 //-------------------------------------------------------------------------
@@ -94,7 +99,7 @@ static const Parameter binder_use_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const Parameter binder_params[] =
+static const Parameter s_params[] =
 {
     { "when", Parameter::PT_TABLE, binder_when_params, nullptr,
       "match criteria" },
@@ -105,7 +110,7 @@ static const Parameter binder_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-BinderModule::BinderModule() : Module("binder", binder_params)
+BinderModule::BinderModule() : Module(s_name, s_help, s_params)
 { work = nullptr; }
 
 BinderModule::~BinderModule()
@@ -174,7 +179,7 @@ bool BinderModule::set(const char* fqn, Value& v, SnortConfig*)
 
 bool BinderModule::begin(const char* fqn, int idx, SnortConfig*)
 {
-    if ( idx && !strcmp(fqn, "binder") )
+    if ( idx && !strcmp(fqn, s_name) )
         work = new Binding;
 
     return true;
@@ -182,7 +187,7 @@ bool BinderModule::begin(const char* fqn, int idx, SnortConfig*)
 
 bool BinderModule::end(const char* fqn, int idx, SnortConfig*)
 {
-    if ( idx && !strcmp(fqn, "binder") )
+    if ( idx && !strcmp(fqn, s_name) )
     {
         bindings.push_back(work);
         work = nullptr;
index d038df332440c3f928fc02e8e997dd1293431b39..8ccbbd782e8a2980323a54a4fac252360685232c 100644 (file)
@@ -133,7 +133,7 @@ static const Parameter norm_tcp_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const Parameter normalize_params[] =
+static const Parameter s_params[] =
 {
     { "ip4", Parameter::PT_TABLE, norm_ip4_params, nullptr,
       "set ip4 normalization options" },
@@ -157,8 +157,13 @@ static const Parameter normalize_params[] =
 // normalize parameters
 //-------------------------------------------------------------------------
 
+static const char* s_name = "normalize";
+
+static const char* s_help =
+    "packet scrubbing for inline mode";
+
 NormalizeModule::NormalizeModule() :
-    Module("normalize", normalize_params)
+    Module(s_name, s_help, s_params)
 {
     memset(&config, 0, sizeof(config));
 }
@@ -254,7 +259,7 @@ bool NormalizeModule::set(const char* fqn, Value& v, SnortConfig* sc)
 
 bool NormalizeModule::begin(const char* fqn, int, SnortConfig*)
 {
-    if ( !strcmp(fqn, "normalize") )
+    if ( !strcmp(fqn, s_name) )
     {
         NetworkPolicy* policy = get_network_policy();
 
index 8c74601d3941d63bc4821896f014f82bc3229509..d240a93ace60cd90a164dca2dc09ca8a55b57ffe 100644 (file)
@@ -26,7 +26,7 @@
 // perf attributes
 //-------------------------------------------------------------------------
 
-static const Parameter perf_params[] =
+static const Parameter s_params[] =
 {
     { "packets", Parameter::PT_INT, "0:", "10000",
       "minim packets to report" },
@@ -77,8 +77,13 @@ static const Parameter perf_params[] =
 // perf attributes
 //-------------------------------------------------------------------------
 
+static const char* s_name = "perf_monitor";
+
+static const char* s_help =
+    "performance monitoring and flow statistics collection";
+
 PerfMonModule::PerfMonModule() :
-    Module("perf_monitor", perf_params)
+    Module(s_name, s_help, s_params)
 { }
 
 ProfileStats* PerfMonModule::get_profile() const
index db0e81cce324e0c0bb350ef0d4a259ecc3ce28c0..782490bd69c7b7c297b2d9d44dbb6436b9bd8489 100644 (file)
@@ -34,7 +34,7 @@ static const char* protos =
 static const char* scans =
     "portscan | portsweep | decoy_portscan | distributed_portscan | all";
 
-static const Parameter port_scan_params[] =
+static const Parameter ps_params[] =
 {
     { "protos", Parameter::PT_MULTI, protos, "all",
       "choose the protocols to monitor" },
@@ -102,8 +102,13 @@ static const RuleMap port_scan_rules[] =
 // port_scan module
 //-------------------------------------------------------------------------
 
+static const char* ps_name = "port_scan";
+
+static const char* ps_help =
+    "port scan detection";
+
 PortScanModule::PortScanModule() :
-    Module("port_scan", port_scan_params)
+    Module(ps_name, ps_help, ps_params)
 {
     config = nullptr;
 }
@@ -198,7 +203,11 @@ PortscanConfig* PortScanModule::get_data()
 // port_scan module
 //-------------------------------------------------------------------------
 
-static const Parameter ps_global_params[] =
+static const char* psg_name = "port_scan_global";
+static const char* psg_help =
+    "shared settings for port_scan inspectors";
+
+static const Parameter psg_params[] =
 {
     { "memcap", Parameter::PT_INT, "1:", "1048576",
       "maxium tracker memory" },
@@ -207,7 +216,7 @@ static const Parameter ps_global_params[] =
 };
 
 PortScanGlobalModule::PortScanGlobalModule() :
-    Module("port_scan_global", ps_global_params)
+    Module(psg_name, psg_help, psg_params)
 { 
     common = nullptr;
 }
index f6eee95ec43bbc0a8fa33726922d13e534f6cb24..c127558647b528f02620dc14993f9a71e49ff46a 100644 (file)
 #define BO_BUF_SIZE         8
 #define BO_BUF_ATTACK_SIZE  1024
 
-static const char* mod_name = "back_orifice";
+static const char* s_name = "back_orifice";
 
 /* global keyvalue for the BoRand() function */
 static THREAD_LOCAL long holdrand = 1L;
@@ -186,10 +186,13 @@ static const RuleMap bo_rules[] =
     { 0, nullptr }
 };
 
+static const char* s_help =
+    "back orifice detection";
+
 class BoModule : public Module
 {
 public:
-    BoModule() : Module(mod_name)
+    BoModule() : Module(s_name, s_help)
     { };
 
     const RuleMap* get_rules() const
@@ -459,7 +462,7 @@ public:
 
 void BackOrifice::show(SnortConfig*)
 {
-    LogMessage("%s\n", mod_name);
+    LogMessage("%s\n", s_name);
 }
 
 void BackOrifice::eval(Packet *p)
@@ -596,7 +599,7 @@ static const InspectApi bo_api =
 {
     {
         PT_INSPECTOR,
-        mod_name,
+        s_name,
         INSAPI_PLUGIN_V0,
         0,
         mod_ctor,
index 560211440c6f19db493ed464150753da8c58be31..8fc3b905b216c0e53f7e37e8ec01e9f25fed39cb 100644 (file)
 #include "framework/plug_data.h"
 #include "detection/detection_util.h"
 
-static const char* data_key = "ftp_data";
+static const char* s_name = "ftp_data";
+
+static const char* s_help =
+    "FTP data channel handler";
 
 static THREAD_LOCAL ProfileStats ftpdataPerfStats;
 static THREAD_LOCAL SimpleStats fdstats;
@@ -209,15 +212,10 @@ public:
     void eval(Packet*);
 };
 
-static const Parameter fd_params[] =
-{
-    { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
-};
-
 class FtpDataModule : public Module
 {
 public:
-    FtpDataModule() : Module(data_key, fd_params) { };
+    FtpDataModule() : Module(s_name, s_help) { };
 
     const char** get_pegs() const;
     PegCount* get_counts() const;
@@ -283,7 +281,7 @@ const InspectApi fd_api =
 {
     {
         PT_INSPECTOR,
-        data_key,
+        s_name,
         INSAPI_PLUGIN_V0,
         0,
         mod_ctor,
index e1120784e47d34a07a0d9e58503afde0b91e2fcf..da009941d8d0b723bb1f581bc8e8d14663eb21a1 100644 (file)
@@ -28,6 +28,12 @@ using namespace std;
 #define FTP_CLIENT "ftp_client"
 #define FTP_SERVER "ftp_server"
 
+static const char* ftp_client_help =
+    "FTP client configuration module";
+
+static const char* ftp_server_help =
+    "main FTP module";
+
 //-------------------------------------------------------------------------
 // client stuff
 //-------------------------------------------------------------------------
@@ -68,7 +74,7 @@ static const Parameter ftp_client_params[] =
 };
 
 FtpClientModule::FtpClientModule() :
-    Module(FTP_CLIENT, ftp_client_params)
+    Module(FTP_CLIENT, ftp_client_help, ftp_client_params)
 {
     conf = nullptr;
 }
@@ -361,7 +367,7 @@ static const RuleMap ftp_server_rules[] =
 //-------------------------------------------------------------------------
 
 FtpServerModule::FtpServerModule() :
-    Module(FTP_SERVER, ftp_server_params)
+    Module(FTP_SERVER, ftp_server_help, ftp_server_params)
 {
     conf = nullptr;
 }
index 76dd7f3a93cb24bd29ad08d4775ea9d2ed84f83f..acc72a2562301b5e7a0bb473a6ebe0b398efbe28 100644 (file)
 
 using namespace std;
 
+static const char* s_name = "telnet";
+
+static const char* s_help = 
+    "telnet inspector";
+
 //-------------------------------------------------------------------------
 // telnet module
 //-------------------------------------------------------------------------
@@ -36,7 +41,7 @@ using namespace std;
 #define TELNET_SB_NO_SE_STR                      \
         "(telnet) Telnet Subnegotiation Begin Command without Subnegotiation End"
 
-static const Parameter telnet_params[] =
+static const Parameter s_params[] =
 {
     { "ayt_attack_thresh", Parameter::PT_INT, "-1:", "-1",
       "alert on this number of consecutive telnet AYT commands" },
@@ -63,7 +68,7 @@ static const RuleMap telnet_rules[] =
 };
 
 TelnetModule::TelnetModule() :
-    Module("telnet", telnet_params)
+    Module(s_name, s_help, s_params)
 {
     conf = nullptr;
 }
index a6edbe28ebed1545cf96404d95c41a2e6509ed08..a90a0944e96970535724529404610d710a3acd9d 100644 (file)
@@ -137,8 +137,11 @@ static const RuleMap hi_global_rules[] =
     { 0, nullptr }
 };
 
+static const char* hi_global_help =
+    "http inspector global configuration and client rules";
+
 HttpInspectModule::HttpInspectModule() :
-    Module(GLOBAL_KEYWORD, hi_global_params)
+    Module(GLOBAL_KEYWORD, hi_global_help, hi_global_params)
 {
     config = nullptr;
 }
@@ -410,8 +413,11 @@ static const RuleMap hi_server_rules[] =
     { 0, nullptr }
 };
 
+static const char* hi_server_help = 
+    "http inspection and server rules";
+
 HttpServerModule::HttpServerModule() :
-    Module(SERVER_KEYWORD, hi_server_params)
+    Module(SERVER_KEYWORD, hi_server_help, hi_server_params)
 { 
     server = nullptr;
 }
index 259de4739e25df028cec568dbb2b613cc29a1414..87f3f1a174afc9b396886872d3fb966a5c9df991 100644 (file)
 
 #include "framework/module.h"
 
+#define NHTTP_HELP "new HTTP inspector"
+
 class NHttpModule : public Module
 {
 public:
-    NHttpModule() : Module("nhttp_inspect", nhttp_params) {};
+    NHttpModule() : Module("nhttp_inspect", NHTTP_HELP, nhttp_params) {};
     bool begin(const char*, int, SnortConfig*);
     bool end(const char*, int, SnortConfig*) { return true; };
     bool set(const char*, Value&, SnortConfig*);
index 050e436a64d0a4e745660e19af891d06b2af7e48..70c9cd5c556e0639a85c7a17a2b7d56c90b4d320 100644 (file)
@@ -33,7 +33,7 @@
 #define RPC_ZERO_LENGTH_FRAGMENT_STR \
     "(rpc_decode) Zero-length RPC Fragment"
 
-static const Parameter rpc_params[] =
+static const Parameter s_params[] =
 {
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
@@ -53,7 +53,10 @@ static const RuleMap rpc_rules[] =
 // rpc module
 //-------------------------------------------------------------------------
 
-RpcDecodeModule::RpcDecodeModule() : Module("rpc_decode", rpc_params)
+static const char* s_name = "rpc_decode";
+static const char* s_help = "RPC inspector";
+
+RpcDecodeModule::RpcDecodeModule() : Module(s_name, s_help, s_params)
 { }
 
 const RuleMap* RpcDecodeModule::get_rules() const
index 8db0d5380f5c3788fbfb576774b22db9b3c8d964..a068c99af0e19aad55d98976e629e67e9138d217 100644 (file)
@@ -31,6 +31,8 @@ using namespace std;
 #include "magic.h"
 
 static const char* s_name = "wizard";
+static const char* s_help = 
+    "inspector that implements port-independent protocol identification";
 
 //-------------------------------------------------------------------------
 // wizard module
@@ -92,7 +94,7 @@ static const Parameter wizard_spells_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const Parameter wizard_params[] =
+static const Parameter s_params[] =
 {
     { "hexes", Parameter::PT_LIST, wizard_hexes_params, nullptr,
       "criteria for binary service identification" },
@@ -103,7 +105,7 @@ static const Parameter wizard_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-WizardModule::WizardModule() : Module(s_name, wizard_params)
+WizardModule::WizardModule() : Module(s_name, s_help, s_params)
 {
     c2s_hexes = nullptr;
     s2c_hexes = nullptr;
index df89bddc6de764e704e429802dd45a9ca1b8b306..0e9dd0fdb3928fcf2a159007363e88683a183750 100644 (file)
@@ -59,7 +59,7 @@ static const Parameter proto_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const Parameter stream_params[] =
+static const Parameter s_params[] =
 {
     { "icmp_cache", Parameter::PT_TABLE, proto_params, nullptr,
       "configure icmp cache limits" },
@@ -76,8 +76,11 @@ static const Parameter stream_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "base stream inspector for flow tracking";
+
 StreamModule::StreamModule() :
-    Module(MOD_NAME, stream_params)
+    Module(MOD_NAME, s_help, s_params)
 {
     proto = &stream_cfg.ip_cfg;
 }
index 864970143993c793609296f4e303d9260770b85a..e772eec4128659ec42f54fdbac4e04d12eeeb8ec 100644 (file)
@@ -31,7 +31,7 @@ using namespace std;
 // stream_icmp module
 //-------------------------------------------------------------------------
 
-static const Parameter stream_icmp_params[] =
+static const Parameter s_params[] =
 {
     { "session_timeout", Parameter::PT_INT, "1:86400", "30",
       "session tracking timeout" },
@@ -39,8 +39,11 @@ static const Parameter stream_icmp_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "stream inspector for ICMP flow tracking";
+
 StreamIcmpModule::StreamIcmpModule() :
-    Module(MOD_NAME, stream_icmp_params)
+    Module(MOD_NAME, s_help, s_params)
 {
     config = nullptr;
 }
index 4554395a460f22f32f9b2bab56fa3c9f61937fc2..8c6a1f154e9a2dfc9b3c97e46aae4daced5ab848 100644 (file)
@@ -97,7 +97,7 @@ static const RuleMap stream_ip_rules[] =
     { 0, nullptr }
 };
 
-static const Parameter stream_ip_params[] =
+static const Parameter s_params[] =
 {
     { "max_frags", Parameter::PT_INT, "1:", "8192",
       "maximum number of simultaneous fragments being tracked" },
@@ -120,8 +120,11 @@ static const Parameter stream_ip_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help =
+    "stream inspector for IP flow tracking";
+
 StreamIpModule::StreamIpModule() :
-    Module(MOD_NAME, stream_ip_params)
+    Module(MOD_NAME, s_help, s_params)
 {
     config = nullptr;
 }
index f63d742c0df34c1fbe5cf862694ba4e4c06db818..81d339cd54ee00b65da9187766822ef6bc515a5d 100644 (file)
@@ -37,7 +37,9 @@
 // stream_reassemble
 //-------------------------------------------------------------------------
 
-#define IPS_REASS "stream_reassemble"
+static const char* s_name = "stream_reassemble";
+static const char* s_help =
+    "detection option for stream reassembly control";
 
 static THREAD_LOCAL ProfileStats streamReassembleRuleOptionPerfStats;
 
@@ -53,7 +55,7 @@ class ReassembleOption : public IpsOption
 {
 public:
     ReassembleOption(const StreamReassembleRuleOptionData& c) :
-        IpsOption(IPS_REASS)
+        IpsOption(s_name)
     { srod = c; };
 
     uint32_t hash() const;
@@ -153,7 +155,7 @@ int ReassembleOption::eval(Cursor&, Packet* pkt)
 // stream_reassemble module
 //-------------------------------------------------------------------------
 
-static const Parameter reassemble_params[] =
+static const Parameter s_params[] =
 {
     { "*action", Parameter::PT_ENUM, "disable|enable", nullptr,
       "stop or start stream reassembly" },
@@ -173,7 +175,7 @@ static const Parameter reassemble_params[] =
 class ReassembleModule : public Module
 {
 public:
-    ReassembleModule() : Module(IPS_REASS, reassemble_params) { };
+    ReassembleModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
@@ -242,7 +244,7 @@ static const IpsApi reassemble_api =
 {
     {
         PT_IPS_OPTION,
-        IPS_REASS,
+        s_name,
         IPSAPI_PLUGIN_V0,
         0,
         reassemble_mod_ctor,
index 891c8e0160c8cbe5579e7bff2a5bd0b88fe210a0..c2a2eb9c2f86ed738aa662ff6b3efa499458a495 100644 (file)
@@ -85,7 +85,9 @@ bool StreamSizeOptionData::compare(uint32_t size1, uint32_t size2)
 // stream_size
 //-------------------------------------------------------------------------
 
-#define IPS_SIZE "stream_size"
+static const char* s_name = "stream_size";
+static const char* s_help =
+    "detection option for stream size checking";
 
 static THREAD_LOCAL ProfileStats streamSizePerfStats;
 
@@ -93,7 +95,7 @@ class SizeOption : public IpsOption
 {
 public:
     SizeOption(const StreamSizeOptionData& c) :
-        IpsOption(IPS_SIZE)
+        IpsOption(s_name)
     { ssod = c; };
 
     uint32_t hash() const;
@@ -215,7 +217,7 @@ int SizeOption::eval(Cursor&, Packet* pkt)
 // stream_size module
 //-------------------------------------------------------------------------
 
-static const Parameter size_params[] =
+static const Parameter s_params[] =
 {
     { "*direction", Parameter::PT_ENUM, "either|client|server|both", nullptr,
       "compare applies to the given direction(s)" },
@@ -232,7 +234,7 @@ static const Parameter size_params[] =
 class SizeModule : public Module
 {
 public:
-    SizeModule() : Module(IPS_SIZE, size_params) { };
+    SizeModule() : Module(s_name, s_help, s_params) { };
 
     bool begin(const char*, int, SnortConfig*);
     bool set(const char*, Value&, SnortConfig*);
@@ -297,7 +299,7 @@ static const IpsApi size_api =
 {
     {
         PT_IPS_OPTION,
-        IPS_SIZE,
+        s_name,
         IPSAPI_PLUGIN_V0,
         0,
         size_mod_ctor,
index e02f75d63b37963cf68aa1085cb2979a94ccc847..05a6b46595ac265a56f4646fd9eaad92ac0f0ff6 100644 (file)
@@ -102,7 +102,7 @@ static const Parameter stream_queue_limit_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const Parameter stream_tcp_params[] =
+static const Parameter s_params[] =
 {
     { "flush_factor", Parameter::PT_INT, "0:", "0",
       "flush upon seeing a drop in segment size after given number of non-decreasing segments" },
@@ -172,8 +172,11 @@ static const RuleMap stream_tcp_rules[] =
     { 0, nullptr }
 };
 
+static const char* s_help = 
+    "stream inspector for TCP flow tracking and stream normalization and reassembly";
+
 StreamTcpModule::StreamTcpModule() :
-    Module(MOD_NAME, stream_tcp_params)
+    Module(MOD_NAME, s_help, s_params)
 {
     config = nullptr;
 }
index bcef49890b037eeee29ddd9f95a30cebb5f8b8d4..e09adcc5941083f35c04bb61a8aa9d97dcfec31a 100644 (file)
@@ -31,7 +31,7 @@ using namespace std;
 // stream_udp module
 //-------------------------------------------------------------------------
 
-static const Parameter stream_udp_params[] =
+static const Parameter s_params[] =
 {
     { "session_timeout", Parameter::PT_INT, "1:86400", "30",
       "session tracking timeout" },
@@ -42,8 +42,11 @@ static const Parameter stream_udp_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
+static const char* s_help = 
+    "stream inspector for UDP flow tracking";
+
 StreamUdpModule::StreamUdpModule() :
-    Module(MOD_NAME, stream_udp_params)
+    Module(MOD_NAME, s_help, s_params)
 {
     config = nullptr;
 }
index 29134212dbc3c443c2788479ac0c4c6620b0dd73..2a8034616459940b95c603b68cb9498143fabacd 100644 (file)
 #include "main/snort_config.h"
 #include "main/snort.h"
 
+static const char* s_name = "ppm";
+static const char* s_help = 
+    "packet and rule latency monitoring and control";
+
 //-------------------------------------------------------------------------
 // ppm attributes
 //-------------------------------------------------------------------------
 
 #ifdef PPM_MGR
-static const Parameter ppm_params[] =
+static const Parameter s_params[] =
 {
     { "max_pkt_time", Parameter::PT_INT, "0:", "0",
       "enable packet latency thresholding (usec), 0 = off" },
@@ -88,7 +92,7 @@ static const RuleMap ppm_rules[] =
 // ppm module
 //-------------------------------------------------------------------------
 
-PpmModule::PpmModule() : Module("ppm", ppm_params) { }
+PpmModule::PpmModule() : Module(s_name, s_help, s_params) { }
 
 const RuleMap* PpmModule::get_rules() const
 { return ppm_rules; }