php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_stream_transport.h File Reference

Go to the source code of this file.

Data Structures

struct  _php_stream_xport_param
 
struct  _php_stream_xport_crypto_param
 

Macros

#define STREAM_XPORT_CLIENT   0
 
#define STREAM_XPORT_SERVER   1
 
#define STREAM_XPORT_CONNECT   2
 
#define STREAM_XPORT_BIND   4
 
#define STREAM_XPORT_LISTEN   8
 
#define STREAM_XPORT_CONNECT_ASYNC   16
 
#define php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode)
 

Typedefs

typedef php_streamphp_stream_transport_factory_func(const char *proto, size_t protolen, const char *resourcename, size_t resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, php_stream_context *context STREAMS_DC)
 
typedef php_stream_transport_factory_funcphp_stream_transport_factory
 
typedef struct _php_stream_xport_param php_stream_xport_param
 
typedef struct _php_stream_xport_crypto_param php_stream_xport_crypto_param
 

Enumerations

enum  php_stream_xport_send_recv_flags { STREAM_OOB = 1 , STREAM_PEEK = 2 }
 
enum  stream_shutdown_t { STREAM_SHUT_RD , STREAM_SHUT_WR , STREAM_SHUT_RDWR }
 
enum  php_stream_xport_crypt_method_t {
  STREAM_CRYPTO_METHOD_SSLv2_CLIENT = (1 << 1 | 1) , STREAM_CRYPTO_METHOD_SSLv3_CLIENT = (1 << 2 | 1) , STREAM_CRYPTO_METHOD_SSLv23_CLIENT = ((1 << 3) | (1 << 4) | (1 << 5) | 1) , STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT = (1 << 3 | 1) ,
  STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT = (1 << 4 | 1) , STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT = (1 << 5 | 1) , STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT = (1 << 6 | 1) , STREAM_CRYPTO_METHOD_TLS_CLIENT = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | 1) ,
  STREAM_CRYPTO_METHOD_TLS_ANY_CLIENT = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | 1) , STREAM_CRYPTO_METHOD_ANY_CLIENT = ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | 1) , STREAM_CRYPTO_METHOD_SSLv2_SERVER = (1 << 1) , STREAM_CRYPTO_METHOD_SSLv3_SERVER = (1 << 2) ,
  STREAM_CRYPTO_METHOD_SSLv23_SERVER = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)) , STREAM_CRYPTO_METHOD_TLSv1_0_SERVER = (1 << 3) , STREAM_CRYPTO_METHOD_TLSv1_1_SERVER = (1 << 4) , STREAM_CRYPTO_METHOD_TLSv1_2_SERVER = (1 << 5) ,
  STREAM_CRYPTO_METHOD_TLSv1_3_SERVER = (1 << 6) , STREAM_CRYPTO_METHOD_TLS_SERVER = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)) , STREAM_CRYPTO_METHOD_TLS_ANY_SERVER = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)) , STREAM_CRYPTO_METHOD_ANY_SERVER = ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6))
}
 

Functions

PHPAPI int php_stream_xport_register (const char *protocol, php_stream_transport_factory factory)
 
PHPAPI int php_stream_xport_unregister (const char *protocol)
 
PHPAPI php_stream_php_stream_xport_create (const char *name, size_t namelen, int options, int flags, const char *persistent_id, struct timeval *timeout, php_stream_context *context, zend_string **error_string, int *error_code STREAMS_DC)
 
PHPAPI int php_stream_xport_bind (php_stream *stream, const char *name, size_t namelen, zend_string **error_text)
 
PHPAPI int php_stream_xport_connect (php_stream *stream, const char *name, size_t namelen, int asynchronous, struct timeval *timeout, zend_string **error_text, int *error_code)
 
PHPAPI int php_stream_xport_listen (php_stream *stream, int backlog, zend_string **error_text)
 
PHPAPI int php_stream_xport_accept (php_stream *stream, php_stream **client, zend_string **textaddr, void **addr, socklen_t *addrlen, struct timeval *timeout, zend_string **error_text)
 
PHPAPI int php_stream_xport_get_name (php_stream *stream, int want_peer, zend_string **textaddr, void **addr, socklen_t *addrlen)
 
PHPAPI int php_stream_xport_recvfrom (php_stream *stream, char *buf, size_t buflen, int flags, void **addr, socklen_t *addrlen, zend_string **textaddr)
 
PHPAPI int php_stream_xport_sendto (php_stream *stream, const char *buf, size_t buflen, int flags, void *addr, socklen_t addrlen)
 
PHPAPI int php_stream_xport_shutdown (php_stream *stream, stream_shutdown_t how)
 
PHPAPI int php_stream_xport_crypto_setup (php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream)
 
PHPAPI int php_stream_xport_crypto_enable (php_stream *stream, int activate)
 
PHPAPI HashTablephp_stream_xport_get_hash (void)
 

Variables

PHPAPI php_stream_transport_factory_func php_stream_generic_socket_factory
 

Macro Definition Documentation

◆ php_stream_xport_create

#define php_stream_xport_create ( name,
namelen,
options,
flags,
persistent_id,
timeout,
context,
estr,
ecode )
Value:
_php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC)
PHP_JSON_API size_t int options
Definition php_json.h:102
PHPAPI php_stream * _php_stream_xport_create(const char *name, size_t namelen, int options, int flags, const char *persistent_id, struct timeval *timeout, php_stream_context *context, zend_string **error_string, int *error_code STREAMS_DC)
Definition transports.c:52
#define STREAMS_CC
Definition php_streams.h:54
ptrdiff_t namelen
Definition session.c:1097
Definition dce.c:49
zend_string * name

Definition at line 54 of file php_stream_transport.h.

◆ STREAM_XPORT_BIND

#define STREAM_XPORT_BIND   4

Definition at line 41 of file php_stream_transport.h.

◆ STREAM_XPORT_CLIENT

#define STREAM_XPORT_CLIENT   0

Definition at line 37 of file php_stream_transport.h.

◆ STREAM_XPORT_CONNECT

#define STREAM_XPORT_CONNECT   2

Definition at line 40 of file php_stream_transport.h.

◆ STREAM_XPORT_CONNECT_ASYNC

#define STREAM_XPORT_CONNECT_ASYNC   16

Definition at line 43 of file php_stream_transport.h.

◆ STREAM_XPORT_LISTEN

#define STREAM_XPORT_LISTEN   8

Definition at line 42 of file php_stream_transport.h.

◆ STREAM_XPORT_SERVER

#define STREAM_XPORT_SERVER   1

Definition at line 38 of file php_stream_transport.h.

Typedef Documentation

◆ php_stream_transport_factory

◆ php_stream_transport_factory_func

typedef php_stream * php_stream_transport_factory_func(const char *proto, size_t protolen, const char *resourcename, size_t resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, php_stream_context *context STREAMS_DC)

Definition at line 26 of file php_stream_transport.h.

◆ php_stream_xport_crypto_param

◆ php_stream_xport_param

Enumeration Type Documentation

◆ php_stream_xport_crypt_method_t

Enumerator
STREAM_CRYPTO_METHOD_SSLv2_CLIENT 
STREAM_CRYPTO_METHOD_SSLv3_CLIENT 
STREAM_CRYPTO_METHOD_SSLv23_CLIENT 
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT 
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT 
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT 
STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT 
STREAM_CRYPTO_METHOD_TLS_CLIENT 
STREAM_CRYPTO_METHOD_TLS_ANY_CLIENT 
STREAM_CRYPTO_METHOD_ANY_CLIENT 
STREAM_CRYPTO_METHOD_SSLv2_SERVER 
STREAM_CRYPTO_METHOD_SSLv3_SERVER 
STREAM_CRYPTO_METHOD_SSLv23_SERVER 
STREAM_CRYPTO_METHOD_TLSv1_0_SERVER 
STREAM_CRYPTO_METHOD_TLSv1_1_SERVER 
STREAM_CRYPTO_METHOD_TLSv1_2_SERVER 
STREAM_CRYPTO_METHOD_TLSv1_3_SERVER 
STREAM_CRYPTO_METHOD_TLS_SERVER 
STREAM_CRYPTO_METHOD_TLS_ANY_SERVER 
STREAM_CRYPTO_METHOD_ANY_SERVER 

