summaryrefslogtreecommitdiffstats
path: root/src/peer.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-01-26 06:00:04 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-01-26 06:00:04 +0100
commit26cf96bea0e07df934c807b78c2d77383556c1ce (patch)
treefffd28e2ea258df38422dcdfe169b9a4b3b27049 /src/peer.h
parent76d955efa5fcd46fd325015d6cd3a389f8d9bb93 (diff)
downloadfastd-26cf96bea0e07df934c807b78c2d77383556c1ce.tar
fastd-26cf96bea0e07df934c807b78c2d77383556c1ce.zip
Switch to the new timeout helpers where possible
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/peer.h b/src/peer.h
index 2720f42..f72fe0b 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -41,8 +41,8 @@ struct fastd_peer {
fastd_peer_address_t address;
fastd_peer_state_t state;
- struct timespec seen;
- struct timespec last_send;
+ struct timespec timeout;
+ struct timespec keepalive_timeout;
fastd_remote_t *remotes;
fastd_remote_t *next_remote;
@@ -56,6 +56,8 @@ struct fastd_peer {
struct timespec last_handshake_response_timeout;
fastd_peer_address_t last_handshake_response_address;
+ struct timespec establish_handshake_timeout;
+
fastd_protocol_peer_config_t *protocol_config;
fastd_protocol_peer_state_t *protocol_state;
};
@@ -80,7 +82,7 @@ struct fastd_peer_config {
struct fastd_peer_eth_addr {
fastd_eth_addr_t addr;
fastd_peer_t *peer;
- struct timespec seen;
+ struct timespec timeout;
};
struct fastd_remote {
@@ -203,7 +205,7 @@ static inline bool fastd_remote_is_dynamic(const fastd_remote_t *remote) {
}
static inline void fastd_peer_seen(fastd_context_t *ctx, fastd_peer_t *peer) {
- peer->seen = ctx->now;
+ peer->timeout = fastd_in_seconds(ctx, ctx->conf->peer_stale_time);
}
static inline bool fastd_peer_is_socket_dynamic(const fastd_peer_t *peer) {