Merge remote-tracking branch 'origin/topic/timw/clang-tidy-fixups'

* origin/topic/timw/clang-tidy-fixups:
  Remove unused state_label() method from ssl analyzer binpac files
  Mark some overridden functions with override keyword
  Use emplace_back over push_back where appropriate
  packet_analysis: Define all plugin type as final
  Use std::make_unique in one place instead of declaring unique_ptr directly
  Avoid unnecessary type names in return statements
  Simplify type trait usage (remove ::value usage)
  A handful of int-to-bool conversions
  Replace empty destructor bodies with =default definitions
  Reduce amount of files passed to clang-tidy
This commit is contained in:
Tim Wojtulewicz 2023-07-07 09:56:56 -07:00
commit c23ee30542
148 changed files with 311 additions and 384 deletions

22
CHANGES
View file

@ -1,3 +1,25 @@
6.1.0-dev.190 | 2023-07-07 09:56:56 -0700
* Remove unused state_label() method from ssl analyzer binpac files (Tim Wojtulewicz)
* Mark some overridden functions with override keyword (Tim Wojtulewicz)
* Use emplace_back over push_back where appropriate (Tim Wojtulewicz)
* packet_analysis: Define all plugin type as final (Tim Wojtulewicz)
* Use std::make_unique in one place instead of declaring unique_ptr directly (Tim Wojtulewicz)
* Avoid unnecessary type names in return statements (Tim Wojtulewicz)
* Simplify type trait usage (remove ::value usage) (Tim Wojtulewicz)
* A handful of int-to-bool conversions (Tim Wojtulewicz)
* Replace empty destructor bodies with =default definitions (Tim Wojtulewicz)
* Reduce amount of files passed to clang-tidy (Tim Wojtulewicz)
6.1.0-dev.179 | 2023-07-07 11:45:53 +0200 6.1.0-dev.179 | 2023-07-07 11:45:53 +0200
* GH-3157: [Spicy] Support `switch` fields when exporting Spicy types to Zeek. (Robin Sommer, Corelight) * GH-3157: [Spicy] Support `switch` fields when exporting Spicy types to Zeek. (Robin Sommer, Corelight)

View file

@ -1 +1 @@
6.1.0-dev.179 6.1.0-dev.190

View file

@ -502,10 +502,14 @@ set(zeek_SRCS
${FLEX_Scanner_INPUT} ${FLEX_Scanner_INPUT}
${BISON_Parser_INPUT} ${BISON_Parser_INPUT}
${CMAKE_CURRENT_BINARY_DIR}/DebugCmdConstants.h ${CMAKE_CURRENT_BINARY_DIR}/DebugCmdConstants.h
${CMAKE_CURRENT_BINARY_DIR}/ZAM-MethodDecls.h ${CMAKE_CURRENT_BINARY_DIR}/ZAM-MethodDecls.h)
${THIRD_PARTY_SRCS}
${HH_SRCS} # Add the above files to the list of clang tidy sources before adding the third party and HH
${MAIN_SRCS}) # sources. Also, the main_SRCS will get added to that list separately.
add_clang_tidy_files(${zeek_SRCS})
list(APPEND zeek_SRCS ${THIRD_PARTY_SRCS})
list(APPEND zeek_SRCS ${HH_SRCS})
list(APPEND zeek_SRCS ${MAIN_SRCS})
collect_headers(zeek_HEADERS ${zeek_SRCS}) collect_headers(zeek_HEADERS ${zeek_SRCS})
@ -515,7 +519,6 @@ set_target_properties(zeek_objs PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(zeek_objs PRIVATE $<BUILD_INTERFACE:zeek_internal>) target_link_libraries(zeek_objs PRIVATE $<BUILD_INTERFACE:zeek_internal>)
target_compile_definitions(zeek_objs PRIVATE ZEEK_CONFIG_SKIP_VERSION_H) target_compile_definitions(zeek_objs PRIVATE ZEEK_CONFIG_SKIP_VERSION_H)
add_dependencies(zeek_objs zeek_autogen_files) add_dependencies(zeek_objs zeek_autogen_files)
add_clang_tidy_files(${zeek_SRCS})
zeek_target_link_libraries(zeek_objs) zeek_target_link_libraries(zeek_objs)
if (HAVE_SPICY) if (HAVE_SPICY)

View file

@ -929,7 +929,7 @@ bool CompositeHash::ReserveSingleTypeKeySize(HashKey& hk, Type* bt, const Val* v
{ {
reporter->InternalError( reporter->InternalError(
"bad index type in CompositeHash::ReserveSingleTypeKeySize"); "bad index type in CompositeHash::ReserveSingleTypeKeySize");
return 0; return false;
} }
} }

View file

@ -63,7 +63,7 @@ DNS_Mapping::DNS_Mapping(FILE* f)
else else
req_addr = IPAddr(req_buf); req_addr = IPAddr(req_buf);
names.push_back(name_buf); names.emplace_back(name_buf);
for ( int i = 0; i < num_addrs; ++i ) for ( int i = 0; i < num_addrs; ++i )
{ {
@ -74,7 +74,7 @@ DNS_Mapping::DNS_Mapping(FILE* f)
if ( newline ) if ( newline )
*newline = '\0'; *newline = '\0';
addrs.emplace_back(IPAddr(buf)); addrs.emplace_back(buf);
} }
init_failed = false; init_failed = false;
@ -134,16 +134,16 @@ void DNS_Mapping::Init(struct hostent* h)
if ( h->h_name ) if ( h->h_name )
// for now, just use the official name // for now, just use the official name
// TODO: this could easily be expanded to include all of the aliases as well // TODO: this could easily be expanded to include all of the aliases as well
names.push_back(h->h_name); names.emplace_back(h->h_name);
if ( h->h_addr_list ) if ( h->h_addr_list )
{ {
for ( int i = 0; h->h_addr_list[i] != NULL; ++i ) for ( int i = 0; h->h_addr_list[i] != NULL; ++i )
{ {
if ( h->h_addrtype == AF_INET ) if ( h->h_addrtype == AF_INET )
addrs.push_back(IPAddr(IPv4, (uint32_t*)h->h_addr_list[i], IPAddr::Network)); addrs.emplace_back(IPv4, (uint32_t*)h->h_addr_list[i], IPAddr::Network);
else if ( h->h_addrtype == AF_INET6 ) else if ( h->h_addrtype == AF_INET6 )
addrs.push_back(IPAddr(IPv6, (uint32_t*)h->h_addr_list[i], IPAddr::Network)); addrs.emplace_back(IPv6, (uint32_t*)h->h_addr_list[i], IPAddr::Network);
} }
} }

View file