Definition at line 164 of file php_stream_transport.h.

◆ php_stream_xport_send_recv_flags

Enumerator
STREAM_OOB 
STREAM_PEEK 

Definition at line 93 of file php_stream_transport.h.

◆ stream_shutdown_t

Enumerator
STREAM_SHUT_RD 
STREAM_SHUT_WR 
STREAM_SHUT_RDWR 

Definition at line 109 of file php_stream_transport.h.

Function Documentation

◆ _php_stream_xport_create()

PHPAPI php_stream * _php_stream_xport_create ( const char * name,
size_t namelen,
int options,
int flags,
const char * persistent_id,
struct timeval * timeout,
php_stream_context * context,
zend_string ** error_string,
int *error_code STREAMS_DC )

Definition at line 52 of file transports.c.

◆ php_stream_xport_accept()

PHPAPI int php_stream_xport_accept ( php_stream * stream,
php_stream ** client,
zend_string ** textaddr,
void ** addr,
socklen_t * addrlen,
struct timeval * timeout,
zend_string ** error_text )

Definition at line 289 of file transports.c.

◆ php_stream_xport_bind()

PHPAPI int php_stream_xport_bind ( php_stream * stream,
const char * name,
size_t namelen,
zend_string ** error_text )

Definition at line 201 of file transports.c.

◆ php_stream_xport_connect()

PHPAPI int php_stream_xport_connect ( php_stream * stream,
const char * name,
size_t namelen,
int asynchronous,
struct timeval * timeout,
zend_string ** error_text,
int * error_code )

Definition at line 229 of file transports.c.

◆ php_stream_xport_crypto_enable()

PHPAPI int php_stream_xport_crypto_enable ( php_stream * stream,
int activate )

Definition at line 378 of file transports.c.

◆ php_stream_xport_crypto_setup()

PHPAPI int php_stream_xport_crypto_setup ( php_stream * stream,
php_stream_xport_crypt_method_t crypto_method,
php_stream * session_stream )

Definition at line 357 of file transports.c.

◆ php_stream_xport_get_hash()

PHPAPI HashTable * php_stream_xport_get_hash ( void )

Definition at line 23 of file transports.c.

◆ php_stream_xport_get_name()

PHPAPI int php_stream_xport_get_name ( php_stream * stream,
int want_peer,
zend_string ** textaddr,
void ** addr,
socklen_t * addrlen )

Definition at line 327 of file transports.c.

◆ php_stream_xport_listen()

PHPAPI int php_stream_xport_listen ( php_stream * stream,
int backlog,
zend_string ** error_text )

Definition at line 265 of file transports.c.

◆ php_stream_xport_recvfrom()

PHPAPI int php_stream_xport_recvfrom ( php_stream * stream,
char * buf,
size_t buflen,
int flags,
void ** addr,
socklen_t * addrlen,
zend_string ** textaddr )

Definition at line 400 of file transports.c.

◆ php_stream_xport_register()

PHPAPI int php_stream_xport_register ( const char * protocol,
php_stream_transport_factory factory )

Definition at line 28 of file transports.c.

◆ php_stream_xport_sendto()

PHPAPI int php_stream_xport_sendto ( php_stream * stream,
const char * buf,
size_t buflen,
int flags,
void * addr,
socklen_t addrlen )

Definition at line 469 of file transports.c.

◆ php_stream_xport_shutdown()

PHPAPI int php_stream_xport_shutdown ( php_stream * stream,
stream_shutdown_t how )

Definition at line 509 of file transports.c.

◆ php_stream_xport_unregister()

PHPAPI int php_stream_xport_unregister ( const char * protocol)

Definition at line 37 of file transports.c.

Variable Documentation

◆ php_stream_generic_socket_factory

PHPAPI php_stream_transport_factory_func php_stream_generic_socket_factory

Definition at line 215 of file php_stream_transport.h.