{
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;
#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"
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