mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Base: Clean up explicit uses of namespaces in places where they're not necessary.
This commit covers all of the common and base classes.
This commit is contained in:
parent
9f802b2a4d
commit
fe0c22c789
240 changed files with 6823 additions and 6787 deletions
|
@ -29,24 +29,24 @@ public:
|
|||
// Addr in network byte order. If data is zero, acts like a set.
|
||||
// Returns ptr to old data if already existing.
|
||||
// For existing items without data, returns non-nil if found.
|
||||
void* Insert(const zeek::IPAddr& addr, int width, void* data = nullptr);
|
||||
void* Insert(const IPAddr& addr, int width, void* data = nullptr);
|
||||
|
||||
// Value may be addr or subnet.
|
||||
void* Insert(const zeek::Val* value, void* data = nullptr);
|
||||
void* Insert(const Val* value, void* data = nullptr);
|
||||
|
||||
// Returns nil if not found, pointer to data otherwise.
|
||||
// For items without data, returns non-nil if found.
|
||||
// If exact is false, performs exact rather than longest-prefix match.
|
||||
void* Lookup(const zeek::IPAddr& addr, int width, bool exact = false) const;
|
||||
void* Lookup(const zeek::Val* value, bool exact = false) const;
|
||||
void* Lookup(const IPAddr& addr, int width, bool exact = false) const;
|
||||
void* Lookup(const Val* value, bool exact = false) const;
|
||||
|
||||
// Returns list of all found matches or empty list otherwise.
|
||||
std::list<std::tuple<zeek::IPPrefix, void*>> FindAll(const zeek::IPAddr& addr, int width) const;
|
||||
std::list<std::tuple<zeek::IPPrefix, void*>> FindAll(const zeek::SubNetVal* value) const;
|
||||
std::list<std::tuple<IPPrefix, void*>> FindAll(const IPAddr& addr, int width) const;
|
||||
std::list<std::tuple<IPPrefix, void*>> FindAll(const SubNetVal* value) const;
|
||||
|
||||
// Returns pointer to data or nil if not found.
|
||||
void* Remove(const zeek::IPAddr& addr, int width);
|
||||
void* Remove(const zeek::Val* value);
|
||||
void* Remove(const IPAddr& addr, int width);
|
||||
void* Remove(const Val* value);
|
||||
|
||||
void Clear() { Clear_Patricia(tree, delete_function); }
|
||||
|
||||
|
@ -57,8 +57,8 @@ public:
|
|||
void* GetNext(iterator* i);
|
||||
|
||||
private:
|
||||
static prefix_t* MakePrefix(const zeek::IPAddr& addr, int width);
|
||||
static zeek::IPPrefix PrefixToIPPrefix(prefix_t* p);
|
||||
static prefix_t* MakePrefix(const IPAddr& addr, int width);
|
||||
static IPPrefix PrefixToIPPrefix(prefix_t* p);
|
||||
|
||||
patricia_tree_t* tree;
|
||||
data_fn_t delete_function;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue