]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
inet_ntop: rename curlx_inet_ntop to Curl_inet_ntop
authorDaniel Stenberg <daniel@haxx.se>
Sun, 11 May 2025 21:48:10 +0000 (23:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 12 May 2025 05:42:59 +0000 (07:42 +0200)
It is not part of the curlx club.

Closes #17313

lib/connect.c
lib/ftp.c
lib/hostip.c
lib/if2ip.c
lib/inet_ntop.c
lib/inet_ntop.h
lib/urlapi.c

index 52f2c84a4e44da270a68f38e8e39d3cc58a8c999..2ae87bc0c12dc61474454848551034d22510a9e9 100644 (file)
@@ -255,7 +255,7 @@ addr_next_match(const struct Curl_addrinfo *addr, int family)
 }
 
 /* retrieves ip address and port from a sockaddr structure.
-   note it calls curlx_inet_ntop which sets errno on fail, not SOCKERRNO. */
+   note it calls Curl_inet_ntop which sets errno on fail, not SOCKERRNO. */
 bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
                       char *addr, int *port)
 {
@@ -272,8 +272,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
   switch(sa->sa_family) {
     case AF_INET:
       si = (struct sockaddr_in *)(void *) sa;
-      if(curlx_inet_ntop(sa->sa_family, &si->sin_addr,
-                         addr, MAX_IPADR_LEN)) {
+      if(Curl_inet_ntop(sa->sa_family, &si->sin_addr, addr, MAX_IPADR_LEN)) {
         unsigned short us_port = ntohs(si->sin_port);
         *port = us_port;
         return TRUE;
@@ -282,8 +281,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
 #ifdef USE_IPV6
     case AF_INET6:
       si6 = (struct sockaddr_in6 *)(void *) sa;
-      if(curlx_inet_ntop(sa->sa_family, &si6->sin6_addr,
-                         addr, MAX_IPADR_LEN)) {
+      if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr, addr, MAX_IPADR_LEN)) {
         unsigned short us_port = ntohs(si6->sin6_port);
         *port = us_port;
         return TRUE;
index 8804ce5e61601a0ab315ec94972982f84f058319..b47406f8c225e63078b7174b6c3b97d93baa05b3 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1020,11 +1020,11 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
     switch(sa->sa_family) {
 #ifdef USE_IPV6
     case AF_INET6:
-      r = curlx_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf));
+      r = Curl_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf));
       break;
 #endif
     default:
-      r = curlx_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf));
+      r = Curl_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf));
       break;
     }
     if(!r) {
index 266ba8e549212a184b8b496fd2de10d9eccd749d..6cb695f3c4ae1bf1d1905adc639e721c35267d5d 100644 (file)
@@ -145,14 +145,14 @@ void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf,
   case AF_INET: {
     const struct sockaddr_in *sa4 = (const void *)ai->ai_addr;
     const struct in_addr *ipaddr4 = &sa4->sin_addr;
-    (void)curlx_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
+    (void)Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
     break;
   }
 #ifdef USE_IPV6
   case AF_INET6: {
     const struct sockaddr_in6 *sa6 = (const void *)ai->ai_addr;
     const struct in6_addr *ipaddr6 = &sa6->sin6_addr;
-    (void)curlx_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
+    (void)Curl_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
     break;
   }
 #endif
index a8acd1f2e4b6d950e7dd618a6a9adc916e73da6e..6da68efd500d09d49e9653d6578ce061aaa4cc4c 100644 (file)
@@ -162,7 +162,7 @@ if2ip_result_t Curl_if2ip(int af,
               addr =
                 &((struct sockaddr_in *)(void *)iface->ifa_addr)->sin_addr;
             res = IF2IP_FOUND;
-            ip = curlx_inet_ntop(af, addr, ipstr, sizeof(ipstr));
+            ip = Curl_inet_ntop(af, addr, ipstr, sizeof(ipstr));
             msnprintf(buf, buf_size, "%s%s", ip, scope);
             break;
           }
@@ -235,7 +235,7 @@ if2ip_result_t Curl_if2ip(int af,
 
   s = (struct sockaddr_in *)(void *)&req.ifr_addr;
   memcpy(&in, &s->sin_addr, sizeof(in));
-  r = curlx_inet_ntop(s->sin_family, &in, buf, buf_size);
+  r = Curl_inet_ntop(s->sin_family, &in, buf, buf_size);
 
   sclose(dummy);
   if(!r)
index 26d84a907b9f72058eb8f21a705adab3c952dc6f..a1a34891c004b301ce1ea63aa7721c4671fedb90 100644 (file)
@@ -196,7 +196,7 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
  * code. This is to avoid losing the actual last Winsock error. When this
  * function returns NULL, check errno not SOCKERRNO.
  */
-char *curlx_inet_ntop(int af, const void *src, char *buf, size_t size)
+char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size)
 {
   switch(af) {
   case AF_INET:
index 97d5adedb51265d342524e12cd8b6193f1a572c6..9923daaed1b91d374caaf54e6b055356ac6c725e 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "curl_setup.h"
 
-char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size);
+char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
 
 #ifdef HAVE_INET_NTOP
 #ifdef HAVE_NETINET_IN_H
@@ -39,12 +39,12 @@ char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size);
 #include <arpa/inet.h>
 #endif
 #ifdef __AMIGA__
-#define curlx_inet_ntop(af,addr,buf,size) \
-        (char *)inet_ntop(af, CURL_UNCONST(addr), (unsigned char *)buf, \
-                          (curl_socklen_t)(size))
+#define Curl_inet_ntop(af,addr,buf,size)                                \
+  (char *)inet_ntop(af, CURL_UNCONST(addr), (unsigned char *)buf,       \
+                    (curl_socklen_t)(size))
 #else
-#define curlx_inet_ntop(af,addr,buf,size) \
-        inet_ntop(af, addr, buf, (curl_socklen_t)(size))
+#define Curl_inet_ntop(af,addr,buf,size)                \
+  inet_ntop(af, addr, buf, (curl_socklen_t)(size))
 #endif
 #endif
 
index f2196a8062ea684209d7dc882d9772d8eb905b69..8cf174ff23421554c084d9116ce627d6f285d2b3 100644 (file)
@@ -513,7 +513,7 @@ static CURLUcode ipv6_parse(struct Curl_URL *u, char *hostname,
     hostname[hlen] = 0; /* end the address there */
     if(1 != curlx_inet_pton(AF_INET6, hostname, dest))
       return CURLUE_BAD_IPV6;
-    if(curlx_inet_ntop(AF_INET6, dest, hostname, hlen)) {
+    if(Curl_inet_ntop(AF_INET6, dest, hostname, hlen)) {
       hlen = strlen(hostname); /* might be shorter now */
       hostname[hlen + 1] = 0;
     }