@ -206,7 +206,7 @@ class DNS_Request
public: public:
DNS_Request(std::string host, int request_type, bool async = false); DNS_Request(std::string host, int request_type, bool async = false);
DNS_Request(const IPAddr& addr, bool async = false); DNS_Request(const IPAddr& addr, bool async = false);
~DNS_Request(); ~DNS_Request() = default;
std::string Host() const { return host; } std::string Host() const { return host; }
const IPAddr& Addr() const { return addr; } const IPAddr& Addr() const { return addr; }
@ -241,8 +241,6 @@ DNS_Request::DNS_Request(const IPAddr& addr, bool async) : addr(addr), async(asy
request_type = T_PTR; request_type = T_PTR;
} }
DNS_Request::~DNS_Request() { }
void DNS_Request::MakeRequest(ares_channel channel, DNS_Mgr* mgr) void DNS_Request::MakeRequest(ares_channel channel, DNS_Mgr* mgr)
{ {
// This needs to get deleted at the end of the callback method. // This needs to get deleted at the end of the callback method.
@ -1612,7 +1610,7 @@ class TestDNS_Mgr final : public DNS_Mgr
{ {
public: public:
explicit TestDNS_Mgr(DNS_MgrMode mode) : DNS_Mgr(mode) { } explicit TestDNS_Mgr(DNS_MgrMode mode) : DNS_Mgr(mode) { }
void Process(); void Process() override;
}; };
void TestDNS_Mgr::Process() void TestDNS_Mgr::Process()

View file

@ -342,7 +342,7 @@ static void parse_function_name(vector<ParseLocationRec>& result, ParseLocationR
vector<ParseLocationRec> parse_location_string(const string& s) vector<ParseLocationRec> parse_location_string(const string& s)
{ {
vector<ParseLocationRec> result; vector<ParseLocationRec> result;
result.push_back(ParseLocationRec()); result.emplace_back();
ParseLocationRec& plr = result[0]; ParseLocationRec& plr = result[0];
// If PLR_FILE_AND_LINE, set this to the filename you want; for // If PLR_FILE_AND_LINE, set this to the filename you want; for
@ -531,7 +531,7 @@ void tokenize(const char* cstr, string& operation, vector<string>& arguments)
if ( ! num_tokens ) if ( ! num_tokens )
operation = string(str, start, len); operation = string(str, start, len);
else else
arguments.push_back(string(str, start, len)); arguments.emplace_back(str, start, len);
++num_tokens; ++num_tokens;
} }

View file

@ -388,10 +388,10 @@ int dbg_cmd_break(DebugCmd cmd, const vector<string>& args)
vector<ID*> choices; vector<ID*> choices;
choose_global_symbols_regex(args[0], choices, true); choose_global_symbols_regex(args[0], choices, true);
for ( unsigned int i = 0; i < choices.size(); ++i ) for ( unsigned int i = 0; i < choices.size(); ++i )
locstrings.push_back(choices[i]->Name()); locstrings.emplace_back(choices[i]->Name());
} }
else else
locstrings.push_back(args[0].c_str()); locstrings.push_back(args[0]);
for ( unsigned int strindex = 0; strindex < locstrings.size(); ++strindex ) for ( unsigned int strindex = 0; strindex < locstrings.size(); ++strindex )
{ {

View file

@ -267,28 +267,26 @@ size_t ODesc::StartsWithEscapeSequence(const char* start, const char* end)
std::pair<const char*, size_t> ODesc::FirstEscapeLoc(const char* bytes, size_t n) std::pair<const char*, size_t> ODesc::FirstEscapeLoc(const char* bytes, size_t n)
{ {
using escape_pos = std::pair<const char*, size_t>;
if ( IsBinary() ) if ( IsBinary() )
return escape_pos(0, 0); return {nullptr, 0};
for ( size_t i = 0; i < n; ++i ) for ( size_t i = 0; i < n; ++i )
{ {
auto printable = isprint(bytes[i]); auto printable = isprint(bytes[i]);
if ( ! printable && ! utf8 ) if ( ! printable && ! utf8 )
return escape_pos(bytes + i, 1); return {bytes + i, 1};
if ( bytes[i] == '\\' ) if ( bytes[i] == '\\' )
return escape_pos(bytes + i, 1); return {bytes + i, 1};
size_t len = StartsWithEscapeSequence(bytes + i, bytes + n); size_t len = StartsWithEscapeSequence(bytes + i, bytes + n);
if ( len ) if ( len )
return escape_pos(bytes + i, len); return {bytes + i, len};
} }
return escape_pos(nullptr, 0); return {nullptr, 0};
} }
void ODesc::AddBytes(const void* bytes, unsigned int n) void ODesc::AddBytes(const void* bytes, unsigned int n)
@ -429,7 +427,7 @@ std::string obj_desc(const Obj* o)
d.SP(); d.SP();
o->GetLocationInfo()->Describe(&d); o->GetLocationInfo()->Describe(&d);
return std::string(d.Description()); return d.Description();
} }
std::string obj_desc_short(const Obj* o) std::string obj_desc_short(const Obj* o)
@ -440,7 +438,7 @@ std::string obj_desc_short(const Obj* o)
d.Clear(); d.Clear();
o->Describe(&d); o->Describe(&d);
return std::string(d.Description()); return d.Description();
} }
} // namespace zeek } // namespace zeek

View file

@ -340,7 +340,7 @@ class DictTestDummy
{ {
public: public:
DictTestDummy(int v) : v(v) { } DictTestDummy(int v) : v(v) { }
~DictTestDummy() { } ~DictTestDummy() = default;
int v = 0; int v = 0;
}; };

View file

