From d86b7e4e1d4462ba037187200fd344d76c7ee37a Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Mon, 11 Nov 2019 13:37:51 +0900 Subject: [PATCH] Fix use of addr/socket types --- src/UDPC_Defines.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/UDPC_Defines.hpp b/src/UDPC_Defines.hpp index 4ef289e..a60fec0 100644 --- a/src/UDPC_Defines.hpp +++ b/src/UDPC_Defines.hpp @@ -72,12 +72,12 @@ struct ConnectionIdHasher { }; struct IPV6_Hasher { - std::size_t operator()(const struct in6_addr& addr) const; + std::size_t operator()(const UDPC_IPV6_ADDR_TYPE& addr) const; }; struct ConnectionData { ConnectionData(); - ConnectionData(bool isServer, Context *ctx, struct in6_addr addr, uint32_t scope_id, uint16_t port); + ConnectionData(bool isServer, Context *ctx, UDPC_IPV6_ADDR_TYPE addr, uint32_t scope_id, uint16_t port); // copy ConnectionData(const ConnectionData& other) = delete; @@ -106,7 +106,7 @@ struct ConnectionData { std::chrono::steady_clock::duration toggleT; std::chrono::steady_clock::duration toggleTimer; std::chrono::steady_clock::duration toggledTimer; - struct in6_addr addr; // in network order + UDPC_IPV6_ADDR_TYPE addr; // in network order uint32_t scope_id; uint16_t port; // in native order std::deque sentPkts; @@ -191,13 +191,13 @@ public: char atostrBuf[UDPC_ATOSTR_SIZE]; UDPC_SOCKETTYPE socketHandle; - struct sockaddr_in6 socketInfo; + UDPC_IPV6_SOCKADDR_TYPE socketInfo; std::chrono::steady_clock::time_point lastUpdated; // ipv6 address and port (as UDPC_ConnectionId) to ConnectionData std::unordered_map conMap; // ipv6 address to all connected UDPC_ConnectionId - std::unordered_map, IPV6_Hasher> addrConMap; + std::unordered_map, IPV6_Hasher> addrConMap; // id to ipv6 address and port (as UDPC_ConnectionId) std::unordered_map idMap; TSLQueue receivedPkts; @@ -242,6 +242,6 @@ void threadedUpdate(Context *ctx); bool operator ==(const UDPC_ConnectionId& a, const UDPC_ConnectionId& b); -bool operator ==(const struct in6_addr& a, const struct in6_addr& b); +bool operator ==(const UDPC_IPV6_ADDR_TYPE& a, const UDPC_IPV6_ADDR_TYPE& b); #endif -- 2.49.0