Deprecate names in BifConst, replace with zeek::BifConst

Some Val* types are also replaced with IntrusivePtr at the new location
This commit is contained in:
Jon Siwek 2020-05-13 23:41:01 -07:00
parent eedeb07550
commit 0db5c920f2
39 changed files with 120 additions and 106 deletions

View file

@ -405,7 +405,7 @@ bool Manager::CreateEventStream(RecordVal* fval)
return false;
}
allow_file_func = BifConst::Input::accept_unsupported_types;
allow_file_func = zeek::BifConst::Input::accept_unsupported_types;
}
@ -637,7 +637,7 @@ bool Manager::CreateTableStream(RecordVal* fval)
int idxfields = fieldsV.size();
if ( val ) // if we are not a set
status = status || ! UnrollRecordType(&fieldsV, val.get(), "", BifConst::Input::accept_unsupported_types);
status = status || ! UnrollRecordType(&fieldsV, val.get(), "", zeek::BifConst::Input::accept_unsupported_types);
int valfields = fieldsV.size() - idxfields;

View file

@ -67,23 +67,23 @@ bool Ascii::DoInit(const ReaderInfo& info, int num_fields, const Field* const* f
{
StopWarningSuppression();
separator.assign( (const char*) BifConst::InputAscii::separator->Bytes(),
BifConst::InputAscii::separator->Len());
separator.assign( (const char*) zeek::BifConst::InputAscii::separator->Bytes(),
zeek::BifConst::InputAscii::separator->Len());
set_separator.assign( (const char*) BifConst::InputAscii::set_separator->Bytes(),
BifConst::InputAscii::set_separator->Len());
set_separator.assign( (const char*) zeek::BifConst::InputAscii::set_separator->Bytes(),
zeek::BifConst::InputAscii::set_separator->Len());
empty_field.assign( (const char*) BifConst::InputAscii::empty_field->Bytes(),
BifConst::InputAscii::empty_field->Len());
empty_field.assign( (const char*) zeek::BifConst::InputAscii::empty_field->Bytes(),
zeek::BifConst::InputAscii::empty_field->Len());
unset_field.assign( (const char*) BifConst::InputAscii::unset_field->Bytes(),
BifConst::InputAscii::unset_field->Len());
unset_field.assign( (const char*) zeek::BifConst::InputAscii::unset_field->Bytes(),
zeek::BifConst::InputAscii::unset_field->Len());
fail_on_invalid_lines = BifConst::InputAscii::fail_on_invalid_lines;
fail_on_file_problem = BifConst::InputAscii::fail_on_file_problem;
fail_on_invalid_lines = zeek::BifConst::InputAscii::fail_on_invalid_lines;
fail_on_file_problem = zeek::BifConst::InputAscii::fail_on_file_problem;
path_prefix.assign((const char*) BifConst::InputAscii::path_prefix->Bytes(),
BifConst::InputAscii::path_prefix->Len());
path_prefix.assign((const char*) zeek::BifConst::InputAscii::path_prefix->Bytes(),
zeek::BifConst::InputAscii::path_prefix->Len());
// Set per-filter configuration options.
for ( ReaderInfo::config_map::const_iterator i = info.config.begin(); i != info.config.end(); i++ )

View file

@ -18,15 +18,15 @@ using threading::Field;
Benchmark::Benchmark(ReaderFrontend *frontend) : ReaderBackend(frontend)
{
num_lines = 0;
multiplication_factor = double(BifConst::InputBenchmark::factor);
autospread = double(BifConst::InputBenchmark::autospread);
spread = int(BifConst::InputBenchmark::spread);
add = int(BifConst::InputBenchmark::addfactor);
multiplication_factor = double(zeek::BifConst::InputBenchmark::factor);
autospread = double(zeek::BifConst::InputBenchmark::autospread);
spread = int(zeek::BifConst::InputBenchmark::spread);
add = int(zeek::BifConst::InputBenchmark::addfactor);
autospread_time = 0;
stopspreadat = int(BifConst::InputBenchmark::stopspreadat);
timedspread = double(BifConst::InputBenchmark::timedspread);
stopspreadat = int(zeek::BifConst::InputBenchmark::stopspreadat);
timedspread = double(zeek::BifConst::InputBenchmark::timedspread);
heartbeatstarttime = 0;
heartbeat_interval = double(BifConst::Threading::heartbeat_interval);
heartbeat_interval = double(zeek::BifConst::Threading::heartbeat_interval);
ascii = new threading::formatter::Ascii(this, threading::formatter::Ascii::SeparatorInfo());
}

View file

@ -19,7 +19,7 @@ Binary::Binary(ReaderFrontend *frontend)
{
if ( ! chunk_size )
{
chunk_size = BifConst::InputBinary::chunk_size;
chunk_size = zeek::BifConst::InputBinary::chunk_size;
if ( ! chunk_size )
chunk_size = 1024;
@ -82,8 +82,8 @@ bool Binary::DoInit(const ReaderInfo& info, int num_fields,
ino = 0;
firstrun = true;
path_prefix.assign((const char*) BifConst::InputBinary::path_prefix->Bytes(),
BifConst::InputBinary::path_prefix->Len());
path_prefix.assign((const char*) zeek::BifConst::InputBinary::path_prefix->Bytes(),
zeek::BifConst::InputBinary::path_prefix->Len());
if ( ! info.source || strlen(info.source) == 0 )
{

View file

@ -63,13 +63,13 @@ void Config::DoClose()
bool Config::DoInit(const ReaderInfo& info, int num_fields, const Field* const* fields)
{
fail_on_file_problem = BifConst::InputConfig::fail_on_file_problem;
fail_on_file_problem = zeek::BifConst::InputConfig::fail_on_file_problem;
set_separator.assign( (const char*) BifConst::InputConfig::set_separator->Bytes(),
BifConst::InputConfig::set_separator->Len());
set_separator.assign( (const char*) zeek::BifConst::InputConfig::set_separator->Bytes(),
zeek::BifConst::InputConfig::set_separator->Len());
empty_field.assign( (const char*) BifConst::InputConfig::empty_field->Bytes(),
BifConst::InputConfig::empty_field->Len());
empty_field.assign( (const char*) zeek::BifConst::InputConfig::empty_field->Bytes(),
zeek::BifConst::InputConfig::empty_field->Len());
formatter::Ascii::SeparatorInfo sep_info("\t", set_separator, "", empty_field);
formatter = std::unique_ptr<threading::formatter::Formatter>(new formatter::Ascii(this, sep_info));

View file

@ -34,10 +34,10 @@ Raw::Raw(ReaderFrontend *frontend) : ReaderBackend(frontend), file(nullptr, fclo
ino = 0;
forcekill = false;
offset = 0;
separator.assign( (const char*) BifConst::InputRaw::record_separator->Bytes(),
BifConst::InputRaw::record_separator->Len());
separator.assign( (const char*) zeek::BifConst::InputRaw::record_separator->Bytes(),
zeek::BifConst::InputRaw::record_separator->Len());
sep_length = BifConst::InputRaw::record_separator->Len();
sep_length = zeek::BifConst::InputRaw::record_separator->Len();
bufpos = 0;

View file

@ -24,18 +24,18 @@ SQLite::SQLite(ReaderFrontend *frontend)
fields(), num_fields(), mode(), started(), query(), db(), st()
{
set_separator.assign(
(const char*) BifConst::LogSQLite::set_separator->Bytes(),
BifConst::InputSQLite::set_separator->Len()
(const char*) zeek::BifConst::LogSQLite::set_separator->Bytes(),
zeek::BifConst::InputSQLite::set_separator->Len()
);
unset_field.assign(
(const char*) BifConst::LogSQLite::unset_field->Bytes(),
BifConst::InputSQLite::unset_field->Len()
(const char*) zeek::BifConst::LogSQLite::unset_field->Bytes(),
zeek::BifConst::InputSQLite::unset_field->Len()
);
empty_field.assign(
(const char*) BifConst::LogAscii::empty_field->Bytes(),
BifConst::InputSQLite::empty_field->Len()
(const char*) zeek::BifConst::LogAscii::empty_field->Bytes(),
zeek::BifConst::InputSQLite::empty_field->Len()
);
io = new threading::formatter::Ascii(this, threading::formatter::Ascii::SeparatorInfo(std::string(), set_separator, unset_field, empty_field));