X-Git-Url: https://unix4lyfe.org/gitweb/darkstat-debian/blobdiff_plain/3c6b3682c70be84db86e70c191016913a9836c31..HEAD:/hosts_db.h diff --git a/hosts_db.h b/hosts_db.h index 109f373..6abb777 100644 --- a/hosts_db.h +++ b/hosts_db.h @@ -19,8 +19,15 @@ struct host { struct addr addr; char *dns; uint8_t mac_addr[6]; - time_t 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. */