Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
pronet.h File Reference

Network related functions. More...

Macros

#define WIN32_LEAN_AND_MEAN
 
#define SIG_SAFE_CALL(expr)   return expr
 
#define SOCKLEN_T   int
 
#define SOCKBUF_T   char *
 

Functions

ssize_t qsendto (int socket, const SOCKBUF_T buf, size_t size, int flags, const struct sockaddr *dest_addr, SOCKLEN_T addrlen)
 
ssize_t qrecvfrom (int socket, SOCKBUF_T buf, size_t size, int flags, struct sockaddr *src_addr, SOCKLEN_T *addrlen)
 
ssize_t qsend (int socket, const void *buf, size_t size)
 
ssize_t qrecv (int socket, void *buf, size_t size)
 
int qselect (int nflds, fd_set *rds, fd_set *wds, fd_set *eds, struct timeval *timeout)
 
ssize_t DONT_USE_FUNCS::sendto (int, const SOCKBUF_T, size_t, int, const struct sockaddr *, SOCKLEN_T)
 
ssize_t DONT_USE_FUNCS::recvfrom (int, SOCKBUF_T, size_t, int, struct sockaddr *, SOCKLEN_T *)
 
ssize_t DONT_USE_FUNCS::send (int, const SOCKBUF_T, size_t, int)
 
ssize_t DONT_USE_FUNCS::recv (int, SOCKBUF_T, size_t, int)
 
int DONT_USE_FUNCS::select (int, fd_set *, fd_set *, fd_set *, struct timeval *)
 
idaman bool ida_export qhost2addr_ (void *out, const char *name, ushort family, ushort port=0)
 Get the IPv4 or IPv6 address corresponding to the given host. More...
 
bool qhost2addr (struct sockaddr_in *out, const char *name, ushort port=0)
 
bool qhost2addr (struct sockaddr_in6 *out, const char *name, ushort port=0)
 
idaman bool ida_export qgethostname (qstring *out)
 

Detailed Description

Network related functions.

Each of the following functions work just like their C standard equivalent, only they are safer and system independent.

Function Documentation

◆ qhost2addr_()

idaman bool ida_export qhost2addr_ ( void *  out,
const char *  name,
ushort  family,
ushort  port = 0 
)

Get the IPv4 or IPv6 address corresponding to the given host.

Parameters
outshould be of type 'sockaddr_in' or 'sockaddr_in6', depending on the value of 'family'.
namethe host name.
familyeither AF_INET or AF_INET6.
porta port number, or 0 for none.
Returns
true on success, false otherwise