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:
Robin Sommer 2012-02-16 18:23:26 -08:00
parent 7458ebf385
commit 94b9644da7
20 changed files with 160 additions and 129 deletions

View file

@ -6,7 +6,9 @@
#include <stdio.h>
#include <list>
#include <utility>
#include "BroString.h"
#include "IPAddr.h"
typedef enum {
DESC_READABLE,
@ -68,13 +70,14 @@ public:
void Add(const char* s, int do_indent=1);
void AddN(const char* s, int len) { AddBytes(s, len); }
void Add(const string& s) { AddBytes(s.data(), s.size()); }
void Add(int i);
void Add(uint32 u);
void Add(int64 i);
void Add(uint64 u);
void Add(double d);
void Add(const IPAddr& addr);
void Add(const IPPrefix& prefix);
void Add(const IPAddr& addr) { Add(addr.AsString()); }
void Add(const IPPrefix& prefix) { Add(prefix.AsString()); }
// Add s as a counted string.
void AddCS(const char* s);