mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Merge branch 'topic/robin/sqlite-merge'
Closes #997. * topic/robin/sqlite-merge: (25 commits) Fix to make sqlite test consistent, and updating coverage baselines Avoid a CMake warning about 3rdparty looking like a number. Fixing linker error. and there is no has-reader. make sqlite3 executable required and add test-cases for errors Renaming src/external -> src/3rdparty fix a few small rough edges (mostly comments that do no longer apply) fix bug in input-manager regarding enums that a writer reads without 0-terminating the string actually make sqlite work again (tests passed because the writer was not actually defined because of the define.) add sqlite distribution. fix warnings, update baselines, handle rotation add sqlite tests and fix small vector/set escaping bugs fix small bug with vectors and sets. make work with newer AsciiFormatter. start adding a different text for empty records for the sqlite writer. no, you will never guess from where I copied this file... make sqlite support more or less work for logging and input make sqlite-writer more stable. make it compile with new version of AsciiInputOutput and adapt to AsciiInputOutput - seems to work... ... Conflicts: scripts/base/frameworks/input/__load__.bro src/CMakeLists.txt src/input.bif src/input/Manager.cc src/main.cc src/types.bif testing/btest/Baseline/coverage.bare-load-baseline/canonified_loaded_scripts.log testing/btest/Baseline/coverage.default-load-baseline/canonified_loaded_scripts.log
This commit is contained in:
commit
358528732c
38 changed files with 146958 additions and 17 deletions
|
@ -9,6 +9,7 @@
|
|||
#include "readers/Raw.h"
|
||||
#include "readers/Benchmark.h"
|
||||
#include "readers/Binary.h"
|
||||
#include "readers/SQLite.h"
|
||||
|
||||
#include "Event.h"
|
||||
#include "EventHandler.h"
|
||||
|
@ -36,6 +37,7 @@ ReaderDefinition input_readers[] = {
|
|||
{ BifEnum::Input::READER_RAW, "Raw", 0, reader::Raw::Instantiate },
|
||||
{ BifEnum::Input::READER_BENCHMARK, "Benchmark", 0, reader::Benchmark::Instantiate },
|
||||
{ BifEnum::Input::READER_BINARY, "Binary", 0, reader::Binary::Instantiate },
|
||||
{ BifEnum::Input::READER_SQLITE, "SQLite", 0, reader::SQLite::Instantiate },
|
||||
|
||||
// End marker
|
||||
{ BifEnum::Input::READER_DEFAULT, "None", 0, (ReaderBackend* (*)(ReaderFrontend* frontend))0 }
|
||||
|
@ -2116,19 +2118,25 @@ Val* Manager::ValueToVal(const Value* val, BroType* request_type)
|
|||
}
|
||||
|
||||
case TYPE_ENUM: {
|
||||
// well, this is kind of stupid, because EnumType just mangles the module name and the var name together again...
|
||||
// but well
|
||||
string module = extract_module_name(val->val.string_val.data);
|
||||
string var = extract_var_name(val->val.string_val.data);
|
||||
// Convert to string first to not have to deal with missing
|
||||
// \0's...
|
||||
string module_string(val->val.string_val.data, val->val.string_val.length);
|
||||
string var_string(val->val.string_val.data, val->val.string_val.length);
|
||||
|
||||
string module = extract_module_name(module_string.c_str());
|
||||
string var = extract_var_name(var_string.c_str());
|
||||
|
||||
// Well, this is kind of stupid, because EnumType just
|
||||
// mangles the module name and the var name together again...
|
||||
// but well.
|
||||
bro_int_t index = request_type->AsEnumType()->Lookup(module, var.c_str());
|
||||
if ( index == -1 )
|
||||
reporter->InternalError("Value not found in enum mappimg. Module: %s, var: %s",
|
||||
module.c_str(), var.c_str());
|
||||
reporter->InternalError("Value not found in enum mappimg. Module: %s, var: %s, var size: %zu",
|
||||
module.c_str(), var.c_str(), var.size());
|
||||
|
||||
return new EnumVal(index, request_type->Ref()->AsEnumType() );
|
||||
return new EnumVal(index, request_type->Ref()->AsEnumType());
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
reporter->InternalError("unsupported type for input_read");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue