mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Move Reporter to zeek namespace
This commit is contained in:
parent
7cedd94ee7
commit
bfab224d7c
132 changed files with 1010 additions and 987 deletions
|
@ -204,7 +204,7 @@ ReaderBackend* Manager::CreateBackend(ReaderFrontend* frontend, zeek::EnumVal* t
|
|||
|
||||
if ( ! c )
|
||||
{
|
||||
reporter->Error("The reader that was requested was not found and could not be initialized.");
|
||||
zeek::reporter->Error("The reader that was requested was not found and could not be initialized.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ bool Manager::CreateStream(Stream* info, zeek::RecordVal* description)
|
|||
|| same_type(rtype, zeek::BifType::Record::Input::EventDescription, false)
|
||||
|| same_type(rtype, zeek::BifType::Record::Input::AnalysisDescription, false) ) )
|
||||
{
|
||||
reporter->Error("Stream description argument not of right type for new input stream");
|
||||
zeek::reporter->Error("Stream description argument not of right type for new input stream");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -230,8 +230,8 @@ bool Manager::CreateStream(Stream* info, zeek::RecordVal* description)
|
|||
|
||||
if ( Stream *i = FindStream(name) )
|
||||
{
|
||||
reporter->Error("Trying create already existing input stream %s",
|
||||
name.c_str());
|
||||
zeek::reporter->Error("Trying create already existing input stream %s",
|
||||
name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ bool Manager::CreateStream(Stream* info, zeek::RecordVal* description)
|
|||
break;
|
||||
|
||||
default:
|
||||
reporter->InternalWarning("unknown input reader mode");
|
||||
zeek::reporter->InternalWarning("unknown input reader mode");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
zeek::RecordType* rtype = fval->GetType()->AsRecordType();
|
||||
if ( ! same_type(rtype, zeek::BifType::Record::Input::EventDescription, false) )
|
||||
{
|
||||
reporter->Error("EventDescription argument not of right type");
|
||||
zeek::reporter->Error("EventDescription argument not of right type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( etype->Flavor() != zeek::FUNC_FLAVOR_EVENT )
|
||||
{
|
||||
reporter->Error("Input stream %s: Stream event is a function, not an event", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Stream event is a function, not an event", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -336,19 +336,19 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( args.size() < 2 )
|
||||
{
|
||||
reporter->Error("Input stream %s: Event does not take enough arguments", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Event does not take enough arguments", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! same_type(args[1], zeek::BifType::Enum::Input::Event, false) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Event's second attribute must be of type Input::Event", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Event's second attribute must be of type Input::Event", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! same_type(args[0], zeek::BifType::Record::Input::EventDescription, false) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Event's first attribute must be of type Input::EventDescription", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Event's first attribute must be of type Input::EventDescription", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
{
|
||||
if ( static_cast<int>(args.size()) != fields->NumFields() + 2 )
|
||||
{
|
||||
reporter->Error("Input stream %s: Event has wrong number of arguments", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Event has wrong number of arguments", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -369,10 +369,10 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
args[i + 2]->Describe(&desc1);
|
||||
fields->GetFieldType(i)->Describe(&desc2);
|
||||
|
||||
reporter->Error("Input stream %s: Incompatible type for event in field %d. Need type '%s':%s, got '%s':%s",
|
||||
stream_name.c_str(), i + 3,
|
||||
zeek::type_name(fields->GetFieldType(i)->Tag()), desc2.Description(),
|
||||
zeek::type_name(args[i + 2]->Tag()), desc1.Description());
|
||||
zeek::reporter->Error("Input stream %s: Incompatible type for event in field %d. Need type '%s':%s, got '%s':%s",
|
||||
stream_name.c_str(), i + 3,
|
||||
zeek::type_name(fields->GetFieldType(i)->Tag()), desc2.Description(),
|
||||
zeek::type_name(args[i + 2]->Tag()), desc1.Description());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
{
|
||||
if ( args.size() != 3 )
|
||||
{
|
||||
reporter->Error("Input stream %s: Event has wrong number of arguments", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Event has wrong number of arguments", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -394,10 +394,10 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
ODesc desc2;
|
||||
args[2]->Describe(&desc1);
|
||||
fields->Describe(&desc2);
|
||||
reporter->Error("Input stream %s: Incompatible type '%s':%s for event, which needs type '%s':%s\n",
|
||||
stream_name.c_str(),
|
||||
zeek::type_name(args[2]->Tag()), desc1.Description(),
|
||||
zeek::type_name(fields->Tag()), desc2.Description());
|
||||
zeek::reporter->Error("Input stream %s: Incompatible type '%s':%s for event, which needs type '%s':%s\n",
|
||||
stream_name.c_str(),
|
||||
zeek::type_name(args[2]->Tag()), desc1.Description(),
|
||||
zeek::type_name(fields->Tag()), desc2.Description());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -420,7 +420,7 @@ bool Manager::CreateEventStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( status )
|
||||
{
|
||||
reporter->Error("Input stream %s: Problem unrolling", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Problem unrolling", stream_name.c_str());
|
||||
for ( auto& f : fieldsV ) delete f;
|
||||
return false;
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
zeek::RecordType* rtype = fval->GetType()->AsRecordType();
|
||||
if ( ! same_type(rtype, zeek::BifType::Record::Input::TableDescription, false) )
|
||||
{
|
||||
reporter->Error("TableDescription argument not of right type");
|
||||
zeek::reporter->Error("TableDescription argument not of right type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -489,7 +489,7 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
{
|
||||
if ( j >= num )
|
||||
{
|
||||
reporter->Error("Input stream %s: Table type has more indexes than index definition", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Table type has more indexes than index definition", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -500,9 +500,10 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
idx->GetFieldType(j)->Describe(&desc1);
|
||||
tl[j]->Describe(&desc2);
|
||||
|
||||
reporter->Error("Input stream %s: Table type does not match index type. Need type '%s':%s, got '%s':%s", stream_name.c_str(),
|
||||
zeek::type_name(idx->GetFieldType(j)->Tag()), desc1.Description(),
|
||||
zeek::type_name(tl[j]->Tag()), desc2.Description());
|
||||
zeek::reporter->Error("Input stream %s: Table type does not match index type. Need type '%s':%s, got '%s':%s",
|
||||
stream_name.c_str(),
|
||||
zeek::type_name(idx->GetFieldType(j)->Tag()), desc1.Description(),
|
||||
zeek::type_name(tl[j]->Tag()), desc2.Description());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -510,7 +511,7 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( num != j )
|
||||
{
|
||||
reporter->Error("Input stream %s: Table has less elements than index definition", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Table has less elements than index definition", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -521,10 +522,10 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
{
|
||||
if ( destination_is_set )
|
||||
{
|
||||
reporter->Error("Input stream %s: 'destination' field is a set, "
|
||||
"but the 'val' field was also specified "
|
||||
"(did you mean to use a table instead of a set?)",
|
||||
stream_name.data());
|
||||
zeek::reporter->Error("Input stream %s: 'destination' field is a set, "
|
||||
"but the 'val' field was also specified "
|
||||
"(did you mean to use a table instead of a set?)",
|
||||
stream_name.data());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -538,8 +539,8 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
ODesc desc2;
|
||||
compare_type->Describe(&desc1);
|
||||
table_yield->Describe(&desc2);
|
||||
reporter->Error("Input stream %s: Table type does not match value type. Need type '%s', got '%s'",
|
||||
stream_name.c_str(), desc1.Description(), desc2.Description());
|
||||
zeek::reporter->Error("Input stream %s: Table type does not match value type. Need type '%s', got '%s'",
|
||||
stream_name.c_str(), desc1.Description(), desc2.Description());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -548,10 +549,10 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
{
|
||||
if ( ! destination_is_set )
|
||||
{
|
||||
reporter->Error("Input stream %s: 'destination' field is a table,"
|
||||
" but 'val' field is not provided"
|
||||
" (did you mean to use a set instead of a table?)",
|
||||
stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: 'destination' field is a table,"
|
||||
" but 'val' field is not provided"
|
||||
" (did you mean to use a set instead of a table?)",
|
||||
stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -565,7 +566,7 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( etype->Flavor() != zeek::FUNC_FLAVOR_EVENT )
|
||||
{
|
||||
reporter->Error("Input stream %s: Stream event is a function, not an event", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Stream event is a function, not an event", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -574,20 +575,22 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( args.size() != required_arg_count )
|
||||
{
|
||||
reporter->Error("Input stream %s: Table event must take %zu arguments",
|
||||
stream_name.c_str(), required_arg_count);
|
||||
zeek::reporter->Error("Input stream %s: Table event must take %zu arguments",
|
||||
stream_name.c_str(), required_arg_count);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! same_type(args[0], zeek::BifType::Record::Input::TableDescription, false) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Table event's first attribute must be of type Input::TableDescription", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Table event's first attribute must be of type Input::TableDescription",
|
||||
stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! same_type(args[1], zeek::BifType::Enum::Input::Event, false) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Table event's second attribute must be of type Input::Event", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Table event's second attribute must be of type Input::Event",
|
||||
stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -597,8 +600,9 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
ODesc desc2;
|
||||
idx->Describe(&desc1);
|
||||
args[2]->Describe(&desc2);
|
||||
reporter->Error("Input stream %s: Table event's index attributes do not match. Need '%s', got '%s'", stream_name.c_str(),
|
||||
desc1.Description(), desc2.Description());
|
||||
zeek::reporter->Error("Input stream %s: Table event's index attributes do not match. Need '%s', got '%s'",
|
||||
stream_name.c_str(),
|
||||
desc1.Description(), desc2.Description());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -610,8 +614,8 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
ODesc desc2;
|
||||
val->Describe(&desc1);
|
||||
args[3]->Describe(&desc2);
|
||||
reporter->Error("Input stream %s: Table event's value attributes do not match. Need '%s', got '%s'",
|
||||
stream_name.c_str(), desc1.Description(), desc2.Description());
|
||||
zeek::reporter->Error("Input stream %s: Table event's value attributes do not match. Need '%s', got '%s'",
|
||||
stream_name.c_str(), desc1.Description(), desc2.Description());
|
||||
return false;
|
||||
}
|
||||
else if ( want_record->InternalInt() == 0 &&
|
||||
|
@ -621,13 +625,13 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
ODesc desc2;
|
||||
val->GetFieldType(0)->Describe(&desc1);
|
||||
args[3]->Describe(&desc2);
|
||||
reporter->Error("Input stream %s: Table event's value attribute does not match. Need '%s', got '%s'",
|
||||
stream_name.c_str(), desc1.Description(), desc2.Description());
|
||||
zeek::reporter->Error("Input stream %s: Table event's value attribute does not match. Need '%s', got '%s'",
|
||||
stream_name.c_str(), desc1.Description(), desc2.Description());
|
||||
return false;
|
||||
}
|
||||
else if ( ! val )
|
||||
{
|
||||
reporter->Error("Encountered a null value when creating a table stream");
|
||||
zeek::reporter->Error("Encountered a null value when creating a table stream");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -653,7 +657,8 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( (valfields > 1) && (want_record->InternalInt() != 1) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Stream does not want a record (want_record=F), but has more then one value field.", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Stream does not want a record (want_record=F), but has more then one value field.",
|
||||
stream_name.c_str());
|
||||
for ( auto& f : fieldsV ) delete f;
|
||||
return false;
|
||||
}
|
||||
|
@ -663,7 +668,7 @@ bool Manager::CreateTableStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( status )
|
||||
{
|
||||
reporter->Error("Input stream %s: Problem unrolling", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Problem unrolling", stream_name.c_str());
|
||||
for ( auto& f : fieldsV ) delete f;
|
||||
return false;
|
||||
}
|
||||
|
@ -717,7 +722,7 @@ bool Manager::CheckErrorEventTypes(const std::string& stream_name, const zeek::F
|
|||
|
||||
if ( etype->Flavor() != zeek::FUNC_FLAVOR_EVENT )
|
||||
{
|
||||
reporter->Error("Input stream %s: Error event is a function, not an event", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Error event is a function, not an event", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -725,31 +730,35 @@ bool Manager::CheckErrorEventTypes(const std::string& stream_name, const zeek::F
|
|||
|
||||
if ( args.size() != 3 )
|
||||
{
|
||||
reporter->Error("Input stream %s: Error event must take 3 arguments", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Error event must take 3 arguments", stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( table && ! same_type(args[0], zeek::BifType::Record::Input::TableDescription, false) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Error event's first attribute must be of type Input::TableDescription", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Error event's first attribute must be of type Input::TableDescription",
|
||||
stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! table && ! same_type(args[0], zeek::BifType::Record::Input::EventDescription, false) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Error event's first attribute must be of type Input::EventDescription", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Error event's first attribute must be of type Input::EventDescription",
|
||||
stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( args[1]->Tag() != zeek::TYPE_STRING )
|
||||
{
|
||||
reporter->Error("Input stream %s: Error event's second attribute must be of type string", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Error event's second attribute must be of type string",
|
||||
stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! same_type(args[2], zeek::BifType::Enum::Reporter::Level, false) )
|
||||
{
|
||||
reporter->Error("Input stream %s: Error event's third attribute must be of type Reporter::Level", stream_name.c_str());
|
||||
zeek::reporter->Error("Input stream %s: Error event's third attribute must be of type Reporter::Level",
|
||||
stream_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -762,7 +771,7 @@ bool Manager::CreateAnalysisStream(zeek::RecordVal* fval)
|
|||
|
||||
if ( ! same_type(rtype, zeek::BifType::Record::Input::AnalysisDescription, false) )
|
||||
{
|
||||
reporter->Error("AnalysisDescription argument not of right type");
|
||||
zeek::reporter->Error("AnalysisDescription argument not of right type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -849,7 +858,7 @@ bool Manager::RemoveStream(Stream *i)
|
|||
|
||||
if ( i->removed )
|
||||
{
|
||||
reporter->Warning("Stream %s is already queued for removal. Ignoring remove.", i->name.c_str());
|
||||
zeek::reporter->Warning("Stream %s is already queued for removal. Ignoring remove.", i->name.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -881,7 +890,7 @@ bool Manager::RemoveStreamContinuation(ReaderFrontend* reader)
|
|||
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->Error("Stream not found in RemoveStreamContinuation");
|
||||
zeek::reporter->Error("Stream not found in RemoveStreamContinuation");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -915,13 +924,14 @@ bool Manager::UnrollRecordType(vector<Field*> *fields, const zeek::RecordType *r
|
|||
rec->GetFieldType(i)->Tag() == zeek::TYPE_OPAQUE ) &&
|
||||
rec->FieldDecl(i)->GetAttr(zeek::detail::ATTR_OPTIONAL) )
|
||||
{
|
||||
reporter->Info("Encountered incompatible type \"%s\" in type definition for field \"%s\" in ReaderFrontend. Ignoring optional field.", zeek::type_name(rec->GetFieldType(i)->Tag()), name.c_str());
|
||||
zeek::reporter->Info("Encountered incompatible type \"%s\" in type definition for field \"%s\" in ReaderFrontend. Ignoring optional field.",
|
||||
zeek::type_name(rec->GetFieldType(i)->Tag()), name.c_str());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
reporter->Error("Incompatible type \"%s\" in type definition for for field \"%s\" in ReaderFrontend",
|
||||
zeek::type_name(rec->GetFieldType(i)->Tag()), name.c_str());
|
||||
zeek::reporter->Error("Incompatible type \"%s\" in type definition for for field \"%s\" in ReaderFrontend",
|
||||
zeek::type_name(rec->GetFieldType(i)->Tag()), name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -931,7 +941,7 @@ bool Manager::UnrollRecordType(vector<Field*> *fields, const zeek::RecordType *r
|
|||
|
||||
if ( rec->FieldDecl(i)->GetAttr(zeek::detail::ATTR_OPTIONAL) )
|
||||
{
|
||||
reporter->Info("The input framework does not support optional record fields: \"%s\"", rec->FieldName(i));
|
||||
zeek::reporter->Info("The input framework does not support optional record fields: \"%s\"", rec->FieldName(i));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -986,13 +996,13 @@ bool Manager::ForceUpdate(const string &name)
|
|||
Stream *i = FindStream(name);
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->Error("Stream %s not found", name.c_str());
|
||||
zeek::reporter->Error("Stream %s not found", name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( i->removed )
|
||||
{
|
||||
reporter->Error("Stream %s is already queued for removal. Ignoring force update.", name.c_str());
|
||||
zeek::reporter->Error("Stream %s is already queued for removal. Ignoring force update.", name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1070,8 +1080,8 @@ void Manager::SendEntry(ReaderFrontend* reader, Value* *vals)
|
|||
Stream *i = FindStream(reader);
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->InternalWarning("Unknown reader %s in SendEntry",
|
||||
reader->Name());
|
||||
zeek::reporter->InternalWarning("Unknown reader %s in SendEntry",
|
||||
reader->Name());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1258,7 +1268,7 @@ int Manager::SendEntryTable(Stream* i, const Value* const *vals)
|
|||
auto k = stream->tab->MakeHashKey(*idxval);
|
||||
|
||||
if ( ! k )
|
||||
reporter->InternalError("could not hash");
|
||||
zeek::reporter->InternalError("could not hash");
|
||||
|
||||
InputHash* ih = new InputHash();
|
||||
ih->idxkey = new HashKey(k->Key(), k->Size(), k->Hash());
|
||||
|
@ -1310,8 +1320,8 @@ void Manager::EndCurrentSend(ReaderFrontend* reader)
|
|||
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->InternalWarning("Unknown reader %s in EndCurrentSend",
|
||||
reader->Name());
|
||||
zeek::reporter->InternalWarning("Unknown reader %s in EndCurrentSend",
|
||||
reader->Name());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1409,8 +1419,8 @@ void Manager::SendEndOfData(ReaderFrontend* reader)
|
|||
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->InternalWarning("Unknown reader %s in SendEndOfData",
|
||||
reader->Name());
|
||||
zeek::reporter->InternalWarning("Unknown reader %s in SendEndOfData",
|
||||
reader->Name());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1436,7 +1446,7 @@ void Manager::Put(ReaderFrontend* reader, Value* *vals)
|
|||
Stream *i = FindStream(reader);
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->InternalWarning("Unknown reader %s in Put", reader->Name());
|
||||
zeek::reporter->InternalWarning("Unknown reader %s in Put", reader->Name());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1664,8 +1674,8 @@ void Manager::Clear(ReaderFrontend* reader)
|
|||
Stream *i = FindStream(reader);
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->InternalWarning("Unknown reader %s in Clear",
|
||||
reader->Name());
|
||||
zeek::reporter->InternalWarning("Unknown reader %s in Clear",
|
||||
reader->Name());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1686,7 +1696,7 @@ bool Manager::Delete(ReaderFrontend* reader, Value* *vals)
|
|||
Stream *i = FindStream(reader);
|
||||
if ( i == nullptr )
|
||||
{
|
||||
reporter->InternalWarning("Unknown reader %s in Delete", reader->Name());
|
||||
zeek::reporter->InternalWarning("Unknown reader %s in Delete", reader->Name());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1995,7 +2005,7 @@ int Manager::GetValueLength(const Value* val) const
|
|||
}
|
||||
|
||||
default:
|
||||
reporter->InternalError("unsupported type %d for GetValueLength", val->type);
|
||||
zeek::reporter->InternalError("unsupported type %d for GetValueLength", val->type);
|
||||
}
|
||||
|
||||
return length;
|
||||
|
@ -2127,7 +2137,7 @@ int Manager::CopyValue(char *data, const int startpos, const Value* val) const
|
|||
}
|
||||
|
||||
default:
|
||||
reporter->InternalError("unsupported type %d for CopyValue", val->type);
|
||||
zeek::reporter->InternalError("unsupported type %d for CopyValue", val->type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2189,7 +2199,7 @@ zeek::Val* Manager::ValueToVal(const Stream* i, const Value* val, zeek::Type* re
|
|||
|
||||
if ( request_type->Tag() != zeek::TYPE_ANY && request_type->Tag() != val->type )
|
||||
{
|
||||
reporter->InternalError("Typetags don't match: %d vs %d in stream %s", request_type->Tag(), val->type, i->name.c_str());
|
||||
zeek::reporter->InternalError("Typetags don't match: %d vs %d in stream %s", request_type->Tag(), val->type, i->name.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -2334,7 +2344,7 @@ zeek::Val* Manager::ValueToVal(const Stream* i, const Value* val, zeek::Type* re
|
|||
}
|
||||
|
||||
default:
|
||||
reporter->InternalError("Unsupported type for input_read in stream %s", i->name.c_str());
|
||||
zeek::reporter->InternalError("Unsupported type for input_read in stream %s", i->name.c_str());
|
||||
}
|
||||
|
||||
assert(false);
|
||||
|
@ -2381,7 +2391,7 @@ void Manager::Info(ReaderFrontend* reader, const char* msg) const
|
|||
Stream *i = FindStream(reader);
|
||||
if ( !i )
|
||||
{
|
||||
reporter->Error("Stream not found in Info; lost message: %s", msg);
|
||||
zeek::reporter->Error("Stream not found in Info; lost message: %s", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2393,7 +2403,7 @@ void Manager::Warning(ReaderFrontend* reader, const char* msg) const
|
|||
Stream *i = FindStream(reader);
|
||||
if ( !i )
|
||||
{
|
||||
reporter->Error("Stream not found in Warning; lost message: %s", msg);
|
||||
zeek::reporter->Error("Stream not found in Warning; lost message: %s", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2405,7 +2415,7 @@ void Manager::Error(ReaderFrontend* reader, const char* msg) const
|
|||
Stream *i = FindStream(reader);
|
||||
if ( !i )
|
||||
{
|
||||
reporter->Error("Stream not found in Error; lost message: %s", msg);
|
||||
zeek::reporter->Error("Stream not found in Error; lost message: %s", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2451,7 +2461,7 @@ void Manager::ErrorHandler(const Stream* i, ErrorType et, bool reporter_send, co
|
|||
int n = vasprintf(&buf, fmt, ap);
|
||||
if ( n < 0 || buf == nullptr )
|
||||
{
|
||||
reporter->InternalError("Could not format error message %s for stream %s", fmt, i->name.c_str());
|
||||
zeek::reporter->InternalError("Could not format error message %s for stream %s", fmt, i->name.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2474,7 +2484,7 @@ void Manager::ErrorHandler(const Stream* i, ErrorType et, bool reporter_send, co
|
|||
break;
|
||||
|
||||
default:
|
||||
reporter->InternalError("Unknown error type while trying to report input error %s", fmt);
|
||||
zeek::reporter->InternalError("Unknown error type while trying to report input error %s", fmt);
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
|
@ -2487,19 +2497,19 @@ void Manager::ErrorHandler(const Stream* i, ErrorType et, bool reporter_send, co
|
|||
switch (et)
|
||||
{
|
||||
case ErrorType::INFO:
|
||||
reporter->Info("%s", buf);
|
||||
zeek::reporter->Info("%s", buf);
|
||||
break;
|
||||
|
||||
case ErrorType::WARNING:
|
||||
reporter->Warning("%s", buf);
|
||||
zeek::reporter->Warning("%s", buf);
|
||||
break;
|
||||
|
||||
case ErrorType::ERROR:
|
||||
reporter->Error("%s", buf);
|
||||
zeek::reporter->Error("%s", buf);
|
||||
break;
|
||||
|
||||
default:
|
||||
reporter->InternalError("Unknown error type while trying to report input error %s", fmt);
|
||||
zeek::reporter->InternalError("Unknown error type while trying to report input error %s", fmt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ void ReaderFrontend::Init(const int arg_num_fields,
|
|||
return;
|
||||
|
||||
if ( initialized )
|
||||
reporter->InternalError("reader initialize twice");
|
||||
zeek::reporter->InternalError("reader initialize twice");
|
||||
|
||||
num_fields = arg_num_fields;
|
||||
fields = arg_fields;
|
||||
|
@ -85,7 +85,7 @@ void ReaderFrontend::Update()
|
|||
|
||||
if ( ! initialized )
|
||||
{
|
||||
reporter->Error("Tried to call update on uninitialized reader");
|
||||
zeek::reporter->Error("Tried to call update on uninitialized reader");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ std::unique_lock<std::mutex> Raw::AcquireForkMutex()
|
|||
|
||||
catch ( const std::system_error& e )
|
||||
{
|
||||
reporter->FatalErrorWithCore("cannot lock fork mutex: %s", e.what());
|
||||
zeek::reporter->FatalErrorWithCore("cannot lock fork mutex: %s", e.what());
|
||||
}
|
||||
|
||||
return lock;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue