Qore Programming Language
0.8.11.1
|
provides an interface to getaddrinfo More...
#include <QoreNet.h>
Public Member Functions | |
DLLEXPORT | QoreAddrInfo () |
create an empty structure | |
DLLEXPORT | ~QoreAddrInfo () |
destroy the object | |
DLLEXPORT void | clear () |
clears the current results, if any | |
DLLLOCAL struct addrinfo * | getAddrInfo () const |
returns the struct addrinfo * being managed (may by 0) | |
DLLEXPORT int | getInfo (ExceptionSink *xsink, const char *node, const char *service, int family=Q_AF_UNSPEC, int flags=0, int socktype=Q_SOCK_STREAM, int protocol=0) |
get address info with the given parameters, if any errors occur, a Qore-language exception is thrown More... | |
DLLEXPORT QoreListNode * | getList () const |
returns a list of hashes of address info, if an addrinfo structure is being managed | |
Static Public Member Functions | |
static DLLEXPORT QoreStringNode * | getAddressDesc (int address_family, const char *addr) |
returns a descriptive string for the address family and an address string (ie AF_INET6, "::1" = "ipv6[::1]") | |
static DLLEXPORT const char * | getFamilyName (int address_family) |
returns the name of the address family as a string (ie AF_INET = "ipv4", etc) | |
provides an interface to getaddrinfo
DLLEXPORT int QoreAddrInfo::getInfo | ( | ExceptionSink * | xsink, |
const char * | node, | ||
const char * | service, | ||
int | family = Q_AF_UNSPEC , |
||
int | flags = 0 , |
||
int | socktype = Q_SOCK_STREAM , |
||
int | protocol = 0 |
||
) |
get address info with the given parameters, if any errors occur, a Qore-language exception is thrown
xsink | if any errors occur, Qore-language exception info is added to this object |
node | the node name for the lookup |
service | the service name (from /etc/services, for example) or port number |
family | a hint for the address family, AF_UNSPEC means any family |
flags | hint flags as per the getaddrinfo() call: AI_ADDRCONFIG, AI_ALL, AI_CANONNAME, AI_NUMERICHOST, AI_NUMERICSERV, AI_PASSIVE, AI_V4MAPPED |
socktype | a hint for the type of socket; 0 = any socket type |
protocol | a hint for the protocol number; 0 = the default protocol |