cf-socket: make Curl_addr2string static

Move as sockaddr2string() into cf-socket.c where its only callers are.

Mark as UNITTEST for unit1609.

Move "struct Curl_sockaddr_ex" into sockaddr.h, so connect.h and
cf-socket.h can be included without all the system headers needed.

Closes #21946
This commit is contained in:
Stefan Eissing 2026-06-10 13:18:30 +02:00 committed by Daniel Stenberg
parent 7ec25148c0
commit 30c9c79cf8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
11 changed files with 95 additions and 91 deletions

View file

@ -25,8 +25,6 @@
***************************************************************************/
#include "curl_setup.h"
#include "sockaddr.h" /* required for Curl_sockaddr_storage */
struct Curl_addrinfo;
struct Curl_cfilter;
struct Curl_easy;
@ -34,23 +32,6 @@ struct connectdata;
struct Curl_sockaddr_ex;
struct ip_quadruple;
/*
* The Curl_sockaddr_ex structure is libcurl's external API curl_sockaddr
* structure with enough space available to directly hold any
* protocol-specific address structures. The variable declared here will be
* used to pass / receive data to/from the fopensocket callback if this has
* been set, before that, it is initialized from parameters.
*/
struct Curl_sockaddr_ex {
int family;
int socktype;
int protocol;
unsigned int addrlen;
union {
struct sockaddr sa;
struct Curl_sockaddr_storage buf;
} addr;
};
#define curl_sa_addr addr.sa
#define curl_sa_addrbuf addr.buf