Mercurial > hg > nginx
comparison src/event/ngx_event_udp.h @ 8002:cfe1284e5d1d
Core: made the ngx_sendmsg() function non-static.
The NGX_HAVE_ADDRINFO_CMSG macro is defined when at least one of methods
to deal with corresponding control message is available.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Tue, 25 Jan 2022 15:48:56 +0300 |
parents | 8206ecdcd837 |
children | 0f6cc8f73744 |
comparison
equal
deleted
inserted
replaced
8001:8206ecdcd837 | 8002:cfe1284e5d1d |
---|---|
11 #include <ngx_config.h> | 11 #include <ngx_config.h> |
12 #include <ngx_core.h> | 12 #include <ngx_core.h> |
13 | 13 |
14 | 14 |
15 #if !(NGX_WIN32) | 15 #if !(NGX_WIN32) |
16 | |
17 #if ((NGX_HAVE_MSGHDR_MSG_CONTROL) \ | |
18 && (NGX_HAVE_IP_SENDSRCADDR || NGX_HAVE_IP_RECVDSTADDR \ | |
19 || NGX_HAVE_IP_PKTINFO \ | |
20 || (NGX_HAVE_INET6 && NGX_HAVE_IPV6_RECVPKTINFO))) | |
21 #define NGX_HAVE_ADDRINFO_CMSG 1 | |
22 | |
23 #endif | |
24 | |
25 | |
26 #if (NGX_HAVE_ADDRINFO_CMSG) | |
27 | |
28 typedef union { | |
29 #if (NGX_HAVE_IP_SENDSRCADDR || NGX_HAVE_IP_RECVDSTADDR) | |
30 struct in_addr addr; | |
31 #endif | |
32 | |
33 #if (NGX_HAVE_IP_PKTINFO) | |
34 struct in_pktinfo pkt; | |
35 #endif | |
36 | |
37 #if (NGX_HAVE_INET6 && NGX_HAVE_IPV6_RECVPKTINFO) | |
38 struct in6_pktinfo pkt6; | |
39 #endif | |
40 } ngx_addrinfo_t; | |
41 | |
42 size_t ngx_set_srcaddr_cmsg(struct cmsghdr *cmsg, | |
43 struct sockaddr *local_sockaddr); | |
44 | |
45 #endif | |
46 | |
16 void ngx_event_recvmsg(ngx_event_t *ev); | 47 void ngx_event_recvmsg(ngx_event_t *ev); |
48 ssize_t ngx_sendmsg(ngx_connection_t *c, struct msghdr *msg, int flags); | |
17 void ngx_udp_rbtree_insert_value(ngx_rbtree_node_t *temp, | 49 void ngx_udp_rbtree_insert_value(ngx_rbtree_node_t *temp, |
18 ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel); | 50 ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel); |
19 #endif | 51 #endif |
20 | 52 |
21 void ngx_delete_udp_connection(void *data); | 53 void ngx_delete_udp_connection(void *data); |