summaryrefslogtreecommitdiffstats
path: root/src/peer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/peer.h b/src/peer.h
index 64cb912..8a1ca7e 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -46,6 +46,8 @@ struct _fastd_peer {
fastd_peer_state state;
uint8_t last_req_id;
+
+ struct timespec seen;
};
struct _fastd_peer_config {
@@ -61,12 +63,14 @@ struct _fastd_eth_addr {
struct _fastd_peer_eth_addr {
fastd_eth_addr addr;
fastd_peer *peer;
+ struct timespec seen;
};
const fastd_eth_addr* fastd_get_source_address(const fastd_context *ctx, fastd_buffer buffer);
const fastd_eth_addr* fastd_get_dest_address(const fastd_context *ctx, fastd_buffer buffer);
+void fastd_peer_reset(fastd_context *ctx, fastd_peer *peer);
fastd_peer* fastd_peer_add(fastd_context *ctx, fastd_peer_config *conf);
fastd_peer* fastd_peer_add_temp(fastd_context *ctx, const fastd_peer_address *address);
fastd_peer* fastd_peer_merge(fastd_context *ctx, fastd_peer *perm_peer, fastd_peer *temp_peer);
@@ -108,7 +112,8 @@ static inline bool fastd_eth_addr_is_unicast(const fastd_eth_addr *addr) {
return ((addr->data[0] & 1) == 0);
}
-void fastd_peer_add_eth_addr(fastd_context *ctx, fastd_peer *peer, const fastd_eth_addr *addr);
+void fastd_peer_eth_addr_add(fastd_context *ctx, fastd_peer *peer, const fastd_eth_addr *addr);
+void fastd_peer_eth_addr_cleanup(fastd_context *ctx);
fastd_peer* fastd_peer_find_by_eth_addr(fastd_context *ctx, const fastd_eth_addr *addr);
#endif /* _FASTD_PEER_H_ */