API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

FUNCTION: INET_NTOP()

Brew Release
Brew MP 1.0.2
See Also
INAddr INAddr6 Helper Functions
Description
This function converts an address structure into a string according to a given address family.
Params
af
[]:
The address family of the address structure that will be converted (AEE_AF_INET for IPv4, or AEE_AF_INET6 for IPv6).
src
[]:
Pointer to the address structure to be converted.
dst
[]:
Buffer to write the string into.
size
[]:
Size of the buffer pointed to by dst.
Prototype
  •    const char* INET_NTOP(int af, const void *src, char *dst, size_t size);
    
Return
  • A pointer to the buffer (dst) containing the string if the conversion succeeds, and NULL otherwise.
Side Effect
  • None.
Comments
For IPv4 addresses, src should point to an INAddr structure. For IPv6 addresses, src should point to an INAddr6 structure. AEE_INET_ADDRSTRLEN and AEE_INET6_ADDRSTRLEN are defined for applications to easily declare buffers of the proper size to store IPv4 and IPv6 addresses in string form.