Socket address. More...
Data Structures | |
| struct | vtm_socket_addr |
Macros | |
| #define | VTM_SOCK_ADDR_LOCALHOST "localhost" |
| #define | VTM_SOCK_ADDR_IPV4_LOOPBACK "127.0.0.1" |
| #define | VTM_SOCK_ADDR_IPV4_ANY "0.0.0.0" |
| #define | VTM_SOCK_ADDR_IPV6_LOOPBACK "::1" |
| #define | VTM_SOCK_ADDR_IPV6_ANY "::" |
| #define | VTM_SOCK_ADDR_BUF_LEN 46 |
Functions | |
| VTM_API int | vtm_socket_os_addr_build (struct vtm_socket_saddr *saddr, struct vtm_socket_addr *from) |
| VTM_API int | vtm_socket_os_addr_convert (struct vtm_socket_saddr *saddr, enum vtm_socket_family *fam, char *host_buf, size_t len, unsigned int *port) |
| #define VTM_SOCK_ADDR_LOCALHOST "localhost" |
Localhost constant
| #define VTM_SOCK_ADDR_IPV4_LOOPBACK "127.0.0.1" |
IPv4 loopback address
| #define VTM_SOCK_ADDR_IPV4_ANY "0.0.0.0" |
IPv4 any address placeholder
| #define VTM_SOCK_ADDR_IPV6_LOOPBACK "::1" |
IPv6 loopback address
| #define VTM_SOCK_ADDR_IPV6_ANY "::" |
IPv6 any address placeholder
| #define VTM_SOCK_ADDR_BUF_LEN 46 |
Minimum buffer size to hold string representation of an IP address
| VTM_API int vtm_socket_os_addr_build | ( | struct vtm_socket_saddr * | saddr, |
| struct vtm_socket_addr * | from | ||
| ) |
Converts a readable address in a platform/os specific representation.
| [out] | saddr | the converted address |
| from | the address that should be converted |
| VTM_API int vtm_socket_os_addr_convert | ( | struct vtm_socket_saddr * | saddr, |
| enum vtm_socket_family * | fam, | ||
| char * | host_buf, | ||
| size_t | len, | ||
| unsigned int * | port | ||
| ) |
Convertes a platform specific address representation back to a readable format.
| saddr | the address that should converted | |
| [out] | fam | the socket family |
| [out] | host_buf | the buffer where the ip address is stored |
| len | the length in bytes of the host buffer | |
| [out] | port | the port of the address |
1.8.8