mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
broker: include cleanup
This commit is contained in:
parent
0cf5799ca6
commit
c6ffec02fc
9 changed files with 33 additions and 26 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "Func.h"
|
||||
#include "Scope.h"
|
||||
#include "NetVar.h"
|
||||
#include "ID.h"
|
||||
|
||||
#include "broker/Manager.h"
|
||||
#include "broker/Data.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "IntrusivePtr.h"
|
||||
#include "Trigger.h"
|
||||
#include "Val.h"
|
||||
#include "ID.h"
|
||||
|
||||
vector<Frame*> g_frame_stack;
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "Conn.h"
|
||||
#include "Reporter.h"
|
||||
#include "IPAddr.h"
|
||||
#include "Var.h" // for internal_type()
|
||||
|
||||
#include "broker/Data.h"
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "Desc.h"
|
||||
#include "IntrusivePtr.h"
|
||||
#include "RE.h"
|
||||
#include "Var.h" // for internal_type()
|
||||
#include "Scope.h"
|
||||
#include "module_util.h"
|
||||
#include "3rdparty/doctest.h"
|
||||
|
@ -1172,6 +1173,14 @@ IntrusivePtr<Val> bro_broker::DataVal::castTo(BroType* t)
|
|||
return data_to_val(data, t);
|
||||
}
|
||||
|
||||
BroType* bro_broker::DataVal::ScriptDataType()
|
||||
{
|
||||
if ( ! script_data_type )
|
||||
script_data_type = internal_type("Broker::Data");
|
||||
|
||||
return script_data_type;
|
||||
}
|
||||
|
||||
IMPLEMENT_OPAQUE_VALUE(bro_broker::DataVal)
|
||||
|
||||
broker::expected<broker::data> bro_broker::DataVal::DoSerialize() const
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "Reporter.h"
|
||||
#include "Frame.h"
|
||||
#include "Expr.h"
|
||||
#include "Var.h" // for internal_type()
|
||||
|
||||
template <class T>
|
||||
class IntrusivePtr;
|
||||
|
@ -111,13 +110,7 @@ public:
|
|||
// Returns the Bro type that scripts use to represent a Broker data
|
||||
// instance. This may be wrapping the opaque value inside another
|
||||
// type.
|
||||
static BroType* ScriptDataType()
|
||||
{
|
||||
if ( ! script_data_type )
|
||||
script_data_type = internal_type("Broker::Data");
|
||||
|
||||
return script_data_type;
|
||||
}
|
||||
static BroType* ScriptDataType();
|
||||
|
||||
broker::data data;
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "NetVar.h"
|
||||
#include "iosource/IOSource.h"
|
||||
#include "logging/WriterBackend.h"
|
||||
|
||||
class Frame;
|
||||
class Func;
|
||||
|
||||
namespace bro_broker {
|
||||
|
||||
|
|
|
@ -1,11 +1,28 @@
|
|||
#include "Store.h"
|
||||
#include "Desc.h"
|
||||
#include "Var.h" // for internal_type()
|
||||
#include "broker/Manager.h"
|
||||
|
||||
namespace bro_broker {
|
||||
|
||||
OpaqueType* opaque_of_store_handle;
|
||||
|
||||
EnumVal* query_status(bool success)
|
||||
{
|
||||
static EnumType* store_query_status = nullptr;
|
||||
static int success_val;
|
||||
static int failure_val;
|
||||
|
||||
if ( ! store_query_status )
|
||||
{
|
||||
store_query_status = internal_type("Broker::QueryStatus")->AsEnumType();
|
||||
success_val = store_query_status->Lookup("Broker", "SUCCESS");
|
||||
failure_val = store_query_status->Lookup("Broker", "FAILURE");
|
||||
}
|
||||
|
||||
return store_query_status->GetVal(success ? success_val : failure_val);
|
||||
}
|
||||
|
||||
void StoreHandleVal::ValDescribe(ODesc* d) const
|
||||
{
|
||||
//using BifEnum::Broker::BackendType;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
#include "broker/store.bif.h"
|
||||
#include "broker/data.bif.h"
|
||||
#include "Type.h"
|
||||
#include "Var.h" // for internal_type()
|
||||
#include "OpaqueVal.h"
|
||||
#include "Trigger.h"
|
||||
|
||||
|
@ -20,21 +18,7 @@ extern OpaqueType* opaque_of_store_handle;
|
|||
* @param success whether the query status should be set to success or failure.
|
||||
* @return a Broker::QueryStatus value.
|
||||
*/
|
||||
inline EnumVal* query_status(bool success)
|
||||
{
|
||||
static EnumType* store_query_status = nullptr;
|
||||
static int success_val;
|
||||
static int failure_val;
|
||||
|
||||
if ( ! store_query_status )
|
||||
{
|
||||
store_query_status = internal_type("Broker::QueryStatus")->AsEnumType();
|
||||
success_val = store_query_status->Lookup("Broker", "SUCCESS");
|
||||
failure_val = store_query_status->Lookup("Broker", "FAILURE");
|
||||
}
|
||||
|
||||
return store_query_status->GetVal(success ? success_val : failure_val);
|
||||
}
|
||||
EnumVal* query_status(bool success);
|
||||
|
||||
/**
|
||||
* @return a Broker::QueryResult value that has a Broker::QueryStatus indicating
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "PktDumper.h"
|
||||
#include "plugin/Manager.h"
|
||||
#include "broker/Manager.h"
|
||||
#include "NetVar.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue