aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/timers.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-28 03:05:22 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-02 03:41:49 +0200
commita8af31524ad8fb036b03a67823d8372e509b41d9 (patch)
treec89c0b1bf07deda487ac37717969743777236771 /src/timers.h
parentpoly1305-mips64: use compiler-defined macros in assembly (diff)
downloadwireguard-linux-compat-a8af31524ad8fb036b03a67823d8372e509b41d9.tar.xz
wireguard-linux-compat-a8af31524ad8fb036b03a67823d8372e509b41d9.zip
global: prefix all functions with wg_
I understand why this must be done, though I'm not so happy about having to do it. In some places, it puts us over 80 chars and we have to break lines up in further ugly ways. And in general, I think this makes things harder to read. Yet another thing we must do to please upstream. Maybe this can be replaced in the future by some kind of automatic module namespacing logic in the linker, or even combined with LTO and aggressive symbol stripping. Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.h')
-rw-r--r--src/timers.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/timers.h b/src/timers.h
index 50014d2..eef4248 100644
--- a/src/timers.h
+++ b/src/timers.h
@@ -10,18 +10,19 @@
struct wireguard_peer;
-void timers_init(struct wireguard_peer *peer);
-void timers_stop(struct wireguard_peer *peer);
-void timers_data_sent(struct wireguard_peer *peer);
-void timers_data_received(struct wireguard_peer *peer);
-void timers_any_authenticated_packet_sent(struct wireguard_peer *peer);
-void timers_any_authenticated_packet_received(struct wireguard_peer *peer);
-void timers_handshake_initiated(struct wireguard_peer *peer);
-void timers_handshake_complete(struct wireguard_peer *peer);
-void timers_session_derived(struct wireguard_peer *peer);
-void timers_any_authenticated_packet_traversal(struct wireguard_peer *peer);
+void wg_timers_init(struct wireguard_peer *peer);
+void wg_timers_stop(struct wireguard_peer *peer);
+void wg_timers_data_sent(struct wireguard_peer *peer);
+void wg_timers_data_received(struct wireguard_peer *peer);
+void wg_timers_any_authenticated_packet_sent(struct wireguard_peer *peer);
+void wg_timers_any_authenticated_packet_received(struct wireguard_peer *peer);
+void wg_timers_handshake_initiated(struct wireguard_peer *peer);
+void wg_timers_handshake_complete(struct wireguard_peer *peer);
+void wg_timers_session_derived(struct wireguard_peer *peer);
+void wg_timers_any_authenticated_packet_traversal(struct wireguard_peer *peer);
-static inline bool has_expired(u64 birthday_nanoseconds, u64 expiration_seconds)
+static inline bool wg_birthdate_has_expired(u64 birthday_nanoseconds,
+ u64 expiration_seconds)
{
return (s64)(birthday_nanoseconds + expiration_seconds * NSEC_PER_SEC)
<= (s64)ktime_get_boot_fast_ns();