From: Josh Date: Mon, 11 Aug 2014 21:13:45 +0000 (-0400) Subject: Merge with Russ X-Git-Tag: 3.0.0-233~1175^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddc949f5d3c06d113f51eaf8a9a6544c5a583bb5;p=thirdparty%2Fsnort3.git Merge with Russ Conflicts: tools/snort2lua/utils/s2l_util.cc --- ddc949f5d3c06d113f51eaf8a9a6544c5a583bb5 diff --cc tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc index e14eb0109,fc54cbd0b..f2dff81fe --- a/tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc +++ b/tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc @@@ -521,21 -476,20 +521,21 @@@ bool Telnet::convert(std::istringstream { ld->add_diff_option_comment("ports", "bindings"); ld->add_comment_to_table("check bindings table for port information"); - // vvvv defined in ConversionState vvvv - - // add commented list for now - std::string tmp = ""; - while (data_stream >> keyword && keyword != "}") - tmp += " " + keyword; - tmpval = ld->add_option_to_table("--ports", tmp + "}"); - -// parse_curly_bracket_list("--ports", data_stream); // create a commented list of the ports + // adding ports to the binding. + if ((data_stream >> keyword) && !keyword.compare("{")) + { + while (data_stream >> keyword && keyword != "}") + bind.add_when_port(keyword); + } + else + { + tmpval = false; + } } - else if(!keyword.compare("detect_anomalies")) - tmpval = ld->add_option_to_table("detect_anomalies", true); + else if(!keyword.compare("detect_anomalies")) + ld->add_deleted_comment("detect_anomalies"); else tmpval = false; diff --cc tools/snort2lua/utils/s2l_util.cc index 1507063a1,5fa02da2f..cb7dfe797 --- a/tools/snort2lua/utils/s2l_util.cc +++ b/tools/snort2lua/utils/s2l_util.cc @@@ -28,7 -28,8 +28,9 @@@ #include #include #include + #include -#include "utils/snort2lua_util.h" ++ +#include "utils/s2l_util.h" #include "conversion_state.h" #include "data/dt_data.h" @@@ -181,36 -182,36 +183,4 @@@ bool case_compare(std::string arg1, std return false; } --#if 0 --bool is_textfile_empty( const char* filename ) --{ -- string s; -- ifstream f( filename, ios::binary ); -- -- // Check for UTF-8 BOM -- if (f.peek() == 0xEF) -- { -- f.get(); -- if (f.get() != 0xBB) -- return false; -- if (f.get() != 0xBF) -- return false; -- } -- -- // Scan every line of the file for non-whitespace characters -- while (getline( f, s )) -- { -- if (s.find_first_not_of( -- " \t\n\v\f\r" // whitespace -- "\0\xFE\xFF" // non-printing (used in various Unicode encodings) -- ) != string::npos) -- return false; -- } -- -- // If we get this far, then the file only contains whitespace -- // (or its size is zero) -- return true; --} --#endif -- } // namespace util