SYNTAX
#include "socket_if.h"
int socket_local(int s,char ip[16],
uint16 *port,uint32 *scope_id);
int socket_remote(int s,char ip[16],
uint16 *port,uint32 *scope_id);
DESCRIPTION
socket_local returns the local IPv6 or IPv4-mapped IPv6 address as ip,
port as port and perhaps the scope_id as scope_id for the UDP or TCP
socket.
socket_remote returns the remote IPv6 or IPv4-mapped IPv6 address as
ip, port as port and perhaps the scope_id as scope_id for the UDP or
TCP socket.
RETURN CODES
If something goes wrong, socket_local and socket_remote return -1,
setting errno appropriately.
EXAMPLE
#include <socket_if.h>
int s;
char ip[16];
uint16 port;
if (socket_remote(s,ip,&port,0) == -1)
strerr_die2sys(111,FATAL,"unable to get remote address: ");
SEE ALSO
socket_if(3), socket_bind(3), socket_connect(3), socket_recv(3),
socket_send(3), socket_setup(3), socket_tcp(3), socket_udp(3)
socket_info(3)
Man(1) output converted with
man2html