#ifndef CONVERSION_STATE_H
#define CONVERSION_STATE_H
-#include <string>
-#include <fstream>
#include <sstream>
-#include <cctype>
-#include <iostream>
-#include "data/dt_data.h"
-#include "data/dt_table_api.h"
-#include "data/dt_rule_api.h"
-
-// the following three files are for the function 'set_next_rule_state'
+#include "helpers/converter.h"
#include "helpers/s2l_util.h"
#include "rule_states/rule_api.h"
-#include "helpers/converter.h"
-#include "conversion_defines.h"
class DataApi;
class RuleApi;
//--------------------------------------------------------------------------
// converter.cc author Josh Rosenbaum <jrosenba@cisco.com>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "converter.h"
+
#include <algorithm>
#include <memory>
#include <stdexcept>
#ifndef UTILS_CONVERTER_H
#define UTILS_CONVERTER_H
-#include <memory>
-#include <string>
#include "conversion_defines.h"
#include "data/dt_data.h"
-#include "data/dt_table_api.h"
#include "data/dt_rule_api.h"
-#include "util_binder.h"
+#include "data/dt_table_api.h"
+#include "helpers/util_binder.h"
typedef std::pair<unsigned, std::shared_ptr<Binder>> PendingBinder;
#include "config.h"
#endif
-#include "helpers/parse_cmd_line.h"
-
-#include <syslog.h>
+#include "parse_cmd_line.h"
#include <cstring>
#include <iomanip>
-#include <iostream>
-#include <string>
-
-#include "data/dt_data.h"
-#include "helpers/converter.h"
-#include "helpers/s2l_util.h"
-#include "helpers/s2l_markup.h"
-#include "helpers/util_binder.h"
+
+#include "converter.h"
+#include "s2l_markup.h"
+#include "s2l_util.h"
namespace parser
{
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//--------------------------------------------------------------------------
-// markup.cc author Russ Combs <rucombs@cisco.com>
+// s2l_markup.cc author Russ Combs <rucombs@cisco.com>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "s2l_markup.h"
+
#include <cstring>
using namespace std;
//--------------------------------------------------------------------------
// s2l_util.cc author Josh Rosenbaum <jrosenba@cisco.com>
-#include <sstream>
-#include <algorithm>
-#include <functional>
-#include <cctype>
-#include <locale>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "s2l_util.h"
+
#include <sys/stat.h>
-#include <iostream>
-#include <string>
-#include <cstring>
-#include <sstream>
-#include "helpers/s2l_util.h"
+#include <algorithm>
+
#include "conversion_state.h"
-#include "data/dt_data.h"
#include "data/data_types/dt_table.h"
namespace util
#ifndef HELPERS_UTIL_H
#define HELPERS_UTIL_H
+#include <memory>
#include <string>
#include <vector>
-#include <algorithm>
-#include <functional>
-#include <cctype>
-#include <locale>
-#include <sstream>
-#include <memory>
struct ConvertMap;
class Table;
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//--------------------------------------------------------------------------
-// pps_binder.cc author Josh Rosenbaum <jrosenba@cisco.com>
+// util_binder.cc author Josh Rosenbaum <jrosenba@cisco.com>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "util_binder.h"
#include <algorithm>
#include <cassert>
-#include "helpers/util_binder.h"
#include "data/dt_table_api.h"
using namespace std;
//--------------------------------------------------------------------------
// kws_rule.cc author Josh Rosenbaum <jrosenba@cisco.com>
-#include <sstream>
-#include <vector>
-
#include "conversion_state.h"
-#include "helpers/converter.h"
-#include "helpers/s2l_util.h"
-#include "rule_states/rule_api.h"
namespace keywords
{
static const std::string sdrop = "sdrop";
static const std::string activate = "activate";
static const std::string dynamic = "dynamic";
-static const std::string ftpbounce = "ftpbounce";
-static const std::string sameip = "sameip";
static const ConvertMap alert_api = { alert, rule_ctor<& alert>};
static const ConvertMap block_api = { block, rule_ctor<& block>};
static const ConvertMap sdrop_api = { sdrop, conv_rule_ctor<& block, &sdrop>};
static const ConvertMap activate_api = { activate, dep_rule_ctor<& activate>};
static const ConvertMap dynamic_api = { dynamic, dep_rule_ctor<& dynamic>};
-static const ConvertMap ftpbounce_api = { ftpbounce, dep_rule_ctor<& ftpbounce>};
-static const ConvertMap sameip_api = { sameip, dep_rule_ctor<& sameip>};
const ConvertMap* alert_map = &alert_api;
const ConvertMap* block_map = &block_api;
const ConvertMap* sdrop_map = &sdrop_api;
const ConvertMap* activate_map = &activate_api;
const ConvertMap* dynamic_map = &dynamic_api;
-const ConvertMap* ftpbounce_map = &ftpbounce_api;
-const ConvertMap* sameip_map = &sameip_api;
} // namespace keywords
//--------------------------------------------------------------------------
// out_syslog.cc author Josh Rosenbaum <jrosenba@cisco.com>
-#include <sstream>
-#include <vector>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <algorithm>
#include "conversion_state.h"
-#include "helpers/converter.h"
-#include "rule_states/rule_api.h"
-#include "helpers/s2l_util.h"
namespace output
{
//--------------------------------------------------------------------------
// pps_dcerpc_server.cc author Maya Dagon <mdagon@cisco.com>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "pps_dcerpc_server.h"
-#include <sstream>
-#include <vector>
-#include <map>
+#include <algorithm>
#include <cstring>
-#include "conversion_state.h"
-#include "helpers/s2l_util.h"
-#include "helpers/util_binder.h"
-
namespace preprocessors
{
namespace dce
#include <map>
#include "conversion_state.h"
-#include "helpers/s2l_util.h"
-#include "helpers/util_binder.h"
namespace preprocessors
{
rule_ttl.cc
rule_threshold.cc
rule_unchanged.cc
+ rule_unsupported.cc
rule_urilen.cc
rule_api.cc
rule_api.h
rule_ttl.cc \
rule_threshold.cc \
rule_unchanged.cc \
+rule_unsupported.cc \
rule_urilen.cc \
rule_api.cc \
rule_api.h
namespace rules
{
extern const ConvertMap* ack_map;
+extern const ConvertMap* activated_by_map;
+extern const ConvertMap* activates_map;
extern const ConvertMap* appid_map;
extern const ConvertMap* asn1_map;
extern const ConvertMap* base64_data_map;
extern const ConvertMap* byte_test_map;
extern const ConvertMap* classtype_map;
extern const ConvertMap* content_map;
+extern const ConvertMap* count_map;
extern const ConvertMap* cvs_map;
extern const ConvertMap* dce_iface_map;
extern const ConvertMap* dce_opnum_map;
extern const ConvertMap* flowbits_map;
extern const ConvertMap* fragbits_map;
extern const ConvertMap* fragoffset_map;
+extern const ConvertMap* ftpbounce_map;
extern const ConvertMap* gid_map;
extern const ConvertMap* gtp_info_map;
extern const ConvertMap* gtp_type_map;
extern const ConvertMap* resp_map;
extern const ConvertMap* rev_map;
extern const ConvertMap* rpc_map;
+extern const ConvertMap* sameip_map;
extern const ConvertMap* sd_pattern_map;
extern const ConvertMap* seq_map;
extern const ConvertMap* session_map;
const std::vector<const ConvertMap*> rule_options_api =
{
ack_map,
+ activated_by_map,
+ activates_map,
appid_map,
asn1_map,
base64_data_map,
byte_test_map,
classtype_map,
content_map,
+ count_map,
cvs_map,
dce_iface_map,
dce_opnum_map,
flowbits_map,
fragbits_map,
fragoffset_map,
+ ftpbounce_map,
gid_map,
gtp_info_map,
gtp_type_map,
resp_map,
rev_map,
rpc_map,
+ sameip_map,
sd_pattern_map,
seq_map,
session_map,
--- /dev/null
+//--------------------------------------------------------------------------
+// Copyright (C) 2014-2017 Cisco and/or its affiliates. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License Version 2 as published
+// by the Free Software Foundation. You may not use, modify or distribute
+// this program under any other version of the GNU General Public License.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//--------------------------------------------------------------------------
+// rule_unsupported.cc author Michael Altizer <mialtize@cisco.com>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "conversion_state.h"
+
+namespace rules
+{
+template<const std::string* rule_opt_name, bool has_suboptions>
+class UnsupportedRuleOption : public ConversionState
+{
+public:
+ UnsupportedRuleOption(Converter& c) : ConversionState(c)
+ {
+ c.get_rule_api().make_rule_a_comment();
+ c.get_rule_api().add_comment("The '" + *rule_opt_name + "' rule option keyword is no longer supported");
+ }
+
+ bool convert(std::istringstream& stream) override
+ {
+ if (has_suboptions)
+ util::get_rule_option_args(stream);
+ return set_next_rule_state(stream);
+ }
+};
+
+/**************************
+ ******* A P I ***********
+ **************************/
+
+template<const std::string* rule_opt_name, bool has_suboptions>
+static ConversionState* unsupported_rule_ctor(Converter& c)
+{
+ return new UnsupportedRuleOption<rule_opt_name, has_suboptions>(c);
+}
+
+static const std::string activated_by = "activated_by";
+static const std::string activates = "activates";
+static const std::string count = "count";
+static const std::string ftpbounce = "ftpbounce";
+static const std::string sameip = "sameip";
+
+static const ConvertMap activated_by_api = { activated_by, unsupported_rule_ctor<&activated_by, true>};
+static const ConvertMap activates_api = { activates, unsupported_rule_ctor<&activates, true>};
+static const ConvertMap count_api = { count, unsupported_rule_ctor<&count, true>};
+static const ConvertMap ftpbounce_api = { ftpbounce, unsupported_rule_ctor<&ftpbounce, false>};
+static const ConvertMap sameip_api = { sameip, unsupported_rule_ctor<&sameip, false>};
+
+const ConvertMap* activated_by_map = &activated_by_api;
+const ConvertMap* activates_map = &activates_api;
+const ConvertMap* count_map = &count_api;
+const ConvertMap* ftpbounce_map = &ftpbounce_api;
+const ConvertMap* sameip_map = &sameip_api;
+} // namespace rules