aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/timers.c
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
commit45a53bbaafbca0af90f0fb097b1ff6c151b5d8f0 (patch)
tree9409e8289e08211e35e8cdeef0e509e1e254acc0 /src/timers.c
parentpoly1305-mips64: use compiler-defined macros in assembly (diff)
downloadwireguard-monolithic-historical-45a53bbaafbca0af90f0fb097b1ff6c151b5d8f0.tar.xz
wireguard-monolithic-historical-45a53bbaafbca0af90f0fb097b1ff6c151b5d8f0.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>
Diffstat (limited to 'src/timers.c')
-rw-r--r--src/timers.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/timers.c b/src/timers.c
index fdc8c38..f8cd5c5 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -29,7 +29,7 @@
#define peer_get_from_timer(timer_name) \
struct wireguard_peer *peer; \
rcu_read_lock_bh(); \
- peer = peer_get_maybe_zero(from_timer(peer, timer, timer_name)); \
+ peer = wg_peer_get_maybe_zero(from_timer(peer, timer, timer_name)); \
rcu_read_unlock_bh(); \
if (unlikely(!peer)) \
return;
@@ -84,24 +84,24 @@ static void expired_retransmit_handshake(struct timer_list *timer)
/* We clear the endpoint address src address, in case this is
* the cause of trouble.
*/
- socket_clear_peer_endpoint_src(peer);
+ wg_socket_clear_peer_endpoint_src(peer);
- packet_send_queued_handshake_initiation(peer, true);
+ wg_packet_send_queued_handshake_initiation(peer, true);
}
- peer_put(peer);
+ wg_peer_put(peer);
}
static void expired_send_keepalive(struct timer_list *timer)
{
peer_get_from_timer(timer_send_keepalive);
- packet_send_keepalive(peer);
+ wg_packet_send_keepalive(peer);
if (peer->timer_need_another_keepalive) {
peer->timer_need_another_keepalive = false;
mod_peer_timer(peer, &peer->timer_send_keepalive,
jiffies + KEEPALIVE_TIMEOUT * HZ);
}
- peer_put(peer);
+ wg_peer_put(peer);
}
static void expired_new_handshake(struct timer_list *timer)
@@ -114,9 +114,9 @@ static void expired_new_handshake(struct timer_list *timer)
/* We clear the endpoint address src address, in case this is the cause
* of trouble.
*/
- socket_clear_peer_endpoint_src(peer);
- packet_send_queued_handshake_initiation(peer, false);
- peer_put(peer);
+ wg_socket_clear_peer_endpoint_src(peer);
+ wg_packet_send_queued_handshake_initiation(peer, false);
+ wg_peer_put(peer);
}
static void expired_zero_key_material(struct timer_list *timer)
@@ -129,7 +129,7 @@ static void expired_zero_key_material(struct timer_list *timer)
if (!queue_work(peer->device->handshake_send_wq,
&peer->clear_peer_work))
/* If the work was already on the queue, we want to drop the extra reference */
- peer_put(peer);
+ wg_peer_put(peer);
}
rcu_read_unlock_bh();
}
@@ -141,9 +141,9 @@ static void queued_expired_zero_key_material(struct work_struct *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,
&peer->endpoint.addr, REJECT_AFTER_TIME * 3);
- noise_handshake_clear(&peer->handshake);
- noise_keypairs_clear(&peer->keypairs);
- peer_put(peer);
+ wg_noise_handshake_clear(&peer->handshake);
+ wg_noise_keypairs_clear(&peer->keypairs);
+ wg_peer_put(peer);
}
static void expired_send_persistent_keepalive(struct timer_list *timer)
@@ -151,12 +151,12 @@ static void expired_send_persistent_keepalive(struct timer_list *timer)
peer_get_from_timer(timer_persistent_keepalive);
if (likely(peer->persistent_keepalive_interval))
- packet_send_keepalive(peer);
- peer_put(peer);
+ wg_packet_send_keepalive(peer);
+ wg_peer_put(peer);
}
/* Should be called after an authenticated data packet is sent. */
-void timers_data_sent(struct wireguard_peer *peer)
+void wg_timers_data_sent(struct wireguard_peer *peer)
{
if (!timer_pending(&peer->timer_new_handshake))
mod_peer_timer(peer, &peer->timer_new_handshake,
@@ -164,7 +164,7 @@ void timers_data_sent(struct wireguard_peer *peer)
}
/* Should be called after an authenticated data packet is received. */
-void timers_data_received(struct wireguard_peer *peer)
+void wg_timers_data_received(struct wireguard_peer *peer)
{
if (likely(netif_running(peer->device->dev))) {
if (!timer_pending(&peer->timer_send_keepalive))
@@ -178,7 +178,7 @@ void timers_data_received(struct wireguard_peer *peer)
/* Should be called after any type of authenticated packet is sent, whether
* keepalive, data, or handshake.
*/
-void timers_any_authenticated_packet_sent(struct wireguard_peer *peer)
+void wg_timers_any_authenticated_packet_sent(struct wireguard_peer *peer)
{
del_peer_timer(peer, &peer->timer_send_keepalive);
}
@@ -186,13 +186,13 @@ void 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 timers_any_authenticated_packet_received(struct wireguard_peer *peer)
+void wg_timers_any_authenticated_packet_received(struct wireguard_peer *peer)
{
del_peer_timer(peer, &peer->timer_new_handshake);
}
/* Should be called after a handshake initiation message is sent. */
-void timers_handshake_initiated(struct wireguard_peer *peer)
+void wg_timers_handshake_initiated(struct wireguard_peer *peer)
{
mod_peer_timer(
peer, &peer->timer_retransmit_handshake,
@@ -203,7 +203,7 @@ void 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 timers_handshake_complete(struct wireguard_peer *peer)
+void wg_timers_handshake_complete(struct wireguard_peer *peer)
{
del_peer_timer(peer, &peer->timer_retransmit_handshake);
peer->timer_handshake_attempts = 0;
@@ -214,7 +214,7 @@ void 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 timers_session_derived(struct wireguard_peer *peer)
+void wg_timers_session_derived(struct wireguard_peer *peer)
{
mod_peer_timer(peer, &peer->timer_zero_key_material,
jiffies + REJECT_AFTER_TIME * 3 * HZ);
@@ -223,14 +223,14 @@ void 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 timers_any_authenticated_packet_traversal(struct wireguard_peer *peer)
+void wg_timers_any_authenticated_packet_traversal(struct wireguard_peer *peer)
{
if (peer->persistent_keepalive_interval)
mod_peer_timer(peer, &peer->timer_persistent_keepalive,
jiffies + peer->persistent_keepalive_interval * HZ);
}
-void timers_init(struct wireguard_peer *peer)
+void wg_timers_init(struct wireguard_peer *peer)
{
timer_setup(&peer->timer_retransmit_handshake,
expired_retransmit_handshake, 0);
@@ -245,7 +245,7 @@ void timers_init(struct wireguard_peer *peer)
peer->timer_need_another_keepalive = false;
}
-void timers_stop(struct wireguard_peer *peer)
+void wg_timers_stop(struct wireguard_peer *peer)
{
del_timer_sync(&peer->timer_retransmit_handshake);
del_timer_sync(&peer->timer_send_keepalive);