34 #ifndef _QORE_QORENET_H
36 #define _QORE_QORENET_H
38 #include <sys/types.h>
43 DLLEXPORT
int q_gethostbyname(
const char *host,
struct in_addr *sin_addr);
46 DLLEXPORT
QoreHashNode *q_gethostbyname_to_hash(
const char *host);
49 DLLEXPORT
QoreStringNode *q_gethostbyname_to_string(
const char *host);
52 DLLEXPORT
char *q_gethostbyaddr(
const char *addr,
int len,
int type);
63 DLLEXPORT
QoreStringNode *q_addr_to_string(
int address_family,
const char *addr);
74 DLLEXPORT
int q_addr_to_string(
int address_family,
const char* addr,
QoreString& str);
77 DLLEXPORT
QoreStringNode *q_addr_to_string2(
const struct sockaddr *ai_addr);
87 DLLEXPORT
int q_addr_to_string2(
const struct sockaddr *ai_addr,
QoreString& str);
90 DLLEXPORT
int q_get_port_from_addr(
const struct sockaddr *ai_addr);
112 DLLEXPORT
void clear();
134 DLLEXPORT
static const char *
getFamilyName(
int address_family);
140 #endif // _QORE_QORENET_H
#define Q_SOCK_STREAM
platform-independent define for SOCK_STREAM
Definition: common.h:64
DLLEXPORT QoreAddrInfo()
create an empty structure
This is the hash or associative list container type in Qore, dynamically allocated only...
Definition: QoreHashNode.h:49
DLLLOCAL struct addrinfo * getAddrInfo() const
returns the struct addrinfo * being managed (may by 0)
Definition: QoreNet.h:126
DLLEXPORT QoreListNode * getList() const
returns a list of hashes of address info, if an addrinfo structure is being managed ...
#define Q_AF_INET
cross-platform define for AF_INET
Definition: common.h:58
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 ...
DLLEXPORT void clear()
clears the current results, if any
provides an interface to getaddrinfo
Definition: QoreNet.h:99
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:50
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:48
static DLLEXPORT const char * getFamilyName(int address_family)
returns the name of the address family as a string (ie AF_INET = "ipv4", etc)
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:43
DLLEXPORT ~QoreAddrInfo()
destroy the object
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]")
#define Q_AF_UNSPEC
cross-platform define for AF_UNSPEC
Definition: common.h:55