summaryrefslogtreecommitdiff
path: root/src/package.hh
blob: e83271fc5da07621ed277ed3dfdbe61b5905c8b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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