]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
cleanup static const char*
authorRuss Combs <rucombs@cisco.com>
Sun, 12 Oct 2014 00:00:33 +0000 (20:00 -0400)
committerRuss Combs <rucombs@cisco.com>
Sun, 12 Oct 2014 00:00:33 +0000 (20:00 -0400)
106 files changed:
ChangeLog
src/actions/act_react.cc
src/actions/act_reject.cc
src/actions/act_replace.cc
src/actions/actions.cc
src/codecs/link/cd_pppoe.cc
src/detection/detection_options.cc
src/detection/fpcreate.cc
src/file_api/libs/file_identifier.cc
src/framework/parameter.cc
src/helpers/chunk.cc
src/helpers/markup.cc
src/helpers/process.cc
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/log/log_text.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_null.cc
src/loggers/log_pcap.cc
src/loggers/unified2.cc
src/main/help.cc
src/main/modules.cc
src/main/shell.cc
src/main/snort_config.cc
src/main/snort_module.cc
src/managers/inspector_manager.cc
src/managers/plugin_manager.cc
src/managers/script_manager.cc
src/network_inspectors/normalize/norm.cc
src/network_inspectors/perf_monitor/perf_base.cc
src/network_inspectors/port_scan/ps_module.cc
src/parser/parse_stream.cc
src/service_inspectors/back_orifice/back_orifice.cc
src/service_inspectors/ftp_telnet/ftp.cc
src/service_inspectors/ftp_telnet/ftp_data.cc
src/service_inspectors/ftp_telnet/ftp_module.cc
src/service_inspectors/http_inspect/hi_module.cc
src/service_inspectors/http_inspect/hi_ui_iis_unicode_map.cc
src/service_inspectors/rpc_decode/rpc_decode.cc
src/service_inspectors/rpc_decode/rpc_module.cc
src/stream/base/stream_base.cc
src/stream/ip/ip_defrag.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/tcp/tcp_session.cc
src/test/sfip_test.cc
src/time/ppm_module.cc
src/utils/stats.cc
src/utils/stats.h

index c1d43f6d2e5cb8f43ae76a310bee0ef935167cef..b8cfe0afdfb3473d85e8d3819688b69184a278f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 125
 -- discovered can't catch exceptions thrown from Lua to C++; need to
    build liblua differently
+-- changed most static const char* s to #define s or static const char*
+   const s
 
 124
 -- valgrind cleanup
index 399e78bc374796716075a6b8165d3b3dd609213c..9f9d2d338a0a4c61eb04383e4d17a4858091e6eb 100644 (file)
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "react";
+#define s_name "react"
 
-static const char* s_help =
-    "send response to client and terminate session";
+#define s_help \
+    "send response to client and terminate session"
 
 static THREAD_LOCAL ProfileStats reactPerfStats;
 
-static const char* MSG_KEY = "<>";
-static const char* MSG_PERCENT = "%";
-
-static const char* DEFAULT_HTTP =
-    "HTTP/1.1 403 Forbidden\r\n"
-    "Connection: close\r\n"
-    "Content-Type: text/html; charset=utf-8\r\n"
-    "Content-Length: %d\r\n"
-    "\r\n";
-
-static const char* DEFAULT_HTML =
-    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n"
-    "    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n"
-    "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\r\n"
-    "<head>\r\n"
-    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n"
-    "<title>Access Denied</title>\r\n"
-    "</head>\r\n"
-    "<body>\r\n"
-    "<h1>Access Denied</h1>\r\n"
-    "<p>%s</p>\r\n"
-    "</body>\r\n"
-    "</html>\r\n";
-
-static const char* DEFAULT_MSG =
-    "You are attempting to access a forbidden site.<br />"
-    "Consult your system administrator for details.";
+#define MSG_KEY "<>"
+#define MSG_PERCENT "%"
+
+#define DEFAULT_HTTP \
+    "HTTP/1.1 403 Forbidden\r\n" \
+    "Connection: close\r\n" \
+    "Content-Type: text/html; charset=utf-8\r\n" \
+    "Content-Length: %d\r\n" \
+    "\r\n"
+
+#define DEFAULT_HTML \
+    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n" \
+    "    \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n" \
+    "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\r\n" \
+    "<head>\r\n" \
+    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n" \
+    "<title>Access Denied</title>\r\n" \
+    "</head>\r\n" \
+    "<body>\r\n" \
+    "<h1>Access Denied</h1>\r\n" \
+    "<p>%s</p>\r\n" \
+    "</body>\r\n" \
+    "</html>\r\n"
+
+#define DEFAULT_MSG \
+    "You are attempting to access a forbidden site.<br />" \
+    "Consult your system administrator for details."
 
 struct ReactData
 {
index 92fbb740a0d4315d9f823c9f4b24458f0009dcc3..785df279b932a733411e1095bf600c6337bdba3b 100644 (file)
 #define REJ_RST_BOTH (REJ_RST_SRC|REJ_RST_DST)
 #define REJ_UNR_ALL  (REJ_UNR_NET|REJ_UNR_HOST|REJ_UNR_PORT)
 
-static const char* s_name = "reject";
+#define s_name "reject"
 
-static const char* s_help =
-    "terminate session with TCP reset or ICMP unreachable";
+#define s_help \
+    "terminate session with TCP reset or ICMP unreachable"
 
 static THREAD_LOCAL ProfileStats rejPerfStats;
 
index dd73471c4442dc4866ed0053404d605c8357f701..ca495535a4c4132272b6a892410a4821f4c60e40 100644 (file)
 #include "snort_debug.h"
 #include "snort.h"
 
-static const char* s_name = "rewrite";
+#define s_name "rewrite"
 
-static const char* s_help =
-    "overwrite packet contents";
+#define s_help \
+    "overwrite packet contents"
 
 // FIXIT-L ips_replace.cc should part of this lib
 // FIXIT-L enforce that a rule with a replace option has a replace action
index 580a00609b43de055de3a1fca33fd19d53ea95f9..3ec150488c46923195c8fe52adb81cbb11ef7ee9 100644 (file)
@@ -120,7 +120,7 @@ static int LogAction(Packet* p, const OptTreeNode* otn)
     return 1;
 }
 
-static const char* rule_type[RULE_TYPE__MAX] =
+static const char* const rule_type[RULE_TYPE__MAX] =
 {
     "none", "alert", "drop", 
     "log", "pass", "sdrop"
index 6f796a6b6211eda09e819bce27ed3be80ad0ca94..b05f961c553e412a58118ecd357614a731e5bddf 100644 (file)
@@ -64,8 +64,8 @@ static const RuleMap pppoe_rules[] =
     { 0, nullptr }
 };
 
-static const char* pppoe_help =
-    "support for point-to-point protocol over ethernet";
+#define pppoe_help \
+    "support for point-to-point protocol over ethernet"
 
 class PPPoEModule : public DecodeModule
 {
index e26de90cb45820d7cecbabfcbedde445dc852c9e..8b60aa7ee087f03a68fa01000856ab9c34013977 100644 (file)
@@ -315,7 +315,7 @@ SFXHASH * DetectionTreeHashTableNew(void)
 }
 
 #ifdef DEBUG_OPTION_TREE
