From 0898066430e0f2908565a1b4588e50de2d41a256 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Fri, 28 Jul 2017 22:01:04 +0200 Subject: Break out Package read/write --- src/package.hh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/package.hh (limited to 'src/package.hh') 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 +#include + +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 -- cgit v1.2.3-70-g09d2