#ifndef CONVERSION_STATE_H
#define CONVERSION_STATE_H
+#include <map>
#include <sstream>
#include "helpers/converter.h"
return false;
}
+ // parse and add a curly bracketed list to the table
+ inline bool parse_curly_bracket_precedence_list(const std::string& list_name,
+ std::istringstream& stream, int max)
+ {
+ std::string elem, tmp;
+ bool retval = true;
+ std::map<int, std::string> order;
+ int dig;
+
+ if (!(stream >> elem) || (elem != "{"))
+ return false;
+
+ while (stream >> elem && elem != "}")
+ {
+ if ( elem == "[" || elem == "]")
+ continue;
+
+ if (stream >> dig)
+ {
+ if (dig <= max)
+ {
+ order.insert(std::pair<int, std::string>(dig, elem));
+ }
+ else
+ {
+ table_api.add_comment("Unable to add " + elem +
+ ". Max precedence value is " + std::to_string(max));
+ }
+ }
+ }
+ for (auto i = order.begin(); i != order.end(); i++)
+ {
+ tmp += " " + i->second;
+ }
+
+ // remove the extra space at the beginning of the string
+ if (!tmp.empty())
+ tmp.erase(tmp.begin());
+
+ table_api.add_option(list_name, tmp);
+ return retval;
+ }
+
// parse and add a curly bracketed list to the table
inline bool parse_curly_bracket_list(const std::string& list_name, std::istringstream& stream)
{
else if (keyword == "uu_decode_depth")
parse_deleted_option("uu_decode_depth", data_stream);
+ else if (keyword == "normalize_random_nulls_in_text")
+ parse_deleted_option("normalize_random_nulls_in_text", data_stream);
+
+ else if (keyword == "fast_blocking")
+ parse_deleted_option("fast_blocking", data_stream);
+
else if (keyword == "iis_unicode_map")
{
std::string codemap;
#include "helpers/s2l_util.h"
#include "helpers/util_binder.h"
+#define MAX_XFF_HEADER 8
+
namespace preprocessors
{
namespace
else if (keyword == "profile")
parse_deleted_option("profile", data_stream);
else if ( keyword == "xff_headers" )
- tmpval = parse_bracketed_unsupported_list("xff_headers", data_stream);
+ tmpval = parse_curly_bracket_precedence_list("xff_headers", data_stream, MAX_XFF_HEADER);
else
{
tmpval = false;