mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Replace most uses of typedef with using for type aliasing
This commit is contained in:
parent
7101f30646
commit
64748edab1
44 changed files with 100 additions and 101 deletions
|
@ -37,7 +37,7 @@ enum ip_addr_anonymization_method_t
|
||||||
NUM_ADDR_ANONYMIZATION_METHODS,
|
NUM_ADDR_ANONYMIZATION_METHODS,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint32_t ipaddr32_t;
|
using ipaddr32_t = uint32_t;
|
||||||
|
|
||||||
// NOTE: all addresses in parameters of *public* functions are in
|
// NOTE: all addresses in parameters of *public* functions are in
|
||||||
// network order.
|
// network order.
|
||||||
|
|
|
@ -124,9 +124,9 @@ protected:
|
||||||
ListValPtr AddrListDelta(ListVal* al1, ListVal* al2);
|
ListValPtr AddrListDelta(ListVal* al1, ListVal* al2);
|
||||||
void DumpAddrList(FILE* f, ListVal* al);
|
void DumpAddrList(FILE* f, ListVal* al);
|
||||||
|
|
||||||
typedef std::map<std::string, std::pair<DNS_Mapping*, DNS_Mapping*>> HostMap;
|
using HostMap = std::map<std::string, std::pair<DNS_Mapping*, DNS_Mapping*>>;
|
||||||
typedef std::map<IPAddr, DNS_Mapping*> AddrMap;
|
using AddrMap = std::map<IPAddr, DNS_Mapping*>;
|
||||||
typedef std::map<std::string, DNS_Mapping*> TextMap;
|
using TextMap = std::map<std::string, DNS_Mapping*>;
|
||||||
void LoadCache(FILE* f);
|
void LoadCache(FILE* f);
|
||||||
void Save(FILE* f, const AddrMap& m);
|
void Save(FILE* f, const AddrMap& m);
|
||||||
void Save(FILE* f, const HostMap& m);
|
void Save(FILE* f, const HostMap& m);
|
||||||
|
@ -168,7 +168,7 @@ protected:
|
||||||
|
|
||||||
RecordTypePtr dm_rec;
|
RecordTypePtr dm_rec;
|
||||||
|
|
||||||
typedef std::list<LookupCallback*> CallbackList;
|
using CallbackList = std::list<LookupCallback*>;
|
||||||
|
|
||||||
struct AsyncRequest
|
struct AsyncRequest
|
||||||
{
|
{
|
||||||
|
@ -217,16 +217,16 @@ protected:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<IPAddr, AsyncRequest*> AsyncRequestAddrMap;
|
using AsyncRequestAddrMap = std::map<IPAddr, AsyncRequest*>;
|
||||||
AsyncRequestAddrMap asyncs_addrs;
|
AsyncRequestAddrMap asyncs_addrs;
|
||||||
|
|
||||||
typedef std::map<std::string, AsyncRequest*> AsyncRequestNameMap;
|
using AsyncRequestNameMap = std::map<std::string, AsyncRequest*>;
|
||||||
AsyncRequestNameMap asyncs_names;
|
AsyncRequestNameMap asyncs_names;
|
||||||
|
|
||||||
typedef std::map<std::string, AsyncRequest*> AsyncRequestTextMap;
|
using AsyncRequestTextMap = std::map<std::string, AsyncRequest*>;
|
||||||
AsyncRequestTextMap asyncs_texts;
|
AsyncRequestTextMap asyncs_texts;
|
||||||
|
|
||||||
typedef std::list<AsyncRequest*> QueuedList;
|
using QueuedList = std::list<AsyncRequest*>;
|
||||||
QueuedList asyncs_queued;
|
QueuedList asyncs_queued;
|
||||||
|
|
||||||
struct AsyncRequestCompare
|
struct AsyncRequestCompare
|
||||||
|
@ -234,8 +234,8 @@ protected:
|
||||||
bool operator()(const AsyncRequest* a, const AsyncRequest* b) { return a->time > b->time; }
|
bool operator()(const AsyncRequest* a, const AsyncRequest* b) { return a->time > b->time; }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::priority_queue<AsyncRequest*, std::vector<AsyncRequest*>, AsyncRequestCompare>
|
using TimeoutQueue =
|
||||||
TimeoutQueue;
|
std::priority_queue<AsyncRequest*, std::vector<AsyncRequest*>, AsyncRequestCompare>;
|
||||||
TimeoutQueue asyncs_timeouts;
|
TimeoutQueue asyncs_timeouts;
|
||||||
|
|
||||||
unsigned long num_requests;
|
unsigned long num_requests;
|
||||||
|
|
|
@ -59,7 +59,7 @@ bool in_debug = false;
|
||||||
|
|
||||||
// ### fix this hardwired access to external variables etc.
|
// ### fix this hardwired access to external variables etc.
|
||||||
struct yy_buffer_state;
|
struct yy_buffer_state;
|
||||||
typedef struct yy_buffer_state* YY_BUFFER_STATE;
|
using YY_BUFFER_STATE = struct yy_buffer_state*;
|
||||||
YY_BUFFER_STATE bro_scan_string(const char*);
|
YY_BUFFER_STATE bro_scan_string(const char*);
|
||||||
|
|
||||||
extern YYLTYPE yylloc; // holds start line and column of token
|
extern YYLTYPE yylloc; // holds start line and column of token
|
||||||
|
|
|
@ -267,7 +267,7 @@ size_t ODesc::StartsWithEscapeSequence(const char* start, const char* end)
|
||||||
|
|
||||||
std::pair<const char*, size_t> ODesc::FirstEscapeLoc(const char* bytes, size_t n)
|
std::pair<const char*, size_t> ODesc::FirstEscapeLoc(const char* bytes, size_t n)
|
||||||
{
|
{
|
||||||
typedef std::pair<const char*, size_t> escape_pos;
|
using escape_pos = std::pair<const char*, size_t>;
|
||||||
|
|
||||||
if ( IsBinary() )
|
if ( IsBinary() )
|
||||||
return escape_pos(0, 0);
|
return escape_pos(0, 0);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "zeek/Hash.h"
|
#include "zeek/Hash.h"
|
||||||
|
|
||||||
// Type for function to be called when deleting elements.
|
// Type for function to be called when deleting elements.
|
||||||
typedef void (*dict_delete_func)(void*);
|
using dict_delete_func = void (*)(void*);
|
||||||
|
|
||||||
namespace zeek
|
namespace zeek
|
||||||
{
|
{
|
||||||
|
|
12
src/Hash.h
12
src/Hash.h
|
@ -50,10 +50,10 @@ extern zeek::detail::BifReturnVal md5_hmac_bif(zeek::detail::Frame* frame, const
|
||||||
namespace zeek::detail
|
namespace zeek::detail
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef uint64_t hash_t;
|
using hash_t = uint64_t;
|
||||||
typedef uint64_t hash64_t;
|
using hash64_t = uint64_t;
|
||||||
typedef uint64_t hash128_t[2];
|
using hash128_t = uint64_t[2];
|
||||||
typedef uint64_t hash256_t[4];
|
using hash256_t = uint64_t[4];
|
||||||
|
|
||||||
class KeyedHash
|
class KeyedHash
|
||||||
{
|
{
|
||||||
|
@ -219,12 +219,12 @@ private:
|
||||||
friend BifReturnVal BifFunc::md5_hmac_bif(zeek::detail::Frame* frame, const Args*);
|
friend BifReturnVal BifFunc::md5_hmac_bif(zeek::detail::Frame* frame, const Args*);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum
|
enum HashKeyTag
|
||||||
{
|
{
|
||||||
HASH_KEY_INT,
|
HASH_KEY_INT,
|
||||||
HASH_KEY_DOUBLE,
|
HASH_KEY_DOUBLE,
|
||||||
HASH_KEY_STRING
|
HASH_KEY_STRING
|
||||||
} HashKeyTag;
|
};
|
||||||
|
|
||||||
constexpr int NUM_HASH_KEYS = HASH_KEY_STRING + 1;
|
constexpr int NUM_HASH_KEYS = HASH_KEY_STRING + 1;
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ private:
|
||||||
// Will be called from the object itself.
|
// Will be called from the object itself.
|
||||||
void Modified(Modifiable* m);
|
void Modified(Modifiable* m);
|
||||||
|
|
||||||
typedef std::unordered_multimap<Modifiable*, Receiver*> ModifiableMap;
|
using ModifiableMap = std::unordered_multimap<Modifiable*, Receiver*>;
|
||||||
ModifiableMap registrations;
|
ModifiableMap registrations;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
#define YYLTYPE zeek::detail::yyltype
|
#define YYLTYPE zeek::detail::yyltype
|
||||||
typedef Location yyltype;
|
using yyltype = Location;
|
||||||
YYLTYPE GetCurrentLocation();
|
YYLTYPE GetCurrentLocation();
|
||||||
|
|
||||||
// Used to mean "no location associated with this object".
|
// Used to mean "no location associated with this object".
|
||||||
|
|
|
@ -35,7 +35,7 @@ struct PolicyFile
|
||||||
vector<const char*> lines;
|
vector<const char*> lines;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef map<string, PolicyFile*> PolicyFileMap;
|
using PolicyFileMap = map<string, PolicyFile*>;
|
||||||
static PolicyFileMap policy_files;
|
static PolicyFileMap policy_files;
|
||||||
|
|
||||||
namespace zeek::detail
|
namespace zeek::detail
|
||||||
|
|
|
@ -304,7 +304,7 @@ void Specific_RE_Matcher::Dump(FILE* f)
|
||||||
|
|
||||||
inline void RE_Match_State::AddMatches(const AcceptingSet& as, MatchPos position)
|
inline void RE_Match_State::AddMatches(const AcceptingSet& as, MatchPos position)
|
||||||
{
|
{
|
||||||
typedef std::pair<AcceptIdx, MatchPos> am_idx;
|
using am_idx = std::pair<AcceptIdx, MatchPos>;
|
||||||
|
|
||||||
for ( AcceptingSet::const_iterator it = as.begin(); it != as.end(); ++it )
|
for ( AcceptingSet::const_iterator it = as.begin(); it != as.end(); ++it )
|
||||||
accepted_matches.insert(am_idx(*it, position));
|
accepted_matches.insert(am_idx(*it, position));
|
||||||
|
|
2
src/RE.h
2
src/RE.h
|
@ -12,7 +12,7 @@
|
||||||
#include "zeek/EquivClass.h"
|
#include "zeek/EquivClass.h"
|
||||||
#include "zeek/List.h"
|
#include "zeek/List.h"
|
||||||
|
|
||||||
typedef int (*cce_func)(int);
|
using cce_func = int (*)(int);
|
||||||
|
|
||||||
// This method is automatically generated by flex and shouldn't be namespaced
|
// This method is automatically generated by flex and shouldn't be namespaced
|
||||||
extern int re_lex(void);
|
extern int re_lex(void);
|
||||||
|
|
|
@ -42,12 +42,12 @@ public:
|
||||||
/**
|
/**
|
||||||
* Type for the analyzer's main type.
|
* Type for the analyzer's main type.
|
||||||
*/
|
*/
|
||||||
typedef uint32_t type_t;
|
using type_t = uint32_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type for the analyzer's subtype.
|
* Type for the analyzer's subtype.
|
||||||
*/
|
*/
|
||||||
typedef uint32_t subtype_t;
|
using subtype_t = uint32_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the tag's main type.
|
* Returns the tag's main type.
|
||||||
|
|
|
@ -1689,8 +1689,7 @@ void EnumType::DescribeReST(ODesc* d, bool roles_only) const
|
||||||
|
|
||||||
// Create temporary, reverse name map so that enums can be documented
|
// Create temporary, reverse name map so that enums can be documented
|
||||||
// in ascending order of their actual integral value instead of by name.
|
// in ascending order of their actual integral value instead of by name.
|
||||||
typedef map<bro_int_t, std::string> RevNameMap;
|
using RevNameMap = std::map<bro_int_t, std::string>;
|
||||||
|
|
||||||
RevNameMap rev;
|
RevNameMap rev;
|
||||||
|
|
||||||
for ( NameMap::const_iterator it = names.begin(); it != names.end(); ++it )
|
for ( NameMap::const_iterator it = names.begin(); it != names.end(); ++it )
|
||||||
|
|
|
@ -743,7 +743,7 @@ protected:
|
||||||
class EnumType final : public Type
|
class EnumType final : public Type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::list<std::pair<std::string, bro_int_t>> enum_name_list;
|
using enum_name_list = std::list<std::pair<std::string, bro_int_t>>;
|
||||||
|
|
||||||
explicit EnumType(const EnumType* e);
|
explicit EnumType(const EnumType* e);
|
||||||
explicit EnumType(const std::string& arg_name);
|
explicit EnumType(const std::string& arg_name);
|
||||||
|
@ -792,7 +792,7 @@ protected:
|
||||||
bool is_export, detail::Expr* deprecation = nullptr,
|
bool is_export, detail::Expr* deprecation = nullptr,
|
||||||
bool from_redef = false);
|
bool from_redef = false);
|
||||||
|
|
||||||
typedef std::map<std::string, bro_int_t> NameMap;
|
using NameMap = std::map<std::string, bro_int_t>;
|
||||||
NameMap names;
|
NameMap names;
|
||||||
|
|
||||||
// Whether any of the elements of the enum were added via redef's.
|
// Whether any of the elements of the enum were added via redef's.
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace zeek
|
||||||
//
|
//
|
||||||
class VectorVal;
|
class VectorVal;
|
||||||
|
|
||||||
typedef u_char* byte_vec;
|
using byte_vec = u_char*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A container type for holding blocks of byte data. This can be used for
|
* A container type for holding blocks of byte data. This can be used for
|
||||||
|
@ -28,18 +28,18 @@ typedef u_char* byte_vec;
|
||||||
class String
|
class String
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::vector<String*> Vec;
|
using Vec = std::vector<String*>;
|
||||||
typedef Vec::iterator VecIt;
|
using VecIt = Vec::iterator;
|
||||||
typedef Vec::const_iterator VecCIt;
|
using VecCIt = Vec::const_iterator;
|
||||||
|
|
||||||
typedef std::vector<const String*> CVec;
|
using CVec = std::vector<const String*>;
|
||||||
typedef Vec::iterator CVecIt;
|
using CVecIt = Vec::iterator;
|
||||||
typedef Vec::const_iterator CVecCIt;
|
using CVecCIt = Vec::const_iterator;
|
||||||
|
|
||||||
// IdxVecs are vectors of indices of characters in a string.
|
// IdxVecs are vectors of indices of characters in a string.
|
||||||
typedef std::vector<int> IdxVec;
|
using IdxVec = std::vector<int>;
|
||||||
typedef IdxVec::iterator IdxVecIt;
|
using IdxVecIt = IdxVec::iterator;
|
||||||
typedef IdxVec::const_iterator IdxVecCIt;
|
using IdxVecCIt = IdxVec::const_iterator;
|
||||||
|
|
||||||
// Constructors creating internal copies of the data passed in.
|
// Constructors creating internal copies of the data passed in.
|
||||||
String(const u_char* str, int arg_n, bool add_NUL);
|
String(const u_char* str, int arg_n, bool add_NUL);
|
||||||
|
|
|
@ -57,8 +57,8 @@ class OutputHandler;
|
||||||
// to the children list, it can invalidate iterators in the outer call,
|
// to the children list, it can invalidate iterators in the outer call,
|
||||||
// causing a crash.
|
// causing a crash.
|
||||||
using analyzer_list = std::list<Analyzer*>;
|
using analyzer_list = std::list<Analyzer*>;
|
||||||
typedef uint32_t ID;
|
using ID = uint32_t;
|
||||||
typedef void (Analyzer::*analyzer_timer_func)(double t);
|
using analyzer_timer_func = void (Analyzer::*)(double_t);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to receive processed output from an anlyzer.
|
* Class to receive processed output from an anlyzer.
|
||||||
|
|
|
@ -28,7 +28,7 @@ class Analyzer;
|
||||||
class Component : public plugin::Component, public plugin::TaggedComponent<analyzer::Tag>
|
class Component : public plugin::Component, public plugin::TaggedComponent<analyzer::Tag>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Analyzer* (*factory_callback)(Connection* conn);
|
using factory_callback = Analyzer* (*)(Connection* conn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
|
|
@ -215,15 +215,15 @@ public:
|
||||||
~Contents_RPC() override;
|
~Contents_RPC() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef enum
|
enum state_t
|
||||||
{
|
{
|
||||||
WAIT_FOR_MESSAGE,
|
WAIT_FOR_MESSAGE,
|
||||||
WAIT_FOR_MARKER,
|
WAIT_FOR_MARKER,
|
||||||
WAIT_FOR_DATA,
|
WAIT_FOR_DATA,
|
||||||
WAIT_FOR_LAST_DATA,
|
WAIT_FOR_LAST_DATA,
|
||||||
} state_t;
|
};
|
||||||
|
|
||||||
typedef enum
|
enum resync_state_t
|
||||||
{
|
{
|
||||||
NEED_RESYNC,
|
NEED_RESYNC,
|
||||||
RESYNC_WAIT_FOR_MSG_START,
|
RESYNC_WAIT_FOR_MSG_START,
|
||||||
|
@ -231,7 +231,7 @@ protected:
|
||||||
RESYNC_HAD_FULL_MSG,
|
RESYNC_HAD_FULL_MSG,
|
||||||
INSYNC,
|
INSYNC,
|
||||||
RESYNC_INIT,
|
RESYNC_INIT,
|
||||||
} resync_state_t;
|
};
|
||||||
|
|
||||||
void Init() override;
|
void Init() override;
|
||||||
virtual bool CheckResync(int& len, const u_char*& data, bool orig);
|
virtual bool CheckResync(int& len, const u_char*& data, bool orig);
|
||||||
|
|
|
@ -424,8 +424,8 @@ protected:
|
||||||
static bool IsDisabled(const analyzer::Tag& tag);
|
static bool IsDisabled(const analyzer::Tag& tag);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::set<Tag> TagSet;
|
using TagSet = std::set<Tag>;
|
||||||
typedef std::map<std::string, TagSet*> MIMEMap;
|
using MIMEMap = std::map<std::string, TagSet*>;
|
||||||
|
|
||||||
TagSet* LookupMIMEType(const std::string& mtype, bool add_if_not_found);
|
TagSet* LookupMIMEType(const std::string& mtype, bool add_if_not_found);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ReaderBackend;
|
||||||
class Component : public plugin::Component, public plugin::TaggedComponent<Tag>
|
class Component : public plugin::Component, public plugin::TaggedComponent<Tag>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef ReaderBackend* (*factory_callback)(ReaderFrontend* frontend);
|
using factory_callback = ReaderBackend* (*)(ReaderFrontend* frontend);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
struct ReaderInfo
|
struct ReaderInfo
|
||||||
{
|
{
|
||||||
// Structure takes ownership of the strings.
|
// Structure takes ownership of the strings.
|
||||||
typedef std::map<const char*, const char*, util::CompareString> config_map;
|
using config_map = std::map<const char*, const char*, util::CompareString>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A string left to the interpretation of the reader
|
* A string left to the interpretation of the reader
|
||||||
|
|
|
@ -20,7 +20,7 @@ class PktDumper;
|
||||||
class Component : public plugin::Component
|
class Component : public plugin::Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef IOSource* (*factory_callback)();
|
using factory_callback = IOSource* (*)();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
BOTH ///< Live input as well as offline.
|
BOTH ///< Live input as well as offline.
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef PktSrc* (*factory_callback)(const std::string& path, bool is_live);
|
using factory_callback = PktSrc* (*)(const std::string& path, bool is_live);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -134,7 +134,7 @@ private:
|
||||||
class PktDumperComponent : public plugin::Component
|
class PktDumperComponent : public plugin::Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef PktDumper* (*factory_callback)(const std::string& path, bool append);
|
using factory_callback = PktDumper* (*)(const std::string& path, bool append);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XXX
|
* XXX
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
|
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
typedef struct bpf_timeval pkt_timeval;
|
using pkt_timeval = bpf_timeval;
|
||||||
#else
|
#else
|
||||||
typedef struct timeval pkt_timeval;
|
using pkt_timeval = struct timeval;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <pcap.h> // For DLT_ constants
|
#include <pcap.h> // For DLT_ constants
|
||||||
|
|
|
@ -18,7 +18,7 @@ class WriterBackend;
|
||||||
class Component : public plugin::Component, public plugin::TaggedComponent<logging::Tag>
|
class Component : public plugin::Component, public plugin::TaggedComponent<logging::Tag>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef WriterBackend* (*factory_callback)(WriterFrontend* frontend);
|
using factory_callback = WriterBackend* (*)(WriterFrontend* frontend);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
|
|
@ -85,9 +85,8 @@ struct Manager::Stream
|
||||||
Func* policy;
|
Func* policy;
|
||||||
list<Filter*> filters;
|
list<Filter*> filters;
|
||||||
|
|
||||||
typedef pair<int, string> WriterPathPair;
|
using WriterPathPair = pair<int, string>;
|
||||||
|
using WriterMap = map<WriterPathPair, WriterInfo*>;
|
||||||
typedef map<WriterPathPair, WriterInfo*> WriterMap;
|
|
||||||
|
|
||||||
WriterMap writers; // Writers indexed by id/path pair.
|
WriterMap writers; // Writers indexed by id/path pair.
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
struct WriterInfo
|
struct WriterInfo
|
||||||
{
|
{
|
||||||
// Structure takes ownership of these strings.
|
// Structure takes ownership of these strings.
|
||||||
typedef std::map<const char*, const char*, util::CompareString> config_map;
|
using config_map = std::map<const char*, const char*, util::CompareString>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A string left to the interpretation of the writer
|
* A string left to the interpretation of the writer
|
||||||
|
|
|
@ -15,11 +15,11 @@ enum TransportProto
|
||||||
|
|
||||||
extern const char* transport_proto_string(TransportProto proto);
|
extern const char* transport_proto_string(TransportProto proto);
|
||||||
|
|
||||||
typedef enum
|
enum IPFamily
|
||||||
{
|
{
|
||||||
IPv4,
|
IPv4,
|
||||||
IPv6
|
IPv6
|
||||||
} IPFamily;
|
};
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace plugin
|
||||||
class Manager
|
class Manager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef void (*bif_init_func)(Plugin*);
|
using bif_init_func = void (*)(Plugin*);
|
||||||
using plugin_list = std::list<Plugin*>;
|
using plugin_list = std::list<Plugin*>;
|
||||||
using component_list = Plugin::component_list;
|
using component_list = Plugin::component_list;
|
||||||
using inactive_plugin_list = std::list<std::pair<std::string, std::string>>;
|
using inactive_plugin_list = std::list<std::pair<std::string, std::string>>;
|
||||||
|
|
|
@ -574,9 +574,9 @@ using HookArgumentList = std::list<HookArgument>;
|
||||||
class Plugin
|
class Plugin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::list<Component*> component_list;
|
using component_list = std::list<Component*>;
|
||||||
typedef std::list<BifItem> bif_item_list;
|
using bif_item_list = std::list<BifItem>;
|
||||||
typedef std::list<std::pair<HookType, int>> hook_list;
|
using hook_list = std::list<std::pair<HookType, int>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The different types of @loads supported by HookLoadFile.
|
* The different types of @loads supported by HookLoadFile.
|
||||||
|
|
|
@ -21,9 +21,9 @@ namespace zeek::probabilistic::detail
|
||||||
class BitVector
|
class BitVector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef uint64_t block_type;
|
using block_type = uint64_t;
|
||||||
typedef size_t size_type;
|
using size_type = size_t;
|
||||||
typedef bool const_reference;
|
using const_reference = bool;
|
||||||
|
|
||||||
static size_type npos;
|
static size_type npos;
|
||||||
static block_type bits_per_block;
|
static block_type bits_per_block;
|
||||||
|
|
|
@ -25,8 +25,8 @@ class BitVector;
|
||||||
class CounterVector
|
class CounterVector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef size_t size_type;
|
using size_type = size_t;
|
||||||
typedef uint64_t count_type;
|
using count_type = uint64_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a counter vector having cells of a given width.
|
* Constructs a counter vector having cells of a given width.
|
||||||
|
|
|
@ -29,8 +29,8 @@ enum HasherType
|
||||||
class Hasher
|
class Hasher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef zeek::detail::hash_t digest;
|
using digest = zeek::detail::hash_t;
|
||||||
typedef std::vector<digest> digest_vector;
|
using digest_vector = std::vector<digest>;
|
||||||
struct seed_t
|
struct seed_t
|
||||||
{
|
{
|
||||||
// actually HH_U64, which has the same type
|
// actually HH_U64, which has the same type
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace detail
|
||||||
|
|
||||||
// An initialization hook for a collection of compiled-to-C++ functions
|
// An initialization hook for a collection of compiled-to-C++ functions
|
||||||
// (the result of a single invocation of the compiler on a set of scripts).
|
// (the result of a single invocation of the compiler on a set of scripts).
|
||||||
typedef void (*CPP_init_func)();
|
using CPP_init_func = void (*)();
|
||||||
|
|
||||||
// Tracks the initialization hooks for different compilation runs.
|
// Tracks the initialization hooks for different compilation runs.
|
||||||
extern std::vector<CPP_init_func> CPP_init_funcs;
|
extern std::vector<CPP_init_func> CPP_init_funcs;
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace zeek::detail
|
||||||
// across function calls).
|
// across function calls).
|
||||||
|
|
||||||
class UseDefSet;
|
class UseDefSet;
|
||||||
typedef std::shared_ptr<UseDefSet> UDs;
|
using UDs = std::shared_ptr<UseDefSet>;
|
||||||
|
|
||||||
class UseDefSet
|
class UseDefSet
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Session;
|
class Session;
|
||||||
typedef void (Session::*timer_func)(double t);
|
using timer_func = void (Session::*)(double t);
|
||||||
|
|
||||||
class Session : public Obj
|
class Session : public Obj
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool Terminating() const { return terminating; }
|
bool Terminating() const { return terminating; }
|
||||||
|
|
||||||
typedef std::list<std::pair<std::string, MsgThread::Stats>> msg_stats_list;
|
using msg_stats_list = std::list<std::pair<std::string, MsgThread::Stats>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns statistics from all current MsgThread instances.
|
* Returns statistics from all current MsgThread instances.
|
||||||
|
@ -143,10 +143,10 @@ protected:
|
||||||
void StartHeartbeatTimer();
|
void StartHeartbeatTimer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::list<BasicThread*> all_thread_list;
|
using all_thread_list = std::list<BasicThread*>;
|
||||||
all_thread_list all_threads;
|
all_thread_list all_threads;
|
||||||
|
|
||||||
typedef std::list<MsgThread*> msg_thread_list;
|
using msg_thread_list = std::list<MsgThread*>;
|
||||||
msg_thread_list msg_threads;
|
msg_thread_list msg_threads;
|
||||||
|
|
||||||
bool did_process; // True if the last Process() found some work to do.
|
bool did_process; // True if the last Process() found some work to do.
|
||||||
|
|
|
@ -120,7 +120,7 @@ struct Value
|
||||||
bro_int_t size;
|
bro_int_t size;
|
||||||
Value** vals;
|
Value** vals;
|
||||||
};
|
};
|
||||||
typedef set_t vec_t;
|
using vec_t = set_t;
|
||||||
struct port_t
|
struct port_t
|
||||||
{
|
{
|
||||||
bro_uint_t port;
|
bro_uint_t port;
|
||||||
|
|
|
@ -284,7 +284,7 @@ double calc_next_rotate(double current, double rotate_interval, double base);
|
||||||
|
|
||||||
template <class T> void delete_each(T* t)
|
template <class T> void delete_each(T* t)
|
||||||
{
|
{
|
||||||
typedef typename T::iterator iterator;
|
using iterator = typename T::iterator;
|
||||||
for ( iterator it = t->begin(); it != t->end(); ++it )
|
for ( iterator it = t->begin(); it != t->end(); ++it )
|
||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3087,14 +3087,14 @@ function decode_base64_conn%(cid: conn_id, s: string, a: string &default=""%): s
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
typedef struct {
|
struct bro_uuid_t {
|
||||||
uint32_t time_low;
|
uint32_t time_low;
|
||||||
uint16_t time_mid;
|
uint16_t time_mid;
|
||||||
uint16_t time_hi_and_version;
|
uint16_t time_hi_and_version;
|
||||||
uint8_t clock_seq_hi_and_reserved;
|
uint8_t clock_seq_hi_and_reserved;
|
||||||
uint8_t clock_seq_low;
|
uint8_t clock_seq_low;
|
||||||
uint8_t node[6];
|
uint8_t node[6];
|
||||||
} bro_uuid_t;
|
};
|
||||||
%%}
|
%%}
|
||||||
|
|
||||||
## Converts a bytes representation of a UUID into its string form. For example,
|
## Converts a bytes representation of a UUID into its string form. For example,
|
||||||
|
|
|
@ -187,8 +187,8 @@ private:
|
||||||
bool from_redef;
|
bool from_redef;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<Redefinition*> redef_list;
|
using redef_list = std::list<Redefinition*>;
|
||||||
typedef std::map<std::string, RecordField*> record_field_map;
|
using record_field_map = std::map<std::string, RecordField*>;
|
||||||
|
|
||||||
std::vector<std::string> comments;
|
std::vector<std::string> comments;
|
||||||
zeek::detail::IDPtr id;
|
zeek::detail::IDPtr id;
|
||||||
|
|
|
@ -32,7 +32,7 @@ class ScriptInfo;
|
||||||
*/
|
*/
|
||||||
template <class T> struct InfoMap
|
template <class T> struct InfoMap
|
||||||
{
|
{
|
||||||
typedef std::map<std::string, T*> map_type;
|
using map_type = std::map<std::string, T*>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param name Name of an info object to retrieve.
|
* @param name Name of an info object to retrieve.
|
||||||
|
@ -216,8 +216,8 @@ public:
|
||||||
bool IsUpToDate(const std::string& target_file, const std::vector<T*>& dependencies) const;
|
bool IsUpToDate(const std::string& target_file, const std::vector<T*>& dependencies) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::vector<std::string> comment_buffer_t;
|
using comment_buffer_t = std::vector<std::string>;
|
||||||
typedef std::map<std::string, comment_buffer_t> comment_buffer_map_t;
|
using comment_buffer_map_t = std::map<std::string, comment_buffer_t>;
|
||||||
|
|
||||||
IdentifierInfo* CreateIdentifierInfo(zeek::detail::IDPtr id, ScriptInfo* script,
|
IdentifierInfo* CreateIdentifierInfo(zeek::detail::IDPtr id, ScriptInfo* script,
|
||||||
bool from_redef = false);
|
bool from_redef = false);
|
||||||
|
|
|
@ -107,7 +107,7 @@ static string make_redef_summary(const string& heading, char underline, char bor
|
||||||
d.SetQuotes(true);
|
d.SetQuotes(true);
|
||||||
id->DescribeReSTShort(&d);
|
id->DescribeReSTShort(&d);
|
||||||
|
|
||||||
typedef list<IdentifierInfo::Redefinition> redef_list;
|
using redef_list = std::list<IdentifierInfo::Redefinition>;
|
||||||
redef_list redefs = (*it)->GetRedefs(from_script);
|
redef_list redefs = (*it)->GetRedefs(from_script);
|
||||||
|
|
||||||
for ( redef_list::const_iterator iit = redefs.begin(); iit != redefs.end(); ++iit )
|
for ( redef_list::const_iterator iit = redefs.begin(); iit != redefs.end(); ++iit )
|
||||||
|
|
|
@ -85,8 +85,8 @@ public:
|
||||||
std::vector<std::string> GetComments() const;
|
std::vector<std::string> GetComments() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::map<std::string, IdentifierInfo*> id_info_map;
|
using id_info_map = std::map<std::string, IdentifierInfo*>;
|
||||||
typedef std::set<std::string> string_set;
|
using string_set = std::set<std::string>;
|
||||||
|
|
||||||
time_t DoGetModificationTime() const override;
|
time_t DoGetModificationTime() const override;
|
||||||
|
|
||||||
|
|
|
@ -149,8 +149,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef Target* (*TargetFactoryFn)(const std::string& name, const std::string& pattern);
|
using TargetFactoryFn = Target* (*)(const std::string& name, const std::string& pattern);
|
||||||
typedef std::map<std::string, TargetFactoryFn> target_creator_map;
|
using target_creator_map = std::map<std::string, TargetFactoryFn>;
|
||||||
target_creator_map target_creators;
|
target_creator_map target_creators;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ public:
|
||||||
void CreateAnalyzerDoc(FILE* f) const { return DoCreateAnalyzerDoc(f); }
|
void CreateAnalyzerDoc(FILE* f) const { return DoCreateAnalyzerDoc(f); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef void (*doc_creator_fn)(FILE*);
|
using doc_creator_fn = void (*)(FILE*);
|
||||||
|
|
||||||
AnalyzerTarget(const std::string& name, const std::string& pattern) : Target(name, pattern) { }
|
AnalyzerTarget(const std::string& name, const std::string& pattern) : Target(name, pattern) { }
|
||||||
|
|
||||||
|
@ -262,7 +262,8 @@ private:
|
||||||
|
|
||||||
std::vector<PackageInfo*> pkg_deps;
|
std::vector<PackageInfo*> pkg_deps;
|
||||||
std::vector<ScriptInfo*> script_deps;
|
std::vector<ScriptInfo*> script_deps;
|
||||||
typedef std::map<PackageInfo*, std::vector<ScriptInfo*>> manifest_t;
|
|
||||||
|
using manifest_t = std::map<PackageInfo*, std::vector<ScriptInfo*>>;
|
||||||
manifest_t pkg_manifest;
|
manifest_t pkg_manifest;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue