mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
Working on merging the v6-addr branch. This is checkpoint, tests don't
pass yet. Changes: - Gave IPAddress/IPPrefix methods AsString() so that one doesn't need to cast to get a string represenation. - Val::AsAddr()/AsSubnet() return references rather than pointers. I find that more intuitive. - ODesc/Serializer/SerializationFormat get methods to support IPAddress/IPPrefix directly. - Reformatted the comments in IPAddr.h from /// to /** style. - Given IPPrefix a Contains() method. - A bit of cleanup.
This commit is contained in:
parent
7458ebf385
commit
94b9644da7
20 changed files with 160 additions and 129 deletions
|
@ -69,6 +69,8 @@ public:
|
|||
{ return format->Read(const_cast<char**>(str), len, tag); }
|
||||
|
||||
bool Read(string* s, const char* tag);
|
||||
bool Read(IPAddr* a, const char* tag) { return format->Read(a, tag); }
|
||||
bool Read(IPPrefix* p, const char* tag) { return format->Read(p, tag); }
|
||||
|
||||
bool Write(const char* s, const char* tag)
|
||||
{ return format->Write(s, tag); }
|
||||
|
@ -76,6 +78,8 @@ public:
|
|||
{ return format->Write(buf, len, tag); }
|
||||
bool Write(const string& s, const char* tag)
|
||||
{ return format->Write(s.data(), s.size(), tag); }
|
||||
bool Write(const IPAddr& a, const char* tag) { return format->Write(a, tag); }
|
||||
bool Write(const IPPrefix& p, const char* tag) { return format->Write(p, tag); }
|
||||
|
||||
bool WriteOpenTag(const char* tag)
|
||||
{ return format->WriteOpenTag(tag); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue