Use the host compiler for build tool c-ify.
[darkstat-debian] / hosts_db.h
index 3f869f1..6abb777 100644 (file)
@@ -1,5 +1,5 @@
 /* darkstat 3
- * copyright (c) 2001-2011 Emil Mikulic.
+ * copyright (c) 2001-2014 Emil Mikulic.
  *
  * hosts_db.h: database of hosts, ports, protocols.
  *
@@ -19,8 +19,15 @@ struct host {
    struct addr addr;
    char *dns;
    uint8_t mac_addr[6];
-   long last_seen_mono;
-   struct hashtable *ports_tcp, *ports_udp, *ip_protos;
+   /* last_seen_mono is converted to/from time_t in export/import.
+    * It can be negative (due to machine reboots).
+    */
+   int64_t last_seen_mono;
+   struct hashtable *ports_tcp;
+   struct hashtable *ports_tcp_remote;
+   struct hashtable *ports_udp;
+   struct hashtable *ports_udp_remote;
+   struct hashtable *ip_protos;
 };
 
 struct port_tcp {
@@ -61,7 +68,11 @@ int hosts_db_export(const int fd);
 struct bucket *host_find(const struct addr *const a); /* can return NULL */
 struct bucket *host_get(const struct addr *const a);
 struct bucket *host_get_port_tcp(struct bucket *host, const uint16_t port);
+struct bucket *host_get_port_tcp_remote(struct bucket *host,
+                                        const uint16_t port);
 struct bucket *host_get_port_udp(struct bucket *host, const uint16_t port);
+struct bucket *host_get_port_udp_remote(struct bucket *host,
+                                        const uint16_t port);
 struct bucket *host_get_ip_proto(struct bucket *host, const uint8_t proto);
 
 /* Web pages. */