37 #ifndef __SL_NET_UTILS_H__ 38 #define __SL_NET_UTILS_H__ 64 #define SLNETUTIL_AI_PASSIVE 0x00000001 65 #define SLNETUTIL_AI_NUMERICHOST 0x00000004 83 #define SLNETUTIL_IPV4_VAL(add_3,add_2,add_1,add_0) ((((uint32_t)add_3 << 24) & 0xFF000000) | (((uint32_t)add_2 << 16) & 0xFF0000) | (((uint32_t)add_1 << 8) & 0xFF00) | ((uint32_t)add_0 & 0xFF) ) 189 int32_t
SlNetUtil_getHostByName(uint32_t ifBitmap,
char *name,
const uint16_t nameLen, uint32_t *ipAddr, uint16_t *ipAddrLen,
const uint8_t family);
414 int32_t
SlNetUtil_inetPton(int16_t addrFamily,
const char *strAddr,
void *binaryAddr);
int ai_socktype
Definition: slnetutils.h:74
Definition: slnetutils.h:71
struct SlNetUtil_addrInfo_t SlNetUtil_addrInfo_t
char * ai_canonname
Definition: slnetutils.h:78
size_t ai_addrlen
Definition: slnetutils.h:76
const char * SlNetUtil_inetNtop(int16_t addrFamily, const void *binaryAddr, char *strAddr, SlNetSocklen_t strAddrLen)
Converts IP address in binary representation to string representation.
uint16_t SlNetSocklen_t
The SlNetSocklen_t is used for declaring the socket length parameter.
Definition: slnetsock.h:647
IpV4 socket address.
Definition: slnetsock.h:652
uint16_t SlNetUtil_htons(uint16_t val)
Reorder the bytes of a 16-bit unsigned value.
int ai_protocol
Definition: slnetutils.h:75
int ai_flags
Definition: slnetutils.h:72
int32_t SlNetUtil_getHostByName(uint32_t ifBitmap, char *name, const uint16_t nameLen, uint32_t *ipAddr, uint16_t *ipAddrLen, const uint8_t family)
Get host IP by name Obtain the IP Address of machine on network, by machine name. ...
int32_t SlNetUtil_inetPton(int16_t addrFamily, const char *strAddr, void *binaryAddr)
Converts IP address in string representation to binary representation.
Internet address.
Definition: slnetsock.h:442
uint32_t SlNetUtil_ntohl(uint32_t val)
Reorder the bytes of a 32-bit unsigned value.
int SlNetUtil_inetAton(const char *str, struct SlNetSock_InAddr_t *addr)
Convert an IPv4 address in string format to binary format.
int ai_family
Definition: slnetutils.h:73
int32_t SlNetUtil_getAddrInfo(uint16_t ifID, const char *node, const char *service, const struct SlNetUtil_addrInfo_t *hints, struct SlNetUtil_addrInfo_t **res)
Network address and service translation.
struct SlNetUtil_addrInfo_t * ai_next
Definition: slnetutils.h:79
void SlNetUtil_freeAddrInfo(struct SlNetUtil_addrInfo_t *res)
Free the results returned from SlNetUtil_getAddrInfo.
int32_t SlNetUtil_init(int32_t flags)
Initialize the SlNetUtil module.
uint32_t SlNetUtil_htonl(uint32_t val)
Reorder the bytes of a 32-bit unsigned value.
const char * SlNetUtil_gaiStrErr(int32_t errorCode)
Return text descriptions of getAddrInfo error codes.
uint16_t SlNetUtil_ntohs(uint16_t val)
Reorder the bytes of a 16-bit unsigned value.
struct SlNetSock_Addr_t * ai_addr
Definition: slnetutils.h:77