summaryrefslogtreecommitdiff
path: root/main/php_network.h
diff options
context:
space:
mode:
Diffstat (limited to 'main/php_network.h')
-rw-r--r--main/php_network.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/main/php_network.h b/main/php_network.h
index d17530208a..16e0e60255 100644
--- a/main/php_network.h
+++ b/main/php_network.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
+ | Copyright (c) 1997-2016 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -28,6 +28,7 @@
#else
# undef closesocket
# define closesocket close
+# include <netinet/tcp.h>
#endif
#ifndef HAVE_SHUTDOWN
@@ -74,6 +75,10 @@ END_EXTERN_C()
#include <sys/socket.h>
#endif
+#ifdef HAVE_GETHOSTBYNAME_R
+#include <netdb.h>
+#endif
+
/* These are here, rather than with the win32 counterparts above,
* since <sys/socket.h> defines them. */
#ifndef SHUT_RD
@@ -106,9 +111,12 @@ typedef int php_socket_t;
# define SOCK_RECV_ERR -1
#endif
-#define STREAM_SOCKOP_NONE 1 << 0
-#define STREAM_SOCKOP_SO_REUSEPORT 1 << 1
-#define STREAM_SOCKOP_SO_BROADCAST 1 << 2
+#define STREAM_SOCKOP_NONE (1 << 0)
+#define STREAM_SOCKOP_SO_REUSEPORT (1 << 1)
+#define STREAM_SOCKOP_SO_BROADCAST (1 << 2)
+#define STREAM_SOCKOP_IPV6_V6ONLY (1 << 3)
+#define STREAM_SOCKOP_IPV6_V6ONLY_ENABLED (1 << 4)
+#define STREAM_SOCKOP_TCP_NODELAY (1 << 5)
/* uncomment this to debug poll(2) emulation on systems that have poll(2) */
@@ -259,7 +267,8 @@ PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock,
socklen_t *addrlen,
struct timeval *timeout,
zend_string **error_string,
- int *error_code
+ int *error_code,
+ int tcp_nodelay
);
PHPAPI int php_network_get_sock_name(php_socket_t sock,
@@ -307,6 +316,10 @@ PHPAPI void php_network_populate_name_from_sockaddr(
PHPAPI int php_network_parse_network_address_with_port(const char *addr,
zend_long addrlen, struct sockaddr *sa, socklen_t *sl);
+
+PHPAPI struct hostent* php_network_gethostbyname(char *name);
+
+PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block);
END_EXTERN_C()
#define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC)