From c590be7c6ead811f929041393a061e4068f35b00 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 27 Dec 2019 01:06:35 -0800 Subject: fixes #1051 nni_ntop is unused --- src/platform/windows/win_resolv.c | 43 +-------------------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'src/platform/windows') diff --git a/src/platform/windows/win_resolv.c b/src/platform/windows/win_resolv.c index e01dba3b..53a39118 100644 --- a/src/platform/windows/win_resolv.c +++ b/src/platform/windows/win_resolv.c @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -307,47 +307,6 @@ resolv_worker(void *notused) nni_mtx_unlock(&resolv_mtx); } -int -nni_ntop(const nni_sockaddr *sa, char *ipstr, char *portstr) -{ - void * ap; - uint16_t port; - int af; - switch (sa->s_family) { - case NNG_AF_INET: - ap = (void *) &sa->s_in.sa_addr; - port = sa->s_in.sa_port; - af = AF_INET; - break; - case NNG_AF_INET6: - ap = (void *) &sa->s_in6.sa_addr; - port = sa->s_in6.sa_port; - af = AF_INET6; - break; - default: - return (NNG_EINVAL); - } - if (ipstr != NULL) { - if (af == AF_INET6) { - size_t l; - ipstr[0] = '['; - InetNtopA(af, ap, ipstr + 1, INET6_ADDRSTRLEN); - l = strlen(ipstr); - ipstr[l++] = ']'; - ipstr[l++] = '\0'; - } else { - InetNtopA(af, ap, ipstr, INET6_ADDRSTRLEN); - } - } - if (portstr != NULL) { -#ifdef NNG_LITTLE_ENDIAN - port = ((port >> 8) & 0xff) | ((port & 0xff) << 8); -#endif - snprintf(portstr, 6, "%u", port); - } - return (0); -} - int nni_win_resolv_sysinit(void) { -- cgit v1.2.3-70-g09d2