diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2019-04-01 17:54:28 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2019-04-02 00:27:38 +0200 |
commit | 5a8ea76603509e4518d527fe9f77d5f2a97dfa00 (patch) | |
tree | ad72ed30d18deb3eebee1b23dbcb6776a220b1be | |
parent | cc7485dab8b6feadb3083be303c39e0f5ec71302 (diff) |
wireguard-lib: Define wg_endpoint type
-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 d8965f75..300eaa85 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; |