From f454c84a2355fd7297db065ab34e845f2c6102a9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 26 Jun 2024 06:35:40 +0100 Subject: [PATCH] Rename SocketPeerInfo to SocketEndpointInfo. I'm preparing to be able to ask about the other end of the connection too, so the first step is to give this data structure a neutral name that can refer to either. No functional change yet. --- defs.h | 2 +- errsock.c | 2 +- network.h | 16 ++++++++-------- pageant.c | 4 ++-- proxy/sshproxy.c | 2 +- psocks.c | 4 ++-- ssh.h | 8 ++++---- ssh/connection1-client.c | 2 +- ssh/connection1-server.c | 2 +- ssh/connection1.c | 4 ++-- ssh/connection1.h | 2 +- ssh/connection2-client.c | 4 ++-- ssh/connection2-server.c | 4 ++-- ssh/connection2.c | 4 ++-- ssh/connection2.h | 4 ++-- ssh/portfwd.c | 4 ++-- ssh/sesschan.c | 4 ++-- ssh/sharing.c | 4 ++-- unix/network.c | 8 ++++---- unix/psusan.c | 4 ++-- unix/uppity.c | 6 +++--- utils/sk_free_peer_info.c | 12 ++++++------ windows/handle-socket.c | 6 +++--- windows/named-pipe-server.c | 2 +- windows/network.c | 8 ++++---- 25 files changed, 61 insertions(+), 61 deletions(-) diff --git a/defs.h b/defs.h index 1c67197b..3192f384 100644 --- a/defs.h +++ b/defs.h @@ -104,7 +104,7 @@ typedef struct SockAddr SockAddr; typedef struct Socket Socket; typedef struct Plug Plug; -typedef struct SocketPeerInfo SocketPeerInfo; +typedef struct SocketEndpointInfo SocketEndpointInfo; typedef struct DeferredSocketOpener DeferredSocketOpener; typedef struct DeferredSocketOpenerVtable DeferredSocketOpenerVtable; diff --git a/errsock.c b/errsock.c index 6f26629d..c951e27b 100644 --- a/errsock.c +++ b/errsock.c @@ -39,7 +39,7 @@ static const char *sk_error_socket_error(Socket *s) return es->error; } -static SocketPeerInfo *sk_error_peer_info(Socket *s) +static SocketEndpointInfo *sk_error_peer_info(Socket *s) { return NULL; } diff --git a/network.h b/network.h index 57e6662d..cfe90267 100644 --- a/network.h +++ b/network.h @@ -34,7 +34,7 @@ struct SocketVtable { void (*set_frozen) (Socket *s, bool is_frozen); /* ignored by tcp, but vital for ssl */ const char *(*socket_error) (Socket *s); - SocketPeerInfo *(*peer_info) (Socket *s); + SocketEndpointInfo *(*peer_info) (Socket *s); }; typedef union { void *p; int i; } accept_ctx_t; @@ -292,23 +292,23 @@ static inline void sk_set_frozen(Socket *s, bool is_frozen) { s->vt->set_frozen(s, is_frozen); } /* - * Return a structure giving some information about the other end of + * Return a structure giving some information about one end of * the socket. May be NULL, if nothing is available at all. If it is * not NULL, then it is dynamically allocated, and should be freed by - * a call to sk_free_peer_info(). See below for the definition. + * a call to sk_free_endpoint_info(). See below for the definition. */ -static inline SocketPeerInfo *sk_peer_info(Socket *s) +static inline SocketEndpointInfo *sk_peer_info(Socket *s) { return s->vt->peer_info(s); } /* - * The structure returned from sk_peer_info, and a function to free + * The structure returned from sk_endpoint_info, and a function to free * one (in utils). */ -struct SocketPeerInfo { +struct SocketEndpointInfo { int addressfamily; /* - * Text form of the IPv4 or IPv6 address of the other end of the + * Text form of the IPv4 or IPv6 address of the specified end of the * socket, if available, in the standard text representation. */ const char *addr_text; @@ -337,7 +337,7 @@ struct SocketPeerInfo { */ const char *log_text; }; -void sk_free_peer_info(SocketPeerInfo *pi); +void sk_free_endpoint_info(SocketEndpointInfo *ei); /* * Simple wrapper on getservbyname(), needed by portfwd.c. Returns the diff --git a/pageant.c b/pageant.c index 2d509728..961e1f03 100644 --- a/pageant.c +++ b/pageant.c @@ -1885,7 +1885,7 @@ static int pageant_listen_accepting(Plug *plug, plug, struct pageant_listen_state, plug); struct pageant_conn_state *pc; const char *err; - SocketPeerInfo *peerinfo; + SocketEndpointInfo *peerinfo; pc = snew(struct pageant_conn_state); pc->plug.vt = &pageant_connection_plugvt; @@ -1914,7 +1914,7 @@ static int pageant_listen_accepting(Plug *plug, pageant_listener_client_log(pl->plc, "c#%"SIZEu": new connection", pc->conn_index); } - sk_free_peer_info(peerinfo); + sk_free_endpoint_info(peerinfo); pageant_register_client(&pc->pc); diff --git a/proxy/sshproxy.c b/proxy/sshproxy.c index 8a20d0ac..9d3b2318 100644 --- a/proxy/sshproxy.c +++ b/proxy/sshproxy.c @@ -123,7 +123,7 @@ static const char *sshproxy_socket_error(Socket *s) return sp->errmsg; } -static SocketPeerInfo *sshproxy_peer_info(Socket *s) +static SocketEndpointInfo *sshproxy_peer_info(Socket *s) { return NULL; } diff --git a/psocks.c b/psocks.c index f9e76949..5054a674 100644 --- a/psocks.c +++ b/psocks.c @@ -72,7 +72,7 @@ struct psocks_connection { static SshChannel *psocks_lportfwd_open( ConnectionLayer *cl, const char *hostname, int port, - const char *description, const SocketPeerInfo *pi, Channel *chan); + const char *description, const SocketEndpointInfo *pi, Channel *chan); static const ConnectionLayerVtable psocks_clvt = { .lportfwd_open = psocks_lportfwd_open, @@ -154,7 +154,7 @@ static void psocks_connection_establish(void *vctx); static SshChannel *psocks_lportfwd_open( ConnectionLayer *cl, const char *hostname, int port, - const char *description, const SocketPeerInfo *pi, Channel *chan) + const char *description, const SocketEndpointInfo *pi, Channel *chan) { psocks_state *ps = container_of(cl, psocks_state, cl); psocks_connection *conn = snew(psocks_connection); diff --git a/ssh.h b/ssh.h index 852eec18..46356f0c 100644 --- a/ssh.h +++ b/ssh.h @@ -225,7 +225,7 @@ struct ConnectionLayerVtable { * PortFwdManager */ SshChannel *(*lportfwd_open)( ConnectionLayer *cl, const char *hostname, int port, - const char *description, const SocketPeerInfo *peerinfo, + const char *description, const SocketEndpointInfo *peerinfo, Channel *chan); /* Initiate opening of a 'session'-type channel */ @@ -234,7 +234,7 @@ struct ConnectionLayerVtable { /* Open outgoing channels for X and agent forwarding. (Used in the * SSH server.) */ SshChannel *(*serverside_x11_open)(ConnectionLayer *cl, Channel *chan, - const SocketPeerInfo *pi); + const SocketEndpointInfo *pi); SshChannel *(*serverside_agent_open)(ConnectionLayer *cl, Channel *chan); /* Add an X11 display for ordinary X forwarding */ @@ -324,12 +324,12 @@ static inline void ssh_rportfwd_remove( { cl->vt->rportfwd_remove(cl, rpf); } static inline SshChannel *ssh_lportfwd_open( ConnectionLayer *cl, const char *host, int port, - const char *desc, const SocketPeerInfo *pi, Channel *chan) + const char *desc, const SocketEndpointInfo *pi, Channel *chan) { return cl->vt->lportfwd_open(cl, host, port, desc, pi, chan); } static inline SshChannel *ssh_session_open(ConnectionLayer *cl, Channel *chan) { return cl->vt->session_open(cl, chan); } static inline SshChannel *ssh_serverside_x11_open( - ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi) + ConnectionLayer *cl, Channel *chan, const SocketEndpointInfo *pi) { return cl->vt->serverside_x11_open(cl, chan, pi); } static inline SshChannel *ssh_serverside_agent_open( ConnectionLayer *cl, Channel *chan) diff --git a/ssh/connection1-client.c b/ssh/connection1-client.c index 41bf9716..e7e6f677 100644 --- a/ssh/connection1-client.c +++ b/ssh/connection1-client.c @@ -531,7 +531,7 @@ struct ssh_rportfwd *ssh1_rportfwd_alloc( } SshChannel *ssh1_serverside_x11_open( - ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi) + ConnectionLayer *cl, Channel *chan, const SocketEndpointInfo *pi) { unreachable("Should never be called in the client"); } diff --git a/ssh/connection1-server.c b/ssh/connection1-server.c index cc69bdb3..a2ccf773 100644 --- a/ssh/connection1-server.c +++ b/ssh/connection1-server.c @@ -315,7 +315,7 @@ static void ssh1sesschan_send_exit_signal( } SshChannel *ssh1_serverside_x11_open( - ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi) + ConnectionLayer *cl, Channel *chan, const SocketEndpointInfo *pi) { struct ssh1_connection_state *s = container_of(cl, struct ssh1_connection_state, cl); diff --git a/ssh/connection1.c b/ssh/connection1.c index 7204450a..0156bca1 100644 --- a/ssh/connection1.c +++ b/ssh/connection1.c @@ -48,7 +48,7 @@ static void ssh1_rportfwd_remove( ConnectionLayer *cl, struct ssh_rportfwd *rpf); static SshChannel *ssh1_lportfwd_open( ConnectionLayer *cl, const char *hostname, int port, - const char *description, const SocketPeerInfo *pi, Channel *chan); + const char *description, const SocketEndpointInfo *pi, Channel *chan); static struct X11FakeAuth *ssh1_add_x11_display( ConnectionLayer *cl, int authtype, struct X11Display *disp); static bool ssh1_agent_forwarding_permitted(ConnectionLayer *cl); @@ -641,7 +641,7 @@ static struct X11FakeAuth *ssh1_add_x11_display( static SshChannel *ssh1_lportfwd_open( ConnectionLayer *cl, const char *hostname, int port, - const char *description, const SocketPeerInfo *pi, Channel *chan) + const char *description, const SocketEndpointInfo *pi, Channel *chan) { struct ssh1_connection_state *s = container_of(cl, struct ssh1_connection_state, cl); diff --git a/ssh/connection1.h b/ssh/connection1.h index ff370131..696aa27f 100644 --- a/ssh/connection1.h +++ b/ssh/connection1.h @@ -111,7 +111,7 @@ struct ssh_rportfwd *ssh1_rportfwd_alloc( int addressfamily, const char *log_description, PortFwdRecord *pfr, ssh_sharing_connstate *share_ctx); SshChannel *ssh1_serverside_x11_open( - ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi); + ConnectionLayer *cl, Channel *chan, const SocketEndpointInfo *pi); SshChannel *ssh1_serverside_agent_open(ConnectionLayer *cl, Channel *chan); void ssh1_connection_direction_specific_setup( diff --git a/ssh/connection2-client.c b/ssh/connection2-client.c index f17d1e21..e8e0c137 100644 --- a/ssh/connection2-client.c +++ b/ssh/connection2-client.c @@ -156,7 +156,7 @@ bool ssh2_connection_parse_global_request( PktOut *ssh2_portfwd_chanopen( struct ssh2_connection_state *s, struct ssh2_channel *c, const char *hostname, int port, - const char *description, const SocketPeerInfo *peerinfo) + const char *description, const SocketEndpointInfo *peerinfo) { PacketProtocolLayer *ppl = &s->ppl; /* for ppl_logevent */ PktOut *pktout; @@ -321,7 +321,7 @@ SshChannel *ssh2_session_open(ConnectionLayer *cl, Channel *chan) } SshChannel *ssh2_serverside_x11_open( - ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi) + ConnectionLayer *cl, Channel *chan, const SocketEndpointInfo *pi) { unreachable("Should never be called in the client"); } diff --git a/ssh/connection2-server.c b/ssh/connection2-server.c index c871b4b3..20966553 100644 --- a/ssh/connection2-server.c +++ b/ssh/connection2-server.c @@ -109,7 +109,7 @@ bool ssh2_connection_parse_global_request( PktOut *ssh2_portfwd_chanopen( struct ssh2_connection_state *s, struct ssh2_channel *c, const char *hostname, int port, - const char *description, const SocketPeerInfo *pi) + const char *description, const SocketEndpointInfo *pi) { PacketProtocolLayer *ppl = &s->ppl; /* for ppl_logevent */ PktOut *pktout; @@ -158,7 +158,7 @@ SshChannel *ssh2_session_open(ConnectionLayer *cl, Channel *chan) } SshChannel *ssh2_serverside_x11_open( - ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi) + ConnectionLayer *cl, Channel *chan, const SocketEndpointInfo *pi) { struct ssh2_connection_state *s = container_of(cl, struct ssh2_connection_state, cl); diff --git a/ssh/connection2.c b/ssh/connection2.c index b08dab5f..4d324f80 100644 --- a/ssh/connection2.c +++ b/ssh/connection2.c @@ -33,7 +33,7 @@ static const PacketProtocolLayerVtable ssh2_connection_vtable = { static SshChannel *ssh2_lportfwd_open( ConnectionLayer *cl, const char *hostname, int port, - const char *description, const SocketPeerInfo *pi, Channel *chan); + const char *description, const SocketEndpointInfo *pi, Channel *chan); static struct X11FakeAuth *ssh2_add_x11_display( ConnectionLayer *cl, int authtype, struct X11Display *x11disp); static struct X11FakeAuth *ssh2_add_sharing_x11_display( @@ -1461,7 +1461,7 @@ static void ssh2channel_hint_channel_is_simple(SshChannel *sc) static SshChannel *ssh2_lportfwd_open( ConnectionLayer *cl, const char *hostname, int port, - const char *description, const SocketPeerInfo *pi, Channel *chan) + const char *description, const SocketEndpointInfo *pi, Channel *chan) { struct ssh2_connection_state *s = container_of(cl, struct ssh2_connection_state, cl); diff --git a/ssh/connection2.h b/ssh/connection2.h index 54c3ebf9..941d350e 100644 --- a/ssh/connection2.h +++ b/ssh/connection2.h @@ -159,7 +159,7 @@ PktOut *ssh2_chanopen_init(struct ssh2_channel *c, const char *type); PktOut *ssh2_portfwd_chanopen( struct ssh2_connection_state *s, struct ssh2_channel *c, const char *hostname, int port, - const char *description, const SocketPeerInfo *peerinfo); + const char *description, const SocketEndpointInfo *peerinfo); struct ssh_rportfwd *ssh2_rportfwd_alloc( ConnectionLayer *cl, @@ -170,7 +170,7 @@ void ssh2_rportfwd_remove( ConnectionLayer *cl, struct ssh_rportfwd *rpf); SshChannel *ssh2_session_open(ConnectionLayer *cl, Channel *chan); SshChannel *ssh2_serverside_x11_open( - ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi); + ConnectionLayer *cl, Channel *chan, const SocketEndpointInfo *pi); SshChannel *ssh2_serverside_agent_open(ConnectionLayer *cl, Channel *chan); void ssh2channel_send_exit_status(SshChannel *c, int status); diff --git a/ssh/portfwd.c b/ssh/portfwd.c index b4eea3c9..5f6c9fb1 100644 --- a/ssh/portfwd.c +++ b/ssh/portfwd.c @@ -152,7 +152,7 @@ static SshChannel *wrap_lportfwd_open( ConnectionLayer *cl, const char *hostname, int port, Socket *s, Channel *chan) { - SocketPeerInfo *pi; + SocketEndpointInfo *pi; char *description; SshChannel *toret; @@ -163,7 +163,7 @@ static SshChannel *wrap_lportfwd_open( description = dupstr("forwarding"); } toret = ssh_lportfwd_open(cl, hostname, port, description, pi, chan); - sk_free_peer_info(pi); + sk_free_endpoint_info(pi); sfree(description); return toret; diff --git a/ssh/sesschan.c b/ssh/sesschan.c index 55d868e0..532fcb3b 100644 --- a/ssh/sesschan.c +++ b/ssh/sesschan.c @@ -383,7 +383,7 @@ static int xfwd_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) Plug *plug; Channel *chan; Socket *s; - SocketPeerInfo *pi; + SocketEndpointInfo *pi; const char *err; chan = portfwd_raw_new(sess->c->cl, &plug, false); @@ -394,7 +394,7 @@ static int xfwd_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) } pi = sk_peer_info(s); portfwd_raw_setup(chan, s, ssh_serverside_x11_open(sess->c->cl, chan, pi)); - sk_free_peer_info(pi); + sk_free_endpoint_info(pi); return 0; } diff --git a/ssh/sharing.c b/ssh/sharing.c index af1f4c09..2df5894c 100644 --- a/ssh/sharing.c +++ b/ssh/sharing.c @@ -1909,7 +1909,7 @@ static int share_listen_accepting(Plug *plug, plug, struct ssh_sharing_state, plug); struct ssh_sharing_connstate *cs; const char *err; - SocketPeerInfo *peerinfo; + SocketEndpointInfo *peerinfo; /* * A new downstream has connected to us. @@ -1956,7 +1956,7 @@ static int share_listen_accepting(Plug *plug, log_downstream(cs, "connected%s%s", (peerinfo && peerinfo->log_text ? " from " : ""), (peerinfo && peerinfo->log_text ? peerinfo->log_text : "")); - sk_free_peer_info(peerinfo); + sk_free_endpoint_info(peerinfo); return 0; } diff --git a/unix/network.c b/unix/network.c index 207047db..2ad1c5af 100644 --- a/unix/network.c +++ b/unix/network.c @@ -488,7 +488,7 @@ static size_t sk_net_write(Socket *s, const void *data, size_t len); static size_t sk_net_write_oob(Socket *s, const void *data, size_t len); static void sk_net_write_eof(Socket *s); static void sk_net_set_frozen(Socket *s, bool is_frozen); -static SocketPeerInfo *sk_net_peer_info(Socket *s); +static SocketEndpointInfo *sk_net_peer_info(Socket *s); static const char *sk_net_socket_error(Socket *s); static const SocketVtable NetSocket_sockvt = { @@ -1494,7 +1494,7 @@ static void sk_net_set_frozen(Socket *sock, bool is_frozen) uxsel_tell(s); } -static SocketPeerInfo *sk_net_peer_info(Socket *sock) +static SocketEndpointInfo *sk_net_peer_info(Socket *sock) { NetSocket *s = container_of(sock, NetSocket, sock); union sockaddr_union addr; @@ -1502,12 +1502,12 @@ static SocketPeerInfo *sk_net_peer_info(Socket *sock) #ifndef NO_IPV6 char buf[INET6_ADDRSTRLEN]; #endif - SocketPeerInfo *pi; + SocketEndpointInfo *pi; if (getpeername(s->s, &addr.sa, &addrlen) < 0) return NULL; - pi = snew(SocketPeerInfo); + pi = snew(SocketEndpointInfo); pi->addressfamily = ADDRTYPE_UNSPEC; pi->addr_text = NULL; pi->port = -1; diff --git a/unix/psusan.c b/unix/psusan.c index f5f7ed2a..9cf7ac41 100644 --- a/unix/psusan.c +++ b/unix/psusan.c @@ -299,12 +299,12 @@ static int server_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) if ((err = sk_socket_error(s)) != NULL) return 1; - SocketPeerInfo *pi = sk_peer_info(s); + SocketEndpointInfo *pi = sk_peer_info(s); char *msg = dupprintf("new connection from %s", pi->log_text); log_to_stderr(inst->id, msg); sfree(msg); - sk_free_peer_info(pi); + sk_free_endpoint_info(pi); sk_set_frozen(s, false); ssh_server_start(plug, s); diff --git a/unix/uppity.c b/unix/uppity.c index 711c2952..8372a88d 100644 --- a/unix/uppity.c +++ b/unix/uppity.c @@ -514,13 +514,13 @@ static int server_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) if ((err = sk_socket_error(s)) != NULL) return 1; - SocketPeerInfo *pi = sk_peer_info(s); + SocketEndpointInfo *pi = sk_peer_info(s); if (pi->addressfamily != ADDRTYPE_LOCAL && !sk_peer_trusted(s)) { fprintf(stderr, "rejected connection to serv#%u " "from %s (untrustworthy peer)\n", cfg->config_id, pi->log_text); - sk_free_peer_info(pi); + sk_free_endpoint_info(pi); sk_close(s); next_id = old_next_id; return 1; @@ -530,7 +530,7 @@ static int server_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) cfg->config_id, pi->log_text); log_to_stderr(inst->id, msg); sfree(msg); - sk_free_peer_info(pi); + sk_free_endpoint_info(pi); sk_set_frozen(s, false); ssh_server_start(plug, s); diff --git a/utils/sk_free_peer_info.c b/utils/sk_free_peer_info.c index a66e09d7..dab68590 100644 --- a/utils/sk_free_peer_info.c +++ b/utils/sk_free_peer_info.c @@ -1,14 +1,14 @@ /* - * Free a SocketPeerInfo, and everything that dangles off it. + * Free a SocketEndpointInfo, and everything that dangles off it. */ #include "putty.h" -void sk_free_peer_info(SocketPeerInfo *pi) +void sk_free_endpoint_info(SocketEndpointInfo *ei) { - if (pi) { - sfree((char *)pi->addr_text); - sfree((char *)pi->log_text); - sfree(pi); + if (ei) { + sfree((char *)ei->addr_text); + sfree((char *)ei->log_text); + sfree(ei); } } diff --git a/windows/handle-socket.c b/windows/handle-socket.c index 2820975c..5a3dd25d 100644 --- a/windows/handle-socket.c +++ b/windows/handle-socket.c @@ -296,7 +296,7 @@ static const char *sk_handle_socket_error(Socket *s) return hs->error; } -static SocketPeerInfo *sk_handle_peer_info(Socket *s) +static SocketEndpointInfo *sk_handle_peer_info(Socket *s) { HandleSocket *hs = container_of(s, HandleSocket, sock); ULONG pid; @@ -326,7 +326,7 @@ static SocketPeerInfo *sk_handle_peer_info(Socket *s) */ if (p_GetNamedPipeClientProcessId && p_GetNamedPipeClientProcessId(hs->send_H, &pid)) { - SocketPeerInfo *pi = snew(SocketPeerInfo); + SocketEndpointInfo *pi = snew(SocketEndpointInfo); pi->addressfamily = ADDRTYPE_LOCAL; pi->addr_text = NULL; pi->port = -1; @@ -431,7 +431,7 @@ static void sk_handle_deferred_set_frozen(Socket *s, bool is_frozen) hs->frozen = is_frozen; } -static SocketPeerInfo *sk_handle_deferred_peer_info(Socket *s) +static SocketEndpointInfo *sk_handle_deferred_peer_info(Socket *s) { return NULL; } diff --git a/windows/named-pipe-server.c b/windows/named-pipe-server.c index ef770796..c1074712 100644 --- a/windows/named-pipe-server.c +++ b/windows/named-pipe-server.c @@ -63,7 +63,7 @@ static const char *sk_namedpipeserver_socket_error(Socket *s) return ps->error; } -static SocketPeerInfo *sk_namedpipeserver_peer_info(Socket *s) +static SocketEndpointInfo *sk_namedpipeserver_peer_info(Socket *s) { return NULL; } diff --git a/windows/network.c b/windows/network.c index d08f3377..f0bf5f9f 100644 --- a/windows/network.c +++ b/windows/network.c @@ -821,7 +821,7 @@ static size_t sk_net_write_oob(Socket *s, const void *data, size_t len); static void sk_net_write_eof(Socket *s); static void sk_net_set_frozen(Socket *s, bool is_frozen); static const char *sk_net_socket_error(Socket *s); -static SocketPeerInfo *sk_net_peer_info(Socket *s); +static SocketEndpointInfo *sk_net_peer_info(Socket *s); static const SocketVtable NetSocket_sockvt = { .plug = sk_net_plug, @@ -1747,7 +1747,7 @@ static const char *sk_net_socket_error(Socket *sock) return s->error; } -static SocketPeerInfo *sk_net_peer_info(Socket *sock) +static SocketEndpointInfo *sk_net_peer_info(Socket *sock) { NetSocket *s = container_of(sock, NetSocket, sock); #ifdef NO_IPV6 @@ -1757,12 +1757,12 @@ static SocketPeerInfo *sk_net_peer_info(Socket *sock) char buf[INET6_ADDRSTRLEN]; #endif int addrlen = sizeof(addr); - SocketPeerInfo *pi; + SocketEndpointInfo *pi; if (p_getpeername(s->s, (struct sockaddr *)&addr, &addrlen) < 0) return NULL; - pi = snew(SocketPeerInfo); + pi = snew(SocketEndpointInfo); pi->addressfamily = ADDRTYPE_UNSPEC; pi->addr_text = NULL; pi->port = -1;