summaryrefslogtreecommitdiff
path: root/src/package.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/package.hh')
-rw-r--r--src/package.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/package.hh b/src/package.hh
new file mode 100644
index 0000000..e83271f
--- /dev/null
+++ b/src/package.hh
@@ -0,0 +1,22 @@
+// -*- mode: c++; c-basic-offset: 2; -*-
+
+#ifndef PACKAGE_HH
+#define PACKAGE_HH
+
+#include <cstdint>
+#include <string>
+
+struct Package {
+ uint32_t id;
+ struct timespec timestamp;
+ uint16_t flags;
+ std::string source_host;
+ uint16_t source_port;
+ std::string target_host;
+ uint16_t target_port;
+};
+
+size_t read_package(Package* package, uint8_t const* data, size_t max);
+size_t write_package(Package const& package, uint8_t* data, size_t max);
+
+#endif // PACKAGE_HH