]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge with Russ
authorJosh <jrosenba@cisco.com>
Mon, 11 Aug 2014 21:13:45 +0000 (17:13 -0400)
committerJosh <jrosenba@cisco.com>
Tue, 12 Aug 2014 19:28:42 +0000 (15:28 -0400)
Conflicts:
tools/snort2lua/utils/s2l_util.cc

1  2 
tools/snort2lua/preprocessor_states/pps_ftp_telnet_protocol.cc
tools/snort2lua/utils/s2l_util.cc

index e14eb0109be2357b91fefa71f90d302bfedbc55d,fc54cbd0b74a86273802496d1ac98e995474efae..f2dff81fef38e9467c5cd0a54d8b08f91dbb4abb
@@@ -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;
index 1507063a14a1509ee536481345cd99323cc39b29,5fa02da2f5307b67c3a6c8afa2ee86e17f5094f2..cb7dfe797267cb20fce0c85f0a3ecc9c895ce12b
@@@ -28,7 -28,8 +28,9 @@@
  #include <iostream>
  #include <string>
  #include <cstring>
 -#include "utils/snort2lua_util.h"
+ #include <sstream>
++
 +#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