xref: /PHP-8.2/ext/sockets/sendrecvmsg.h (revision 98e5c4e3)
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 
9 #ifdef PHP_WIN32
10 #define IPV6_RECVPKTINFO	IPV6_PKTINFO
11 #define IPV6_RECVHOPLIMIT	IPV6_HOPLIMIT
12 #endif
13 
14 void php_socket_sendrecvmsg_init(INIT_FUNC_ARGS);
15 void php_socket_sendrecvmsg_shutdown(SHUTDOWN_FUNC_ARGS);
16 
17 int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4);
18 int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result);
19 
20 /* for conversions.c */
21 typedef struct {
22 	int	cmsg_level;	/* originating protocol */
23 	int	cmsg_type;	/* protocol-specific type */
24 } anc_reg_key;
25 
26 typedef size_t (calculate_req_space)(const zval *value, ser_context *ctx);
27 
28 typedef struct {
29 	socklen_t size; /* size of native structure */
30 	socklen_t var_el_size; /* size of repeatable component */
31 	calculate_req_space *calc_space;
32 	from_zval_write_field *from_array;
33 	to_zval_read_field *to_array;
34 } ancillary_reg_entry;
35 
36 ancillary_reg_entry *get_ancillary_reg_entry(int cmsg_level, int msg_type);
37 
38 #endif
39