summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-07 02:12:36 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-07 02:12:36 +0100
commitc6e6c751546124134ed0087bd30a1905a8d4a99d (patch)
tree0c2c8eaf4fa5d7d1ba4e10e302a7cb8df995d47b /src/fastd.h
parentf8a2fec8f399229d15d3481be0ce8567b2ed6851 (diff)
downloadfastd-c6e6c751546124134ed0087bd30a1905a8d4a99d.tar
fastd-c6e6c751546124134ed0087bd30a1905a8d4a99d.zip
Forget old peers and addresses
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fastd.h b/src/fastd.h
index e4bef44..9ce15e7 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -68,6 +68,10 @@ struct _fastd_method {
struct _fastd_config {
fastd_loglevel loglevel;
+ unsigned peer_stale_time;
+ unsigned peer_stale_time_temp;
+ unsigned eth_addr_stale_time;
+
char *ifname;
struct sockaddr_in bind_addr_in;
@@ -147,4 +151,9 @@ static inline size_t fastd_max_packet_size(const fastd_context *ctx) {
}
}
+/* returns (tp1 - tp2) in milliseconds */
+static inline int timespec_diff(const struct timespec *tp1, const struct timespec *tp2) {
+ return ((tp1->tv_sec - tp2->tv_sec))*1000 + (tp1->tv_nsec - tp2->tv_nsec)/1e6;
+}
+
#endif /* _FASTD_FASTD_H_ */