Rizin
unix-like reverse engineering framework and cli tools
|
#include <assert.h>
#include <stdlib.h>
#include "uv.h"
#include "internal.h"
#include "handle-inl.h"
#include "stream-inl.h"
#include "req-inl.h"
Go to the source code of this file.
Macros | |
#define | SOCKOPT_SETTER(name, option4, option6, validate) |
#define | VALIDATE_TTL(value) ((value) >= 1 && (value) <= 255) |
#define | VALIDATE_MULTICAST_TTL(value) ((value) >= -1 && (value) <= 255) |
#define | VALIDATE_MULTICAST_LOOP(value) (1) |
Variables | |
const unsigned int | uv_active_udp_streams_threshold = 0 |
static char | uv_zero_ [] = "" |
SOCKOPT_SETTER | ( | ttl | , |
IP_TTL | , | ||
IPV6_HOPLIMIT | , | ||
VALIDATE_TTL | |||
) |
Definition at line 1019 of file udp.c.
References addr, addrlen, err, flags, handle, uv_translate_sys_error(), and uv_udp_maybe_bind().
|
static |
Definition at line 404 of file udp.c.
References addr, addrlen, bufs, bytes, cb, DWORD, handle, loop, memset(), NULL, REGISTER_HANDLE_REQ, req, uv__count_bufs(), uv_insert_pending_req(), UV_REQ_INIT, UV_SUCCEEDED_WITH_IOCP, and UV_SUCCEEDED_WITHOUT_IOCP.
Referenced by uv__udp_send().
Definition at line 1055 of file udp.c.
References addr, addrlen, err, handle, uv_addr_ip4_any_, uv_addr_ip6_any_, UV_HANDLE_BOUND, UV_HANDLE_UDP_CONNECTED, uv_translate_sys_error(), and uv_udp_maybe_bind().
Definition at line 1084 of file udp.c.
References addr, err, handle, memset(), UV_HANDLE_UDP_CONNECTED, and uv_translate_sys_error().
Definition at line 128 of file udp.c.
References AF_UNSPEC, domain, DWORD, err, handle, loop, QUEUE_REMOVE, SOCK_DGRAM, socket, uv__handle_init, UV_REQ_INIT, uv_translate_sys_error(), and uv_udp_set_socket().
Definition at line 938 of file udp.c.
References addr, addrlen, handle, and uv_udp_getsockname().
Referenced by uv_udp_open().
int uv__udp_recv_start | ( | uv_udp_t * | handle, |
uv_alloc_cb | alloc_cb, | ||
uv_udp_recv_cb | recv_cb | ||
) |
Definition at line 361 of file udp.c.
References err, handle, INCREASE_ACTIVE_COUNT, loop, uv_addr_ip4_any_, UV_HANDLE_READ_PENDING, UV_HANDLE_READING, uv_translate_sys_error(), uv_udp_maybe_bind(), and uv_udp_queue_recv().
Definition at line 393 of file udp.c.
References DECREASE_ACTIVE_COUNT, handle, loop, and UV_HANDLE_READING.
int uv__udp_send | ( | uv_udp_send_t * | req, |
uv_udp_t * | handle, | ||
const uv_buf_t | bufs[], | ||
unsigned int | nbufs, | ||
const struct sockaddr * | addr, | ||
unsigned int | addrlen, | ||
uv_udp_send_cb | send_cb | ||
) |
Definition at line 1102 of file udp.c.
References addr, addrlen, bufs, err, handle, req, uv__send(), uv_addr_ip4_any_, uv_addr_ip6_any_, UV_HANDLE_BOUND, uv_translate_sys_error(), and uv_udp_maybe_bind().
|
static |
Definition at line 589 of file udp.c.
References AF_INET, err, handle, memset(), in_addr::s_addr, sockaddr_in::sin_addr, uv_addr_ip4_any_, UV_HANDLE_IPV6, uv_inet_pton(), UV_JOIN_GROUP, UV_LEAVE_GROUP, uv_translate_sys_error(), uv_udp_maybe_bind(), and UV_UDP_REUSEADDR.
Referenced by uv_udp_set_membership().
int uv__udp_set_membership6 | ( | uv_udp_t * | handle, |
const struct sockaddr_in6 * | multicast_addr, | ||
const char * | interface_addr, | ||
uv_membership | membership | ||
) |
Definition at line 643 of file udp.c.
References err, handle, memset(), sockaddr_in6::sin6_addr, sockaddr_in6::sin6_scope_id, uv_addr_ip6_any_, UV_HANDLE_BOUND, UV_HANDLE_IPV6, uv_ip6_addr(), UV_JOIN_GROUP, UV_LEAVE_GROUP, uv_translate_sys_error(), uv_udp_maybe_bind(), and UV_UDP_REUSEADDR.
Referenced by uv_udp_set_membership().
|
static |
Definition at line 698 of file udp.c.
References AF_INET, err, handle, memset(), NULL, in_addr::s_addr, sockaddr_in::sin_addr, uv_addr_ip4_any_, UV_HANDLE_IPV6, uv_inet_pton(), UV_JOIN_GROUP, UV_LEAVE_GROUP, uv_translate_sys_error(), uv_udp_maybe_bind(), and UV_UDP_REUSEADDR.
Referenced by uv_udp_set_source_membership().
int uv__udp_set_source_membership6 | ( | uv_udp_t * | handle, |
const struct sockaddr_in6 * | multicast_addr, | ||
const char * | interface_addr, | ||
const struct sockaddr_in6 * | source_addr, | ||
uv_membership | membership | ||
) |
Definition at line 750 of file udp.c.
References err, handle, MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, memcpy(), memset(), NULL, sockaddr_in6::sin6_scope_id, STATIC_ASSERT, uv_addr_ip6_any_, UV_HANDLE_BOUND, UV_HANDLE_IPV6, uv_ip6_addr(), UV_JOIN_GROUP, UV_LEAVE_GROUP, uv_translate_sys_error(), uv_udp_maybe_bind(), and UV_UDP_REUSEADDR.
Referenced by uv_udp_set_source_membership().
int uv__udp_try_send | ( | uv_udp_t * | handle, |
const uv_buf_t | bufs[], | ||
unsigned int | nbufs, | ||
const struct sockaddr * | addr, | ||
unsigned int | addrlen | ||
) |
Definition at line 1133 of file udp.c.
References addr, addrlen, assert(), bufs, bytes, DWORD, err, handle, NULL, uv__convert_to_localhost_if_unspecified(), uv_addr_ip4_any_, uv_addr_ip6_any_, UV_HANDLE_BOUND, uv_translate_sys_error(), and uv_udp_maybe_bind().
Definition at line 453 of file udp.c.
References assert(), bytes, DECREASE_PENDING_REQ_COUNT, done, DWORD, err, flags, from, GET_REQ_SOCK_ERROR, handle, loop, memset(), NULL, req, REQ_SUCCESS, uv_buf_init(), UV_HANDLE_READ_PENDING, UV_HANDLE_READING, UV_HANDLE_ZERO_READ, uv_translate_sys_error(), UV_UDP_PARTIAL, uv_udp_queue_recv(), and uv_udp_recv_stop().
Referenced by uv_process_reqs().
void uv_process_udp_send_req | ( | uv_loop_t * | loop, |
uv_udp_t * | handle, | ||
uv_udp_send_t * | req | ||
) |
Definition at line 564 of file udp.c.
References assert(), DECREASE_PENDING_REQ_COUNT, err, GET_REQ_SOCK_ERROR, handle, loop, req, REQ_SUCCESS, UNREGISTER_HANDLE_REQ, and uv_translate_sys_error().
Referenced by uv_process_reqs().
Definition at line 170 of file udp.c.
References handle, loop, uv__handle_closing, uv_udp_recv_stop(), and uv_want_endgame().
Referenced by uv_close().
Definition at line 183 of file udp.c.
References assert(), handle, uv__handle_close, UV_HANDLE_CLOSED, and UV_HANDLE_CLOSING.
Referenced by uv_process_endgames().
Definition at line 39 of file udp.c.
References handle, and uv__getsockpeername().
Referenced by uv__udp_is_connected().
|
static |
Definition at line 197 of file udp.c.
References addr, addrlen, AF_INET6, bind, DWORD, err, flags, handle, IPV6_V6ONLY, r, SO_REUSEADDR, SOCK_DGRAM, socket, SOL_SOCKET, UV_HANDLE_BOUND, UV_HANDLE_IPV6, UV_UDP_IPV6ONLY, UV_UDP_REUSEADDR, and uv_udp_set_socket().
Referenced by SOCKOPT_SETTER(), uv__udp_connect(), uv__udp_recv_start(), uv__udp_send(), uv__udp_set_membership4(), uv__udp_set_membership6(), uv__udp_set_source_membership4(), uv__udp_set_source_membership6(), and uv__udp_try_send().
int uv_udp_open | ( | uv_udp_t * | handle, |
uv_os_sock_t | sock | ||
) |
Definition at line 950 of file udp.c.
References err, handle, int, SOL_SOCKET, uv__fd_exists(), uv__nonblock, uv__set_reuse(), uv__udp_is_bound(), uv__udp_is_connected(), UV_HANDLE_BOUND, UV_HANDLE_UDP_CONNECTED, uv_translate_sys_error(), and uv_udp_set_socket().
Referenced by uv_accept().
Definition at line 267 of file udp.c.
References assert(), bytes, DWORD, flags, handle, loop, memset(), NULL, req, SET_REQ_ERROR, uv_active_udp_streams_threshold, uv_buf_init(), UV_HANDLE_READ_PENDING, UV_HANDLE_READING, UV_HANDLE_ZERO_READ, uv_insert_pending_req(), UV_SUCCEEDED_WITH_IOCP, UV_SUCCEEDED_WITHOUT_IOCP, and uv_zero_.
Referenced by uv__udp_recv_start(), and uv_process_udp_recv_req().
Definition at line 920 of file udp.c.
References handle, SO_BROADCAST, SOL_SOCKET, UV__ERR, uv_translate_sys_error(), and value.
Referenced by main().
int uv_udp_set_membership | ( | uv_udp_t * | handle, |
const char * | multicast_addr, | ||
const char * | interface_addr, | ||
uv_membership | membership | ||
) |
Definition at line 807 of file udp.c.
References AF_INET, AF_INET6, err, handle, uv__udp_maybe_deferred_bind(), uv__udp_set_membership4(), uv__udp_set_membership6(), uv_ip4_addr(), uv_ip6_addr(), and UV_UDP_REUSEADDR.
Definition at line 867 of file udp.c.
References AF_INET, AF_INET6, assert(), handle, memset(), in_addr::s_addr, sockaddr_in6::sin6_scope_id, sockaddr_in::sin_addr, UV__ERR, UV_HANDLE_IPV6, uv_ip4_addr(), uv_ip6_addr(), and uv_translate_sys_error().
|
static |
Definition at line 63 of file udp.c.
References AF_INET6, assert(), DWORD, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS, FILE_SKIP_SET_EVENT_ON_HANDLE, FIONBIO, handle, HANDLE, info(), int, loop, NULL, socket, SOL_SOCKET, UV_HANDLE_IPV6, UV_HANDLE_SYNC_BYPASS_IOCP, uv_wsarecv_workaround(), and uv_wsarecvfrom_workaround().
Referenced by uv__udp_init_ex(), uv_udp_maybe_bind(), and uv_udp_open().
int uv_udp_set_source_membership | ( | uv_udp_t * | handle, |
const char * | multicast_addr, | ||
const char * | interface_addr, | ||
const char * | source_addr, | ||
uv_membership | membership | ||
) |
Definition at line 823 of file udp.c.
References err, handle, uv__sockaddr::in, uv__sockaddr::in6, uv__udp_set_source_membership4(), uv__udp_set_source_membership6(), uv_ip4_addr(), and uv_ip6_addr().
Definition at line 35 of file udp.c.
Referenced by uv_udp_queue_recv().
|
static |
Definition at line 38 of file udp.c.
Referenced by uv_udp_queue_recv().