-static const char *option_type_str[] =
+static const char* const option_type_str[] =
 {
     "RULE_OPTION_TYPE_LEAF_NODE",
     "RULE_OPTION_TYPE_CONTENT",
index 0c8f6e763f0ea50c8f3188aa09ba5916208fd6f6..f191b89897ac5fcea24db61e3e4b47370fbf687c 100644 (file)
@@ -92,7 +92,7 @@ static int fpAddPortGroupPrmx(PORT_GROUP *pg, OptTreeNode *otn, int cflag);
 static void PrintFastPatternInfo(OptTreeNode *otn, PatternMatchData *pmd,
         const char *pattern, int pattern_length);
 
-static const char *pm_type_strings[PM_TYPE__MAX] =
+static const char* const pm_type_strings[PM_TYPE__MAX] =
 {
     "Normal Content",
     "HTTP Uri content",
index 5fede328088026890707b819b28d517de8094c76..d543a00ec0467893310f545bbb2be48074d691de 100644 (file)
@@ -543,8 +543,6 @@ char *test_find_file_type(void *conf)
 
     FileContext *context = (FileContext*)SnortAlloc(sizeof (*context));
 
-    static const char *file_type = "MSEXE";
-
     printf("Check string:");
 
     for (i = 0; i < strlen((char*)str); i++)
@@ -564,7 +562,7 @@ char *test_find_file_type(void *conf)
         printf("File type is: %s (%d)\n",file_info_from_ID(conf, type_id), type_id);
 
     free(context);
-    return ((char *)file_type);
+    return ((char *)"MSEXE");
 #else
     UNUSED(conf);
     return NULL;
index 13e40e2ef83dfdc52ec5cfbbb2c4dbe17183bc9b..9c924602af7a3aec6553735f95018c77ca0c8ead 100644 (file)
@@ -175,9 +175,10 @@ static bool valid_enum(Value& v, const char* r)
     return true;
 }
 
+#define delim " \t\n"
+
 static unsigned split(const string& txt, vector<string>& strs)
 {
-    static const char* delim = " \t\n";
     size_t last = txt.find_first_not_of(delim);
     size_t pos = txt.find_first_of(delim, last);
     strs.clear();
@@ -369,7 +370,7 @@ bool Parameter::validate(Value& v) const
     return false;
 }
 
-static const char* pt2str[Parameter::PT_MAX] =
+static const char* const pt2str[Parameter::PT_MAX] =
 {
     "table", "list",
     "bool", "int", "real", "port",
index 1350cb325b6ffb5df767991d8db7b40ae01cb155..b7254d713c015891a1d552e622b88392be2edafd 100644 (file)
@@ -30,7 +30,7 @@
 
 using namespace std;
 
-static const char* opt_init = "init";
+#define opt_init "init"
 
 //-------------------------------------------------------------------------
 // lua stuff
index 72b55357993de91783457101c238b2ef413ca601..3fe9d0508697dd5eb7eb2bc3403345f03942515b 100644 (file)
@@ -28,9 +28,10 @@ bool Markup::enabled = false;
 void Markup::enable(bool e)
 { enabled = e; }
 
+#define hn "========== "
+
 const char* Markup::head(unsigned level)
 { 
-    static const char* hn = "========== ";
     unsigned max = strlen(hn);
 
     if ( level >= max )
index e887c76222b60af70bb6cbe16abb1d14140a0a37..1a0ad89385c7169cdd5e904784ee2128575472a5 100644 (file)
@@ -57,7 +57,7 @@ using namespace std;
 #define SIGNAL_SNORT_READ_ATTR_TBL SIGURG
 #endif
 
-const char* pig_sig_names[PIG_SIG_MAX] =
+static const char* const pig_sig_names[PIG_SIG_MAX] =
 {
     "none", "quit", "term", "int",
     "reload-config", "reload-attributes",
index dcdac7644d5b3fec3321bd842623ca8e93f5e6ea..b5c3d71cc8d2043a17b41adf31eb4833b5a94e49 100644 (file)
 #include "framework/range.h"
 #include "protocols/tcp.h"
 
-static const char* s_name = "ack";
+#define s_name "ack"
 
-static const char* s_help =
-    "rule option to match on TCP ack numbers";
+#define s_help \
+    "rule option to match on TCP ack numbers"
 
 static THREAD_LOCAL ProfileStats tcpAckPerfStats;
 
index 42bf6b80278c60b5ee67bd340d2a4cce9c213c56..e85be622d22c7dd4deb1f4d0d4fc1e56d38ff69c 100644 (file)
 
 static THREAD_LOCAL ProfileStats asn1PerfStats;
 
-static const char* s_name = "asn1";
+#define s_name "asn1"
 
-static const char* s_help =
-    "rule option for asn1 detection";
+#define s_help \
+    "rule option for asn1 detection"
 
 class Asn1Option : public IpsOption
 {
index 0f0752561448b5e094f330efc038ea445bf084d8..16a636d8c0a99f394df2c5b284a81dea6adea1f4 100644 (file)
@@ -55,10 +55,10 @@ static THREAD_LOCAL uint32_t base64_decode_size;
 
 static THREAD_LOCAL ProfileStats base64PerfStats;
 
-static const char* s_name = "base64_decode";
+#define s_name "base64_decode"
 
-static const char* s_help =
-    "rule option to decode base64 data - must be used with base64_data option";
+#define s_help \
+    "rule option to decode base64 data - must be used with base64_data option"
 
 //-------------------------------------------------------------------------
 // base64_decode
@@ -290,8 +290,8 @@ static const IpsApi base64_decode_api =
 // base64_data
 //-------------------------------------------------------------------------
 
-static const char* s_data_name = "base64_data";
-static const char* s_data_help = "set detection cursor to decoded Base64 data";
+#define s_data_name "base64_data"
+#define s_data_help "set detection cursor to decoded Base64 data"
 
 class Base64DataOption : public IpsOption
 {
index 895a5e80d2a22beb0a377fef4a53da5739016b98..2d2296cf9e940159a383470ecc20d505c24ca9d4 100644 (file)
 #include "framework/cursor.h"
 #include "framework/module.h"
 
-static const char* s_name = "bufferlen";
+#define s_name "bufferlen"
 
-static const char* s_help =
-    "rule option to check length of current buffer";
+#define s_help \
+    "rule option to check length of current buffer"
 
 static THREAD_LOCAL ProfileStats lenCheckPerfStats;
 
index 84e01efa86024e6f3ff2e39878ba870947de85d5..268cc22e38cd00c331812f27b41a1fa67f59fb3e 100644 (file)
 
 static THREAD_LOCAL ProfileStats byteExtractPerfStats;
 
-static const char* s_name = "byte_extract";
+#define s_name "byte_extract"
 
-static const char* s_help =
-    "rule option to convert data to an integer variable";
+#define s_help \
+    "rule option to convert data to an integer variable"
 
 #define MAX_BYTES_TO_GRAB 4
 
index 968bd9cc59399fe608a41ebba8895e29ebda2b6e..51f9411364f9cfe84a606379220e86287bd63b5d 100644 (file)
@@ -98,7 +98,7 @@
 
 static THREAD_LOCAL ProfileStats byteJumpPerfStats;
 
-static const char* s_name = "byte_jump";
+#define s_name "byte_jump"
 using namespace std;
 
 typedef struct _ByteJumpData
@@ -351,8 +351,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to move the detection cursor";
+#define s_help \
+    "rule option to move the detection cursor"
 
 class ByteJumpModule : public Module
 {
index 081fe6813fdaa15758682b0a95d355b073bc2eb8..f0fdf7205b5189842bf0c8dff5719844391b350b 100644 (file)
@@ -122,7 +122,7 @@ using namespace std;
 
 static THREAD_LOCAL ProfileStats byteTestPerfStats;
 
-static const char* s_name = "byte_test";
+#define s_name "byte_test"
 
 #define CHECK_EQ            0
 #define CHECK_NEQ           1
@@ -482,8 +482,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to convert data to integer and compare";
+#define s_help \
+    "rule option to convert data to integer and compare"
 
 class ByteTestModule : public Module
 {
index c908660595746aacce679246d8e967f6d71141de..af16bd3e5a5f98c88186609c312894edea9f9636 100644 (file)
@@ -36,7 +36,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "classtype";
+#define s_name "classtype"
 
 //-------------------------------------------------------------------------
 // module
@@ -50,8 +50,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "general rule option for rule classification";
+#define s_help \
+    "general rule option for rule classification"
 
 class ClassTypeModule : public Module
 {
index 22cbf0f81309cbf80c900835005c55990686c044..f3cf590e6f80648c9b9a32a640ba9f290a3e9a6d 100644 (file)
@@ -54,7 +54,7 @@
 
 #define MAX_PATTERN_SIZE 2048
 
-static const char* s_name = "content";
+#define s_name "content"
 
 static THREAD_LOCAL ProfileStats contentPerfStats;
 
@@ -711,8 +711,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "payload rule option for basic pattern matching";
+#define s_help \
+    "payload rule option for basic pattern matching"
 
 class ContentModule : public Module
 {
index 432f281357412a9b8c75f03bde0a8e4bccb9ef3c..621f13fbaa03a0aca6d54fa573bf4a591a1d3d8c 100644 (file)
@@ -65,7 +65,7 @@
 
 static THREAD_LOCAL ProfileStats cvsPerfStats;
 
-static const char* s_name = "cvs";
+#define s_name "cvs"
 
 #define CVS_CONFIG_DELIMITERS  " \t\n"
 
@@ -437,8 +437,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "payload rule option for detecting specific attacks";
+#define s_help \
+    "payload rule option for detecting specific attacks"
 
 class CvsModule : public Module
 {
index 9a3b3779fe72d0f7b0e49fc5aa589c3d02cf23fe..17b05a89e6775f537972a8925f6fe3d52495f4f1 100644 (file)
@@ -41,7 +41,7 @@
 #include "filters/detection_filter.h"
 #include "filters/sfthd.h"
 
-static const char* s_name = "detection_filter";
+#define s_name "detection_filter"
 
 //-------------------------------------------------------------------------
 // module
@@ -61,8 +61,8 @@ static const Parameter s_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";
+#define s_help \
+    "rule option to require multiple hits before a rule generates an event"
 
 class DetectionFilterModule : public Module
 {
index a1d18993ab1cf355be14f47665de31cfa3b3839c..14c28e8b93b1aa743abde8c83afc7cd8898b8524 100644 (file)
@@ -43,7 +43,7 @@
 #include "framework/module.h"
 #include "framework/range.h"
 
-static const char* s_name = "dsize";
+#define s_name "dsize"
 
 static THREAD_LOCAL ProfileStats dsizePerfStats;
 
@@ -130,8 +130,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to test payload size";
+#define s_help \
+    "rule option to test payload size"
 
 class DsizeModule : public Module
 {
index 86252d31f0db5584add4128bbc2f5b26226222ef..b2d7bd0f70d40bab0a898bb6b56eb70423c3c855 100644 (file)
@@ -37,7 +37,7 @@
 #include "framework/ips_option.h"
 #include "framework/module.h"
 
-static const char* s_name = "file_data";
+#define s_name "file_data"
 
 static THREAD_LOCAL ProfileStats fileDataPerfStats;
 
@@ -86,8 +86,8 @@ int FileDataOption::eval(Cursor& c, Packet*)
 // module
 //-------------------------------------------------------------------------
 
-static const char* s_help =
-    "rule option to set detection cursor to file data";
+#define s_help \
+    "rule option to set detection cursor to file data"
 
 class FileDataModule : public Module
 {
index 5400b49b4e0159551556d92b31461d1ef16dd293..7bb9383951df90f0032aad5262e805e5aa79f9f0 100644 (file)
@@ -58,7 +58,7 @@
 #define R_ECE          0x40  /* ECN echo, RFC 3168 */
 #define R_CWR          0x80  /* Congestion Window Reduced, RFC 3168 */
 
-static const char* s_name = "flags";
+#define s_name "flags"
 
 static THREAD_LOCAL ProfileStats tcpFlagsPerfStats;
 
@@ -410,8 +410,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to test TCP control flags";
+#define s_help \
+    "rule option to test TCP control flags"
 
 class FlagsModule : public Module
 {
index 9282eb7f56a5f3fe19acd9e338e70020698b7e32..9e09844a9885a5c55d6d885b386091d3bd68b1a6 100644 (file)
@@ -46,7 +46,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "flow";
+#define s_name "flow"
 
 static THREAD_LOCAL ProfileStats flowCheckPerfStats;
 
@@ -369,8 +369,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check session properties";
+#define s_help \
+    "rule option to check session properties"
 
 class FlowModule : public Module
 {
index 589bb9cfc01d60f6692543160feb97f4fb9cd147..935275dd69062701e3fb60059cca8b5957336348 100644 (file)
@@ -74,7 +74,7 @@ using namespace std;
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "flowbits";
+#define s_name "flowbits"
 
 static THREAD_LOCAL ProfileStats flowBitsPerfStats;
 
@@ -1152,8 +1152,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to set and test arbitrary boolean flags";
+#define s_help \
+    "rule option to set and test arbitrary boolean flags"
 
 class FlowbitsModule : public Module
 {
index 1d3a220ea090175fb3957267de307b79b0bdd480..07068ba32a797a7231236f06869798e1336387e0 100644 (file)
@@ -79,7 +79,7 @@
 #define FB_DF  0x4000
 #define FB_MF  0x2000
 
-static const char* s_name = "fragbits";
+#define s_name "fragbits"
 
 static THREAD_LOCAL ProfileStats fragBitsPerfStats;
 
@@ -308,8 +308,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to test IP frag flags";
+#define s_help \
+    "rule option to test IP frag flags"
 
 class FragBitsModule : public Module
 {
index 2cc9a29552cc38779e80034deb0e25f36231bbca..018d9c8649ccea25e0f7ccaa4440404608f4f8df 100644 (file)
@@ -39,7 +39,7 @@
 #include "framework/module.h"
 #include "framework/range.h"
 
-static const char* s_name = "fragoffset";
+#define s_name "fragoffset"
 
 static THREAD_LOCAL ProfileStats fragOffsetPerfStats;
 
@@ -120,8 +120,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to test IP frag offset";
+#define s_help \
+    "rule option to test IP frag offset"
 
 class FragOffsetModule : public Module
 {
index 9e3347965408900ace10525a7a8bffb4b51a789f..4289d936759767742d3d3b9dd2f2e70587e37382 100644 (file)
@@ -33,7 +33,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "gid";
+#define s_name "gid"
 
 //-------------------------------------------------------------------------
 // module
@@ -47,8 +47,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option specifying rule generator";
+#define s_help \
+    "rule option specifying rule generator"
 
 class GidModule : public Module
 {
index 4de79efb3de70d5af6314a1a7b316018fd09d021..9bd756222ce957067daebc2611dbfdd3bc172f5b 100644 (file)
@@ -114,8 +114,8 @@ 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";
+#define uri_help \
+    "rule option to set the detection cursor to the normalized URI buffer"
 
 static THREAD_LOCAL ProfileStats uri_ps;
 
@@ -158,8 +158,8 @@ static const IpsApi uri_api =
 #undef IPS_OPT
 #define IPS_OPT "http_client_body"
 
-static const char* cb_help =
-    "rule option to set the detection cursor to the request body";
+#define cb_help \
+    "rule option to set the detection cursor to the request body"
 
 static THREAD_LOCAL ProfileStats cb_ps;
 
@@ -202,8 +202,8 @@ static const IpsApi client_body_api =
 #undef IPS_OPT
 #define IPS_OPT "http_method"
 
-static const char* meth_help =
-    "rule option to set the detection cursor to the HTTP request method";
+#define meth_help \
+    "rule option to set the detection cursor to the HTTP request method"
 
 static THREAD_LOCAL ProfileStats meth_ps;
 
@@ -246,8 +246,8 @@ 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";
+#define cookie_help  \
+    "rule option to set the detection cursor to the HTTP cookie"
 
 static THREAD_LOCAL ProfileStats cookie_ps;
 
@@ -290,8 +290,8 @@ 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";
+#define stat_code_help  \
+    "rule option to set the detection cursor to the HTTP status code"
 
 static THREAD_LOCAL ProfileStats stat_code_ps;
 
@@ -334,8 +334,8 @@ 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";
+#define stat_msg_help  \
+    "rule option to set the detection cursor to the HTTP status message"
 
 static THREAD_LOCAL ProfileStats stat_msg_ps;
 
@@ -378,8 +378,8 @@ 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";
+#define raw_uri_help  \
+    "rule option to set the detection cursor to the unnormalized URI"
 
 static THREAD_LOCAL ProfileStats raw_uri_ps;
 
@@ -422,8 +422,8 @@ 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";
+#define raw_header_help  \
+    "rule option to set the detection cursor to the unnormalized headers"
 
 static THREAD_LOCAL ProfileStats raw_header_ps;
 
@@ -466,8 +466,8 @@ 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";
+#define raw_cookie_help  \
+    "rule option to set the detection cursor to the unnormalized cookie"
 
 static THREAD_LOCAL ProfileStats raw_cookie_ps;
 
index f25400f3118e0860809606b9ea23073f30d3fb8c..1fc81c81834b0c9eb6de757985767e23166a2ff9 100644 (file)
@@ -37,7 +37,7 @@ using namespace std;
 #include "framework/inspector.h"
 #include "framework/module.h"
 
-static const char* s_name = "http_header";
+#define s_name "http_header"
 
 static THREAD_LOCAL ProfileStats httpHeaderPerfStats;
 
@@ -53,8 +53,8 @@ static const Parameter s_params[] =
 // module
 //-------------------------------------------------------------------------
 
-static const char* s_help =
-    "rule option to set the detection cursor to the normalized header(s)";
+#define s_help \
+    "rule option to set the detection cursor to the normalized header(s)"
 
 class HttpHeaderModule : public Module
 {
index 155ea75f68e0af959f81a37f96b26b83320ad7ce..dac1c16921249a6e288d333f7548ec78f0a8df5a 100644 (file)
@@ -61,7 +61,7 @@
 #include "protocols/icmp4.h"
 #include "protocols/icmp6.h"
 
-static const char* s_name = "icmp_id";
+#define s_name "icmp_id"
 
 static THREAD_LOCAL ProfileStats icmpIdPerfStats;
 
@@ -144,8 +144,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check ICMP ID";
+#define s_help \
+    "rule option to check ICMP ID"
 
 class IcmpIdModule : public Module
 {
index 4c86b773b98818cd64ae4e517dba123d2e39c4e5..113bc5d53fb62477dcfed197b95378e5489580fb 100644 (file)
@@ -61,7 +61,7 @@
 #include "protocols/icmp4.h"
 #include "protocols/icmp6.h"
 
-static const char* s_name = "icmp_seq";
+#define s_name "icmp_seq"
 
 static THREAD_LOCAL ProfileStats icmpSeqPerfStats;
 
@@ -146,8 +146,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check ICMP sequence number";
+#define s_help \
+    "rule option to check ICMP sequence number"
 
 class IcmpSeqModule : public Module
 {
index ca82959f5eb82a465646fc4d0549667503c22879..05372aa970e3e41079e112762d77067d7dad258b 100644 (file)
@@ -40,7 +40,7 @@
 #include "framework/range.h"
 #include "protocols/icmp4.h"
 
-static const char* s_name = "icode";
+#define s_name "icode"
 
 static THREAD_LOCAL ProfileStats icmpCodePerfStats;
 
@@ -117,8 +117,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check ICMP code";
+#define s_help \
+    "rule option to check ICMP code"
 
 class IcodeModule : public Module
 {
index 8a804e37cf13db47c99039302bc7188c352efad9..39d4804c434507ebcf29b855e2a875ca6a86e206 100644 (file)
@@ -36,7 +36,7 @@
 #include "framework/module.h"
 #include "framework/range.h"
 
-static const char* s_name = "id";
+#define s_name "id"
 
 static THREAD_LOCAL ProfileStats ipIdPerfStats;
 
@@ -112,8 +112,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check the IP ID field";
+#define s_help \
+    "rule option to check the IP ID field"
 
 class IpIdModule : public Module
 {
index e947e1c0329e29db12b961539536f0e8a290f892..6881811b9a0c2b5e132849c1c80dfd64ca7e8119 100644 (file)
@@ -46,7 +46,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "ip_proto";
+#define s_name "ip_proto"
 
 static THREAD_LOCAL ProfileStats ipProtoPerfStats;
 
@@ -294,8 +294,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check the IP protocol number";
+#define s_help \
+    "rule option to check the IP protocol number"
 
 class IpProtoModule : public Module
 {
index a38ae1c3e128a4ca9778a1ca94bea8a03198e67a..0f83e5be6cb76fb7c44508b566336a6a49a78b75 100644 (file)
@@ -45,7 +45,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "ipopts";
+#define s_name "ipopts"
 
 static THREAD_LOCAL ProfileStats ipOptionPerfStats;
 
@@ -213,8 +213,8 @@ static void ipopts_parse(const char* data, IpOptionData* ds_ptr)
 // module
 //-------------------------------------------------------------------------
 
-static const char* s_opts =
-    "rr|eol|nop|ts|sec|esec|lsrr|lsrre|ssrr|satid|any";
+#define s_opts \
+    "rr|eol|nop|ts|sec|esec|lsrr|lsrre|ssrr|satid|any"
 
 static const Parameter s_params[] =
 {
@@ -224,8 +224,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check for IP options";
+#define s_help \
+    "rule option to check for IP options"
 
 class IpOptModule : public Module
 {
index e0728e2a7e9b17c81081bb1472d9390e068f3c14..9437c0b9c5972fe9ac451c596e4e6c85bfd771d9 100644 (file)
@@ -63,7 +63,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "isdataat";
+#define s_name "isdataat"
 
 static THREAD_LOCAL ProfileStats isDataAtPerfStats;
 
@@ -254,8 +254,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check for the presence of payload data";
+#define s_help \
+    "rule option to check for the presence of payload data"
 
 class IsDataAtModule : public Module
 {
index 94fd99433f46a2e80bae93710cfd954a45eb839e..8151d85b996132ad6dced65ecd89ae8241177911 100644 (file)
@@ -36,7 +36,7 @@
 #include "framework/range.h"
 #include "protocols/icmp4.h"
 
-static const char* s_name = "itype";
+#define s_name "itype"
 
 static THREAD_LOCAL ProfileStats icmpTypePerfStats;
 
@@ -114,8 +114,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check ICMP type";
+#define s_help \
+    "rule option to check ICMP type"
 
 class ItypeModule : public Module
 {
index 9150e290d9404cc3d775dddac63f4e2d096966ad..f1981ea70e28c2f27f63e72c25b66ab0a23fb729 100644 (file)
@@ -35,7 +35,7 @@
 
 static THREAD_LOCAL ProfileStats luaIpsPerfStats;
 
-static const char* opt_eval = "eval";
+#define opt_eval "eval"
 
 //-------------------------------------------------------------------------
 // ffi stuff
@@ -77,8 +77,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option for detecting with Lua scripts";
+#define s_help \
+    "rule option for detecting with Lua scripts"
 
 class LuaJitModule : public Module
 {
index 9840f6e0382805aa26056add8f345165c191bcf1..f533249613364f4eb4b7142ed0d014ab94ac6290 100644 (file)
@@ -35,7 +35,7 @@ using namespace std;
 #include "framework/module.h"
 #include "parser/parse_conf.h"
 
-static const char* s_name = "metadata";
+#define s_name "metadata"
 
 //-------------------------------------------------------------------------
 // module
@@ -52,8 +52,8 @@ static const Parameter s_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";
+#define s_help \
+    "rule option for conveying arbitrary name, value data within the rule text"
 
 class MetadataModule : public Module
 {
index 11f78772ab3b978547587aaf9ce72d016bdae3e0..d4c6a960b4c3808eed0e9ff5e9bbbba55a4807b8 100644 (file)
@@ -35,7 +35,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "msg";
+#define s_name "msg"
 
 //-------------------------------------------------------------------------
 // module
@@ -49,8 +49,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option summarizing rule purpose output with events";
+#define s_help \
+    "rule option summarizing rule purpose output with events"
 
 class MsgModule : public Module
 {
index 3d7e2590031f1d00724b331fcb41563a8cb6b4c2..4d0d3a59c9f48eb11cee0d2e80938d519cd438cf 100644 (file)
@@ -68,7 +68,7 @@
 #define SNORT_PCRE_ANCHORED         0x00040
 #define SNORT_OVERRIDE_MATCH_LIMIT  0x00080 // Override default limits on match & match recursion
 
-static const char* s_name = "pcre";
+#define s_name "pcre"
 
 /*
  * we need to specify the vector length for our pcre_exec call.  we only care
@@ -641,8 +641,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option for matching payload data with regex";
+#define s_help \
+    "rule option for matching payload data with regex"
 
 class PcreModule : public Module
 {
index 6b9ac8623a135c10a425b0ae78954b43e026614e..3163419e104282309bac5e9a20b0d3e10f6ca4e3 100644 (file)
@@ -33,7 +33,7 @@
 #include "framework/module.h"
 #include "detection/detection_defines.h"
 
-static const char* s_name = "pkt_data";
+#define s_name "pkt_data"
 
 static THREAD_LOCAL ProfileStats pktDataPerfStats;
 
@@ -63,8 +63,8 @@ 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";
+#define s_help \
+    "rule option to set the detection cursor to the normalized packet data"
 
 class PktDataModule : public Module
 {
index 36eb06fc35ce26b1d623aaa6607e576a06535d64..421433b4eb382f3ea6c458ce1ab57f952026f80e 100644 (file)
@@ -33,7 +33,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "priority";
+#define s_name "priority"
 
 //-------------------------------------------------------------------------
 // module
@@ -47,8 +47,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option for prioritizing events";
+#define s_help \
+    "rule option for prioritizing events"
 
 class PriorityModule : public Module
 {
index 9317f4e710562db75af6c78789ac927a48cbabc3..9144a7359cd951aab5738030dd60654169ee0d5a 100644 (file)
@@ -33,7 +33,7 @@
 #include "framework/ips_option.h"
 #include "framework/module.h"
 
-static const char* s_name = "raw_data";
+#define s_name "raw_data"
 
 static THREAD_LOCAL ProfileStats rawDataPerfStats;
 
@@ -63,8 +63,8 @@ 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";
+#define s_help \
+    "rule option to set the detection cursor to the raw packet data"
 
 class RawDataModule : public Module
 {
index 03a22d6ee7680c5f1b6f1be7736a643db0c003b8..522d6066fbe6e4dce058b32dde62fe268be6ba09 100644 (file)
@@ -33,7 +33,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "reference";
+#define s_name "reference"
 
 //-------------------------------------------------------------------------
 // module
@@ -50,8 +50,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to indicate relevant attack indentification system";
+#define s_help \
+    "rule option to indicate relevant attack indentification system"
 
 class ReferenceModule : public Module
 {
index a163179ba7fbc5d6eacc62bd893bc6acaf738a4c..2dac78ce50b6089ff5262b10f6269d7e406f22eb 100644 (file)
@@ -32,7 +32,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "rem";
+#define s_name "rem"
 
 //-------------------------------------------------------------------------
 // module
@@ -46,8 +46,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to convey an arbitrary comment in the rule body";
+#define s_help \
+    "rule option to convey an arbitrary comment in the rule body"
 
 class RemModule : public Module
 {
index 4a095ee7b1caab0ad917e8a61297b2eca8df6efc..c1f5ec31ebb1a9d77ff34d5683a3296ed1afd626 100644 (file)
@@ -81,7 +81,7 @@ static bool replace_ok()
 // replace rule option
 //-------------------------------------------------------------------------
 
-static const char* s_name = "replace";
+#define s_name "replace"
 
 static THREAD_LOCAL ProfileStats replacePerfStats;
 
@@ -201,8 +201,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to overwrite payload data; use with rewrite action";
+#define s_help \
+    "rule option to overwrite payload data; use with rewrite action"
 
 class ReplModule : public Module
 {
index aa5fdaa1926201d03e53f234e245f989c6d5dbb6..93c01f174766f7c64ad41effc6cd45270cd87282 100644 (file)
@@ -31,7 +31,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "rev";
+#define s_name "rev"
 
 //-------------------------------------------------------------------------
 // module
@@ -45,8 +45,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to indicate current revision of signature";
+#define s_help \
+    "rule option to indicate current revision of signature"
 
 class RevModule : public Module
 {
index 934826b458ba030df0579fe1e18e53d04f5ee976..2e11fb8d761da496f50a52f79f93a5cd5d6597fb 100644 (file)
@@ -43,7 +43,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "rpc";
+#define s_name "rpc"
 
 static THREAD_LOCAL ProfileStats rpcCheckPerfStats;
 
@@ -258,8 +258,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check SUNRPC CALL parameters";
+#define s_help \
+    "rule option to check SUNRPC CALL parameters"
 
 class RpcModule : public Module
 {
index b0edb4f7000a9c39a8ee8e6f580d8fd51cb61736..a8822881533b587a670a3c86d9cf7fa01b125dfc 100644 (file)
@@ -35,7 +35,7 @@
 #include "framework/range.h"
 #include "protocols/tcp.h"
 
-static const char* s_name = "seq";
+#define s_name "seq"
 
 static THREAD_LOCAL ProfileStats tcpSeqPerfStats;
 
@@ -111,8 +111,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check TCP sequence number";
+#define s_help \
+    "rule option to check TCP sequence number"
 
 class SeqModule : public Module
 {
index 1e0c2bcef19d7ab8745d8f6cde93c958813d12ed..668b89e512575ea75f8ac0c46f11afbf4bc08fbb 100644 (file)
@@ -71,7 +71,7 @@
 #include "framework/module.h"
 #include "sfip/sf_ip.h"
 
-static const char* s_name = "session";
+#define s_name "session"
 
 static THREAD_LOCAL ProfileStats sessionPerfStats;
 
@@ -327,8 +327,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check user data from TCP sessions";
+#define s_help \
+    "rule option to check user data from TCP sessions"
 
 class SsnModule : public Module
 {
index 4eb5fffcc3653e214f9f45f913416bb526c9d0d4..a6318b47664a3cb841e88c811d4d5cd5fbff575f 100644 (file)
@@ -31,7 +31,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "sid";
+#define s_name "sid"
 
 //-------------------------------------------------------------------------
 // module
@@ -45,8 +45,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to indicate signature number";
+#define s_help \
+    "rule option to indicate signature number"
 
 class SidModule : public Module
 {
index 11b1a978d4cfbf8fedffdec72d0d5cef9c4b8892..49f5194d570f7d7c2b5fd95e3c266b04d366dfec 100644 (file)
@@ -34,7 +34,7 @@ using namespace std;
 #include "parser/parser.h"
 #include "time/profiler.h"
 
-static const char* s_name = "so";
+#define s_name "so"
 
 static THREAD_LOCAL ProfileStats soPerfStats;
 
@@ -117,8 +117,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to call custom eval function";
+#define s_help \
+    "rule option to call custom eval function"
 
 class SoModule : public Module
 {
index e84141b0fcac70291f69ef2c83fdff3b2620e313..a10ede62560b319d434a2eb413c0d0cf2cbcd38a 100644 (file)
@@ -36,7 +36,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "soid";
+#define s_name "soid"
 
 //-------------------------------------------------------------------------
 // module
@@ -50,8 +50,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to specify a shared object rule ID";
+#define s_help \
+    "rule option to specify a shared object rule ID"
 
 class SoidModule : public Module
 {
index 7ad5b89933923dfc89a875500562b70992e85e35..5e7c06e6feba6fe937202093dbd1e47c426c2570 100644 (file)
@@ -35,7 +35,7 @@
 #include "framework/parameter.h"
 #include "framework/module.h"
 
-static const char* s_name = "tag";
+#define s_name "tag"
 
 //-------------------------------------------------------------------------
 // module
@@ -58,8 +58,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to log additional packets";
+#define s_help \
+    "rule option to log additional packets"
 
 class TagModule : public Module
 {
index 9e5958478a74d9f3c856aa5d63362965f64b23fc..c289f880b9722311b75e9a840ebef66953e3033c 100644 (file)
@@ -33,7 +33,7 @@
 #include "framework/module.h"
 #include "framework/range.h"
 
-static const char* s_name = "tos";
+#define s_name "tos"
 
 static THREAD_LOCAL ProfileStats ipTosPerfStats;
 
@@ -113,8 +113,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check type of service field";
+#define s_help \
+    "rule option to check type of service field"
 
 class TosModule : public Module
 {
index 641287b4490037fec169a6f8c49dc47ec5bc499f..7d6cf63b8f2a77febae8168a15e5559c6b15fa48 100644 (file)
@@ -35,7 +35,7 @@
 #include "framework/module.h"
 #include "framework/range.h"
 
-static const char* s_name = "ttl";
+#define s_name "ttl"
 
 static THREAD_LOCAL ProfileStats ttlCheckPerfStats;
 
@@ -112,8 +112,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check time to live field";
+#define s_help \
+    "rule option to check time to live field"
 
 class TtlModule : public Module
 {
index ade4654f8d3b42b1f885a19f981a4f923eb5aed6..1d42b3d938b3ea978e12466638d82e3f7798d521 100644 (file)
@@ -35,7 +35,7 @@
 #include "framework/range.h"
 #include "protocols/tcp.h"
 
-static const char* s_name = "window";
+#define s_name "window"
 
 static THREAD_LOCAL ProfileStats tcpWinPerfStats;
 
@@ -111,8 +111,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "rule option to check TCP window field";
+#define s_help \
+    "rule option to check TCP window field"
 
 class WindowModule : public Module
 {
index 74468e1ee15dbf8b5fb59ba7133550d391239ba2..258a54963c7377e57e4d5654f674939ce66c4741 100644 (file)
@@ -1461,7 +1461,7 @@ static void LogCharData(TextLog* log, char *data, int len)
 #define BYTES_PER_FRAME 16
 /* middle of packet:"41 02 43 04 45 06 47 08 49 0A 4B 0C 4D 0E 4F 0F  A.C.E.G.I.K.M.O."*/
 /* at end of packet:"41 02 43 04 45 06 47 08                          A.C.E.G."*/
-static const char* pad3 = "                                                 ";
+#define pad3 "                                                 "
 
 void LogNetData (TextLog* log, const uint8_t* data, const int len, Packet *p)
 {
index 7f4a99a98f7e355bf78636ab2f5638b13b964446..79603fe9083d3fad01cc78c6d25611676a28fe5a 100644 (file)
@@ -60,17 +60,17 @@ using namespace std;
 // module stuff
 //-------------------------------------------------------------------------
 
-static const char* csv_range =
-    "timestamp | gid | sid | rev | msg | proto | "
-    "src_addr | dst_addr | src_port | dst_port | "
-    "eth_src | eth_dst | eth_type | eth_len | "
-    "ttl | tos | id | ip_len | dgm_len | "
-    "icmp_type | icmp_code | icmp_id | icmp_seq"
-    "tcp_flags | tcp_seq | tcp_ack | tcp_len | tcp_win | "
-    "udp_len";
-
-static const char* csv_deflt =
-    "timestamp gid sid rev src_addr src_port dst_addr dst_port";
+#define csv_range \
+    "timestamp | gid | sid | rev | msg | proto | " \
+    "src_addr | dst_addr | src_port | dst_port | " \
+    "eth_src | eth_dst | eth_type | eth_len | " \
+    "ttl | tos | id | ip_len | dgm_len | " \
+    "icmp_type | icmp_code | icmp_id | icmp_seq" \
+    "tcp_flags | tcp_seq | tcp_ack | tcp_len | tcp_win | " \
+    "udp_len"
+
+#define csv_deflt \
+    "timestamp gid sid rev src_addr src_port dst_addr dst_port"
 
 static const Parameter s_params[] =
 {
@@ -90,8 +90,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event in csv format";
+#define s_help \
+    "output event in csv format"
 
 class CsvModule : public Module
 {
index c86d86e92c6b92099bfb4d925f90a24b3ebfa8a0..a091104a20080afe3f9537acfa502b9d241e24c5 100644 (file)
@@ -96,8 +96,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event with brief text format";
+#define s_help \
+    "output event with brief text format"
 
 class FastModule : public Module
 {
index b364d3d377895b401c79574f8c4927d43ca27e4d..5041a7f04cc663b0d5f3a361a4ad138f7cc5005d 100644 (file)
@@ -85,8 +85,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event with full packet dump";
+#define s_help \
+    "output event with full packet dump"
 
 class FullModule : public Module
 {
index 1fcb56103d6c90081178fca5db4b897855fd3588..9e3a72271b4237e231a5d5e0e263c874b1a87d3a 100644 (file)
@@ -134,8 +134,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event from custom Lua script";
+#define s_help \
+    "output event from custom Lua script"
 
 class LuaLogModule : public Module
 {
index 0a9f55a8d3350b96a16b751dc03a6cc8cb81b23c..0e7b34215c949557ee14e0e79e8df917722e2d00 100644 (file)
@@ -66,7 +66,7 @@ static THREAD_LOCAL SfSock context;
 using namespace std;
 typedef vector<RuleId> RuleVector;
 
-static const char* s_name = "alert_sfsocket";
+#define s_name "alert_sfsocket"
 
 //-------------------------------------------------------------------------
 // alert_sfsocket module
@@ -94,8 +94,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event over socket";
+#define s_help \
+    "output event over socket"
 
 class SfSocketModule : public Module
 {
index ba6585ec9f745a137ebc5b51999100fddb0ac21e..8e24dc837d7640c19c1f60822ed73f8203aa87f6 100644 (file)
 
 using namespace std;
 
-static const char* s_name = "alert_syslog";
+#define s_name "alert_syslog"
 
 //-------------------------------------------------------------------------
 // translation stuff
 //-------------------------------------------------------------------------
 
-static const char* syslog_facilities =
-    "auth | authpriv | daemon | user | "
-    "local0 | local1 | local2 | local3 | "
-    "local4 | local5 | local6 | local7";
+#define syslog_facilities \
+    "auth | authpriv | daemon | user | " \
+    "local0 | local1 | local2 | local3 | " \
+    "local4 | local5 | local6 | local7"
 
 static int get_facility(unsigned fac)
 {
@@ -82,8 +82,8 @@ static int get_facility(unsigned fac)
     return 0;
 }
 
-static const char* syslog_levels = 
-    "emerg | alert | crit | err | warning | notice | info | debug";
+#define syslog_levels  \
+    "emerg | alert | crit | err | warning | notice | info | debug"
 
 static int get_level(unsigned lvl)
 {
@@ -101,8 +101,8 @@ static int get_level(unsigned lvl)
     return 0;
 }
 
-static const char* syslog_options =
-    "cons | ndelay | perror | pid";
+#define syslog_options \
+    "cons | ndelay | perror | pid"
 
 static int get_options(const char* s)
 {
@@ -141,8 +141,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event to syslog";
+#define s_help \
+    "output event to syslog"
 
 class SyslogModule : public Module
 {
index 54ae28d0d6400ecd3714cedf9d548823dd91034d..078d42ac04b932104b203253cab8a28695381850 100644 (file)
@@ -82,8 +82,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event in custom tsv format";
+#define s_help \
+    "output event in custom tsv format"
 
 class TestModule : public Module
 {
index 1ac51bcac3c5d8a77b20dd0e15f1b10a4f114a76..33f65909260d44374f79b8af58bc1056744fe7fa 100644 (file)
@@ -96,7 +96,7 @@ struct UnixSock
 
 static THREAD_LOCAL UnixSock us;
 
-static const char* s_name = "alert_unixsock";
+#define s_name "alert_unixsock"
 
 //-------------------------------------------------------------------------
 // alert_unixsock module
@@ -109,8 +109,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "output event over unix socket";
+#define s_help \
+    "output event over unix socket"
 
 class UnixSockModule : public Module
 {
index aa88e5dd8a22c1c0d8dc837fce7860b65e3b2e99..6ae0c4e72d7ed01f9284011111980ee8285ddea3 100644 (file)
@@ -34,8 +34,8 @@
 #include "framework/module.h"
 #include "snort.h"
 
-static const char* s_name = "log_null";
-static const char* s_help = "support for null encapsulation";
+#define s_name "log_null"
+#define s_help "support for null encapsulation"
 
 //-------------------------------------------------------------------------
 // log_null module
index bb454e5137a9d28508381907a6891d7c65f3246d..fec5dd76e3b7a22ac2dcf700a7af15fb722a474b 100644 (file)
@@ -101,8 +101,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "log packet in pcap format";
+#define s_help \
+    "log packet in pcap format"
 
 class TcpdumpModule : public Module
 {
index d7a15b9b3e5b7d59d271bd768afdcf7706f49924..ec86b45b6fea4b1bab64fa8d11bad6845efa2f35 100644 (file)
@@ -1066,8 +1066,8 @@ static const Parameter s_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* s_help =
-    "ouput event and packet in unified2 format file";
+#define s_help \
+    "ouput event and packet in unified2 format file"
 
 class U2Module : public Module
 {
index 955431e033e8c97cae4ee14b588e8194567f49c5..8e13cb0069415e7c1f6877190f6c29be48263662 100644 (file)
@@ -47,49 +47,49 @@ using namespace std;
 #include "framework/module.h"
 #include "framework/parameter.h"
 
-static const char* snort_help =
-"\n"
-"Snort has several options to get more help:\n"
-"\n"
-"-? list command line options (same as --help)\n"
-"--help this overview of help\n"
-"--help-commands [<module prefix>] output matching commands\n"
-"--help-config [<module prefix>] output matching config options\n"
-"--help-module <module> output description of given module\n"
-"--help-modules list all available modules with brief help\n"
-"--help-plugins list all available plugins with brief help\n"
-"--help-options [<option prefix>] output matching command line options\n"
-"--help-signals dump available control signals\n"
-"--list-buffers output available inspection buffers\n"
-"--list-builtin [<module prefix>] output matching builtin rules\n"
-"--list-gids [<module prefix>] output matching generators\n"
-"--list-modules [<module type>] list all known modules\n"
-"--list-plugins list all known modules\n"
-"--show-plugins list module and plugin versions\n"
-"\n"
-"--help* and --list* options preempt other processing so should be last on the\n"
-"command line since any following options are ignored.  To ensure options like\n"
-"--markup and --plugin-path take effect, place them ahead of the help or list\n"
-"options.\n"
-"\n"
-"Options that filter output based on a matching prefix, such as --help-config\n"
-"won't output anything if there is no match.  If no prefix is given, everything\n"
-"matches.\n"
-"\n"
-"Parameters are given with this format:\n"
-"\n"
-"    type name = default: help { range }\n"
-"\n"
-"++ For Lua configuration (not IPS rules), if the name ends with [] it is a\n"
-"   list item and can be repeated.\n"
-"++ For IPS rules only, names starting with ~ indicate positional parameters.\n"
-"   The name does not appear in the rule.\n"
-"++ IPS rules may also have a wild card parameter, which is indicated by a *.\n"
-"   Only used for metadata that Snort ignores.\n"
-"++ The snort module has command line options starting with a -.\n"
-"\n"
+#define snort_help \
+"\n" \
+"Snort has several options to get more help:\n" \
+"\n" \
+"-? list command line options (same as --help)\n" \
+"--help this overview of help\n" \
+"--help-commands [<module prefix>] output matching commands\n" \
+"--help-config [<module prefix>] output matching config options\n" \
+"--help-module <module> output description of given module\n" \
+"--help-modules list all available modules with brief help\n" \
+"--help-plugins list all available plugins with brief help\n" \
+"--help-options [<option prefix>] output matching command line options\n" \
+"--help-signals dump available control signals\n" \
+"--list-buffers output available inspection buffers\n" \
+"--list-builtin [<module prefix>] output matching builtin rules\n" \
+"--list-gids [<module prefix>] output matching generators\n" \
+"--list-modules [<module type>] list all known modules\n" \
+"--list-plugins list all known modules\n" \
+"--show-plugins list module and plugin versions\n" \
+"\n" \
+"--help* and --list* options preempt other processing so should be last on the\n" \
+"command line since any following options are ignored.  To ensure options like\n" \
+"--markup and --plugin-path take effect, place them ahead of the help or list\n" \
+"options.\n" \
+"\n" \
+"Options that filter output based on a matching prefix, such as --help-config\n" \
+"won't output anything if there is no match.  If no prefix is given, everything\n" \
+"matches.\n" \
+"\n" \
+"Parameters are given with this format:\n" \
+"\n" \
+"    type name = default: help { range }\n" \
+"\n" \
+"++ For Lua configuration (not IPS rules), if the name ends with [] it is a\n" \
+"   list item and can be repeated.\n" \
+"++ For IPS rules only, names starting with ~ indicate positional parameters.\n" \
+"   The name does not appear in the rule.\n" \
+"++ IPS rules may also have a wild card parameter, which is indicated by a *.\n" \
+"   Only used for metadata that Snort ignores.\n" \
+"++ The snort module has command line options starting with a -.\n" \
+"\n" \
 "Report bugs to bugs@snort.org.\n"
-;
+
 
 //-------------------------------------------------------------------------
 
index d99983c83c94fe5ff2aba277c4957e5be915f11b..a07fedbd3ebf11eed7e3d71c8ac69f20d21bc67c 100644 (file)
@@ -82,8 +82,8 @@ static const Parameter detection_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* detection_help =
-    "configure general IPS rule processing parameters";
+#define detection_help \
+    "configure general IPS rule processing parameters"
 
 class DetectionModule : public Module
 {
@@ -138,8 +138,8 @@ static const Parameter event_queue_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* event_queue_help =
-    "configure event queue parameters";
+#define event_queue_help \
+    "configure event queue parameters"
 
 class EventQueueModule : public Module
 {
@@ -231,8 +231,8 @@ static const Parameter search_engine_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* search_engine_help =
-    "configure fast pattern matcher";
+#define search_engine_help \
+    "configure fast pattern matcher"
 
 class SearchEngineModule : public Module
 {
@@ -353,8 +353,8 @@ static const Parameter profile_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* profile_help =
-    "configure profiling of rules and/or modules (requires --enable-perf-profiling)";
+#define profile_help \
+    "configure profiling of rules and/or modules (requires --enable-perf-profiling)"
 
 class ProfileModule : public Module
 {
@@ -409,8 +409,8 @@ 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";
+#define classifications_help \
+    "define rule categories with priority"
 
 static const Parameter classification_params[] =
 {
@@ -478,8 +478,8 @@ bool ClassificationsModule::set(const char*, Value& v, SnortConfig*)
 // reference module
 //-------------------------------------------------------------------------
 
-static const char* reference_help =
-    "define reference systems used in rules";
+#define reference_help \
+    "define reference systems used in rules"
 
 static const Parameter reference_params[] =
 {
@@ -577,8 +577,8 @@ static const Parameter alerts_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* alerts_help =
-    "configure alerts";
+#define alerts_help \
+    "configure alerts"
 
 class AlertsModule : public Module
 {
@@ -684,8 +684,8 @@ static const Parameter output_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* output_help =
-    "configure general output parameters";
+#define output_help \
+    "configure general output parameters"
 
 class OutputModule : public Module
 {
@@ -783,8 +783,8 @@ static const Parameter active_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* active_help =
-    "configure responses";
+#define active_help \
+    "configure responses"
 
 class ActiveModule : public Module
 {
@@ -843,8 +843,8 @@ static const Parameter packets_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* packets_help =
-    "configure basic packet handling";
+#define packets_help \
+    "configure basic packet handling"
 
 class PacketsModule : public Module
 {
@@ -913,8 +913,8 @@ static const Parameter daq_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* daq_help =
-    "configure packet acquisition interface";
+#define daq_help \
+    "configure packet acquisition interface"
 
 class DaqModule : public Module
 {
@@ -1043,8 +1043,8 @@ static const Parameter network_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* network_help =
-    "configure basic network parameters";
+#define network_help \
+    "configure basic network parameters"
 
 class NetworkModule : public Module
 {
@@ -1114,8 +1114,8 @@ static const Parameter ips_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* ips_help =
-    "configure IPS rule processing";
+#define ips_help \
+    "configure IPS rule processing"
 
 class IpsModule : public Module
 {
@@ -1196,8 +1196,8 @@ static const Parameter process_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* process_help =
-    "configure basic process setup";
+#define process_help \
+    "configure basic process setup"
 
 class ProcessModule : public Module
 {
@@ -1335,8 +1335,8 @@ static const Parameter file_id_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* file_id_help =
-    "configure file identification";
+#define file_id_help \
+    "configure file identification"
 
 class FileIdModule : public Module
 {
@@ -1402,8 +1402,8 @@ static const Parameter suppress_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* suppress_help =
-    "configure event suppressions";
+#define suppress_help \
+    "configure event suppressions"
 
 class SuppressModule : public Module
 {
@@ -1484,8 +1484,8 @@ static const Parameter event_filter_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* event_filter_help =
-    "configure thresholding of events";
+#define event_filter_help \
+    "configure thresholding of events"
 
 class EventFilterModule : public Module
 {
@@ -1583,8 +1583,8 @@ 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)";
+#define rate_filter_help \
+    "configure rate filters (which change rule actions)"
 
 class RateFilterModule : public Module
 {
@@ -1662,8 +1662,8 @@ static const Parameter rule_state_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* rule_state_help =
-    "enable/disable specific IPS rules";
+#define rule_state_help \
+    "enable/disable specific IPS rules"
 
 class RuleStateModule : public Module
 {
@@ -1713,12 +1713,12 @@ bool RuleStateModule::end(const char*, int idx, SnortConfig* sc)
 
 // FIXIT-L these are cloned from ip_module.cc and tcp_module.cc
 
-static const char* ip_policies =
-    "first | linux | bsd | bsd_right |last | windows | solaris";
+#define ip_policies \
+    "first | linux | bsd | bsd_right |last | windows | solaris"
 
-static const char* tcp_policies =
-    "first | last | bsd | linux | old-linux | windows | win-2003 | vista "
-    "solaris | hpux | hpux10 | irix | macos";
+#define tcp_policies \
+    "first | last | bsd | linux | old-linux | windows | win-2003 | vista " \
+    "solaris | hpux | hpux10 | irix | macos"
 
 static const Parameter service_params[] =
 {
@@ -1751,8 +1751,8 @@ static const Parameter hosts_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* hosts_help =
-    "configure hosts";
+#define hosts_help \
+    "configure hosts"
 
 class HostsModule : public Module
 {
@@ -1848,8 +1848,8 @@ static const Parameter xxx_params[] =
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
 };
 
-static const char* xxx_help =
-    "configure ";
+#define xxx_help \
+    "configure "
 
 class XXXModule : public Module
 {
index 14d7326c3cb36f1bbeff9b0d0f78e85086e521d1..79eb15bc9615302527e8e5cae38f2ac7ca5ab959 100644 (file)
@@ -31,7 +31,7 @@
 
 using namespace std;
 
-static const char* required = "require('snort_config'); ";
+#define required "require('snort_config'); "
 
 //-------------------------------------------------------------------------
 // helper functions
index 0a3f4699446e67801d25d22cb3d330bb488bbdb9..649fa590b3dd4aa67e592387c53765cdab880a5b 100644 (file)
@@ -125,7 +125,7 @@ static inline RuleTreeNode * protocolRuleList(RuleListNode *rule, int protocol)
 
 static inline const char* getProtocolName (int protocol)
 {
-    static const char *protocolName[] = {"TCP", "UDP", "ICMP"};
+    static const char* const protocolName[] = {"TCP", "UDP", "ICMP"};
     switch (protocol)
     {
         case IPPROTO_TCP:
index 544668f28f243d8d9e017f275bde325a6f9f017a..e448e8503109c2b833dc64d462eb9ba798936432 100644 (file)
@@ -387,10 +387,10 @@ static const Parameter s_params[] =
 // module
 //-------------------------------------------------------------------------
 
-static const char* s_name = "snort";
+#define s_name "snort"
 
-static const char* s_help =
-    "command line configuration and shell commands";
+#define s_help \
+    "command line configuration and shell commands"
 
 class SnortModule : public Module
 {
index 815aabfb8367ae420eaaca3d42503f8f4a3dd68a..65dda854fc27b25c0dcb511237247f6d4112d558 100644 (file)
@@ -40,8 +40,8 @@
 using namespace std;
 
 // FIXIT-L should be using IT_* instead or at least define once
-static const char* bind_id = "binder";
-static const char* wiz_id = "wizard";
+#define bind_id "binder"
+#define wiz_id "wizard"
 
 //-------------------------------------------------------------------------
 // list stuff
index dc6f0da7d409d9bb3944d8caa727d2954f1768c3..3b1eb2a60c50f655528769d20da1047c5a1c0c04 100644 (file)
@@ -68,9 +68,9 @@ using namespace std;
 #include "parser/parser.h"
 
 #if defined(LINUX)
-static const char* lib_ext = ".so";
+#define lib_ext ".so"
 #else
-static const char* lib_ext = ".dylib";
+#define lib_ext ".dylib"
 #endif
 
 struct Symbol
index b77ce7e2cf236b21d22b1d6f44935e0a1c61c57e..1d41f075717296f880b59f240f1ef0c98701b7a9 100644 (file)
@@ -41,7 +41,7 @@
 // keep just one copy of rule option + args
 
 using namespace std;
-static const char* script_ext = ".lua";
+#define script_ext ".lua"
 
 //-------------------------------------------------------------------------
 // lua api stuff
index f3111c06d55d0193953e0f53284f6bbb62f9909e..cf7077eaa730261ec0ad2a829b6d2ad4eacd2be3 100644 (file)
@@ -62,7 +62,7 @@ typedef enum {
     PC_MAX
 } PegCounts;
 
-static const char* pegName[PC_MAX] = {
+static const char* const pegName[PC_MAX] = {
     "ip4.trim",
     "ip4.tos",
     "ip4.df",
index 6ba33d2bd6bf1ca59bb2c1ae1fa279c76b634256..c810b5041ba9f2e3a87afb7266a1ea2b8b990237 100644 (file)
@@ -1417,7 +1417,7 @@ static void LogBasePerfStats(SFBASE_STATS *sfBaseStats,  FILE * fh )
     fflush(fh);
 }
 
-static const char* iNames[PERF_COUNT_MAX] = {
+static const char* const iNames[PERF_COUNT_MAX] = {
     "ip4::trim",
     "ip4::tos",
     "ip4::df",
index b7436b595c7c7ea4cc0c16e7545c911c958df911..7ebc5386f002b93c81c4fe23027b94bc6ef217b4 100644 (file)
 //-------------------------------------------------------------------------
 
 // order of protos and scans must match PS_* flags
-static const char* protos =
-    "tcp | udp | icmp | ip | all";
+#define protos \
+    "tcp | udp | icmp | ip | all"
 
-static const char* scans =
-    "portscan | portsweep | decoy_portscan | distributed_portscan | all";
+#define scans \
+    "portscan | portsweep | decoy_portscan | distributed_portscan | all"
 
 static const Parameter ps_params[] =
 {
index f4cb764d81643d3df9d83ae065ac6e420fb1ee06..ddbfbe41f459ece0b00db76e67a4377e4a44dd58 100644 (file)
@@ -50,7 +50,7 @@ enum TokenType
 };
 
 #if 0
-static const char* toks[TT_MAX] =
+static const char* const toks[TT_MAX] =
 {
     "none", "punct", "string", "list", "literal"
 };
index dc8149827bcffce2585845330d6be634fb0e64a8..4b17fadfbc4fe818556ce367eae1a0714e516814 100644 (file)
 #define BO_BUF_SIZE         8
 #define BO_BUF_ATTACK_SIZE  1024
 
-static const char* s_name = "back_orifice";
+#define s_name "back_orifice"
 
-static const char* s_help =
-    "back orifice detection";
+#define s_help \
+    "back orifice detection"
 
 /* global keyvalue for the BoRand() function */
 static THREAD_LOCAL long holdrand = 1L;
index 06447d8bd3f410ac04a7a1f8761075c158055007..d22472e78e282925b9ccecf53707524ad1d3a45b 100644 (file)
 
 int16_t ftp_data_app_id = SFTARGET_UNKNOWN_PROTOCOL;
 
-static const char* client_key = "ftp_client";
-static const char* server_key = "ftp_server";
+#define client_key "ftp_client"
+#define server_key "ftp_server"
 
-static const char* client_help = "FTP inspector client module";
-static const char* server_help = "FTP inspector server module";
+#define client_help "FTP inspector client module"
+#define server_help "FTP inspector server module"
 
 THREAD_LOCAL ProfileStats ftpPerfStats;
 THREAD_LOCAL SimpleStats ftstats;
index 076f24bbf07658ee5f76f490011c479b7a62bc0f..31aeed69db4bcd1d8cd4e96e3c40580fe7e6c358 100644 (file)
 #include "detection/detection_util.h"
 #include "protocols/tcp.h"
 
-static const char* s_name = "ftp_data";
+#define s_name "ftp_data"
 
-static const char* s_help =
-    "FTP data channel handler";
+#define s_help \
+    "FTP data channel handler"
 
 static THREAD_LOCAL ProfileStats ftpdataPerfStats;
 static THREAD_LOCAL SimpleStats fdstats;
index b6ef1f87ff0c6695161e1eba346753ea19fa1c64..4527f9d1bdb0f843e8eeb0c76bcb10736d482463 100644 (file)
@@ -28,11 +28,11 @@ using namespace std;
 #define FTP_CLIENT "ftp_client"
 #define FTP_SERVER "ftp_server"
 
-static const char* ftp_client_help =
-    "FTP client configuration module for use with ftp_server";
+#define ftp_client_help \
+    "FTP client configuration module for use with ftp_server"
 
-static const char* ftp_server_help =
-    "main FTP module; ftp_client should also be configured";
+#define ftp_server_help \
+    "main FTP module; ftp_client should also be configured"
 
 //-------------------------------------------------------------------------
 // client stuff
index c4276ec0491330413b33af96e095444b51198dec..dc835c3654763721c09b3e69784ee68c9c05a764 100644 (file)
@@ -137,8 +137,8 @@ static const RuleMap hi_global_rules[] =
     { 0, nullptr }
 };
 
-static const char* hi_global_help =
-    "http inspector global configuration and client rules for use with http_server";
+#define hi_global_help \
+    "http inspector global configuration and client rules for use with http_server"
 
 HttpInspectModule::HttpInspectModule() :
     Module(GLOBAL_KEYWORD, hi_global_help, hi_global_params)
@@ -251,14 +251,14 @@ bool HttpInspectModule::end(const char* fqn, int, SnortConfig*)
 // http_server module
 //-------------------------------------------------------------------------
 
-static const char* profiles = "none | all | apache | iis | iis_40 | iis_50";
+#define profiles "none | all | apache | iis | iis_40 | iis_50"
 
-static const char* default_methods =
-    "GET POST PUT SEARCH MKCOL COPY MOVE LOCK UNLOCK NOTIFY POLL BCOPY "
-    "BDELETE BMOVE LINK UNLINK OPTIONS HEAD DELETE TRACE TRACK CONNECT "
-    "SOURCE SUBSCRIBE UNSUBSCRIBE PROPFIND PROPPATCH BPROPFIND BPROPPATCH "
-    "RPC_CONNECT PROXY_SUCCESS BITS_POST CCM_POST SMS_POST RPC_IN_DATA "
-    "RPC_OUT_DATA RPC_ECHO_DATA";
+#define default_methods \
+    "GET POST PUT SEARCH MKCOL COPY MOVE LOCK UNLOCK NOTIFY POLL BCOPY " \
+    "BDELETE BMOVE LINK UNLINK OPTIONS HEAD DELETE TRACE TRACK CONNECT " \
+    "SOURCE SUBSCRIBE UNSUBSCRIBE PROPFIND PROPPATCH BPROPFIND BPROPPATCH " \
+    "RPC_CONNECT PROXY_SUCCESS BITS_POST CCM_POST SMS_POST RPC_IN_DATA " \
+    "RPC_OUT_DATA RPC_ECHO_DATA"
 
 // FIXIT-L refactor params to create a profile table so that user can define
 // different profiles (like above) and use those.  rename existing profile
@@ -420,8 +420,8 @@ static const RuleMap hi_server_rules[] =
     { 0, nullptr }
 };
 
-static const char* hi_server_help = 
-    "http inspection and server rules; also configure http_inpsect";
+#define hi_server_help  \
+    "http inspection and server rules; also configure http_inpsect"
 
 HttpServerModule::HttpServerModule() :
     Module(SERVER_KEYWORD, hi_server_help, hi_server_params)
index 5d4ba9ff18e23ab15b96581dd7249e61b0564695..8c625b1a851e05a962fe68b53d768b7279b6a6df 100644 (file)
@@ -275,13 +275,13 @@ int hi_ui_parse_iis_unicode_map(uint8_t** iis_unicode_map, char *filename,
 }
 
 
-// update the defaul unicode map here
+// update the default unicode map here
 // page 1252 is us english
 // map is just a single string of tokens of the form
 // xxxx:xx (xxxx = unicode, xx = ascii char)
-static const unsigned default_unicode_page = 1252;
-static const char* default_unicode_map =
-"0100:41 0101:61 0102:41 0103:61 0104:41 0105:61 0106:43 0107:63 0108:43 0109:63 010a:43 010b:63    010c:43 010d:63 010e:44 010f:64 0111:64 0112:45 0113:65 0114:45 0115:65 0116:45 0117:65 0118:45    0119:65 011a:45 011b:65 011c:47 011d:67 011e:47 011f:67 0120:47 0121:67 0122:47 0123:67 0124:48    0125:68 0126:48 0127:68 0128:49 0129:69 012a:49 012b:69 012c:49 012d:69 012e:49 012f:69 0130:49    0131:69 0134:4a 0135:6a 0136:4b 0137:6b 0139:4c 013a:6c 013b:4c 013c:6c 013d:4c 013e:6c 0141:4c    0142:6c 0143:4e 0144:6e 0145:4e 0146:6e 0147:4e 0148:6e 014c:4f 014d:6f 014e:4f 014f:6f 0150:4f    0151:6f 0154:52 0155:72 0156:52 0157:72 0158:52 0159:72 015a:53 015b:73 015c:53 015d:73 015e:53    015f:73 0162:54 0163:74 0164:54 0165:74 0166:54 0167:74 0168:55 0169:75 016a:55 016b:75 016c:55    016d:75 016e:55 016f:75 0170:55 0171:75 0172:55 0173:75 0174:57 0175:77 0176:59 0177:79 0179:5a    017b:5a 017c:7a 0180:62 0197:49 019a:6c 019f:4f 01a0:4f 01a1:6f 01ab:74 01ae:54 01af:55 01b0:75    01b6:7a 01c0:7c 01c3:21 01cd:41 01ce:61 01cf:49 01d0:69 01d1:4f 01d2:6f 01d3:55 01d4:75 01d5:55    01d6:75 01d7:55 01d8:75 01d9:55 01da:75 01db:55 01dc:75 01de:41 01df:61 01e4:47 01e5:67 01e6:47    01e7:67 01e8:4b 01e9:6b 01ea:4f 01eb:6f 01ec:4f 01ed:6f 01f0:6a 0261:67 02b9:27 02ba:22 02bc:27    02c4:5e 02c8:27 02cb:60 02cd:5f 0300:60 0302:5e 0303:7e 030e:22 0331:5f 0332:5f 037e:3b 0393:47    0398:54 03a3:53 03a6:46 03a9:4f 03b1:61 03b4:64 03b5:65 03c0:70 03c3:73 03c4:74 03c6:66 04bb:68    0589:3a 066a:25 2000:20 2001:20 2002:20 2003:20 2004:20 2005:20 2006:20 2010:2d 2011:2d 2017:3d    2032:27 2035:60 2044:2f 2074:34 2075:35 2076:36 2077:37 2078:38 207f:6e 2080:30 2081:31 2082:32    2083:33 2084:34 2085:35 2086:36 2087:37 2088:38 2089:39 20a7:50 2102:43 2107:45 210a:67 210b:48    210c:48 210d:48 210e:68 2110:49 2111:49 2112:4c 2113:6c 2115:4e 2118:50 2119:50 211a:51 211b:52    211c:52 211d:52 2124:5a 2128:5a 212a:4b 212c:42 212d:43 212e:65 212f:65 2130:45 2131:46 2133:4d    2134:6f 2212:2d 2215:2f 2216:5c 2217:2a 221a:76 221e:38 2223:7c 2229:6e 2236:3a 223c:7e 2261:3d    2264:3d 2265:3d 2303:5e 2320:28 2321:29 2329:3c 232a:3e 2500:2d 250c:2b 2510:2b 2514:2b 2518:2b    251c:2b 252c:2d 2534:2d 253c:2b 2550:2d 2552:2b 2553:2b 2554:2b 2555:2b 2556:2b 2557:2b 2558:2b    2559:2b 255a:2b 255b:2b 255c:2b 255d:2b 2564:2d 2565:2d 2566:2d 2567:2d 2568:2d 2569:2d 256a:2b    256b:2b 256c:2b 2584:5f 2758:7c 3000:20 3008:3c 3009:3e 301a:5b 301b:5d ff01:21 ff02:22 ff03:23    ff04:24 ff05:25 ff06:26 ff07:27 ff08:28 ff09:29 ff0a:2a ff0b:2b ff0c:2c ff0d:2d ff0e:2e ff0f:2f    ff10:30 ff11:31 ff12:32 ff13:33 ff14:34 ff15:35 ff16:36 ff17:37 ff18:38 ff19:39 ff1a:3a ff1b:3b    ff1c:3c ff1d:3d ff1e:3e ff20:40 ff21:41 ff22:42 ff23:43 ff24:44 ff25:45 ff26:46 ff27:47 ff28:48    ff29:49 ff2a:4a ff2b:4b ff2c:4c ff2d:4d ff2e:4e ff2f:4f ff30:50 ff31:51 ff32:52 ff33:53 ff34:54    ff35:55 ff36:56 ff37:57 ff38:58 ff39:59 ff3a:5a ff3b:5b ff3c:5c ff3d:5d ff3e:5e ff3f:5f ff40:60    ff41:61 ff42:62 ff43:63 ff44:64 ff45:65 ff46:66 ff47:67 ff48:68 ff49:69 ff4a:6a ff4b:6b ff4c:6c    ff4d:6d ff4e:6e ff4f:6f ff50:70 ff51:71 ff52:72 ff53:73 ff54:74 ff55:75 ff56:76 ff57:77 ff58:78    ff59:79 ff5a:7a ff5b:7b ff5c:7c ff5d:7d ff5e:7e";
+#define default_unicode_page 1252
+#define default_unicode_map \
+"0100:41 0101:61 0102:41 0103:61 0104:41 0105:61 0106:43 0107:63 0108:43 0109:63 010a:43 010b:63    010c:43 010d:63 010e:44 010f:64 0111:64 0112:45 0113:65 0114:45 0115:65 0116:45 0117:65 0118:45    0119:65 011a:45 011b:65 011c:47 011d:67 011e:47 011f:67 0120:47 0121:67 0122:47 0123:67 0124:48    0125:68 0126:48 0127:68 0128:49 0129:69 012a:49 012b:69 012c:49 012d:69 012e:49 012f:69 0130:49    0131:69 0134:4a 0135:6a 0136:4b 0137:6b 0139:4c 013a:6c 013b:4c 013c:6c 013d:4c 013e:6c 0141:4c    0142:6c 0143:4e 0144:6e 0145:4e 0146:6e 0147:4e 0148:6e 014c:4f 014d:6f 014e:4f 014f:6f 0150:4f    0151:6f 0154:52 0155:72 0156:52 0157:72 0158:52 0159:72 015a:53 015b:73 015c:53 015d:73 015e:53    015f:73 0162:54 0163:74 0164:54 0165:74 0166:54 0167:74 0168:55 0169:75 016a:55 016b:75 016c:55    016d:75 016e:55 016f:75 0170:55 0171:75 0172:55 0173:75 0174:57 0175:77 0176:59 0177:79 0179:5a    017b:5a 017c:7a 0180:62 0197:49 019a:6c 019f:4f 01a0:4f 01a1:6f 01ab:74 01ae:54 01af:55 01b0:75    01b6:7a 01c0:7c 01c3:21 01cd:41 01ce:61 01cf:49 01d0:69 01d1:4f 01d2:6f 01d3:55 01d4:75 01d5:55    01d6:75 01d7:55 01d8:75 01d9:55 01da:75 01db:55 01dc:75 01de:41 01df:61 01e4:47 01e5:67 01e6:47    01e7:67 01e8:4b 01e9:6b 01ea:4f 01eb:6f 01ec:4f 01ed:6f 01f0:6a 0261:67 02b9:27 02ba:22 02bc:27    02c4:5e 02c8:27 02cb:60 02cd:5f 0300:60 0302:5e 0303:7e 030e:22 0331:5f 0332:5f 037e:3b 0393:47    0398:54 03a3:53 03a6:46 03a9:4f 03b1:61 03b4:64 03b5:65 03c0:70 03c3:73 03c4:74 03c6:66 04bb:68    0589:3a 066a:25 2000:20 2001:20 2002:20 2003:20 2004:20 2005:20 2006:20 2010:2d 2011:2d 2017:3d    2032:27 2035:60 2044:2f 2074:34 2075:35 2076:36 2077:37 2078:38 207f:6e 2080:30 2081:31 2082:32    2083:33 2084:34 2085:35 2086:36 2087:37 2088:38 2089:39 20a7:50 2102:43 2107:45 210a:67 210b:48    210c:48 210d:48 210e:68 2110:49 2111:49 2112:4c 2113:6c 2115:4e 2118:50 2119:50 211a:51 211b:52    211c:52 211d:52 2124:5a 2128:5a 212a:4b 212c:42 212d:43 212e:65 212f:65 2130:45 2131:46 2133:4d    2134:6f 2212:2d 2215:2f 2216:5c 2217:2a 221a:76 221e:38 2223:7c 2229:6e 2236:3a 223c:7e 2261:3d    2264:3d 2265:3d 2303:5e 2320:28 2321:29 2329:3c 232a:3e 2500:2d 250c:2b 2510:2b 2514:2b 2518:2b    251c:2b 252c:2d 2534:2d 253c:2b 2550:2d 2552:2b 2553:2b 2554:2b 2555:2b 2556:2b 2557:2b 2558:2b    2559:2b 255a:2b 255b:2b 255c:2b 255d:2b 2564:2d 2565:2d 2566:2d 2567:2d 2568:2d 2569:2d 256a:2b    256b:2b 256c:2b 2584:5f 2758:7c 3000:20 3008:3c 3009:3e 301a:5b 301b:5d ff01:21 ff02:22 ff03:23    ff04:24 ff05:25 ff06:26 ff07:27 ff08:28 ff09:29 ff0a:2a ff0b:2b ff0c:2c ff0d:2d ff0e:2e ff0f:2f    ff10:30 ff11:31 ff12:32 ff13:33 ff14:34 ff15:35 ff16:36 ff17:37 ff18:38 ff19:39 ff1a:3a ff1b:3b    ff1c:3c ff1d:3d ff1e:3e ff20:40 ff21:41 ff22:42 ff23:43 ff24:44 ff25:45 ff26:46 ff27:47 ff28:48    ff29:49 ff2a:4a ff2b:4b ff2c:4c ff2d:4d ff2e:4e ff2f:4f ff30:50 ff31:51 ff32:52 ff33:53 ff34:54    ff35:55 ff36:56 ff37:57 ff38:58 ff39:59 ff3a:5a ff3b:5b ff3c:5c ff3d:5d ff3e:5e ff3f:5f ff40:60    ff41:61 ff42:62 ff43:63 ff44:64 ff45:65 ff46:66 ff47:67 ff48:68 ff49:69 ff4a:6a ff4b:6b ff4c:6c    ff4d:6d ff4e:6e ff4f:6f ff50:70 ff51:71 ff52:72 ff53:73 ff54:74 ff55:75 ff56:76 ff57:77 ff58:78    ff59:79 ff5a:7a ff5b:7b ff5c:7c ff5d:7d ff5e:7e"
 
 bool get_default_unicode_map(uint8_t*& map, int& page)
 {
index 6434a07e87517bb7a8febc0c3198db6f72a80c9d..ba09a367d4225890b2182ed724638c8e1d188b54 100644 (file)
@@ -123,8 +123,8 @@ static THREAD_LOCAL const uint32_t flush_size = 28;
 static THREAD_LOCAL const uint32_t rpc_memcap = 1048510;
 static THREAD_LOCAL uint32_t rpc_memory = 0;
 
-static const char* mod_name = "rpc_decode";
-static const char* mod_help = "RPC inspector";
+#define mod_name "rpc_decode"
+#define mod_help "RPC inspector"
 
 THREAD_LOCAL ProfileStats rpcdecodePerfStats;
 THREAD_LOCAL SimpleStats rdstats;
index 1704331757a2682abd19ede8a3c51b18e0451b00..b86b03843ab8df7caffb4bffe1fbd95655c5f0b1 100644 (file)
@@ -53,8 +53,8 @@ static const RuleMap rpc_rules[] =
 // rpc module
 //-------------------------------------------------------------------------
 
-static const char* s_name = "rpc_decode";
-static const char* s_help = "RPC inspector";
+#define s_name "rpc_decode"
+#define s_help "RPC inspector"
 
 RpcDecodeModule::RpcDecodeModule() : Module(s_name, s_help, s_params)
 { }
index ec71de1043946fa7ac4817d79088a761539500bc..a0d9788de68db883cc5e4cc5377013fc27e257b5 100644 (file)
@@ -70,7 +70,7 @@ struct BaseStats
 static BaseStats g_stats;
 static THREAD_LOCAL BaseStats t_stats;
 
-static const char* base_pegs[] =
+static const char* const base_pegs[] =
 {
     "tcp flows",
     "udp flows",
index 6aeca193055ca071e587444a4bae5556d0f0fc3d..b631c7ce3c22a400df0b29d553fdc79cdacf14a5 100644 (file)
@@ -202,7 +202,7 @@ struct FragStats
 
 };
 
-static const char* peg_names[] =
+static const char* const peg_names[] =
 {
     "fragments",
     "reassembled",
@@ -231,7 +231,7 @@ static THREAD_LOCAL uint32_t pkt_snaplen = 0;
 static THREAD_LOCAL Packet** defrag_pkts;  // An array of Packet pointers
 
 /* enum for policy names */
-static const char *frag_policy_names[] =
+static const char* const frag_policy_names[] =
 {
     "no policy",
     "FIRST",
index 6be984526e6c9fe9712b276981ee3aca85ce5716..94999ac0236aa6d29348596782224498cbab2945 100644 (file)
@@ -77,8 +77,8 @@ FragEngine::FragEngine()
 // stream_ip module
 //-------------------------------------------------------------------------
 
-static const char* policies = 
-    "first | linux | bsd | bsd_right | last | windows | solaris";
+#define policies  \
+    "first | linux | bsd | bsd_right | last | windows | solaris"
 
 static const RuleMap stream_ip_rules[] =
 {
index 47a6a71913255564bc9a6440d537d673219b2aea..276e62c74b2580089634e63cb992b73f5d938904 100644 (file)
@@ -37,9 +37,9 @@
 // stream_reassemble
 //-------------------------------------------------------------------------
 
-static const char* s_name = "stream_reassemble";
-static const char* s_help =
-    "detection option for stream reassembly control";
+#define s_name "stream_reassemble"
+#define s_help \
+    "detection option for stream reassembly control"
 
 static THREAD_LOCAL ProfileStats streamReassembleRuleOptionPerfStats;
 
index a8ce896f51def41705aab7e09dba463ee958881c..04530ada08dc2be69a4fb75a561e5602cdc555a5 100644 (file)
@@ -86,9 +86,9 @@ bool StreamSizeOptionData::compare(uint32_t size1, uint32_t size2)
 // stream_size
 //-------------------------------------------------------------------------
 
-static const char* s_name = "stream_size";
-static const char* s_help =
-    "detection option for stream size checking";
+#define s_name "stream_size"
+#define s_help \
+    "detection option for stream size checking"
 
 static THREAD_LOCAL ProfileStats streamSizePerfStats;
 
index 1ea7c7ba9876135a5457ab2cce20611d22859f82..e4712916eab1e528bcb4c13b0092a1866192a03e 100644 (file)
@@ -73,9 +73,9 @@ using namespace std;
 #define STREAM_TCP_NO_3WHS_STR \
     "TCP session without 3-way handshake"
 
-static const char* policies =
-    "first | last | bsd | linux | old-linux | windows | win-2003 | vista | "
-    "solaris | hpux | hpux10 | irix | macos";
+#define policies \
+    "first | last | bsd | linux | old-linux | windows | win-2003 | vista | " \
+    "solaris | hpux | hpux10 | irix | macos"
 
 static const Parameter stream_tcp_small_params[] =
 {
index 2936936713b641eb6ce03f640702b2b2190561bc..0834402577702a3671b8787b162679e21ae5b48a 100644 (file)
@@ -408,7 +408,7 @@ void s5TcpStreamReassembleRuleOptionCleanup(void *dataPtr);
 /*  G L O B A L S  **************************************************/
 
 /* enum for policy names */
-static const char *reassembly_policy_names[] = {
+static const char* const reassembly_policy_names[] = {
     "no policy",
     "FIRST",
     "LINUX",
@@ -427,7 +427,7 @@ static const char *reassembly_policy_names[] = {
 };
 
 #ifdef DEBUG_STREAM5
-static const char *state_names[] = {
+static const char* const state_names[] = {
     "NONE",
     "LISTEN",
     "SYN_RCVD",
@@ -442,7 +442,7 @@ static const char *state_names[] = {
     "CLOSED"
 };
 
-static const char* flush_policy_names[] =
+static const char* const flush_policy_names[] =
 {
     "ignore",
     "on-ack",
@@ -984,7 +984,7 @@ typedef enum {
 static PegCount gnormStats[PC_MAX];
 static THREAD_LOCAL PegCount normStats[PC_MAX];
 
-static const char* pegName[PC_MAX] = {
+static const char* const pegName[PC_MAX] = {
     "tcp::trim",
     "tcp::ecn_ssn",
     "tcp::ts_nop",
@@ -2661,12 +2661,12 @@ static void TraceSession (const Flow* lws)
     );
 }
 
-static const char* statext[] = {
+static const char* const statext[] = {
     "NON", "LST", "SYR", "SYS", "EST", "CLW",
     "LAK", "FW1", "CLG", "FW2", "TWT", "CLD"
 };
 
-static const char* flushxt[] = {
+static const char* const flushxt[] = {
     "NON", "FPR", "LOG", "RSP", "SLW",
 #if 0
     "CON",
index 5a1b01fa2aa9b2fd46277ae77df474b812d1bf3e..e7cfc6a383976a6e9fbcc1fb2e595c31eb423295 100644 (file)
@@ -45,7 +45,7 @@
 
 static int s_debug = 0;
 
-static const char* codes[] = {
+static const char* const codes[] = {
     "success",
     "failure",
     "lesser",
index b3212bad60097bc8871cccc591349226142cff02..4062f0238f5620debb5772e214a42ee1a5caca61 100644 (file)
@@ -35,9 +35,9 @@
 
 #ifdef PPM_MGR
 
-static const char* s_name = "ppm";
-static const char* s_help =
-    "packet and rule latency monitoring and control (requires --enable-ppm)";
+#define s_name "ppm"
+#define s_help \
+    "packet and rule latency monitoring and control (requires --enable-ppm)"
 
 static const Parameter s_params[] =
 {
index ce8d3544daeb4566dc948cfe499f555063912382..513fea5c7c87b7de68cd6d08f110102a0d3aa25b 100644 (file)
@@ -172,12 +172,12 @@ struct DAQVerdicts
 
 //-------------------------------------------------------------------------
 
-static const char* simple_names[] =
+static const char* const simple_names[] =
 {
     "packets"
 };
 
-static const char* daq_names[] =
+static const char* const daq_names[] =
 {
     "received",
     "analyzed",
@@ -190,7 +190,7 @@ static const char* daq_names[] =
 #endif
 };
 
-const char* verdict_names[] =
+const char* const verdict_names[] =
 {
     "allow",
     "block",
@@ -202,7 +202,7 @@ const char* verdict_names[] =
     "internal whitelist"
 };
 
-static const char* pc_names[] =
+static const char* const pc_names[] =
 {
     "analyzed",
     "fail open",
@@ -220,7 +220,7 @@ static const char* pc_names[] =
     "idle"
 };
 
-static const char* proc_names[] =
+static const char* const proc_names[] =
 {
     "local commands",
     "remote commands",
@@ -364,7 +364,7 @@ void sum_stats(
 }
 
 void show_stats(
-    PegCount* pegs, const char* names[], unsigned n, const char* module_name)
+    PegCount* pegs, const char* const names[], unsigned n, const char* module_name)
 {
     bool head = false;
 
@@ -387,7 +387,7 @@ void show_stats(
 }
 
 void show_percent_stats(
-    PegCount* pegs, const char* names[], unsigned n, const char* module_name)
+    PegCount* pegs, const char* const names[], unsigned n, const char* module_name)
 {
     bool head = false;
 
index 4f49092243b152e8a7503e295225bb7a4ec7deb4..a04038e7e504e67e5b8546fab1d3cac20e74a658 100644 (file)
@@ -74,9 +74,9 @@ void LogStat(const char*, uint64_t n, uint64_t tot);
 void LogStat(const char*, double);
 
 void sum_stats(PegCount* sums, PegCount* counts, unsigned n);
-void show_stats(PegCount*, const char* names[], unsigned n,
+void show_stats(PegCount*, const char* const names[], unsigned n,
     const char* module_name = nullptr);
-void show_percent_stats(PegCount*, const char* names[], unsigned n,
+void show_percent_stats(PegCount*, const char* const names[], unsigned n,
     const char* module_name = nullptr);
 
 void sum_stats(SimpleStats* sums, SimpleStats* counts);