diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2019-04-01 17:54:28 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-08 18:52:55 +0200 |
commit | 4577100b6620bfc998a2cff2b9fd87d969f9dd35 (patch) | |
tree | c05983c871e8d7c989711f8a0d626f36548df265 /sysdep/linux | |
parent | 6dddcc519697a9a0b8e17707fd8f8a38ec8d1aa2 (diff) |
Wireguard-lib: Define wg_endpoint type
Diffstat (limited to 'sysdep/linux')
-rw-r--r-- | sysdep/linux/wireguard.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sysdep/linux/wireguard.h b/sysdep/linux/wireguard.h index e7a1bbf0..66c19304 100644 --- a/sysdep/linux/wireguard.h +++ b/sysdep/linux/wireguard.h @@ -40,17 +40,19 @@ enum wg_peer_flags { WGPEER_HAS_PERSISTENT_KEEPALIVE_INTERVAL = 1U << 4 }; +typedef union wg_endpoint { + struct sockaddr addr; + struct sockaddr_in addr4; + struct sockaddr_in6 addr6; +} wg_endpoint; + typedef struct wg_peer { enum wg_peer_flags flags; wg_key public_key; wg_key preshared_key; - union { - struct sockaddr addr; - struct sockaddr_in addr4; - struct sockaddr_in6 addr6; - } endpoint; + wg_endpoint endpoint; struct timespec64 last_handshake_time; uint64_t rx_bytes, tx_bytes; |