mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Rename BroObj to Obj
This commit is contained in:
parent
736a3f53d4
commit
02cef05f93
36 changed files with 105 additions and 103 deletions
|
@ -51,7 +51,7 @@ using AttrPtr = zeek::IntrusivePtr<Attr>;
|
|||
class Attributes;
|
||||
using AttributesPtr = zeek::IntrusivePtr<Attributes>;
|
||||
|
||||
class Attr final : public BroObj {
|
||||
class Attr final : public Obj {
|
||||
public:
|
||||
static inline const AttrPtr nil;
|
||||
|
||||
|
@ -95,7 +95,7 @@ protected:
|
|||
};
|
||||
|
||||
// Manages a collection of attributes.
|
||||
class Attributes final : public BroObj {
|
||||
class Attributes final : public Obj {
|
||||
public:
|
||||
[[deprecated("Remove in v4.1. Construct using IntrusivePtrs instead.")]]
|
||||
Attributes(attr_list* a, zeek::TypePtr t, bool in_record, bool is_global);
|
||||
|
|
|
@ -64,7 +64,7 @@ static inline int addr_port_canon_lt(const IPAddr& addr1, uint32_t p1,
|
|||
|
||||
namespace analyzer { class Analyzer; }
|
||||
|
||||
class Connection final : public zeek::BroObj {
|
||||
class Connection final : public zeek::Obj {
|
||||
public:
|
||||
Connection(NetSessions* s, const ConnIDKey& k, double t, const ConnID* id,
|
||||
uint32_t flow, const Packet* pkt, const EncapsulationStack* arg_encap);
|
||||
|
|
|
@ -24,7 +24,7 @@ class DFA_State;
|
|||
class DFA_Machine;
|
||||
class DFA_State;
|
||||
|
||||
class DFA_State : public zeek::BroObj {
|
||||
class DFA_State : public zeek::Obj {
|
||||
public:
|
||||
DFA_State(int state_num, const EquivClass* ec,
|
||||
NFA_state_list* nfa_states, AcceptingSet* accept);
|
||||
|
@ -109,7 +109,7 @@ private:
|
|||
std::map<DigestStr, DFA_State*> states;
|
||||
};
|
||||
|
||||
class DFA_Machine : public zeek::BroObj {
|
||||
class DFA_Machine : public zeek::Obj {
|
||||
public:
|
||||
DFA_Machine(NFA_Machine* n, EquivClass* ec);
|
||||
~DFA_Machine() override;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "Reporter.h"
|
||||
|
||||
// Support classes
|
||||
DbgWatch::DbgWatch(zeek::BroObj* var_to_watch)
|
||||
DbgWatch::DbgWatch(zeek::Obj* var_to_watch)
|
||||
{
|
||||
reporter->InternalError("DbgWatch unimplemented");
|
||||
}
|
||||
|
|
|
@ -5,15 +5,16 @@
|
|||
#include "util.h"
|
||||
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(Expr, zeek::detail);
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(BroObj, zeek);
|
||||
namespace zeek { class Obj; }
|
||||
using BroObj [[deprecated("Remove in v4.1. Use zeek:Obj instead.")]] = zeek::Obj;
|
||||
|
||||
class DbgWatch {
|
||||
public:
|
||||
explicit DbgWatch(zeek::BroObj* var_to_watch);
|
||||
explicit DbgWatch(zeek::Obj* var_to_watch);
|
||||
explicit DbgWatch(zeek::detail::Expr* expr_to_watch);
|
||||
~DbgWatch();
|
||||
|
||||
protected:
|
||||
zeek::BroObj* var;
|
||||
zeek::Obj* var;
|
||||
zeek::detail::Expr* expr;
|
||||
};
|
||||
|
|
10
src/Event.cc
10
src/Event.cc
|
@ -19,7 +19,7 @@ uint64_t num_events_queued = 0;
|
|||
uint64_t num_events_dispatched = 0;
|
||||
|
||||
Event::Event(EventHandlerPtr arg_handler, zeek::Args arg_args,
|
||||
SourceID arg_src, analyzer::ID arg_aid, BroObj* arg_obj)
|
||||
SourceID arg_src, analyzer::ID arg_aid, Obj* arg_obj)
|
||||
: handler(arg_handler),
|
||||
args(std::move(arg_args)),
|
||||
src(arg_src),
|
||||
|
@ -95,14 +95,14 @@ EventMgr::~EventMgr()
|
|||
|
||||
void EventMgr::QueueEventFast(const EventHandlerPtr &h, val_list vl,
|
||||
SourceID src, analyzer::ID aid, TimerMgr* mgr,
|
||||
BroObj* obj)
|
||||
Obj* obj)
|
||||
{
|
||||
QueueEvent(new Event(h, zeek::val_list_to_args(vl), src, aid, obj));
|
||||
}
|
||||
|
||||
void EventMgr::QueueEvent(const EventHandlerPtr &h, val_list vl,
|
||||
SourceID src, analyzer::ID aid,
|
||||
TimerMgr* mgr, BroObj* obj)
|
||||
TimerMgr* mgr, Obj* obj)
|
||||
{
|
||||
auto args = zeek::val_list_to_args(vl);
|
||||
|
||||
|
@ -112,7 +112,7 @@ void EventMgr::QueueEvent(const EventHandlerPtr &h, val_list vl,
|
|||
|
||||
void EventMgr::QueueEvent(const EventHandlerPtr &h, val_list* vl,
|
||||
SourceID src, analyzer::ID aid,
|
||||
TimerMgr* mgr, BroObj* obj)
|
||||
TimerMgr* mgr, Obj* obj)
|
||||
{
|
||||
auto args = zeek::val_list_to_args(*vl);
|
||||
delete vl;
|
||||
|
@ -122,7 +122,7 @@ void EventMgr::QueueEvent(const EventHandlerPtr &h, val_list* vl,
|
|||
}
|
||||
|
||||
void EventMgr::Enqueue(const EventHandlerPtr& h, zeek::Args vl,
|
||||
SourceID src, analyzer::ID aid, BroObj* obj)
|
||||
SourceID src, analyzer::ID aid, Obj* obj)
|
||||
{
|
||||
QueueEvent(new Event(h, std::move(vl), src, aid, obj));
|
||||
}
|
||||
|
|
16
src/Event.h
16
src/Event.h
|
@ -14,11 +14,11 @@
|
|||
|
||||
class EventMgr;
|
||||
|
||||
class Event final : public zeek::BroObj {
|
||||
class Event final : public zeek::Obj {
|
||||
public:
|
||||
Event(EventHandlerPtr handler, zeek::Args args,
|
||||
SourceID src = SOURCE_LOCAL, analyzer::ID aid = 0,
|
||||
zeek::BroObj* obj = nullptr);
|
||||
zeek::Obj* obj = nullptr);
|
||||
|
||||
void SetNext(Event* n) { next_event = n; }
|
||||
Event* NextEvent() const { return next_event; }
|
||||
|
@ -41,14 +41,14 @@ protected:
|
|||
zeek::Args args;
|
||||
SourceID src;
|
||||
analyzer::ID aid;
|
||||
zeek::BroObj* obj;
|
||||
zeek::Obj* obj;
|
||||
Event* next_event;
|
||||
};
|
||||
|
||||
extern uint64_t num_events_queued;
|
||||
extern uint64_t num_events_dispatched;
|
||||
|
||||
class EventMgr final : public zeek::BroObj, public iosource::IOSource {
|
||||
class EventMgr final : public zeek::Obj, public iosource::IOSource {
|
||||
public:
|
||||
EventMgr();
|
||||
~EventMgr() override;
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
[[deprecated("Remove in v4.1. Use Enqueue() instead.")]]
|
||||
void QueueEventFast(const EventHandlerPtr &h, val_list vl,
|
||||
SourceID src = SOURCE_LOCAL, analyzer::ID aid = 0,
|
||||
TimerMgr* mgr = nullptr, zeek::BroObj* obj = nullptr);
|
||||
TimerMgr* mgr = nullptr, zeek::Obj* obj = nullptr);
|
||||
|
||||
// Queues an event if there's an event handler (or remote consumer). This
|
||||
// function always takes ownership of decrementing the reference count of
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
[[deprecated("Remove in v4.1. Use Enqueue() instead.")]]
|
||||
void QueueEvent(const EventHandlerPtr &h, val_list vl,
|
||||
SourceID src = SOURCE_LOCAL, analyzer::ID aid = 0,
|
||||
TimerMgr* mgr = nullptr, zeek::BroObj* obj = nullptr);
|
||||
TimerMgr* mgr = nullptr, zeek::Obj* obj = nullptr);
|
||||
|
||||
// Same as QueueEvent, except taking the event's argument list via a
|
||||
// pointer instead of by value. This function takes ownership of the
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
[[deprecated("Remove in v4.1. Use Enqueue() instead.")]]
|
||||
void QueueEvent(const EventHandlerPtr &h, val_list* vl,
|
||||
SourceID src = SOURCE_LOCAL, analyzer::ID aid = 0,
|
||||
TimerMgr* mgr = nullptr, zeek::BroObj* obj = nullptr);
|
||||
TimerMgr* mgr = nullptr, zeek::Obj* obj = nullptr);
|
||||
|
||||
/**
|
||||
* Adds an event to the queue. If no handler is found for the event
|
||||
|
@ -100,7 +100,7 @@ public:
|
|||
*/
|
||||
void Enqueue(const EventHandlerPtr& h, zeek::Args vl,
|
||||
SourceID src = SOURCE_LOCAL, analyzer::ID aid = 0,
|
||||
zeek::BroObj* obj = nullptr);
|
||||
zeek::Obj* obj = nullptr);
|
||||
|
||||
/**
|
||||
* A version of Enqueue() taking a variable number of arguments.
|
||||
|
|
|
@ -84,7 +84,7 @@ using ExprPtr = zeek::IntrusivePtr<Expr>;
|
|||
using EventExprPtr = zeek::IntrusivePtr<EventExpr>;
|
||||
using ListExprPtr = zeek::IntrusivePtr<ListExpr>;
|
||||
|
||||
class Expr : public BroObj {
|
||||
class Expr : public Obj {
|
||||
public:
|
||||
[[deprecated("Remove in v4.1. Use GetType().")]]
|
||||
zeek::Type* Type() const { return type.get(); }
|
||||
|
|
|
@ -29,7 +29,7 @@ ZEEK_FORWARD_DECLARE_NAMESPACED(RecordVal, zeek);
|
|||
class BroFile;
|
||||
using BroFilePtr = zeek::IntrusivePtr<BroFile>;
|
||||
|
||||
class BroFile final : public zeek::BroObj {
|
||||
class BroFile final : public zeek::Obj {
|
||||
public:
|
||||
explicit BroFile(FILE* arg_f);
|
||||
BroFile(FILE* arg_f, const char* filename, const char* access);
|
||||
|
|
|
@ -35,7 +35,7 @@ using TriggerPtr = zeek::IntrusivePtr<Trigger>;
|
|||
class Frame;
|
||||
using FramePtr = zeek::IntrusivePtr<Frame>;
|
||||
|
||||
class Frame : public BroObj {
|
||||
class Frame : public Obj {
|
||||
public:
|
||||
/**
|
||||
* Constructs a new frame belonging to *func* with *fn_args*
|
||||
|
|
|
@ -800,7 +800,7 @@ void emit_builtin_error(const char* msg, zeek::ValPtr arg)
|
|||
emit_builtin_error(msg, arg.get());
|
||||
}
|
||||
|
||||
void emit_builtin_error(const char* msg, BroObj* arg)
|
||||
void emit_builtin_error(const char* msg, Obj* arg)
|
||||
{
|
||||
auto emit = [=](const zeek::detail::CallExpr* ce)
|
||||
{
|
||||
|
@ -878,7 +878,7 @@ void builtin_error(const char* msg, zeek::ValPtr arg)
|
|||
zeek::emit_builtin_error(msg, arg);
|
||||
}
|
||||
|
||||
void builtin_error(const char* msg, zeek::BroObj* arg)
|
||||
void builtin_error(const char* msg, zeek::Obj* arg)
|
||||
{
|
||||
zeek::emit_builtin_error(msg, arg);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace zeek {
|
|||
class Func;
|
||||
using FuncPtr = zeek::IntrusivePtr<Func>;
|
||||
|
||||
class Func : public BroObj {
|
||||
class Func : public Obj {
|
||||
public:
|
||||
|
||||
static inline const FuncPtr nil;
|
||||
|
@ -282,7 +282,7 @@ extern std::string render_call_stack();
|
|||
// These methods are used by BIFs, so they're in the public namespace.
|
||||
extern void emit_builtin_error(const char* msg);
|
||||
extern void emit_builtin_error(const char* msg, zeek::ValPtr);
|
||||
extern void emit_builtin_error(const char* msg, BroObj* arg);
|
||||
extern void emit_builtin_error(const char* msg, Obj* arg);
|
||||
|
||||
} // namespace zeek
|
||||
|
||||
|
@ -309,4 +309,4 @@ extern void builtin_error(const char* msg);
|
|||
[[deprecated("Remove in v4.1. Use zeek::emit_builtin_error.")]]
|
||||
extern void builtin_error(const char* msg, zeek::ValPtr);
|
||||
[[deprecated("Remove in v4.1. Use zeek::emit_builtin_error.")]]
|
||||
extern void builtin_error(const char* msg, zeek::BroObj* arg);
|
||||
extern void builtin_error(const char* msg, zeek::Obj* arg);
|
||||
|
|
|
@ -385,9 +385,9 @@ TraversalCode ID::Traverse(TraversalCallback* cb) const
|
|||
HANDLE_TC_EXPR_POST(tc);
|
||||
}
|
||||
|
||||
void ID::Error(const char* msg, const BroObj* o2)
|
||||
void ID::Error(const char* msg, const Obj* o2)
|
||||
{
|
||||
BroObj::Error(msg, o2, true);
|
||||
Obj::Error(msg, o2, true);
|
||||
SetType(error_type());
|
||||
}
|
||||
|
||||
|
|
4
src/ID.h
4
src/ID.h
|
@ -45,7 +45,7 @@ enum IDScope { SCOPE_FUNCTION, SCOPE_MODULE, SCOPE_GLOBAL };
|
|||
class ID;
|
||||
using IDPtr = zeek::IntrusivePtr<ID>;
|
||||
|
||||
class ID final : public BroObj, public notifier::Modifiable {
|
||||
class ID final : public Obj, public notifier::Modifiable {
|
||||
public:
|
||||
static inline const IDPtr nil;
|
||||
|
||||
|
@ -137,7 +137,7 @@ public:
|
|||
|
||||
std::string GetDeprecationWarning() const;
|
||||
|
||||
void Error(const char* msg, const BroObj* o2 = nullptr);
|
||||
void Error(const char* msg, const Obj* o2 = nullptr);
|
||||
|
||||
void Describe(ODesc* d) const override;
|
||||
// Adds type and value to description.
|
||||
|
|
|
@ -33,7 +33,7 @@ struct NewRef {};
|
|||
* for destroying the shared object.
|
||||
*
|
||||
* The @c IntrusivePtr works with any type that offers the two free functions,
|
||||
* but most notably is designed to work with @c BroObj and its subtypes.
|
||||
* but most notably is designed to work with @c Obj and its subtypes.
|
||||
*
|
||||
* The same object may get managed via @c IntrusivePtr in one part of the
|
||||
* code base while another part of the program manages it manually by passing
|
||||
|
|
|
@ -25,7 +25,7 @@ using NFA_state_list = zeek::PList<NFA_State>;
|
|||
#define SYM_CCL 260
|
||||
|
||||
|
||||
class NFA_State : public zeek::BroObj {
|
||||
class NFA_State : public zeek::Obj {
|
||||
public:
|
||||
NFA_State(int sym, EquivClass* ec);
|
||||
explicit NFA_State(CCL* ccl);
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
EpsilonState() : NFA_State(SYM_EPSILON, nullptr) { }
|
||||
};
|
||||
|
||||
class NFA_Machine : public zeek::BroObj {
|
||||
class NFA_Machine : public zeek::Obj {
|
||||
public:
|
||||
explicit NFA_Machine(NFA_State* first, NFA_State* final = nullptr);
|
||||
~NFA_Machine() override;
|
||||
|
|
32
src/Obj.cc
32
src/Obj.cc
|
@ -53,9 +53,9 @@ bool Location::operator==(const Location& l) const
|
|||
|
||||
} // namespace detail
|
||||
|
||||
int BroObj::suppress_errors = 0;
|
||||
int Obj::suppress_errors = 0;
|
||||
|
||||
BroObj::~BroObj()
|
||||
Obj::~Obj()
|
||||
{
|
||||
if ( notify_plugins )
|
||||
PLUGIN_HOOK_VOID(HOOK_BRO_OBJ_DTOR, HookBroObjDtor(this));
|
||||
|
@ -63,7 +63,7 @@ BroObj::~BroObj()
|
|||
delete location;
|
||||
}
|
||||
|
||||
void BroObj::Warn(const char* msg, const BroObj* obj2, bool pinpoint_only, const detail::Location* expr_location) const
|
||||
void Obj::Warn(const char* msg, const Obj* obj2, bool pinpoint_only, const detail::Location* expr_location) const
|
||||
{
|
||||
ODesc d;
|
||||
DoMsg(&d, msg, obj2, pinpoint_only, expr_location);
|
||||
|
@ -71,7 +71,7 @@ void BroObj::Warn(const char* msg, const BroObj* obj2, bool pinpoint_only, const
|
|||
reporter->PopLocation();
|
||||
}
|
||||
|
||||
void BroObj::Error(const char* msg, const BroObj* obj2, bool pinpoint_only, const detail::Location* expr_location) const
|
||||
void Obj::Error(const char* msg, const Obj* obj2, bool pinpoint_only, const detail::Location* expr_location) const
|
||||
{
|
||||
if ( suppress_errors )
|
||||
return;
|
||||
|
@ -82,7 +82,7 @@ void BroObj::Error(const char* msg, const BroObj* obj2, bool pinpoint_only, cons
|
|||
reporter->PopLocation();
|
||||
}
|
||||
|
||||
void BroObj::BadTag(const char* msg, const char* t1, const char* t2) const
|
||||
void Obj::BadTag(const char* msg, const char* t1, const char* t2) const
|
||||
{
|
||||
char out[512];
|
||||
|
||||
|
@ -99,7 +99,7 @@ void BroObj::BadTag(const char* msg, const char* t1, const char* t2) const
|
|||
reporter->PopLocation();
|
||||
}
|
||||
|
||||
void BroObj::Internal(const char* msg) const
|
||||
void Obj::Internal(const char* msg) const
|
||||
{
|
||||
ODesc d;
|
||||
DoMsg(&d, msg);
|
||||
|
@ -113,7 +113,7 @@ void BroObj::Internal(const char* msg) const
|
|||
reporter->PopLocation();
|
||||
}
|
||||
|
||||
void BroObj::InternalWarning(const char* msg) const
|
||||
void Obj::InternalWarning(const char* msg) const
|
||||
{
|
||||
ODesc d;
|
||||
DoMsg(&d, msg);
|
||||
|
@ -121,7 +121,7 @@ void BroObj::InternalWarning(const char* msg) const
|
|||
reporter->PopLocation();
|
||||
}
|
||||
|
||||
void BroObj::AddLocation(ODesc* d) const
|
||||
void Obj::AddLocation(ODesc* d) const
|
||||
{
|
||||
if ( ! location )
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ void BroObj::AddLocation(ODesc* d) const
|
|||
location->Describe(d);
|
||||
}
|
||||
|
||||
bool BroObj::SetLocationInfo(const detail::Location* start, const detail::Location* end)
|
||||
bool Obj::SetLocationInfo(const detail::Location* start, const detail::Location* end)
|
||||
{
|
||||
if ( ! start || ! end )
|
||||
return false;
|
||||
|
@ -153,7 +153,7 @@ bool BroObj::SetLocationInfo(const detail::Location* start, const detail::Locati
|
|||
return true;
|
||||
}
|
||||
|
||||
void BroObj::UpdateLocationEndInfo(const detail::Location& end)
|
||||
void Obj::UpdateLocationEndInfo(const detail::Location& end)
|
||||
{
|
||||
if ( ! location )
|
||||
SetLocationInfo(&end, &end);
|
||||
|
@ -162,7 +162,7 @@ void BroObj::UpdateLocationEndInfo(const detail::Location& end)
|
|||
location->last_column = end.last_column;
|
||||
}
|
||||
|
||||
void BroObj::DoMsg(ODesc* d, const char s1[], const BroObj* obj2,
|
||||
void Obj::DoMsg(ODesc* d, const char s1[], const Obj* obj2,
|
||||
bool pinpoint_only, const detail::Location* expr_location) const
|
||||
{
|
||||
d->SetShort();
|
||||
|
@ -180,7 +180,7 @@ void BroObj::DoMsg(ODesc* d, const char s1[], const BroObj* obj2,
|
|||
reporter->PushLocation(GetLocationInfo(), loc2);
|
||||
}
|
||||
|
||||
void BroObj::PinPoint(ODesc* d, const BroObj* obj2, bool pinpoint_only) const
|
||||
void Obj::PinPoint(ODesc* d, const Obj* obj2, bool pinpoint_only) const
|
||||
{
|
||||
d->Add(" (");
|
||||
Describe(d);
|
||||
|
@ -193,7 +193,7 @@ void BroObj::PinPoint(ODesc* d, const BroObj* obj2, bool pinpoint_only) const
|
|||
d->Add(")");
|
||||
}
|
||||
|
||||
void BroObj::Print() const
|
||||
void Obj::Print() const
|
||||
{
|
||||
static BroFile fstderr(stderr);
|
||||
ODesc d(DESC_READABLE, &fstderr);
|
||||
|
@ -207,14 +207,14 @@ void bad_ref(int type)
|
|||
abort();
|
||||
}
|
||||
|
||||
void bro_obj_delete_func(void* v)
|
||||
void obj_delete_func(void* v)
|
||||
{
|
||||
Unref((BroObj*) v);
|
||||
Unref((Obj*) v);
|
||||
}
|
||||
|
||||
} // namespace zeek
|
||||
|
||||
void print(const zeek::BroObj* obj)
|
||||
void print(const zeek::Obj* obj)
|
||||
{
|
||||
obj->Print();
|
||||
}
|
||||
|
|
44
src/Obj.h
44
src/Obj.h
|
@ -55,9 +55,9 @@ inline void set_location(const Location start, const Location end)
|
|||
|
||||
} // namespace detail
|
||||
|
||||
class BroObj {
|
||||
class Obj {
|
||||
public:
|
||||
BroObj()
|
||||
Obj()
|
||||
{
|
||||
// A bit of a hack. We'd like to associate location
|
||||
// information with every object created when parsing,
|
||||
|
@ -77,18 +77,18 @@ public:
|
|||
SetLocationInfo(&detail::start_location, &detail::end_location);
|
||||
}
|
||||
|
||||
virtual ~BroObj();
|
||||
virtual ~Obj();
|
||||
|
||||
/* disallow copying */
|
||||
BroObj(const BroObj &) = delete;
|
||||
BroObj &operator=(const BroObj &) = delete;
|
||||
Obj(const Obj &) = delete;
|
||||
Obj &operator=(const Obj &) = delete;
|
||||
|
||||
// Report user warnings/errors. If obj2 is given, then it's
|
||||
// included in the message, though if pinpoint_only is non-zero,
|
||||
// then obj2 is only used to pinpoint the location.
|
||||
void Warn(const char* msg, const BroObj* obj2 = nullptr,
|
||||
void Warn(const char* msg, const Obj* obj2 = nullptr,
|
||||
bool pinpoint_only = false, const detail::Location* expr_location = nullptr) const;
|
||||
void Error(const char* msg, const BroObj* obj2 = nullptr,
|
||||
void Error(const char* msg, const Obj* obj2 = nullptr,
|
||||
bool pinpoint_only = false, const detail::Location* expr_location = nullptr) const;
|
||||
|
||||
// Report internal errors.
|
||||
|
@ -130,8 +130,8 @@ public:
|
|||
// as long as there exist any instances.
|
||||
class SuppressErrors {
|
||||
public:
|
||||
SuppressErrors() { ++BroObj::suppress_errors; }
|
||||
~SuppressErrors() { --BroObj::suppress_errors; }
|
||||
SuppressErrors() { ++Obj::suppress_errors; }
|
||||
~SuppressErrors() { --Obj::suppress_errors; }
|
||||
};
|
||||
|
||||
void Print() const;
|
||||
|
@ -142,13 +142,13 @@ protected:
|
|||
private:
|
||||
friend class SuppressErrors;
|
||||
|
||||
void DoMsg(ODesc* d, const char s1[], const BroObj* obj2 = nullptr,
|
||||
void DoMsg(ODesc* d, const char s1[], const Obj* obj2 = nullptr,
|
||||
bool pinpoint_only = false, const detail::Location* expr_location = nullptr) const;
|
||||
void PinPoint(ODesc* d, const BroObj* obj2 = nullptr,
|
||||
void PinPoint(ODesc* d, const Obj* obj2 = nullptr,
|
||||
bool pinpoint_only = false) const;
|
||||
|
||||
friend inline void Ref(BroObj* o);
|
||||
friend inline void Unref(BroObj* o);
|
||||
friend inline void Ref(Obj* o);
|
||||
friend inline void Unref(Obj* o);
|
||||
|
||||
bool notify_plugins = false;
|
||||
int ref_cnt = 1;
|
||||
|
@ -158,16 +158,16 @@ private:
|
|||
static int suppress_errors;
|
||||
};
|
||||
|
||||
// Sometimes useful when dealing with BroObj subclasses that have their
|
||||
// Sometimes useful when dealing with Obj subclasses that have their
|
||||
// own (protected) versions of Error.
|
||||
inline void Error(const BroObj* o, const char* msg)
|
||||
inline void Error(const Obj* o, const char* msg)
|
||||
{
|
||||
o->Error(msg);
|
||||
}
|
||||
|
||||
[[noreturn]] extern void bad_ref(int type);
|
||||
|
||||
inline void Ref(BroObj* o)
|
||||
inline void Ref(Obj* o)
|
||||
{
|
||||
if ( ++(o->ref_cnt) <= 1 )
|
||||
bad_ref(0);
|
||||
|
@ -175,7 +175,7 @@ inline void Ref(BroObj* o)
|
|||
bad_ref(1);
|
||||
}
|
||||
|
||||
inline void Unref(BroObj* o)
|
||||
inline void Unref(Obj* o)
|
||||
{
|
||||
if ( o && --o->ref_cnt <= 0 )
|
||||
{
|
||||
|
@ -184,18 +184,18 @@ inline void Unref(BroObj* o)
|
|||
delete o;
|
||||
|
||||
// We could do the following if o were passed by reference.
|
||||
// o = (BroObj*) 0xcd;
|
||||
// o = (Obj*) 0xcd;
|
||||
}
|
||||
}
|
||||
|
||||
// A dict_delete_func that knows to Unref() dictionary entries.
|
||||
extern void bro_obj_delete_func(void* v);
|
||||
extern void obj_delete_func(void* v);
|
||||
|
||||
} // namespace zeek
|
||||
|
||||
using Location [[deprecated("Remove in v4.1. Use zeek::detail::Location instead.")]] = zeek::detail::Location;
|
||||
using yyltype [[deprecated("Remove in v4.1. Use zeek::detail::yyltype instead.")]] = zeek::detail::yyltype;
|
||||
using BroObj [[deprecated("Remove in v4.1. Use zeek::BroObj instead.")]] = zeek::BroObj;
|
||||
using BroObj [[deprecated("Remove in v4.1. Use zeek::Obj instead.")]] = zeek::Obj;
|
||||
|
||||
[[deprecated("Remove in v4.1. Use zeek::BroObj::Print instead.")]]
|
||||
extern void print(const zeek::BroObj* obj);
|
||||
[[deprecated("Remove in v4.1. Use zeek::Obj::Print instead.")]]
|
||||
extern void print(const zeek::Obj* obj);
|
||||
|
|
|
@ -251,7 +251,7 @@ private:
|
|||
DataBlockMap block_map;
|
||||
};
|
||||
|
||||
class Reassembler : public zeek::BroObj {
|
||||
class Reassembler : public zeek::Obj {
|
||||
public:
|
||||
Reassembler(uint64_t init_seq, ReassemblerType reassem_type = REASSEM_UNKNOWN);
|
||||
~Reassembler() override {}
|
||||
|
|
|
@ -31,7 +31,7 @@ using IDPtr = zeek::IntrusivePtr<ID>;
|
|||
class Scope;
|
||||
using ScopePtr = zeek::IntrusivePtr<Scope>;
|
||||
|
||||
class Scope : public BroObj {
|
||||
class Scope : public Obj {
|
||||
public:
|
||||
explicit Scope(zeek::detail::IDPtr id,
|
||||
std::unique_ptr<std::vector<zeek::detail::AttrPtr>> al);
|
||||
|
|
|
@ -53,7 +53,7 @@ Stmt::~Stmt()
|
|||
|
||||
bool Stmt::SetLocationInfo(const Location* start, const Location* end)
|
||||
{
|
||||
if ( ! BroObj::SetLocationInfo(start, end) )
|
||||
if ( ! Obj::SetLocationInfo(start, end) )
|
||||
return false;
|
||||
|
||||
// Update the Filemap of line number -> statement mapping for
|
||||
|
|
|
@ -30,7 +30,7 @@ using ListExprPtr = zeek::IntrusivePtr<ListExpr>;
|
|||
class Stmt;
|
||||
using StmtPtr = zeek::IntrusivePtr<Stmt>;
|
||||
|
||||
class Stmt : public BroObj {
|
||||
class Stmt : public Obj {
|
||||
public:
|
||||
BroStmtTag Tag() const { return tag; }
|
||||
|
||||
|
@ -166,7 +166,7 @@ protected:
|
|||
StmtPtr s2;
|
||||
};
|
||||
|
||||
class Case final : public BroObj {
|
||||
class Case final : public Obj {
|
||||
public:
|
||||
Case(ListExprPtr c, id_list* types, StmtPtr arg_s);
|
||||
~Case() override;
|
||||
|
|
|
@ -59,7 +59,7 @@ TraversalCode zeek::detail::trigger::TriggerTraversalCallback::PreExpr(const zee
|
|||
case EXPR_INDEX:
|
||||
{
|
||||
const auto* e = static_cast<const zeek::detail::IndexExpr*>(expr);
|
||||
BroObj::SuppressErrors no_errors;
|
||||
Obj::SuppressErrors no_errors;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace zeek::detail::trigger {
|
|||
class TriggerTimer;
|
||||
class TriggerTraversalCallback;
|
||||
|
||||
class Trigger final : public BroObj, public notifier::Receiver {
|
||||
class Trigger final : public Obj, public notifier::Receiver {
|
||||
public:
|
||||
// Don't access Trigger objects; they take care of themselves after
|
||||
// instantiation. Note that if the condition is already true, the
|
||||
|
@ -110,7 +110,7 @@ private:
|
|||
bool delayed; // true if a function call is currently being delayed
|
||||
bool disabled;
|
||||
|
||||
std::vector<std::pair<BroObj *, notifier::Modifiable*>> objs;
|
||||
std::vector<std::pair<Obj *, notifier::Modifiable*>> objs;
|
||||
|
||||
using ValCache = std::map<const zeek::detail::CallExpr*, Val*>;
|
||||
ValCache cache;
|
||||
|
|
|
@ -167,7 +167,7 @@ constexpr int DOES_NOT_MATCH_INDEX = 0;
|
|||
constexpr int MATCHES_INDEX_SCALAR = 1;
|
||||
constexpr int MATCHES_INDEX_VECTOR = 2;
|
||||
|
||||
class Type : public BroObj {
|
||||
class Type : public Obj {
|
||||
public:
|
||||
static inline const TypePtr nil;
|
||||
|
||||
|
|
10
src/Val.h
10
src/Val.h
|
@ -138,7 +138,7 @@ union BroValUnion {
|
|||
: table_val(value) {}
|
||||
};
|
||||
|
||||
class Val : public BroObj {
|
||||
class Val : public Obj {
|
||||
public:
|
||||
static inline const ValPtr nil;
|
||||
|
||||
|
@ -1204,10 +1204,10 @@ public:
|
|||
*/
|
||||
TableValPtr GetRecordFieldsVal() const;
|
||||
|
||||
// This is an experiment to associate a BroObj within the
|
||||
// This is an experiment to associate a Obj within the
|
||||
// event engine to a record value in bro script.
|
||||
void SetOrigin(BroObj* o) { origin = o; }
|
||||
BroObj* GetOrigin() const { return origin; }
|
||||
void SetOrigin(Obj* o) { origin = o; }
|
||||
Obj* GetOrigin() const { return origin; }
|
||||
|
||||
// Returns a new value representing the value coerced to the given
|
||||
// type. If coercion is not possible, returns 0. The non-const
|
||||
|
@ -1241,7 +1241,7 @@ public:
|
|||
protected:
|
||||
ValPtr DoClone(CloneState* state) override;
|
||||
|
||||
BroObj* origin;
|
||||
Obj* origin;
|
||||
|
||||
using RecordTypeValMap = std::unordered_map<zeek::RecordType*, std::vector<RecordValPtr>>;
|
||||
static RecordTypeValMap parse_time_records;
|
||||
|
|
|
@ -122,7 +122,7 @@ static void make_var(const zeek::detail::IDPtr& id, zeek::TypePtr t,
|
|||
{
|
||||
if ( id->IsRedefinable() || (! init && attr && ! zeek::IsFunc(id->GetType()->Tag())) )
|
||||
{
|
||||
zeek::BroObj* redef_obj = init ? (zeek::BroObj*) init.get() : (zeek::BroObj*) t.get();
|
||||
zeek::Obj* redef_obj = init ? (zeek::Obj*) init.get() : (zeek::Obj*) t.get();
|
||||
if ( dt != VAR_REDEF )
|
||||
id->Warn("redefinition requires \"redef\"", redef_obj, true);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ extern "C" {
|
|||
|
||||
namespace analyzer::arp {
|
||||
|
||||
class ARP_Analyzer : public zeek::BroObj {
|
||||
class ARP_Analyzer : public zeek::Obj {
|
||||
public:
|
||||
ARP_Analyzer();
|
||||
~ARP_Analyzer() override;
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace analyzer::stepping_stone {
|
|||
class SteppingStoneEndpoint;
|
||||
class SteppingStoneManager;
|
||||
|
||||
class SteppingStoneEndpoint : public zeek::BroObj {
|
||||
class SteppingStoneEndpoint : public zeek::Obj {
|
||||
public:
|
||||
SteppingStoneEndpoint(tcp::TCP_Endpoint* e, SteppingStoneManager* m);
|
||||
~SteppingStoneEndpoint() override;
|
||||
|
|
|
@ -1557,7 +1557,7 @@ void TCP_Analyzer::ExpireTimer(double t)
|
|||
}
|
||||
|
||||
// Connection still active, so reschedule timer.
|
||||
// ### if PQ_Element's were BroObj's, could just Ref the timer
|
||||
// ### if PQ_Element's were Obj's, could just Ref the timer
|
||||
// and adjust its value here, instead of creating a new timer.
|
||||
ADD_ANALYZER_TIMER(&TCP_Analyzer::ExpireTimer, t + tcp_session_timer,
|
||||
false, TIMER_TCP_EXPIRE);
|
||||
|
|
|
@ -578,7 +578,7 @@ void Manager::RequestEvent(EventHandlerPtr handler, Plugin* plugin)
|
|||
handler->SetGenerateAlways();
|
||||
}
|
||||
|
||||
void Manager::RequestBroObjDtor(BroObj* obj, Plugin* plugin)
|
||||
void Manager::RequestBroObjDtor(Obj* obj, Plugin* plugin)
|
||||
{
|
||||
obj->NotifyPluginsOnDtor();
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ public:
|
|||
void RequestEvent(EventHandlerPtr handler, Plugin* plugin);
|
||||
|
||||
/**
|
||||
* Register interest in the destruction of a BroObj instance. When Bro's
|
||||
* Register interest in the destruction of a Obj instance. When Bro's
|
||||
* reference counting triggers the objects destructor to run, the \a
|
||||
* HookBroObjDtor will be called.
|
||||
*
|
||||
|
@ -222,7 +222,7 @@ public:
|
|||
*
|
||||
* @param plugin The plugin expressing interest.
|
||||
*/
|
||||
void RequestBroObjDtor(BroObj* obj, Plugin* plugin);
|
||||
void RequestBroObjDtor(Obj* obj, Plugin* plugin);
|
||||
|
||||
// Hook entry functions.
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ void Plugin::RequestEvent(EventHandlerPtr handler)
|
|||
plugin_mgr->RequestEvent(handler, this);
|
||||
}
|
||||
|
||||
void Plugin::RequestBroObjDtor(BroObj* obj)
|
||||
void Plugin::RequestBroObjDtor(Obj* obj)
|
||||
{
|
||||
plugin_mgr->RequestBroObjDtor(obj, this);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,11 @@ ZEEK_FORWARD_DECLARE_NAMESPACED(Frame, zeek::detail);
|
|||
namespace zeek {
|
||||
template <class T> class IntrusivePtr;
|
||||
using ValPtr = zeek::IntrusivePtr<Val>;
|
||||
class Obj;
|
||||
}
|
||||
|
||||
using BroObj [[deprecated("Remove in v4.1. Use zeek::Obj instead.")]] = zeek::Obj;
|
||||
|
||||
namespace threading {
|
||||
struct Field;
|
||||
}
|
||||
|
@ -613,7 +616,7 @@ protected:
|
|||
void RequestEvent(EventHandlerPtr handler);
|
||||
|
||||
/**
|
||||
* Registers interest in the destruction of a BroObj instance. When
|
||||
* Registers interest in the destruction of a Obj instance. When
|
||||
* Bro's reference counting triggers the objects destructor to run,
|
||||
* \a HookBroObjDtor will be called.
|
||||
*
|
||||
|
@ -621,7 +624,7 @@ protected:
|
|||
*
|
||||
* @param handler The object being interested in.
|
||||
*/
|
||||
void RequestBroObjDtor(zeek::BroObj* obj);
|
||||
void RequestBroObjDtor(zeek::Obj* obj);
|
||||
|
||||
// Hook functions.
|
||||
|
||||
|
|
|
@ -710,7 +710,7 @@ static int load_files(const char* orig_file)
|
|||
yylloc.first_line = yylloc.last_line = line_number = 1;
|
||||
|
||||
// Don't delete the old filename - it's pointed to by
|
||||
// every BroObj created when parsing it.
|
||||
// every Obj created when parsing it.
|
||||
yylloc.filename = filename = copy_string(file_path.c_str());
|
||||
|
||||
return 1;
|
||||
|
@ -923,7 +923,7 @@ int yywrap()
|
|||
if ( load_files(files[0]) )
|
||||
{
|
||||
// Don't delete the filename - it's pointed to by
|
||||
// every BroObj created when parsing it.
|
||||
// every Obj created when parsing it.
|
||||
(void) files.remove_nth(0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "iosource/IOSource.h"
|
||||
#include "Flare.h"
|
||||
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(BroObj, zeek);
|
||||
|
||||
namespace threading {
|
||||
|
||||
class BasicInputMessage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue