Remove packet_analysis/Defines.h

- Replace uses of identifier_t with uint32_t
- Replace repeated usage of tuple type for Analysis results with type alias
This commit is contained in:
Tim Wojtulewicz 2020-07-16 13:52:04 -07:00
parent b46e600775
commit c2500d03d6
42 changed files with 66 additions and 80 deletions

View file

@ -11,8 +11,8 @@ namespace zeek::packet_analysis {
class Dispatcher; // Forward decl for Value
using DispatcherPtr = std::shared_ptr<Dispatcher>;
using register_pair = std::pair<identifier_t, std::pair<AnalyzerPtr, DispatcherPtr>>;
using register_map = std::map<identifier_t, std::pair<AnalyzerPtr, DispatcherPtr>>;
using register_pair = std::pair<uint32_t, std::pair<AnalyzerPtr, DispatcherPtr>>;
using register_map = std::map<uint32_t, std::pair<AnalyzerPtr, DispatcherPtr>>;
class Value {
public:
@ -35,22 +35,22 @@ public:
~Dispatcher();
bool Register(identifier_t identifier, AnalyzerPtr analyzer, DispatcherPtr dispatcher);
bool Register(uint32_t identifier, AnalyzerPtr analyzer, DispatcherPtr dispatcher);
void Register(const register_map& data);
ValuePtr Lookup(identifier_t identifier) const;
ValuePtr Lookup(uint32_t identifier) const;
size_t Size() const;
void Clear();
void DumpDebug() const;
private:
identifier_t lowest_identifier = 0;
uint32_t lowest_identifier = 0;
std::vector<ValuePtr> table;
void FreeValues();
inline identifier_t GetHighestIdentifier() const
inline uint32_t GetHighestIdentifier() const
{
return lowest_identifier + table.size() - 1;
}