summaryrefslogtreecommitdiffhomepage
path: root/src/timers.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-10-08 03:36:20 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-08 03:38:12 +0200
commit1027c1fb4493130ed9df96fd4092c4bf9c599b82 (patch)
tree9cc86eb2c6c003f220c9d66171a2d5d0f59745b6 /src/timers.c
parent021084071d57c47c9aabe9c3fcd9be8fd870fa0e (diff)
global: rename struct wireguard_ to struct wg_
This required a bit of pruning of our christmas trees. Suggested-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.c')
-rw-r--r--src/timers.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/timers.c b/src/timers.c
index 5127485..563f03b 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -27,14 +27,14 @@
*/
#define peer_get_from_timer(timer_name) \
- struct wireguard_peer *peer; \
+ struct wg_peer *peer; \
rcu_read_lock_bh(); \
peer = wg_peer_get_maybe_zero(from_timer(peer, timer, timer_name)); \
rcu_read_unlock_bh(); \
if (unlikely(!peer)) \
return;
-static inline void mod_peer_timer(struct wireguard_peer *peer,
+static inline void mod_peer_timer(struct wg_peer *peer,
struct timer_list *timer,
unsigned long expires)
{
@@ -44,7 +44,7 @@ static inline void mod_peer_timer(struct wireguard_peer *peer,
rcu_read_unlock_bh();
}
-static inline void del_peer_timer(struct wireguard_peer *peer,
+static inline void del_peer_timer(struct wg_peer *peer,
struct timer_list *timer)
{
rcu_read_lock_bh();
@@ -135,8 +135,8 @@ static void wg_expired_zero_key_material(struct timer_list *timer)
}
static void wg_queued_expired_zero_key_material(struct work_struct *work)
{
- struct wireguard_peer *peer =
- container_of(work, struct wireguard_peer, clear_peer_work);
+ struct wg_peer *peer = container_of(work, struct wg_peer,
+ clear_peer_work);
pr_debug("%s: Zeroing out all keys for peer %llu (%pISpfsc), since we haven't received a new one in %d seconds\n",
peer->device->dev->name, peer->internal_id,
@@ -156,7 +156,7 @@ static void wg_expired_send_persistent_keepalive(struct timer_list *timer)
}
/* Should be called after an authenticated data packet is sent. */
-void wg_timers_data_sent(struct wireguard_peer *peer)
+void wg_timers_data_sent(struct wg_peer *peer)
{
if (!timer_pending(&peer->timer_new_handshake))
mod_peer_timer(peer, &peer->timer_new_handshake,
@@ -164,7 +164,7 @@ void wg_timers_data_sent(struct wireguard_peer *peer)
}
/* Should be called after an authenticated data packet is received. */
-void wg_timers_data_received(struct wireguard_peer *peer)
+void wg_timers_data_received(struct wg_peer *peer)
{
if (likely(netif_running(peer->device->dev))) {
if (!timer_pending(&peer->timer_send_keepalive))
@@ -178,7 +178,7 @@ void wg_timers_data_received(struct wireguard_peer *peer)
/* Should be called after any type of authenticated packet is sent, whether
* keepalive, data, or handshake.
*/
-void wg_timers_any_authenticated_packet_sent(struct wireguard_peer *peer)
+void wg_timers_any_authenticated_packet_sent(struct wg_peer *peer)
{
del_peer_timer(peer, &peer->timer_send_keepalive);
}
@@ -186,13 +186,13 @@ void wg_timers_any_authenticated_packet_sent(struct wireguard_peer *peer)
/* Should be called after any type of authenticated packet is received, whether
* keepalive, data, or handshake.
*/
-void wg_timers_any_authenticated_packet_received(struct wireguard_peer *peer)
+void wg_timers_any_authenticated_packet_received(struct wg_peer *peer)
{
del_peer_timer(peer, &peer->timer_new_handshake);
}
/* Should be called after a handshake initiation message is sent. */
-void wg_timers_handshake_initiated(struct wireguard_peer *peer)
+void wg_timers_handshake_initiated(struct wg_peer *peer)
{
mod_peer_timer(peer, &peer->timer_retransmit_handshake,
jiffies + REKEY_TIMEOUT * HZ +
@@ -202,7 +202,7 @@ void wg_timers_handshake_initiated(struct wireguard_peer *peer)
/* Should be called after a handshake response message is received and processed
* or when getting key confirmation via the first data message.
*/
-void wg_timers_handshake_complete(struct wireguard_peer *peer)
+void wg_timers_handshake_complete(struct wg_peer *peer)
{
del_peer_timer(peer, &peer->timer_retransmit_handshake);
peer->timer_handshake_attempts = 0;
@@ -213,7 +213,7 @@ void wg_timers_handshake_complete(struct wireguard_peer *peer)
/* Should be called after an ephemeral key is created, which is before sending a
* handshake response or after receiving a handshake response.
*/
-void wg_timers_session_derived(struct wireguard_peer *peer)
+void wg_timers_session_derived(struct wg_peer *peer)
{
mod_peer_timer(peer, &peer->timer_zero_key_material,
jiffies + REJECT_AFTER_TIME * 3 * HZ);
@@ -222,14 +222,14 @@ void wg_timers_session_derived(struct wireguard_peer *peer)
/* Should be called before a packet with authentication, whether
* keepalive, data, or handshakem is sent, or after one is received.
*/
-void wg_timers_any_authenticated_packet_traversal(struct wireguard_peer *peer)
+void wg_timers_any_authenticated_packet_traversal(struct wg_peer *peer)
{
if (peer->persistent_keepalive_interval)
mod_peer_timer(peer, &peer->timer_persistent_keepalive,
jiffies + peer->persistent_keepalive_interval * HZ);
}
-void wg_timers_init(struct wireguard_peer *peer)
+void wg_timers_init(struct wg_peer *peer)
{
timer_setup(&peer->timer_retransmit_handshake,
wg_expired_retransmit_handshake, 0);
@@ -244,7 +244,7 @@ void wg_timers_init(struct wireguard_peer *peer)
peer->timer_need_another_keepalive = false;
}
-void wg_timers_stop(struct wireguard_peer *peer)
+void wg_timers_stop(struct wg_peer *peer)
{
del_timer_sync(&peer->timer_retransmit_handshake);
del_timer_sync(&peer->timer_send_keepalive);