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.
Variables | |
const unsigned int | uv_active_tcp_streams_threshold = 0 |
const unsigned int | uv_simultaneous_server_accepts = 32 |
static char | uv_zero_ [] = "" |
|
static |
Definition at line 355 of file tcp.c.
References assert(), handle, NULL, req, and uv_fatal_error().
Referenced by uv_tcp_queue_accept(), and uv_tcp_queue_read().
|
static |
Definition at line 374 of file tcp.c.
References assert(), handle, NULL, req, and uv_fatal_error().
Referenced by uv_tcp_write().
|
static |
Definition at line 772 of file tcp.c.
References pRtlGetVersion.
Referenced by uv_tcp_try_connect().
Definition at line 751 of file tcp.c.
References AF_INET, AF_INET6, htons, i, sockaddr_in6::sin6_addr, and sockaddr_in::sin_addr.
Referenced by uv_tcp_try_connect().
int uv__tcp_bind | ( | uv_tcp_t * | handle, |
const struct sockaddr * | addr, | ||
unsigned int | addrlen, | ||
unsigned int | flags | ||
) |
Definition at line 1544 of file tcp.c.
References addr, addrlen, err, flags, handle, uv_tcp_try_bind(), and uv_translate_sys_error().
int uv__tcp_connect | ( | uv_connect_t * | req, |
uv_tcp_t * | handle, | ||
const struct sockaddr * | addr, | ||
unsigned int | addrlen, | ||
uv_connect_cb | cb | ||
) |
|
static |
Definition at line 60 of file tcp.c.
References SO_KEEPALIVE, socket, SOL_SOCKET, and TCP_KEEPALIVE.
Definition at line 968 of file tcp.c.
References bufs, bytes, DWORD, handle, NULL, and uv_translate_sys_error().
Referenced by uv_try_write().
int uv__tcp_xfer_export | ( | uv_tcp_t * | handle, |
int | target_pid, | ||
uv__ipc_socket_xfer_type_t * | xfer_type, | ||
uv__ipc_socket_xfer_info_t * | xfer_info | ||
) |
Definition at line 1242 of file tcp.c.
References uv__ipc_socket_xfer_info_t::delayed_error, handle, listen, uv__ipc_socket_xfer_info_t::socket_info, UV__IPC_SOCKET_XFER_TCP_CONNECTION, UV__IPC_SOCKET_XFER_TCP_SERVER, UV_HANDLE_BOUND, UV_HANDLE_CONNECTION, UV_HANDLE_LISTENING, and UV_HANDLE_SHARED_TCP_SOCKET.
Referenced by uv__pipe_write_ipc().
int uv__tcp_xfer_import | ( | uv_tcp_t * | tcp, |
uv__ipc_socket_xfer_type_t | xfer_type, | ||
uv__ipc_socket_xfer_info_t * | xfer_info | ||
) |
Definition at line 1277 of file tcp.c.
References assert(), uv__ipc_socket_xfer_info_t::delayed_error, err, socket, uv__ipc_socket_xfer_info_t::socket_info, UV__IPC_SOCKET_XFER_TCP_CONNECTION, UV__IPC_SOCKET_XFER_TCP_SERVER, uv_connection_init(), UV_HANDLE_BOUND, UV_HANDLE_READABLE, UV_HANDLE_SHARED_TCP_SOCKET, UV_HANDLE_WRITABLE, and uv_tcp_set_socket().
Referenced by uv_pipe_accept().
Definition at line 1161 of file tcp.c.
References assert(), DECREASE_ACTIVE_COUNT, DECREASE_PENDING_REQ_COUNT, err, GET_REQ_SOCK_ERROR, handle, loop, req, REQ_SUCCESS, SOL_SOCKET, UV_HANDLE_LISTENING, uv_tcp_queue_accept(), and uv_translate_sys_error().
void uv_process_tcp_connect_req | ( | uv_loop_t * | loop, |
uv_tcp_t * | handle, | ||
uv_connect_t * | req | ||
) |
Definition at line 1209 of file tcp.c.
References assert(), DECREASE_PENDING_REQ_COUNT, err, GET_REQ_SOCK_ERROR, handle, loop, NULL, req, REQ_SUCCESS, SO_UPDATE_CONNECT_CONTEXT, SOL_SOCKET, UNREGISTER_HANDLE_REQ, uv_connection_init(), UV_HANDLE_CLOSING, UV_HANDLE_READABLE, UV_HANDLE_WRITABLE, and uv_translate_sys_error().
Definition at line 992 of file tcp.c.
References assert(), bytes, count, DECREASE_ACTIVE_COUNT, DECREASE_PENDING_REQ_COUNT, done, DWORD, err, flags, GET_REQ_SOCK_ERROR, handle, loop, NULL, req, REQ_SUCCESS, uv_buf_init(), UV_HANDLE_READ_PENDING, UV_HANDLE_READABLE, UV_HANDLE_READING, UV_HANDLE_ZERO_READ, uv_tcp_queue_read(), and uv_translate_sys_error().
void uv_process_tcp_write_req | ( | uv_loop_t * | loop, |
uv_tcp_t * | handle, | ||
uv_write_t * | req | ||
) |
Definition at line 1120 of file tcp.c.
References assert(), DECREASE_PENDING_REQ_COUNT, err, GET_REQ_SOCK_ERROR, handle, INVALID_HANDLE_VALUE, loop, NULL, req, UNREGISTER_HANDLE_REQ, UV_HANDLE_EMULATE_IOCP, uv_translate_sys_error(), and uv_want_endgame().
Definition at line 657 of file tcp.c.
References AF_INET, AF_INET6, assert(), err, loop, NULL, req, uv_connection_init(), UV_HANDLE_BOUND, UV_HANDLE_CLOSING, UV_HANDLE_IPV6, UV_HANDLE_READABLE, UV_HANDLE_TCP_ACCEPT_STATE_CHANGING, UV_HANDLE_TCP_SINGLE_ACCEPT, UV_HANDLE_WRITABLE, uv_simultaneous_server_accepts, uv_tcp_queue_accept(), and uv_tcp_set_socket().
Referenced by uv_accept().
Definition at line 1426 of file tcp.c.
References DECREASE_ACTIVE_COUNT, i, loop, NULL, req, SD_SEND, uv__handle_closing, UV_HANDLE_LISTENING, UV_HANDLE_READ_PENDING, UV_HANDLE_READABLE, UV_HANDLE_READING, UV_HANDLE_SHARED_TCP_SOCKET, UV_HANDLE_TCP_SOCKET_CLOSED, UV_HANDLE_WRITABLE, uv_simultaneous_server_accepts, uv_tcp_try_cancel_io(), and uv_want_endgame().
Referenced by uv_close().
int uv_tcp_close_reset | ( | uv_tcp_t * | handle, |
uv_close_cb | close_cb | ||
) |
Definition at line 551 of file tcp.c.
References fd, handle, SO_LINGER, SOL_SOCKET, UV__ERR, uv__stream_fd, uv_close(), UV_HANDLE_SHUTTING, and uv_translate_sys_error().
Definition at line 208 of file tcp.c.
References assert(), DECREASE_PENDING_REQ_COUNT, err, handle, i, INVALID_HANDLE_VALUE, loop, NULL, req, SD_SEND, UNREGISTER_HANDLE_REQ, uv__free(), uv__handle_close, UV_HANDLE_CLOSED, UV_HANDLE_CLOSING, UV_HANDLE_CONNECTION, UV_HANDLE_EMULATE_IOCP, UV_HANDLE_TCP_SOCKET_CLOSED, uv_simultaneous_server_accepts, and uv_translate_sys_error().
Referenced by uv_process_endgames().
Definition at line 889 of file tcp.c.
References handle, and uv__getsockpeername().
Definition at line 203 of file tcp.c.
References AF_UNSPEC, handle, loop, and uv_tcp_init_ex().
Referenced by main(), on_new_connection(), and on_resolved().
Definition at line 154 of file tcp.c.
References AF_INET, AF_INET6, AF_UNSPEC, domain, DWORD, err, flags, handle, loop, maybe_new_socket(), NULL, QUEUE_REMOVE, SOCK_STREAM, socket, uv__stream_init(), uv_stream_init(), uv_tcp_set_socket(), and uv_translate_sys_error().
Definition at line 1336 of file tcp.c.
References err, handle, uv__stream_fd, uv__tcp_keepalive(), and UV_HANDLE_TCP_KEEPALIVE.
int uv_tcp_listen | ( | uv_tcp_t * | handle, |
int | backlog, | ||
uv_connection_cb | cb | ||
) |
Definition at line 566 of file tcp.c.
References AF_INET, assert(), cb, err, flags, getenv(), handle, i, INCREASE_ACTIVE_COUNT, INVALID_HANDLE_VALUE, listen, loop, maybe_new_socket(), NULL, req, UV__ERR, uv__io_start(), uv__load_relaxed, uv__malloc(), uv__server_io(), uv__store_relaxed, uv_addr_ip4_any_, uv_fatal_error(), uv_get_acceptex_function(), UV_HANDLE_BOUND, UV_HANDLE_EMULATE_IOCP, UV_HANDLE_LISTENING, UV_HANDLE_READING, UV_HANDLE_SHARED_TCP_SOCKET, UV_HANDLE_TCP_SINGLE_ACCEPT, UV_REQ_INIT, uv_simultaneous_server_accepts, uv_tcp_queue_accept(), uv_tcp_try_bind(), and val.
Referenced by uv_listen().
Definition at line 1317 of file tcp.c.
References err, handle, uv__stream_fd, uv__tcp_nodelay(), and UV_HANDLE_TCP_NODELAY.
int uv_tcp_open | ( | uv_tcp_t * | handle, |
uv_os_sock_t | sock | ||
) |
Definition at line 1498 of file tcp.c.
References err, handle, int, SOL_SOCKET, uv__fd_exists(), uv__nonblock, uv__stream_open(), uv_connection_init(), UV_HANDLE_BOUND, UV_HANDLE_READABLE, UV_HANDLE_WRITABLE, uv_tcp_getpeername(), uv_tcp_getsockname(), uv_tcp_set_socket(), and uv_translate_sys_error().
|
static |
Definition at line 393 of file tcp.c.
References AF_INET, AF_INET6, assert(), bytes, DWORD, handle, HANDLE, INVALID_HANDLE_VALUE, loop, memset(), NULL, post_completion(), req, SET_REQ_ERROR, SOCK_STREAM, socket, UV_HANDLE_EMULATE_IOCP, UV_HANDLE_IPV6, UV_HANDLE_LISTENING, uv_insert_pending_req(), UV_SUCCEEDED_WITH_IOCP, and UV_SUCCEEDED_WITHOUT_IOCP.
Referenced by uv_process_tcp_accept_req(), uv_tcp_accept(), and uv_tcp_listen().
Definition at line 477 of file tcp.c.
References assert(), bytes, DWORD, flags, handle, HANDLE, INVALID_HANDLE_VALUE, loop, memset(), NULL, post_completion(), req, SET_REQ_ERROR, uv_active_tcp_streams_threshold, uv_buf_init(), UV_HANDLE_EMULATE_IOCP, 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_process_tcp_read_req(), and uv_tcp_read_start().
int uv_tcp_read_start | ( | uv_tcp_t * | handle, |
uv_alloc_cb | alloc_cb, | ||
uv_read_cb | read_cb | ||
) |
Definition at line 726 of file tcp.c.
References handle, INCREASE_ACTIVE_COUNT, loop, NULL, uv_fatal_error(), UV_HANDLE_EMULATE_IOCP, UV_HANDLE_READ_PENDING, UV_HANDLE_READING, and uv_tcp_queue_read().
Referenced by uv_read_start().
|
static |
Definition at line 81 of file tcp.c.
References AF_INET6, assert(), DWORD, err, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS, FILE_SKIP_SET_EVENT_ON_HANDLE, FIONBIO, handle, HANDLE, loop, NULL, socket, uv__tcp_keepalive(), uv__tcp_nodelay(), UV_HANDLE_EMULATE_IOCP, UV_HANDLE_IPV6, UV_HANDLE_SYNC_BYPASS_IOCP, UV_HANDLE_TCP_KEEPALIVE, UV_HANDLE_TCP_NODELAY, uv_tcp_non_ifs_lsp_ipv4, and uv_tcp_non_ifs_lsp_ipv6.
Referenced by uv__tcp_xfer_import(), uv_tcp_accept(), uv_tcp_init_ex(), uv_tcp_open(), and uv_tcp_try_bind().
Definition at line 1357 of file tcp.c.
References handle, UV_HANDLE_CONNECTION, UV_HANDLE_LISTENING, UV_HANDLE_TCP_ACCEPT_STATE_CHANGING, and UV_HANDLE_TCP_SINGLE_ACCEPT.
|
static |
Definition at line 294 of file tcp.c.
References addr, addrlen, AF_INET6, bind, DWORD, err, flags, handle, IPV6_V6ONLY, r, SOCK_STREAM, socket, UV_HANDLE_BOUND, UV_TCP_IPV6ONLY, and uv_tcp_set_socket().
Referenced by uv__tcp_bind(), uv_tcp_listen(), and uv_tcp_try_connect().
Definition at line 1389 of file tcp.c.
References assert(), bytes, DWORD, HANDLE, NULL, SIO_BASE_HANDLE, socket, UV_HANDLE_IPV6, uv_tcp_non_ifs_lsp_ipv4, and uv_tcp_non_ifs_lsp_ipv6.
Referenced by uv_tcp_close().
|
static |
Definition at line 786 of file tcp.c.
References addr, addrlen, bytes, cb, DWORD, err, handle, loop, _TCP_INITIAL_RTO_PARAMETERS::MaxSynRetransmissions, memset(), NULL, REGISTER_HANDLE_REQ, req, _TCP_INITIAL_RTO_PARAMETERS::Rtt, SIO_TCP_INITIAL_RTO, TCP_INITIAL_RTO_NO_SYN_RETRANSMISSIONS, uv__convert_to_localhost_if_unspecified(), uv__is_fast_loopback_fail_supported(), uv__is_loopback(), uv_addr_ip4_any_, uv_addr_ip6_any_, uv_get_connectex_function(), UV_HANDLE_BOUND, uv_insert_pending_req(), UV_REQ_INIT, UV_SUCCEEDED_WITH_IOCP, UV_SUCCEEDED_WITHOUT_IOCP, and uv_tcp_try_bind().
Referenced by uv__tcp_connect().
int uv_tcp_write | ( | uv_loop_t * | loop, |
uv_write_t * | req, | ||
uv_tcp_t * | handle, | ||
const uv_buf_t | bufs[], | ||
unsigned int | nbufs, | ||
uv_write_cb | cb | ||
) |
Definition at line 901 of file tcp.c.
References bufs, bytes, cb, DWORD, handle, HANDLE, INVALID_HANDLE_VALUE, loop, memset(), NULL, post_write_completion(), REGISTER_HANDLE_REQ, req, SET_REQ_ERROR, uv__count_bufs(), uv_fatal_error(), UV_HANDLE_EMULATE_IOCP, uv_insert_pending_req(), UV_REQ_INIT, UV_SUCCEEDED_WITH_IOCP, and UV_SUCCEEDED_WITHOUT_IOCP.
Referenced by uv_write().
Definition at line 38 of file tcp.c.
Referenced by uv_tcp_queue_read().
Definition at line 43 of file tcp.c.
Referenced by uv_tcp_accept(), uv_tcp_close(), uv_tcp_endgame(), and uv_tcp_listen().
|
static |
Definition at line 46 of file tcp.c.
Referenced by uv_tcp_queue_read().