diff --git a/src/NetVar.cc b/src/NetVar.cc index 012e4a85bc..1a2e604e90 100644 --- a/src/NetVar.cc +++ b/src/NetVar.cc @@ -243,6 +243,7 @@ OpaqueType* md5_type; OpaqueType* sha1_type; OpaqueType* sha256_type; OpaqueType* entropy_type; +OpaqueType* topk_type; #include "const.bif.netvar_def" #include "types.bif.netvar_def" @@ -308,6 +309,7 @@ void init_general_global_var() sha1_type = new OpaqueType("sha1"); sha256_type = new OpaqueType("sha256"); entropy_type = new OpaqueType("entropy"); + topk_type = new OpaqueType("topk"); } void init_net_var() diff --git a/src/NetVar.h b/src/NetVar.h index d7590b20e7..37ed3c7c85 100644 --- a/src/NetVar.h +++ b/src/NetVar.h @@ -248,6 +248,7 @@ extern OpaqueType* md5_type; extern OpaqueType* sha1_type; extern OpaqueType* sha256_type; extern OpaqueType* entropy_type; +extern OpaqueType* topk_type; // Initializes globals that don't pertain to network/event analysis. extern void init_general_global_var(); diff --git a/src/Topk.cc b/src/Topk.cc index 2b84b389b0..10374f3087 100644 --- a/src/Topk.cc +++ b/src/Topk.cc @@ -4,6 +4,7 @@ #include "CompHash.h" #include "Reporter.h" #include "Serializer.h" +#include "NetVar.h" namespace Topk { @@ -36,7 +37,7 @@ HashKey* TopkVal::GetHash(Val* v) const return key; } -TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(new OpaqueType("topk")) +TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(topk_type) { elementDict = new PDict(Element); elementDict->SetDeleteFunc(topk_element_hash_delete_func); @@ -46,7 +47,7 @@ TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(new OpaqueType("topk")) pruned = false; } -TopkVal::TopkVal() : OpaqueVal(new OpaqueType("topk")) +TopkVal::TopkVal() : OpaqueVal(topk_type) { elementDict = new PDict(Element); elementDict->SetDeleteFunc(topk_element_hash_delete_func);