xref: /PHP-7.4/ext/sockets/sendrecvmsg.h (revision bdeb220f)
1 #ifndef PHP_SENDRECVMSG_H
2 #define PHP_SENDRECVMSG_H 1
3 
4 #include <php.h>
5 #include "conversions.h"
6 
7 /* for sockets.c */
8 PHP_FUNCTION(socket_sendmsg);
9 PHP_FUNCTION(socket_recvmsg);
10 PHP_FUNCTION(socket_cmsg_space);
11 
12 void php_socket_sendrecvmsg_init(INIT_FUNC_ARGS);
13 void php_socket_sendrecvmsg_shutdown(SHUTDOWN_FUNC_ARGS);
14 
15 int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4);
16 int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result);
17 
18 /* for conversions.c */
19 typedef struct {
20 	int	cmsg_level;	/* originating protocol */
21 	int	cmsg_type;	/* protocol-specific type */
22 } anc_reg_key;
23 
24 typedef size_t (calculate_req_space)(const zval *value, ser_context *ctx);
25 
26 typedef struct {
27 	socklen_t size; /* size of native structure */
28 	socklen_t var_el_size; /* size of repeatable component */
29 	calculate_req_space *calc_space;
30 	from_zval_write_field *from_array;
31 	to_zval_read_field *to_array;
32 } ancillary_reg_entry;
33 
34 ancillary_reg_entry *get_ancillary_reg_entry(int cmsg_level, int msg_type);
35 
36 #endif
37