leafnode  1.12.0
About: Leafnode is a store & forward NNTP proxy for small (dialup) sites.
  Fossies Dox: leafnode-1.12.0.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

masock.h File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
Include dependency graph for masock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * masock_sa2addr (const struct sockaddr *sa)
 
long masock_sa2port (const struct sockaddr *sa)
 
char * masock_sa2name (const struct sockaddr *sa, int *h_error)
 

Function Documentation

◆ masock_sa2addr()

char * masock_sa2addr ( const struct sockaddr *  sa)

◆ masock_sa2name()

char * masock_sa2name ( const struct sockaddr *  sa,
int *  h_e 
)

Look up the host name belonging to the socket address. If compiled with IPv6 support, use IPv6 lookup unless the address is actually an IPv6-mapped IPv4 address.

Returns
strdup'ed string containing the host name or NULL in case of trouble.
Bug:
Linux [e]glibc has broken IN6_IS_ADDR_* macros that do not cast to const and that do not work in strict conformance mode because they access nonstandard members.
Parameters
sasocket address to convert
h_evariable to place h_errno into

Definition at line 43 of file masock_sa2name.c.

References critstrdup().

Referenced by main().

◆ masock_sa2port()

long masock_sa2port ( const struct sockaddr *  sa)