sockaddr_conv.h 904 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef PHP_SOCKADR_CONV_H
  2. #define PHP_SOCKADR_CONV_H
  3. #include <php_network.h>
  4. #include "php_sockets.h" /* php_socket */
  5. #ifndef PHP_WIN32
  6. # include <netinet/in.h>
  7. #else
  8. # include <Winsock2.h>
  9. #endif
  10. /*
  11. * Convert an IPv6 literal or a hostname info a sockaddr_in6.
  12. * The IPv6 literal can be a IPv4 mapped address (like ::ffff:127.0.0.1).
  13. * If the hostname yields no IPv6 addresses, a mapped IPv4 address may be returned (AI_V4MAPPED)
  14. */
  15. int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock);
  16. /*
  17. * Convert an IPv4 literal or a hostname into a sockaddr_in.
  18. */
  19. int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock);
  20. /*
  21. * Calls either php_set_inet6_addr() or php_set_inet_addr(), depending on the type of the socket.
  22. */
  23. int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock);
  24. #endif