summaryrefslogtreecommitdiffstats
path: root/src/peer.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-28 15:00:24 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-28 15:45:43 +0200
commit72b8ec6a93885c943d8303303e268bd5ec286a46 (patch)
tree426fbb37dba45838ff0022a4fedeff224295608a /src/peer.h
parent1b9709bae3718efc397fc824fb8a0ec5fac31bd1 (diff)
downloadfastd-72b8ec6a93885c943d8303303e268bd5ec286a46.tar
fastd-72b8ec6a93885c943d8303303e268bd5ec286a46.zip
ec25519: ensure that there is always a handshake enqueued after sending a handshake finish
This ensures that the handshake is repeated in case the finish packet is lost.
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/peer.h b/src/peer.h
index 1c939b5..5a73abd 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -28,6 +28,7 @@
#define _FASTD_PEER_H_
#include "fastd.h"
+#include "task.h"
struct fastd_peer {
@@ -135,6 +136,10 @@ bool fastd_peer_matches_address(fastd_context_t *ctx, const fastd_peer_t *peer,
bool fastd_peer_claim_address(fastd_context_t *ctx, fastd_peer_t *peer, fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr);
void fastd_peer_reset_socket(fastd_context_t *ctx, fastd_peer_t *peer);
+static inline void fastd_peer_schedule_handshake(fastd_context_t *ctx, fastd_peer_t *peer) {
+ fastd_task_schedule_handshake(ctx, peer, fastd_rand(ctx, 17500, 22500));
+}
+
const fastd_eth_addr_t* fastd_get_source_address(const fastd_context_t *ctx, fastd_buffer_t buffer);
const fastd_eth_addr_t* fastd_get_dest_address(const fastd_context_t *ctx, fastd_buffer_t buffer);