Plugins: Clean up explicit uses of namespaces in places where they're not necessary.

This commit covers all of the plugin classes.
This commit is contained in:
Tim Wojtulewicz 2020-08-21 09:45:16 -07:00
parent fe0c22c789
commit 70c2397f69
169 changed files with 3139 additions and 3141 deletions

View file

@ -11,30 +11,30 @@
namespace zeek::file_analysis::detail {
DataEvent::DataEvent(zeek::RecordValPtr args, zeek::file_analysis::File* file,
zeek::EventHandlerPtr ce, zeek::EventHandlerPtr se)
: file_analysis::Analyzer(zeek::file_mgr->GetComponentTag("DATA_EVENT"),
DataEvent::DataEvent(RecordValPtr args, file_analysis::File* file,
EventHandlerPtr ce, EventHandlerPtr se)
: file_analysis::Analyzer(file_mgr->GetComponentTag("DATA_EVENT"),
std::move(args), file),
chunk_event(ce), stream_event(se)
{
}
zeek::file_analysis::Analyzer* DataEvent::Instantiate(zeek::RecordValPtr args,
zeek::file_analysis::File* file)
file_analysis::Analyzer* DataEvent::Instantiate(RecordValPtr args,
file_analysis::File* file)
{
const auto& chunk_val = args->GetField("chunk_event");
const auto& stream_val = args->GetField("stream_event");
if ( ! chunk_val && ! stream_val ) return nullptr;
zeek::EventHandlerPtr chunk;
zeek::EventHandlerPtr stream;
EventHandlerPtr chunk;
EventHandlerPtr stream;
if ( chunk_val )
chunk = zeek::event_registry->Lookup(chunk_val->AsFunc()->Name());
chunk = event_registry->Lookup(chunk_val->AsFunc()->Name());
if ( stream_val )
stream = zeek::event_registry->Lookup(stream_val->AsFunc()->Name());
stream = event_registry->Lookup(stream_val->AsFunc()->Name());
return new DataEvent(std::move(args), file, chunk, stream);
}
@ -43,10 +43,10 @@ bool DataEvent::DeliverChunk(const u_char* data, uint64_t len, uint64_t offset)
{
if ( ! chunk_event ) return true;
zeek::event_mgr.Enqueue(chunk_event,
GetFile()->ToVal(),
zeek::make_intrusive<zeek::StringVal>(new zeek::String(data, len, false)),
zeek::val_mgr->Count(offset)
event_mgr.Enqueue(chunk_event,
GetFile()->ToVal(),
make_intrusive<StringVal>(new String(data, len, false)),
val_mgr->Count(offset)
);
return true;
@ -56,9 +56,9 @@ bool DataEvent::DeliverStream(const u_char* data, uint64_t len)
{
if ( ! stream_event ) return true;
zeek::event_mgr.Enqueue(stream_event,
GetFile()->ToVal(),
zeek::make_intrusive<zeek::StringVal>(new zeek::String(data, len, false))
event_mgr.Enqueue(stream_event,
GetFile()->ToVal(),
make_intrusive<StringVal>(new String(data, len, false))
);
return true;

View file

@ -14,7 +14,7 @@ namespace zeek::file_analysis::detail {
/**
* An analyzer to send file data to script-layer via events.
*/
class DataEvent : public zeek::file_analysis::Analyzer {
class DataEvent : public file_analysis::Analyzer {
public:
/**
@ -43,8 +43,8 @@ public:
* @return the new DataEvent analyzer instance or a null pointer if
* no "chunk_event" or "stream_event" field was specfied in \a args.
*/
static zeek::file_analysis::Analyzer* Instantiate(zeek::RecordValPtr args,
zeek::file_analysis::File* file);
static file_analysis::Analyzer* Instantiate(RecordValPtr args,
file_analysis::File* file);
protected:
@ -57,12 +57,12 @@ protected:
* @param se pointer to event handler which will be called to receive
* sequential file data.
*/
DataEvent(zeek::RecordValPtr args, zeek::file_analysis::File* file,
zeek::EventHandlerPtr ce, zeek::EventHandlerPtr se);
DataEvent(RecordValPtr args, file_analysis::File* file,
EventHandlerPtr ce, EventHandlerPtr se);
private:
zeek::EventHandlerPtr chunk_event;
zeek::EventHandlerPtr stream_event;
EventHandlerPtr chunk_event;
EventHandlerPtr stream_event;
};
} // namespace zeek::file_analysis::detail