aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-06-26 19:47:23 -0400
committerDeterminant <[email protected]>2018-06-26 19:47:23 -0400
commitbfb0b426df85efc5485872702b19af7921ff455e (patch)
treed8396dd5fa600ed72109a6891ba279f2bf13e727
parent3a892e396803e0b53d8cee0e4b9f8c5c9b33b742 (diff)
...
-rw-r--r--include/salticidae/netaddr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/salticidae/netaddr.h b/include/salticidae/netaddr.h
index c166c3a..b11f9b3 100644
--- a/include/salticidae/netaddr.h
+++ b/include/salticidae/netaddr.h
@@ -31,6 +31,7 @@
#include <arpa/inet.h>
#include "salticidae/util.h"
+#include "salticidae/stream.h"
namespace salticidae {
@@ -92,6 +93,10 @@ struct NetAddr {
}
bool is_null() const { return ip == 0 && port == 0; }
+
+ void serialize(DataStream &s) const { s << ip << port; }
+
+ void unserialize(DataStream &s) { s >> ip >> port; }
};
}