summaryrefslogtreecommitdiffstats
path: root/src/wireguard.h
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@mail.noconroy.net>2019-08-08 21:34:39 +1000
committerMatt Dunwoodie <ncon@mail.noconroy.net>2019-08-08 21:37:38 +1000
commit7d38ac453586416e6b7589cb2d52ea90729ab8d5 (patch)
tree3fba55b296bba5ad57ad2b23b62c6f0616f0da3e /src/wireguard.h
parentMove timers to wireguard.c (diff)
downloadwireguard-openbsd-7d38ac453586416e6b7589cb2d52ea90729ab8d5.tar.xz
wireguard-openbsd-7d38ac453586416e6b7589cb2d52ea90729ab8d5.zip
Move rest of timers to wireguard.c
Diffstat (limited to 'src/wireguard.h')
-rw-r--r--src/wireguard.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wireguard.h b/src/wireguard.h
index 38a69b02ac7..ce85dbb1163 100644
--- a/src/wireguard.h
+++ b/src/wireguard.h
@@ -166,7 +166,7 @@ void wg_session_init(struct wg_session *);
uint32_t wg_handshake_clean(struct wg_handshake *);
uint32_t wg_session_clean(struct wg_session *);
-enum wg_error wg_handshake_make_initiation(struct wg_handshake *, uint32_t, struct wg_msg_initiation *);
+enum wg_error wg_handshake_make_initiation(struct wg_handshake *, uint32_t, struct wg_msg_initiation *, struct wg_timers *);
enum wg_error wg_handshake_make_response(struct wg_handshake *, uint32_t, struct wg_msg_response *);
enum wg_error wg_handshake_make_cookie(struct wg_keypair *kp, struct wg_cookie *, uint32_t, uint8_t *, uint8_t, uint8_t mac[WG_MAC_SIZE], struct wg_msg_cookie *);
@@ -179,7 +179,7 @@ enum wg_error wg_handshake_merge(struct wg_handshake *, struct wg_handshake *);
enum wg_error wg_session_encrypt(struct wg_session *, struct wg_msg_transport *, size_t);
enum wg_error wg_session_decrypt(struct wg_session *, struct wg_msg_transport *, size_t);
-enum wg_error wg_session_from_handshake(struct wg_session *, struct wg_handshake *);
+enum wg_error wg_session_from_handshake(struct wg_session *, struct wg_handshake *, struct wg_timers *);
void wg_keypair_from_bytes(struct wg_keypair *, const uint8_t [WG_KEY_SIZE]);
enum wg_pkt_type wg_pkt_type(uint8_t *, size_t);
@@ -191,6 +191,7 @@ void wg_timer_cleanup(void *);
void wg_timer_setup(struct wg_timers *, void *, void (*)(void *),
void (*)(void *), void (*)(void *), void (*)(void *));
void wg_timer_persistent_keepalive_tick(struct wg_timers *);
+void wg_timer_persistent_keepalive_set(struct wg_timers *, uint16_t);
void wg_timer_cleanup_tick(struct wg_timers *);
void wg_timer_keepalive_flag(struct wg_timers *);
void wg_timer_keepalive_unflag(struct wg_timers *);
@@ -198,6 +199,8 @@ void wg_timer_broken_flag(struct wg_timers *);
void wg_timer_broken_unflag(struct wg_timers *);
void wg_timer_reinit_flag(struct wg_timers *);
void wg_timer_reinit_unflag(struct wg_timers *);
+struct timespec wg_timer_last_initiation(struct wg_timers *);
+struct timespec wg_timer_last_handshake(struct wg_timers *);
/* TODO make better */
void wg_keypair_generate(struct wg_keypair *);