2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
6 | Copyright (c) 1997-2010 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
18 #ifndef incl_HPHP_EXT_NETWORK_H_
19 #define incl_HPHP_EXT_NETWORK_H_
21 #include "hphp/runtime/base/base_includes.h"
22 #include "hphp/runtime/ext/ext_stream.h"
26 ///////////////////////////////////////////////////////////////////////////////
28 Variant
f_gethostname();
29 Variant
f_gethostbyaddr(CStrRef ip_address
);
30 String
f_gethostbyname(CStrRef hostname
);
31 Variant
f_gethostbynamel(CStrRef hostname
);
32 Variant
f_getprotobyname(CStrRef name
);
33 Variant
f_getprotobynumber(int number
);
34 Variant
f_getservbyname(CStrRef service
, CStrRef protocol
);
35 Variant
f_getservbyport(int port
, CStrRef protocol
);
36 Variant
f_inet_ntop(CStrRef in_addr
);
37 Variant
f_inet_pton(CStrRef address
);
38 Variant
f_ip2long(CStrRef ip_address
);
39 String
f_long2ip(int proper_address
);
41 bool f_dns_check_record(CStrRef host
, CStrRef type
= null_string
);
43 bool f_checkdnsrr(CStrRef host
, CStrRef type
= null_string
);
45 Variant
f_dns_get_record(CStrRef hostname
, int type
= -1, VRefParam authns
= uninit_null(),
46 VRefParam addtl
= uninit_null());
48 bool f_dns_get_mx(CStrRef hostname
, VRefParam mxhosts
, VRefParam weights
= uninit_null());
50 bool f_getmxrr(CStrRef hostname
, VRefParam mxhosts
,
51 VRefParam weight
= uninit_null());
53 ///////////////////////////////////////////////////////////////////////////////
56 Variant
f_fsockopen(CStrRef hostname
, int port
= -1, VRefParam errnum
= uninit_null(),
57 VRefParam errstr
= uninit_null(), double timeout
= 0.0);
59 Variant
f_pfsockopen(CStrRef hostname
, int port
= -1, VRefParam errnum
= uninit_null(),
60 VRefParam errstr
= uninit_null(), double timeout
= 0.0);
62 Variant
f_socket_get_status(CResRef stream
);
64 bool f_socket_set_blocking(CResRef stream
, int mode
);
66 bool f_socket_set_timeout(CResRef stream
, int seconds
,
67 int microseconds
= 0);
69 ///////////////////////////////////////////////////////////////////////////////
72 void f_header(CStrRef str
, bool replace
= true, int http_response_code
= 0);
74 Variant
f_http_response_code(int response_code
= 0);
76 Array
f_headers_list();
78 bool f_headers_sent(VRefParam file
= uninit_null(), VRefParam line
= uninit_null());
80 bool f_header_register_callback(CVarRef callback
);
82 void f_header_remove(CStrRef name
= null_string
);
84 int f_get_http_request_size();
86 bool f_setcookie(CStrRef name
, CStrRef value
= null_string
, int64_t expire
= 0,
87 CStrRef path
= null_string
, CStrRef domain
= null_string
,
88 bool secure
= false, bool httponly
= false);
90 bool f_setrawcookie(CStrRef name
, CStrRef value
= null_string
, int64_t expire
= 0,
91 CStrRef path
= null_string
, CStrRef domain
= null_string
,
92 bool secure
= false, bool httponly
= false);
94 ///////////////////////////////////////////////////////////////////////////////
97 void f_define_syslog_variables();
99 bool f_openlog(CStrRef ident
, int option
, int facility
);
103 bool f_syslog(int priority
, CStrRef message
);
105 ///////////////////////////////////////////////////////////////////////////////
108 #endif // incl_HPHP_EXT_NETWORK_H_