diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-07 02:12:36 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-07 02:12:36 +0100 |
commit | c6e6c751546124134ed0087bd30a1905a8d4a99d (patch) | |
tree | 0c2c8eaf4fa5d7d1ba4e10e302a7cb8df995d47b /src/peer.h | |
parent | f8a2fec8f399229d15d3481be0ce8567b2ed6851 (diff) | |
download | fastd-c6e6c751546124134ed0087bd30a1905a8d4a99d.tar fastd-c6e6c751546124134ed0087bd30a1905a8d4a99d.zip |
Forget old peers and addresses
Diffstat (limited to 'src/peer.h')
-rw-r--r-- | src/peer.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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_ */ |