aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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; }
};
}