@ -27,8 +27,6 @@ Discarder::Discarder()
discarder_maxlen = static_cast<int>(id::find_val("discarder_maxlen")->AsCount()); discarder_maxlen = static_cast<int>(id::find_val("discarder_maxlen")->AsCount());
} }
Discarder::~Discarder() { }
bool Discarder::IsActive() bool Discarder::IsActive()
{ {
return check_ip || check_tcp || check_udp || check_icmp; return check_ip || check_tcp || check_udp || check_icmp;

View file

@ -18,11 +18,11 @@ using FuncPtr = IntrusivePtr<Func>;
namespace detail namespace detail
{ {
class Discarder class Discarder final
{ {
public: public:
Discarder(); Discarder();
~Discarder(); ~Discarder() = default;
bool IsActive(); bool IsActive();

View file

@ -169,8 +169,6 @@ EventGroupPtr EventRegistry::LookupGroup(EventGroupKind kind, std::string_view n
EventGroup::EventGroup(EventGroupKind kind, std::string_view name) : kind(kind), name(name) { } EventGroup::EventGroup(EventGroupKind kind, std::string_view name) : kind(kind), name(name) { }
EventGroup::~EventGroup() noexcept { }
// Run through all ScriptFunc instances associated with this group and // Run through all ScriptFunc instances associated with this group and
// update their bodies after a group's enable/disable state has changed. // update their bodies after a group's enable/disable state has changed.
// Once that has completed, also update the Func's has_enabled_bodies // Once that has completed, also update the Func's has_enabled_bodies

View file

@ -37,7 +37,7 @@ using ScriptFuncPtr = zeek::IntrusivePtr<ScriptFunc>;
} }
// The registry keeps track of all events that we provide or handle. // The registry keeps track of all events that we provide or handle.
class EventRegistry class EventRegistry final
{ {
public: public:
EventRegistry(); EventRegistry();
@ -135,11 +135,11 @@ private:
* bodies of the tracked ScriptFuncs and updates them to reflect the current * bodies of the tracked ScriptFuncs and updates them to reflect the current
* group state. * group state.
*/ */
class EventGroup class EventGroup final
{ {
public: public:
EventGroup(EventGroupKind kind, std::string_view name); EventGroup(EventGroupKind kind, std::string_view name);
~EventGroup() noexcept; ~EventGroup() noexcept = default;
EventGroup(const EventGroup& g) = delete; EventGroup(const EventGroup& g) = delete;
EventGroup& operator=(const EventGroup&) = delete; EventGroup& operator=(const EventGroup&) = delete;

View file

@ -101,8 +101,6 @@ ValTrace::ValTrace(const ValPtr& _v) : v(_v)
} }
} }
ValTrace::~ValTrace() { }
bool ValTrace::operator==(const ValTrace& vt) const bool ValTrace::operator==(const ValTrace& vt) const
{ {
auto& vt_v = vt.GetVal(); auto& vt_v = vt.GetVal();

View file

@ -47,7 +47,7 @@ class ValTrace
{ {
public: public:
ValTrace(const ValPtr& v); ValTrace(const ValPtr& v);
~ValTrace(); ~ValTrace() = default;
const ValPtr& GetVal() const { return v; } const ValPtr& GetVal() const { return v; }
const TypePtr& GetType() const { return t; } const TypePtr& GetType() const { return t; }

View file

@ -4237,8 +4237,6 @@ TableCoerceExpr::TableCoerceExpr(ExprPtr arg_op, TableTypePtr tt, bool type_chec
ExprError("coercion of non-table/set to table/set"); ExprError("coercion of non-table/set to table/set");
} }
TableCoerceExpr::~TableCoerceExpr() { }
ValPtr TableCoerceExpr::Fold(Val* v) const ValPtr TableCoerceExpr::Fold(Val* v) const
{ {
TableVal* tv = v->AsTableVal(); TableVal* tv = v->AsTableVal();
@ -4264,8 +4262,6 @@ VectorCoerceExpr::VectorCoerceExpr(ExprPtr arg_op, VectorTypePtr v)
ExprError("coercion of non-vector to vector"); ExprError("coercion of non-vector to vector");
} }
VectorCoerceExpr::~VectorCoerceExpr() { }
ValPtr VectorCoerceExpr::Fold(Val* v) const ValPtr VectorCoerceExpr::Fold(Val* v) const
{ {
VectorVal* vv = v->AsVectorVal(); VectorVal* vv = v->AsVectorVal();
@ -4281,8 +4277,6 @@ ScheduleTimer::ScheduleTimer(const EventHandlerPtr& arg_event, Args arg_args, do
{ {
} }
ScheduleTimer::~ScheduleTimer() { }
void ScheduleTimer::Dispatch(double /* t */, bool /* is_expire */) void ScheduleTimer::Dispatch(double /* t */, bool /* is_expire */)
{ {
if ( event ) if ( event )

View file

@ -1330,7 +1330,7 @@ class TableCoerceExpr final : public UnaryExpr
{ {
public: public:
TableCoerceExpr(ExprPtr op, TableTypePtr r, bool type_check = true); TableCoerceExpr(ExprPtr op, TableTypePtr r, bool type_check = true);
~TableCoerceExpr() override; ~TableCoerceExpr() override = default;
// Optimization-related: // Optimization-related:
ExprPtr Duplicate() override; ExprPtr Duplicate() override;
@ -1343,7 +1343,7 @@ class VectorCoerceExpr final : public UnaryExpr
{ {
public: public:
VectorCoerceExpr(ExprPtr op, VectorTypePtr v); VectorCoerceExpr(ExprPtr op, VectorTypePtr v);
~VectorCoerceExpr() override; ~VectorCoerceExpr() override = default;
// Optimization-related: // Optimization-related:
ExprPtr Duplicate() override; ExprPtr Duplicate() override;
@ -1356,7 +1356,7 @@ class ScheduleTimer final : public Timer
{ {
public: public:
ScheduleTimer(const EventHandlerPtr& event, zeek::Args args, double t); ScheduleTimer(const EventHandlerPtr& event, zeek::Args args, double t);
~ScheduleTimer() override; ~ScheduleTimer() override = default;
void Dispatch(double t, bool is_expire) override; void Dispatch(double t, bool is_expire) override;

View file

@ -148,7 +148,7 @@ bool File::Open(FILE* file, const char* mode)
} }
is_open = true; is_open = true;
open_files.emplace_back(std::make_pair(name, this)); open_files.emplace_back(name, this);
RaiseOpenEvent(); RaiseOpenEvent();

View file

@ -801,8 +801,6 @@ BuiltinFunc::BuiltinFunc(built_in_func arg_func, const char* arg_name, bool arg_
id->SetConst(); id->SetConst();
} }
BuiltinFunc::~BuiltinFunc() { }
bool BuiltinFunc::IsPure() const bool BuiltinFunc::IsPure() const
{ {
return is_pure; return is_pure;

View file

@ -336,7 +336,7 @@ class BuiltinFunc final : public Func
{ {
public: public:
BuiltinFunc(built_in_func func, const char* name, bool is_pure); BuiltinFunc(built_in_func func, const char* name, bool is_pure);
~BuiltinFunc() override; ~BuiltinFunc() override = default;
bool IsPure() const override; bool IsPure() const override;
ValPtr Invoke(zeek::Args* args, Frame* parent) const override; ValPtr Invoke(zeek::Args* args, Frame* parent) const override;

View file

@ -27,21 +27,20 @@ alignas(16) unsigned long long KeyedHash::shared_siphash_key[2];
// we use the following lines to not pull in the highwayhash headers in Hash.h - but to check the // we use the following lines to not pull in the highwayhash headers in Hash.h - but to check the
// types did not change underneath us. // types did not change underneath us.
static_assert(std::is_same<hash64_t, highwayhash::HHResult64>::value, static_assert(std::is_same_v<hash64_t, highwayhash::HHResult64>,
"Highwayhash return values must match hash_x_t"); "Highwayhash return values must match hash_x_t");
static_assert(std::is_same<hash128_t, highwayhash::HHResult128>::value, static_assert(std::is_same_v<hash128_t, highwayhash::HHResult128>,
"Highwayhash return values must match hash_x_t"); "Highwayhash return values must match hash_x_t");
static_assert(std::is_same<hash256_t, highwayhash::HHResult256>::value, static_assert(std::is_same_v<hash256_t, highwayhash::HHResult256>,
"Highwayhash return values must match hash_x_t"); "Highwayhash return values must match hash_x_t");
void KeyedHash::InitializeSeeds(const std::array<uint32_t, SEED_INIT_SIZE>& seed_data) void KeyedHash::InitializeSeeds(const std::array<uint32_t, SEED_INIT_SIZE>& seed_data)
{ {
static_assert(std::is_same<decltype(KeyedHash::shared_siphash_key),
highwayhash::SipHashState::Key>::value,
"Highwayhash Key is not unsigned long long[2]");
static_assert( static_assert(
std::is_same<decltype(KeyedHash::shared_highwayhash_key), highwayhash::HHKey>::value, std::is_same_v<decltype(KeyedHash::shared_siphash_key), highwayhash::SipHashState::Key>,
"Highwayhash HHKey is not uint64_t[4]"); "Highwayhash Key is not unsigned long long[2]");
static_assert(std::is_same_v<decltype(KeyedHash::shared_highwayhash_key), highwayhash::HHKey>,
"Highwayhash HHKey is not uint64_t[4]");
if ( seeds_initialized ) if ( seeds_initialized )
return; return;

View file

@ -612,28 +612,29 @@ bool IPv6_Hdr_Chain::IsFragment() const
IPAddr IPv6_Hdr_Chain::SrcAddr() const IPAddr IPv6_Hdr_Chain::SrcAddr() const
{ {
if ( homeAddr ) if ( homeAddr )
return IPAddr(*homeAddr); return {*homeAddr};
if ( chain.empty() ) if ( chain.empty() )
{ {
reporter->InternalWarning("empty IPv6 header chain"); reporter->InternalWarning("empty IPv6 header chain");
return IPAddr(); return {};
} }
return IPAddr(((const struct ip6_hdr*)(chain[0]->Data()))->ip6_src); return IPAddr{((const struct ip6_hdr*)(chain[0]->Data()))->ip6_src};
} }
IPAddr IPv6_Hdr_Chain::DstAddr() const IPAddr IPv6_Hdr_Chain::DstAddr() const
{ {
if ( finalDst ) if ( finalDst )
return IPAddr(*finalDst); return {*finalDst};
if ( chain.empty() ) if ( chain.empty() )
{ {
reporter->InternalWarning("empty IPv6 header chain"); reporter->InternalWarning("empty IPv6 header chain");
return IPAddr(); return {};
} }
return IPAddr(((const struct ip6_hdr*)(chain[0]->Data()))->ip6_dst); return IPAddr{((const struct ip6_hdr*)(chain[0]->Data()))->ip6_dst};
} }
void IPv6_Hdr_Chain::ProcessRoutingHeader(const struct ip6_rthdr* r, uint16_t len) void IPv6_Hdr_Chain::ProcessRoutingHeader(const struct ip6_rthdr* r, uint16_t len)

View file

@ -50,8 +50,6 @@ OpaqueMgr* OpaqueMgr::mgr()
OpaqueVal::OpaqueVal(OpaqueTypePtr t) : Val(std::move(t)) { } OpaqueVal::OpaqueVal(OpaqueTypePtr t) : Val(std::move(t)) { }
OpaqueVal::~OpaqueVal() { }
const std::string& OpaqueMgr::TypeID(const OpaqueVal* v) const const std::string& OpaqueMgr::TypeID(const OpaqueVal* v) const
{ {
auto x = _types.find(v->OpaqueName()); auto x = _types.find(v->OpaqueName());

View file

@ -118,7 +118,7 @@ class OpaqueVal : public Val
{ {
public: public:
explicit OpaqueVal(OpaqueTypePtr t); explicit OpaqueVal(OpaqueTypePtr t);
~OpaqueVal() override; ~OpaqueVal() override = default;
/** /**
* Serializes the value into a Broker representation. * Serializes the value into a Broker representation.

View file

@ -79,7 +79,7 @@ std::list<std::tuple<IPPrefix, void*>> PrefixTable::FindAll(const IPAddr& addr,
patricia_search_all(tree, prefix, &list, &elems); patricia_search_all(tree, prefix, &list, &elems);
for ( int i = 0; i < elems; ++i ) for ( int i = 0; i < elems; ++i )
out.push_back(std::make_tuple(PrefixToIPPrefix(list[i]->prefix), list[i]->data)); out.emplace_back(PrefixToIPPrefix(list[i]->prefix), list[i]->data);
Deref_Prefix(prefix); Deref_Prefix(prefix);
free(list); free(list);

View file

@ -203,7 +203,7 @@ std::string Specific_RE_Matcher::LookupDef(const std::string& def)
if ( iter != defs.end() ) if ( iter != defs.end() )
return iter->second; return iter->second;
return std::string(); return {};
} }
bool Specific_RE_Matcher::MatchAll(const char* s) bool Specific_RE_Matcher::MatchAll(const char* s)

View file

@ -24,12 +24,12 @@ void ScriptCoverageManager::AddStmt(Stmt* s)
if ( ignoring != 0 ) if ( ignoring != 0 )
return; return;
stmts.push_back({NewRef{}, s}); stmts.emplace_back(NewRef{}, s);
} }
void ScriptCoverageManager::AddFunction(IDPtr func_id, StmtPtr body) void ScriptCoverageManager::AddFunction(IDPtr func_id, StmtPtr body)
{ {
func_instances.push_back({func_id, body}); func_instances.emplace_back(func_id, body);
} }
bool ScriptCoverageManager::ReadStats() bool ScriptCoverageManager::ReadStats()

View file

@ -14,7 +14,7 @@ class BreakNextScriptValidation : public TraversalCallback
public: public:
BreakNextScriptValidation(bool _report) : report(_report) { } BreakNextScriptValidation(bool _report) : report(_report) { }
TraversalCode PreStmt(const Stmt* stmt) TraversalCode PreStmt(const Stmt* stmt) override
{ {
if ( ! StmtIsRelevant(stmt) ) if ( ! StmtIsRelevant(stmt) )
return TC_CONTINUE; return TC_CONTINUE;
@ -31,7 +31,7 @@ public:
return TC_CONTINUE; return TC_CONTINUE;
} }
TraversalCode PostStmt(const Stmt* stmt) TraversalCode PostStmt(const Stmt* stmt) override
{ {
if ( ! StmtIsRelevant(stmt) ) if ( ! StmtIsRelevant(stmt) )
return TC_CONTINUE; return TC_CONTINUE;
@ -43,7 +43,7 @@ public:
return TC_CONTINUE; return TC_CONTINUE;
} }
TraversalCode PreFunction(const zeek::Func* func) TraversalCode PreFunction(const zeek::Func* func) override
{ {
if ( func->Flavor() == zeek::FUNC_FLAVOR_HOOK ) if ( func->Flavor() == zeek::FUNC_FLAVOR_HOOK )
++hook_depth; ++hook_depth;
@ -53,7 +53,7 @@ public:
return TC_CONTINUE; return TC_CONTINUE;
} }
TraversalCode PostFunction(const zeek::Func* func) TraversalCode PostFunction(const zeek::Func* func) override
{ {
if ( func->Flavor() == zeek::FUNC_FLAVOR_HOOK ) if ( func->Flavor() == zeek::FUNC_FLAVOR_HOOK )
--hook_depth; --hook_depth;

View file

@ -103,10 +103,6 @@ bool SerializationFormat::WriteData(const void* b, size_t count)
return true; return true;
} }
BinarySerializationFormat::BinarySerializationFormat() { }
BinarySerializationFormat::~BinarySerializationFormat() { }
bool BinarySerializationFormat::Read(int* v, const char* tag) bool BinarySerializationFormat::Read(int* v, const char* tag)
{ {
uint32_t tmp; uint32_t tmp;

View file

@ -106,8 +106,8 @@ protected:
class BinarySerializationFormat final : public SerializationFormat class BinarySerializationFormat final : public SerializationFormat
{ {
public: public:
BinarySerializationFormat(); BinarySerializationFormat() = default;
~BinarySerializationFormat() override; ~BinarySerializationFormat() override = default;
bool Read(int* v, const char* tag) override; bool Read(int* v, const char* tag) override;
bool Read(uint16_t* v, const char* tag) override; bool Read(uint16_t* v, const char* tag) override;

View file

@ -37,7 +37,7 @@ const Substring& Substring::operator=(const Substring& bst)
void Substring::AddAlignment(const String* str, int index) void Substring::AddAlignment(const String* str, int index)
{ {
_aligns.push_back(BSSAlign(str, index)); _aligns.emplace_back(str, index);
} }
bool Substring::DoesCover(const Substring* bst) const bool Substring::DoesCover(const Substring* bst) const

View file

@ -2085,7 +2085,7 @@ void WhenInfo::BuildProfile()
if ( ! is_present ) if ( ! is_present )
{ {
IDPtr wl_ptr = {NewRef{}, const_cast<ID*>(wl)}; IDPtr wl_ptr = {NewRef{}, const_cast<ID*>(wl)};
cl->emplace_back(FuncType::Capture{wl_ptr, false}); cl->emplace_back(wl_ptr, false);
} }
// In addition, don't treat them as external locals that // In addition, don't treat them as external locals that
@ -2098,7 +2098,7 @@ void WhenInfo::BuildProfile()
// We need IDPtr versions of the locals so we can manipulate // We need IDPtr versions of the locals so we can manipulate
// them during script optimization. // them during script optimization.
auto non_const_w = const_cast<ID*>(w); auto non_const_w = const_cast<ID*>(w);
when_expr_locals.push_back({NewRef{}, non_const_w}); when_expr_locals.emplace_back(NewRef{}, non_const_w);
} }
} }

View file

@ -31,7 +31,7 @@ public:
{ {
} }
virtual TraversalCode PreExpr(const Expr*) override; TraversalCode PreExpr(const Expr*) override;
private: private:
IDSet& globals; IDSet& globals;
@ -76,7 +76,7 @@ public:
time = run_state::network_time; time = run_state::network_time;
} }
~TriggerTimer() { Unref(trigger); } ~TriggerTimer() override { Unref(trigger); }
void Dispatch(double t, bool is_expire) override void Dispatch(double t, bool is_expire) override
{ {
@ -398,7 +398,7 @@ void Trigger::Register(const ID* const_id)
notifier::detail::registry.Register(id, this); notifier::detail::registry.Register(id, this);
Ref(id); Ref(id);
objs.push_back({id, id}); objs.emplace_back(id, id);
} }
void Trigger::Register(Val* val) void Trigger::Register(Val* val)

View file

@ -1024,7 +1024,7 @@ class DirectManagedFieldInit final : public FieldInit
{ {
public: public:
DirectManagedFieldInit(ZVal _init_val) : init_val(_init_val) { } DirectManagedFieldInit(ZVal _init_val) : init_val(_init_val) { }
~DirectManagedFieldInit() { ZVal::DeleteManagedType(init_val); } ~DirectManagedFieldInit() override { ZVal::DeleteManagedType(init_val); }
ZVal Generate() const override ZVal Generate() const override
{ {
@ -1196,7 +1196,7 @@ void RecordType::AddField(unsigned int field, const TypeDecl* td)
else else
{ {
auto efi = std::make_unique<detail::ExprFieldInit>(def_expr, type); auto efi = std::make_unique<detail::ExprFieldInit>(def_expr, type);
creation_inits.emplace_back(std::make_pair(field, std::move(efi))); creation_inits.emplace_back(field, std::move(efi));
} }
} }
@ -1793,7 +1793,7 @@ EnumType::enum_name_list EnumType::Names() const
{ {
enum_name_list n; enum_name_list n;
for ( NameMap::const_iterator iter = names.begin(); iter != names.end(); ++iter ) for ( NameMap::const_iterator iter = names.begin(); iter != names.end(); ++iter )
n.push_back(std::make_pair(iter->first, iter->second)); n.emplace_back(iter->first, iter->second);
return n; return n;
} }

View file

@ -956,13 +956,13 @@ const char* StringVal::CheckString() const
string StringVal::ToStdString() const string StringVal::ToStdString() const
{ {
auto* bs = AsString(); auto* bs = AsString();
return string((char*)bs->Bytes(), bs->Len()); return {(char*)bs->Bytes(), static_cast<size_t>(bs->Len())};
} }
string_view StringVal::ToStdStringView() const string_view StringVal::ToStdStringView() const
{ {
auto* bs = AsString(); auto* bs = AsString();
return string_view((char*)bs->Bytes(), bs->Len()); return {(char*)bs->Bytes(), static_cast<size_t>(bs->Len())};
} }
StringVal* StringVal::ToUpper() StringVal* StringVal::ToUpper()
@ -1012,7 +1012,7 @@ StringValPtr StringVal::Replace(RE_Matcher* re, const String& repl, bool do_all)
break; break;
// s[offset .. offset+end_of_match-1] matches re. // s[offset .. offset+end_of_match-1] matches re.
cut_points.push_back({offset, offset + end_of_match}); cut_points.emplace_back(offset, offset + end_of_match);
offset += end_of_match; offset += end_of_match;
n -= end_of_match; n -= end_of_match;
@ -1563,8 +1563,6 @@ ListVal::ListVal(TypeTag t) : Val(make_intrusive<TypeList>(t == TYPE_ANY ? nullp
tag = t; tag = t;
} }
ListVal::~ListVal() { }
ValPtr ListVal::SizeVal() const ValPtr ListVal::SizeVal() const
{ {
return val_mgr->Count(vals.size()); return val_mgr->Count(vals.size());

View file

@ -663,7 +663,7 @@ class ListVal final : public Val
public: public:
explicit ListVal(TypeTag t); explicit ListVal(TypeTag t);
~ListVal() override; ~ListVal() override = default;
TypeTag BaseTag() const { return tag; } TypeTag BaseTag() const { return tag; }

View file

@ -20,7 +20,7 @@ public:
AnalyzerTimer(Analyzer* arg_analyzer, analyzer_timer_func arg_timer, double arg_t, AnalyzerTimer(Analyzer* arg_analyzer, analyzer_timer_func arg_timer, double arg_t,
int arg_do_expire, zeek::detail::TimerType arg_type); int arg_do_expire, zeek::detail::TimerType arg_type);
virtual ~AnalyzerTimer(); ~AnalyzerTimer() override;
void Dispatch(double t, bool is_expire) override; void Dispatch(double t, bool is_expire) override;

View file

@ -21,8 +21,6 @@ ConnSize_Analyzer::ConnSize_Analyzer(Connection* c)
start_time = c->StartTime(); start_time = c->StartTime();
} }
ConnSize_Analyzer::~ConnSize_Analyzer() { }
void ConnSize_Analyzer::Init() void ConnSize_Analyzer::Init()
{ {
Analyzer::Init(); Analyzer::Init();

View file

@ -12,7 +12,7 @@ class ConnSize_Analyzer : public analyzer::Analyzer
{ {
public: public:
explicit ConnSize_Analyzer(Connection* c); explicit ConnSize_Analyzer(Connection* c);
~ConnSize_Analyzer() override; ~ConnSize_Analyzer() override = default;
void Init() override; void Init() override;
void Done() override; void Done() override;

View file

@ -403,8 +403,6 @@ DNP3_TCP_Analyzer::DNP3_TCP_Analyzer(Connection* c)
{ {
} }
DNP3_TCP_Analyzer::~DNP3_TCP_Analyzer() { }
void DNP3_TCP_Analyzer::Done() void DNP3_TCP_Analyzer::Done()
{ {
TCP_ApplicationAnalyzer::Done(); TCP_ApplicationAnalyzer::Done();
@ -444,8 +442,6 @@ void DNP3_TCP_Analyzer::EndpointEOF(bool is_orig)
DNP3_UDP_Analyzer::DNP3_UDP_Analyzer(Connection* c) : DNP3_Base(this), Analyzer("DNP3_UDP", c) { } DNP3_UDP_Analyzer::DNP3_UDP_Analyzer(Connection* c) : DNP3_Base(this), Analyzer("DNP3_UDP", c) { }
DNP3_UDP_Analyzer::~DNP3_UDP_Analyzer() { }
void DNP3_UDP_Analyzer::DeliverPacket(int len, const u_char* data, bool orig, uint64_t seq, void DNP3_UDP_Analyzer::DeliverPacket(int len, const u_char* data, bool orig, uint64_t seq,
const IP_Hdr* ip, int caplen) const IP_Hdr* ip, int caplen)
{ {

View file

@ -71,7 +71,7 @@ class DNP3_TCP_Analyzer : public detail::DNP3_Base, public analyzer::tcp::TCP_Ap
{ {
public: public:
explicit DNP3_TCP_Analyzer(Connection* conn); explicit DNP3_TCP_Analyzer(Connection* conn);
~DNP3_TCP_Analyzer() override; ~DNP3_TCP_Analyzer() override = default;
void Done() override; void Done() override;
void DeliverStream(int len, const u_char* data, bool orig) override; void DeliverStream(int len, const u_char* data, bool orig) override;
@ -85,7 +85,7 @@ class DNP3_UDP_Analyzer : public detail::DNP3_Base, public analyzer::Analyzer
{ {
public: public:
explicit DNP3_UDP_Analyzer(Connection* conn); explicit DNP3_UDP_Analyzer(Connection* conn);
~DNP3_UDP_Analyzer() override; ~DNP3_UDP_Analyzer() override = default;
void DeliverPacket(int len, const u_char* data, bool orig, uint64_t seq, const IP_Hdr* ip, void DeliverPacket(int len, const u_char* data, bool orig, uint64_t seq, const IP_Hdr* ip,
int caplen) override; int caplen) override;

View file

@ -30,8 +30,6 @@ Contents_Rsh_Analyzer::Contents_Rsh_Analyzer(Connection* conn, bool orig,
} }
} }
Contents_Rsh_Analyzer::~Contents_Rsh_Analyzer() { }
void Contents_Rsh_Analyzer::DoDeliver(int len, const u_char* data) void Contents_Rsh_Analyzer::DoDeliver(int len, const u_char* data)
{ {
int endp_state; int endp_state;

View file

@ -28,7 +28,7 @@ class Contents_Rsh_Analyzer final : public analyzer::tcp::ContentLine_Analyzer
{ {
public: public:
Contents_Rsh_Analyzer(Connection* conn, bool orig, Rsh_Analyzer* analyzer); Contents_Rsh_Analyzer(Connection* conn, bool orig, Rsh_Analyzer* analyzer);
~Contents_Rsh_Analyzer() override; ~Contents_Rsh_Analyzer() override = default;
rsh_state RshSaveState() const { return save_state; } rsh_state RshSaveState() const { return save_state; }

View file

@ -26,8 +26,6 @@ Contents_Rlogin_Analyzer::Contents_Rlogin_Analyzer(Connection* conn, bool orig,
state = save_state = RLOGIN_SERVER_ACK; state = save_state = RLOGIN_SERVER_ACK;
} }
Contents_Rlogin_Analyzer::~Contents_Rlogin_Analyzer() { }
void Contents_Rlogin_Analyzer::DoDeliver(int len, const u_char* data) void Contents_Rlogin_Analyzer::DoDeliver(int len, const u_char* data)
{ {
int endp_state; int endp_state;

View file

@ -36,7 +36,7 @@ class Contents_Rlogin_Analyzer final : public analyzer::tcp::ContentLine_Analyze
{ {
public: public:
Contents_Rlogin_Analyzer(Connection* conn, bool orig, Rlogin_Analyzer* analyzer); Contents_Rlogin_Analyzer(Connection* conn, bool orig, Rlogin_Analyzer* analyzer);
~Contents_Rlogin_Analyzer() override; ~Contents_Rlogin_Analyzer() override = default;
void SetPeer(Contents_Rlogin_Analyzer* arg_peer) { peer = arg_peer; } void SetPeer(Contents_Rlogin_Analyzer* arg_peer) { peer = arg_peer; }

View file

@ -169,8 +169,6 @@ Contents_NCP_Analyzer::Contents_NCP_Analyzer(Connection* conn, bool orig,
resync_set = false; resync_set = false;
} }
Contents_NCP_Analyzer::~Contents_NCP_Analyzer() { }
void Contents_NCP_Analyzer::DeliverStream(int len, const u_char* data, bool orig) void Contents_NCP_Analyzer::DeliverStream(int len, const u_char* data, bool orig)
{ {
analyzer::tcp::TCP_SupportAnalyzer::DeliverStream(len, data, orig); analyzer::tcp::TCP_SupportAnalyzer::DeliverStream(len, data, orig);

View file

@ -91,7 +91,7 @@ class Contents_NCP_Analyzer : public analyzer::tcp::TCP_SupportAnalyzer
{ {
public: public:
Contents_NCP_Analyzer(Connection* conn, bool orig, detail::NCP_Session* session); Contents_NCP_Analyzer(Connection* conn, bool orig, detail::NCP_Session* session);
~Contents_NCP_Analyzer() override; ~Contents_NCP_Analyzer() override = default;
protected: protected:
void DeliverStream(int len, const u_char* data, bool orig) override; void DeliverStream(int len, const u_char* data, bool orig) override;

View file

@ -52,8 +52,6 @@ POP3_Analyzer::POP3_Analyzer(Connection* conn)
AddSupportAnalyzer(cl_resp); AddSupportAnalyzer(cl_resp);
} }
POP3_Analyzer::~POP3_Analyzer() { }
void POP3_Analyzer::Done() void POP3_Analyzer::Done()
{ {
analyzer::tcp::TCP_ApplicationAnalyzer::Done(); analyzer::tcp::TCP_ApplicationAnalyzer::Done();
@ -224,7 +222,7 @@ void POP3_Analyzer::ProcessRequest(int length, const char* line)
// Some clients pipeline their commands (i.e., keep sending // Some clients pipeline their commands (i.e., keep sending
// without waiting for a server's responses). Therefore we // without waiting for a server's responses). Therefore we
// keep a list of pending commands. // keep a list of pending commands.
cmds.push_back(std::string(line)); cmds.emplace_back(line);
if ( cmds.size() == 1 ) if ( cmds.size() == 1 )
// Not waiting for another server response, // Not waiting for another server response,

View file

@ -74,7 +74,7 @@ class POP3_Analyzer final : public analyzer::tcp::TCP_ApplicationAnalyzer
{ {
public: public:
explicit POP3_Analyzer(Connection* conn); explicit POP3_Analyzer(Connection* conn);
~POP3_Analyzer() override; ~POP3_Analyzer() override = default;
void Done() override; void Done() override;
void DeliverStream(int len, const u_char* data, bool orig) override; void DeliverStream(int len, const u_char* data, bool orig) override;

View file

@ -297,8 +297,6 @@ Portmapper_Analyzer::Portmapper_Analyzer(Connection* conn)
orig_rpc = resp_rpc = nullptr; orig_rpc = resp_rpc = nullptr;
} }
Portmapper_Analyzer::~Portmapper_Analyzer() { }
void Portmapper_Analyzer::Init() void Portmapper_Analyzer::Init()
{ {
RPC_Analyzer::Init(); RPC_Analyzer::Init();

View file

@ -33,7 +33,7 @@ class Portmapper_Analyzer : public RPC_Analyzer
{ {
public: public:
explicit Portmapper_Analyzer(Connection* conn); explicit Portmapper_Analyzer(Connection* conn);
~Portmapper_Analyzer() override; ~Portmapper_Analyzer() override = default;
void Init() override; void Init() override;
static analyzer::Analyzer* Instantiate(Connection* conn) static analyzer::Analyzer* Instantiate(Connection* conn)

View file

@ -423,8 +423,6 @@ void Contents_RPC::Init()
analyzer::tcp::TCP_SupportAnalyzer::Init(); analyzer::tcp::TCP_SupportAnalyzer::Init();
} }
Contents_RPC::~Contents_RPC() { }
void Contents_RPC::Undelivered(uint64_t seq, int len, bool orig) void Contents_RPC::Undelivered(uint64_t seq, int len, bool orig)
{ {
analyzer::tcp::TCP_SupportAnalyzer::Undelivered(seq, len, orig); analyzer::tcp::TCP_SupportAnalyzer::Undelivered(seq, len, orig);

View file

@ -212,7 +212,7 @@ class Contents_RPC final : public analyzer::tcp::TCP_SupportAnalyzer
{ {
public: public:
Contents_RPC(Connection* conn, bool orig, detail::RPC_Interpreter* interp); Contents_RPC(Connection* conn, bool orig, detail::RPC_Interpreter* interp);
~Contents_RPC() override; ~Contents_RPC() override = default;
protected: protected:
enum state_t enum state_t

View file

@ -71,7 +71,7 @@ refine flow SIP_Flow += {
if ( build_headers ) if ( build_headers )
{ {
headers.push_back({zeek::AdoptRef{}, build_sip_header_val(name, value)}); headers.emplace_back(zeek::AdoptRef{}, build_sip_header_val(name, value));
} }
return true; return true;

View file

@ -24,7 +24,7 @@ type uint48 = record {
%code{ %code{
string orig_label(bool is_orig) string orig_label(bool is_orig)
{ {
return string(is_orig ? "originator" :"responder"); return is_orig ? "originator" :"responder";
} }
%} %}
@ -42,8 +42,6 @@ string orig_label(bool is_orig)
((uint64)num->byte4() << 16) | ((uint64)num->byte5() << 8) | (uint64)num->byte6(); ((uint64)num->byte4() << 16) | ((uint64)num->byte5() << 8) | (uint64)num->byte6();
} }
}; };
string state_label(int state_nr);
%} %}
extern type to_int; extern type to_int;

View file

@ -21,22 +21,6 @@ enum AnalyzerState {
STATE_ENCRYPTED STATE_ENCRYPTED
}; };
%code{
string state_label(int state_nr)
{
switch ( state_nr ) {
case STATE_CLEAR:
return string("CLEAR");
case STATE_ENCRYPTED:
return string("ENCRYPTED");
default:
return string(zeek::util::fmt("UNKNOWN (%d)", state_nr));
}
}
%}
###################################################################### ######################################################################
# Change Cipher Spec Protocol (7.1.) # Change Cipher Spec Protocol (7.1.)
###################################################################### ######################################################################

View file

@ -11,7 +11,7 @@ namespace zeek::analyzer::xmpp
XMPP_Analyzer::XMPP_Analyzer(Connection* conn) XMPP_Analyzer::XMPP_Analyzer(Connection* conn)
: analyzer::tcp::TCP_ApplicationAnalyzer("XMPP", conn) : analyzer::tcp::TCP_ApplicationAnalyzer("XMPP", conn)
{ {
interp = unique_ptr<binpac::XMPP::XMPP_Conn>(new binpac::XMPP::XMPP_Conn(this)); interp = std::make_unique<binpac::XMPP::XMPP_Conn>(this);
had_gap = false; had_gap = false;
tls_active = false; tls_active = false;
} }

View file

@ -889,7 +889,7 @@ broker::expected<broker::data> val_to_data(const Val* v)
std::string name(f->Name()); std::string name(f->Name());
broker::vector rval; broker::vector rval;
rval.push_back(name); rval.emplace_back(name);
if ( name.find("lambda_<") == 0 ) if ( name.find("lambda_<") == 0 )
{ {

View file

@ -246,8 +246,6 @@ Manager::Manager(bool arg_use_real_time)
writer_id_type = nullptr; writer_id_type = nullptr;
} }
Manager::~Manager() { }
void Manager::InitPostScript() void Manager::InitPostScript()
{ {
DBG_LOG(DBG_BROKER, "Initializing"); DBG_LOG(DBG_BROKER, "Initializing");

View file

@ -96,7 +96,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
~Manager() override; ~Manager() override = default;
/** /**
* Initialization of the manager. This is called late during Zeek's * Initialization of the manager. This is called late during Zeek's

View file

@ -23,8 +23,6 @@ void Component::Initialize()
file_mgr->RegisterComponent(this, "ANALYZER_"); file_mgr->RegisterComponent(this, "ANALYZER_");
} }
Component::~Component() { }
void Component::DoDescribe(ODesc* d) const void Component::DoDescribe(ODesc* d) const
{ {
if ( factory_func ) if ( factory_func )

View file

@ -60,7 +60,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
~Component() override; ~Component() override = default;
/** /**
* Initialization function. This function has to be called before any * Initialization function. This function has to be called before any

View file

@ -21,8 +21,6 @@ void Component::Initialize()
input_mgr->RegisterComponent(this, "READER_"); input_mgr->RegisterComponent(this, "READER_");
} }
Component::~Component() { }
void Component::DoDescribe(ODesc* d) const void Component::DoDescribe(ODesc* d) const
{ {
d->Add("Input::READER_"); d->Add("Input::READER_");

View file

@ -36,7 +36,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
~Component() override; ~Component() override = default;
/** /**
* Initialization function. This function has to be called before any * Initialization function. This function has to be called before any

View file

@ -130,7 +130,7 @@ public:
string file_id; string file_id;
AnalysisStream(); AnalysisStream();
~AnalysisStream() override; ~AnalysisStream() override = default;
}; };
Manager::TableStream::TableStream() Manager::TableStream::TableStream()
@ -177,8 +177,6 @@ Manager::TableStream::~TableStream()
Manager::AnalysisStream::AnalysisStream() : Manager::Stream::Stream(ANALYSIS_STREAM), file_id() { } Manager::AnalysisStream::AnalysisStream() : Manager::Stream::Stream(ANALYSIS_STREAM), file_id() { }
Manager::AnalysisStream::~AnalysisStream() { }
Manager::Manager() : plugin::ComponentManager<input::Component>("Input", "Reader") Manager::Manager() : plugin::ComponentManager<input::Component>("Input", "Reader")
{ {
end_of_data = event_registry->Register("Input::end_of_data"); end_of_data = event_registry->Register("Input::end_of_data");

View file

@ -44,7 +44,7 @@ FieldMapping::FieldMapping(const FieldMapping& arg)
FieldMapping FieldMapping::subType() FieldMapping FieldMapping::subType()
{ {
return FieldMapping(name, subtype, position); return {name, subtype, position};
} }
FieldMapping& FieldMapping::operator=(const FieldMapping& arg) FieldMapping& FieldMapping::operator=(const FieldMapping& arg)

View file

@ -54,8 +54,6 @@ Config::Config(ReaderFrontend* frontend) : ReaderBackend(frontend)
} }
} }
Config::~Config() { }
void Config::DoClose() { } void Config::DoClose() { }
bool Config::DoInit(const ReaderInfo& info, int num_fields, const Field* const* fields) bool Config::DoInit(const ReaderInfo& info, int num_fields, const Field* const* fields)

View file

@ -23,7 +23,7 @@ class Config : public ReaderBackend
{ {
public: public:
explicit Config(ReaderFrontend* frontend); explicit Config(ReaderFrontend* frontend);
~Config() override; ~Config() override = default;
// prohibit copying and moving // prohibit copying and moving
Config(const Config&) = delete; Config(const Config&) = delete;

View file

@ -7,8 +7,6 @@ namespace zeek::plugin::detail::Zeek_RawReader
Plugin plugin; Plugin plugin;
Plugin::Plugin() { }
zeek::plugin::Configuration Plugin::Configure() zeek::plugin::Configuration Plugin::Configure()
{ {
AddComponent(new zeek::input::Component("Raw", zeek::input::reader::detail::Raw::Instantiate)); AddComponent(new zeek::input::Component("Raw", zeek::input::reader::detail::Raw::Instantiate));

View file

@ -13,7 +13,7 @@ namespace zeek::plugin::detail::Zeek_RawReader
class Plugin : public plugin::Plugin class Plugin : public plugin::Plugin
{ {
public: public:
Plugin(); Plugin() = default;
plugin::Configuration Configure() override; plugin::Configuration Configure() override;

View file

@ -17,8 +17,6 @@ Component::Component(plugin::component::Type type, const std::string& name)
{ {
} }
Component::~Component() { }
PktSrcComponent::PktSrcComponent(const std::string& arg_name, const std::string& arg_prefix, PktSrcComponent::PktSrcComponent(const std::string& arg_name, const std::string& arg_prefix,
InputType arg_type, factory_callback arg_factory) InputType arg_type, factory_callback arg_factory)
: Component(plugin::component::PKTSRC, arg_name) : Component(plugin::component::PKTSRC, arg_name)
@ -28,8 +26,6 @@ PktSrcComponent::PktSrcComponent(const std::string& arg_name, const std::string&
factory = arg_factory; factory = arg_factory;
} }
PktSrcComponent::~PktSrcComponent() { }
const std::vector<std::string>& PktSrcComponent::Prefixes() const const std::vector<std::string>& PktSrcComponent::Prefixes() const
{ {
return prefixes; return prefixes;
@ -110,8 +106,6 @@ PktDumperComponent::PktDumperComponent(const std::string& name, const std::strin
factory = arg_factory; factory = arg_factory;
} }
PktDumperComponent::~PktDumperComponent() { }
PktDumperComponent::factory_callback PktDumperComponent::Factory() const PktDumperComponent::factory_callback PktDumperComponent::Factory() const
{ {
return factory; return factory;

View file

@ -33,7 +33,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
~Component() override; ~Component() override = default;
protected: protected:
/** /**
@ -84,7 +84,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
~PktSrcComponent() override; ~PktSrcComponent() override = default;
/** /**
* Returns the prefix(es) passed to the constructor. * Returns the prefix(es) passed to the constructor.
@ -145,7 +145,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
~PktDumperComponent() override; ~PktDumperComponent() override = default;
/** /**
* Returns the prefix(es) passed to the constructor. * Returns the prefix(es) passed to the constructor.

View file

@ -16,8 +16,6 @@ PktDumper::PktDumper()
errmsg = ""; errmsg = "";
} }
PktDumper::~PktDumper() { }
void PktDumper::Init() void PktDumper::Init()
{ {
Open(); Open();

View file

@ -28,7 +28,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
virtual ~PktDumper(); virtual ~PktDumper() = default;
/** /**
* Returns the path associated with the dumper. * Returns the path associated with the dumper.

View file

@ -20,8 +20,6 @@ PcapDumper::PcapDumper(const std::string& path, bool arg_append)
pd = nullptr; pd = nullptr;
} }
PcapDumper::~PcapDumper() { }
void PcapDumper::Open() void PcapDumper::Open()
{ {
int linktype = -1; int linktype = -1;

View file

@ -18,7 +18,7 @@ class PcapDumper : public PktDumper
{ {
public: public:
PcapDumper(const std::string& path, bool append); PcapDumper(const std::string& path, bool append);
~PcapDumper() override; ~PcapDumper() override = default;
static PktDumper* Instantiate(const std::string& path, bool append); static PktDumper* Instantiate(const std::string& path, bool append);

View file

@ -21,8 +21,6 @@ void Component::Initialize()
log_mgr->RegisterComponent(this, "WRITER_"); log_mgr->RegisterComponent(this, "WRITER_");
} }
Component::~Component() { }
void Component::DoDescribe(ODesc* d) const void Component::DoDescribe(ODesc* d) const
{ {
d->Add("Log::WRITER_"); d->Add("Log::WRITER_");

View file

@ -36,7 +36,7 @@ public:
/** /**
* Destructor. * Destructor.
*/ */
~Component() override; ~Component() override = default;
/** /**
* Initialization function. This function has to be called before any * Initialization function. This function has to be called before any

View file

@ -41,7 +41,7 @@ public:
{ {
} }
virtual ~RotateMessage() { delete[] rotated_path; } ~RotateMessage() override { delete[] rotated_path; }
bool Process() override { return Object()->Rotate(rotated_path, open, close, terminating); } bool Process() override { return Object()->Rotate(rotated_path, open, close, terminating); }

View file

@ -23,7 +23,7 @@ bool None::DoInit(const WriterInfo& info, int num_fields, const threading::Field
for ( WriterInfo::config_map::const_iterator i = info.config.begin(); for ( WriterInfo::config_map::const_iterator i = info.config.begin();
i != info.config.end(); i++ ) i != info.config.end(); i++ )
keys.push_back(std::make_pair(i->first, i->second)); keys.emplace_back(i->first, i->second);
std::sort(keys.begin(), keys.end()); std::sort(keys.begin(), keys.end());

View file

@ -39,7 +39,7 @@ string extract_module_name(const char* name)
string::size_type pos = module_name.rfind("::"); string::size_type pos = module_name.rfind("::");
if ( pos == string::npos ) if ( pos == string::npos )
return string(GLOBAL_MODULE_NAME); return GLOBAL_MODULE_NAME;
module_name.erase(pos); module_name.erase(pos);
@ -63,7 +63,7 @@ string extract_var_name(const char* name)
return var_name; return var_name;
if ( pos + 2 > var_name.size() ) if ( pos + 2 > var_name.size() )
return string(""); return "";
return var_name.substr(pos + 2); return var_name.substr(pos + 2);
} }
@ -81,7 +81,7 @@ string normalized_module_name(const char* module_name)
if ( (mod_len = strlen(module_name)) >= 2 && streq(module_name + mod_len - 2, "::") ) if ( (mod_len = strlen(module_name)) >= 2 && streq(module_name + mod_len - 2, "::") )
mod_len -= 2; mod_len -= 2;
return string(module_name, mod_len); return {module_name, static_cast<size_t>(mod_len)};
} }
TEST_CASE("module_util make_full_var_name") TEST_CASE("module_util make_full_var_name")
@ -103,7 +103,7 @@ string make_full_var_name(const char* module_name, const char* var_name)
if ( streq(GLOBAL_MODULE_NAME, extract_module_name(var_name).c_str()) ) if ( streq(GLOBAL_MODULE_NAME, extract_module_name(var_name).c_str()) )
return extract_var_name(var_name); return extract_var_name(var_name);
return string(var_name); return var_name;
} }
string full_name = normalized_module_name(module_name); string full_name = normalized_module_name(module_name);

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_ARP namespace zeek::plugin::Zeek_ARP
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"ARP", zeek::packet_analysis::ARP::ARPAnalyzer::Instantiate)); "ARP", zeek::packet_analysis::ARP::ARPAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_AYIYA namespace zeek::plugin::Zeek_AYIYA
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"AYIYA", zeek::packet_analysis::AYIYA::AYIYAAnalyzer::Instantiate)); "AYIYA", zeek::packet_analysis::AYIYA::AYIYAAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_Ethernet namespace zeek::plugin::Zeek_Ethernet
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"Ethernet", zeek::packet_analysis::Ethernet::EthernetAnalyzer::Instantiate)); "Ethernet", zeek::packet_analysis::Ethernet::EthernetAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_FDDI namespace zeek::plugin::Zeek_FDDI
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"FDDI", zeek::packet_analysis::FDDI::FDDIAnalyzer::Instantiate)); "FDDI", zeek::packet_analysis::FDDI::FDDIAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_Geneve namespace zeek::plugin::Zeek_Geneve
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"Geneve", zeek::packet_analysis::Geneve::GeneveAnalyzer::Instantiate)); "Geneve", zeek::packet_analysis::Geneve::GeneveAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_GRE namespace zeek::plugin::Zeek_GRE
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"GRE", zeek::packet_analysis::GRE::GREAnalyzer::Instantiate)); "GRE", zeek::packet_analysis::GRE::GREAnalyzer::Instantiate));

View file

@ -8,7 +8,7 @@
namespace zeek::plugin::detail::Zeek_GTPv1 namespace zeek::plugin::detail::Zeek_GTPv1
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() override zeek::plugin::Configuration Configure() override

View file

@ -335,8 +335,9 @@ zeek::RecordValPtr ICMPAnalyzer::ExtractICMP4Context(int len, const u_char*& dat
{ {
// We don't have an entire IP header. // We don't have an entire IP header.
bad_hdr_len = true; bad_hdr_len = true;
bad_checksum = false;
ip_len = frag_offset = 0; ip_len = frag_offset = 0;
DF = MF = bad_checksum = 0; DF = MF = 0;
src_port = dst_port = 0; src_port = dst_port = 0;
} }
@ -370,7 +371,7 @@ zeek::RecordValPtr ICMPAnalyzer::ExtractICMP4Context(int len, const u_char*& dat
// 4 above is the magic number meaning that both // 4 above is the magic number meaning that both
// port numbers are included in the ICMP. // port numbers are included in the ICMP.
src_port = dst_port = 0; src_port = dst_port = 0;
bad_hdr_len = 1; bad_hdr_len = true;
} }
} }
@ -500,7 +501,7 @@ void ICMPAnalyzer::RouterAdvert(double t, const struct icmp* icmpp, int len, int
int opt_offset = sizeof(reachable) + sizeof(retrans); int opt_offset = sizeof(reachable) + sizeof(retrans);
adapter->EnqueueConnEvent( adapter->EnqueueConnEvent(
f, adapter->ConnVal(), BuildInfo(icmpp, len, 1, ip_hdr), f, adapter->ConnVal(), BuildInfo(icmpp, len, true, ip_hdr),
val_mgr->Count(icmpp->icmp_num_addrs), // Cur Hop Limit val_mgr->Count(icmpp->icmp_num_addrs), // Cur Hop Limit
val_mgr->Bool(icmpp->icmp_wpa & 0x80), // Managed val_mgr->Bool(icmpp->icmp_wpa & 0x80), // Managed
val_mgr->Bool(icmpp->icmp_wpa & 0x40), // Other val_mgr->Bool(icmpp->icmp_wpa & 0x40), // Other
@ -530,7 +531,7 @@ void ICMPAnalyzer::NeighborAdvert(double t, const struct icmp* icmpp, int len, i
int opt_offset = sizeof(in6_addr); int opt_offset = sizeof(in6_addr);
adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, 1, ip_hdr), adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, true, ip_hdr),
val_mgr->Bool(icmpp->icmp_num_addrs & 0x80), // Router val_mgr->Bool(icmpp->icmp_num_addrs & 0x80), // Router
val_mgr->Bool(icmpp->icmp_num_addrs & 0x40), // Solicited val_mgr->Bool(icmpp->icmp_num_addrs & 0x40), // Solicited
val_mgr->Bool(icmpp->icmp_num_addrs & 0x20), // Override val_mgr->Bool(icmpp->icmp_num_addrs & 0x20), // Override
@ -554,7 +555,7 @@ void ICMPAnalyzer::NeighborSolicit(double t, const struct icmp* icmpp, int len,
int opt_offset = sizeof(in6_addr); int opt_offset = sizeof(in6_addr);
adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, 1, ip_hdr), adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, true, ip_hdr),
make_intrusive<AddrVal>(tgtaddr), make_intrusive<AddrVal>(tgtaddr),
BuildNDOptionsVal(caplen - opt_offset, data + opt_offset, adapter)); BuildNDOptionsVal(caplen - opt_offset, data + opt_offset, adapter));
} }
@ -577,7 +578,7 @@ void ICMPAnalyzer::Redirect(double t, const struct icmp* icmpp, int len, int cap
int opt_offset = 2 * sizeof(in6_addr); int opt_offset = 2 * sizeof(in6_addr);
adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, 1, ip_hdr), adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, true, ip_hdr),
make_intrusive<AddrVal>(tgtaddr), make_intrusive<AddrVal>(dstaddr), make_intrusive<AddrVal>(tgtaddr), make_intrusive<AddrVal>(dstaddr),
BuildNDOptionsVal(caplen - opt_offset, data + opt_offset, adapter)); BuildNDOptionsVal(caplen - opt_offset, data + opt_offset, adapter));
} }
@ -591,7 +592,7 @@ void ICMPAnalyzer::RouterSolicit(double t, const struct icmp* icmpp, int len, in
if ( ! f ) if ( ! f )
return; return;
adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, 1, ip_hdr), adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, true, ip_hdr),
BuildNDOptionsVal(caplen, data, adapter)); BuildNDOptionsVal(caplen, data, adapter));
} }
@ -612,7 +613,7 @@ void ICMPAnalyzer::Context4(double t, const struct icmp* icmpp, int len, int cap
} }
if ( f ) if ( f )
adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, 0, ip_hdr), adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, false, ip_hdr),
val_mgr->Count(icmpp->icmp_code), val_mgr->Count(icmpp->icmp_code),
ExtractICMP4Context(caplen, data)); ExtractICMP4Context(caplen, data));
} }
@ -646,7 +647,7 @@ void ICMPAnalyzer::Context6(double t, const struct icmp* icmpp, int len, int cap
} }
if ( f ) if ( f )
adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, 1, ip_hdr), adapter->EnqueueConnEvent(f, adapter->ConnVal(), BuildInfo(icmpp, len, true, ip_hdr),
val_mgr->Count(icmpp->icmp_code), val_mgr->Count(icmpp->icmp_code),
ExtractICMP6Context(caplen, data)); ExtractICMP6Context(caplen, data));
} }

View file

@ -10,10 +10,10 @@
namespace zeek::plugin::Zeek_ICMP namespace zeek::plugin::Zeek_ICMP
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"ICMP", zeek::packet_analysis::ICMP::ICMPAnalyzer::Instantiate)); "ICMP", zeek::packet_analysis::ICMP::ICMPAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_IEEE802_11 namespace zeek::plugin::Zeek_IEEE802_11
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"IEEE802_11", zeek::packet_analysis::IEEE802_11::IEEE802_11Analyzer::Instantiate)); "IEEE802_11", zeek::packet_analysis::IEEE802_11::IEEE802_11Analyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_IEEE802_11_Radio namespace zeek::plugin::Zeek_IEEE802_11_Radio
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"IEEE802_11_Radio", "IEEE802_11_Radio",

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_IP namespace zeek::plugin::Zeek_IP
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"IP", zeek::packet_analysis::IP::IPAnalyzer::Instantiate)); "IP", zeek::packet_analysis::IP::IPAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_IPTunnel namespace zeek::plugin::Zeek_IPTunnel
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"IPTunnel", zeek::packet_analysis::IPTunnel::IPTunnelAnalyzer::Instantiate)); "IPTunnel", zeek::packet_analysis::IPTunnel::IPTunnelAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_LinuxSLL namespace zeek::plugin::Zeek_LinuxSLL
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"LinuxSLL", zeek::packet_analysis::LinuxSLL::LinuxSLLAnalyzer::Instantiate)); "LinuxSLL", zeek::packet_analysis::LinuxSLL::LinuxSLLAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_LinuxSLL2 namespace zeek::plugin::Zeek_LinuxSLL2
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"LinuxSLL2", zeek::packet_analysis::LinuxSLL2::LinuxSLL2Analyzer::Instantiate)); "LinuxSLL2", zeek::packet_analysis::LinuxSLL2::LinuxSLL2Analyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_LLC namespace zeek::plugin::Zeek_LLC
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"LLC", zeek::packet_analysis::LLC::LLCAnalyzer::Instantiate)); "LLC", zeek::packet_analysis::LLC::LLCAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_MPLS namespace zeek::plugin::Zeek_MPLS
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"MPLS", zeek::packet_analysis::MPLS::MPLSAnalyzer::Instantiate)); "MPLS", zeek::packet_analysis::MPLS::MPLSAnalyzer::Instantiate));

View file

@ -8,10 +8,10 @@
namespace zeek::plugin::Zeek_NFLog namespace zeek::plugin::Zeek_NFLog
{ {
class Plugin : public zeek::plugin::Plugin class Plugin final : public zeek::plugin::Plugin
{ {
public: public:
zeek::plugin::Configuration Configure() zeek::plugin::Configuration Configure() override
{ {
AddComponent(new zeek::packet_analysis::Component( AddComponent(new zeek::packet_analysis::Component(
"NFLog", zeek::packet_analysis::NFLog::NFLogAnalyzer::Instantiate)); "NFLog", zeek::packet_analysis::NFLog::NFLogAnalyzer::Instantiate));

Some files were not shown because too many files have changed in this diff Show more