Don't apply ports-{max,keep} to protocols.
[darkstat] / db.h
1 /* darkstat 3
2 *
3 * db.h: load and save in-memory database from/to file
4 * copyright (c) 2007 Ben Stewart, Emil Mikulic.
5 */
6
7 void db_import(const char *filename);
8 void db_export(const char *filename);
9
10 /* byteswap */
11 uint64_t hton64(const uint64_t ho);
12 uint64_t ntoh64(const uint64_t no);
13 void test_64order(void);
14
15 /* read helpers */
16 unsigned int xtell(const int fd);
17 int readn(const int fd, void *dest, const size_t len);
18 int read8(const int fd, uint8_t *dest);
19 int expect8(const int fd, uint8_t expecting);
20 int read16(const int fd, uint16_t *dest);
21 int read32(const int fd, uint32_t *dest);
22 int readaddr(const int fd, in_addr_t *dest);
23 int read64(const int fd, uint64_t *dest);
24 int read_file_header(const int fd, const uint8_t expected[4]);
25
26 /* write helpers */
27 int writen(const int fd, const void *dest, const size_t len);
28 int write8(const int fd, const uint8_t i);
29 int write16(const int fd, const uint16_t i);
30 int write32(const int fd, const uint32_t i);
31 int writeaddr(const int fd, const in_addr_t addr);
32 int write64(const int fd, const uint64_t i);
33
34 /* vim:set ts=3 sw=3 tw=78 et: */