From: Michael Altizer (mialtize) Date: Sat, 30 Mar 2019 22:25:36 +0000 (-0400) Subject: Merge pull request #1565 in SNORT/snort3 from ~MIALTIZE/snort3:policy_true_false... X-Git-Tag: 3.0.0-251~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9494465c51734ae547c55a29d8fae6f01f1e7a5d;p=thirdparty%2Fsnort3.git Merge pull request #1565 in SNORT/snort3 from ~MIALTIZE/snort3:policy_true_false to master Squashed commit of the following: commit 4bd25a96d51859bfb7cda72561fce93869f82dcd Author: Michael Altizer Date: Sat Mar 30 16:39:30 2019 -0400 policy: Rename TRUE/FALSE to ENABLE/DISABLED Works around awkward C-style usage situations where TRUE/FALSE are defined and used. --- diff --git a/src/detection/rules.cc b/src/detection/rules.cc index 241e031cc..f77f27efd 100644 --- a/src/detection/rules.cc +++ b/src/detection/rules.cc @@ -164,8 +164,8 @@ void RuleStateEnable::update_rtn(RuleTreeNode* rtn) { switch( enable ) { - case IpsPolicy::FALSE: rtn->clear_enabled(); break; - case IpsPolicy::TRUE: rtn->set_enabled(); break; + case IpsPolicy::DISABLED: rtn->clear_enabled(); break; + case IpsPolicy::ENABLED: rtn->set_enabled(); break; case IpsPolicy::INHERIT_ENABLE: break; } } diff --git a/src/main/policy.h b/src/main/policy.h index ec67d2464..8a6b59a40 100644 --- a/src/main/policy.h +++ b/src/main/policy.h @@ -137,7 +137,7 @@ struct IpsPolicy { public: enum Action : uint8_t { LOG, PASS, ALERT, DROP, BLOCK, RESET, INHERIT_ACTION }; - enum Enable : uint8_t { FALSE, TRUE, INHERIT_ENABLE }; + enum Enable : uint8_t { DISABLED, ENABLED, INHERIT_ENABLE }; IpsPolicy(PolicyId = 0); ~IpsPolicy(); diff --git a/src/main/snort_config.h b/src/main/snort_config.h index 3bae004fc..86df3ef33 100644 --- a/src/main/snort_config.h +++ b/src/main/snort_config.h @@ -507,10 +507,10 @@ public: case IpsPolicy::INHERIT_ENABLE: return get_conf()->global_default_rule_state; - case IpsPolicy::TRUE: + case IpsPolicy::ENABLED: return true; - case IpsPolicy::FALSE: + case IpsPolicy::DISABLED: return false; } return true;