summaryrefslogtreecommitdiffstats
path: root/src/peer.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-23 19:48:46 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-23 19:48:46 +0200
commit945cc762afe999bdc9b30fa2818f64e7a5ae2db6 (patch)
tree16cce8aa878aeb08803e1bb764129f5c510e6be3 /src/peer.h
parentf0a655e9db3a46ab3f0c8bba7af548ff440ab98e (diff)
downloadfastd-945cc762afe999bdc9b30fa2818f64e7a5ae2db6.tar
fastd-945cc762afe999bdc9b30fa2818f64e7a5ae2db6.zip
Prepare for improved peer state handling
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/peer.h b/src/peer.h
index 217e5e4..43a6d02 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -40,7 +40,7 @@ struct fastd_peer {
fastd_peer_address_t local_address;
fastd_peer_address_t address;
- bool established;
+ fastd_peer_state_t state;
struct timespec last_resolve;
struct timespec last_resolve_return;
@@ -144,7 +144,13 @@ static inline bool fastd_peer_is_temporary(const fastd_peer_t *peer) {
}
static inline bool fastd_peer_is_established(const fastd_peer_t *peer) {
- return peer->established;
+ switch(peer->state) {
+ case STATE_ESTABLISHED:
+ return true;
+
+ default:
+ return false;
+ }
}
static inline void fastd_peer_seen(fastd_context_t *ctx, fastd_peer_t *peer) {