Inherits Continuation.
Public Types | |
enum | { SOCKS_INIT = 1, SOCKS_ACCEPT, AUTH_DONE, SERVER_TUNNEL, HTTP_REQ, RESP_TO_CLIENT, ALL_DONE, SOCKS_ERROR } |
typedef int(SocksProxy::* | EventHandler )(int event, void *data) |
Public Member Functions | |
SocksProxy () | |
~SocksProxy () | |
int | mainEvent (int event, void *data) |
int | setupHttpRequest (unsigned char *p) |
int | sendResp (bool granted) |
void | init (NetVConnection *netVC) |
void | free () |
Definition at line 48 of file SocksProxy.cc.
typedef int(SocksProxy::* SocksProxy::EventHandler)(int event, void *data) |
Definition at line 50 of file SocksProxy.cc.
anonymous enum |
SOCKS_INIT | |
SOCKS_ACCEPT | |
AUTH_DONE | |
SERVER_TUNNEL | |
HTTP_REQ | |
RESP_TO_CLIENT | |
ALL_DONE | |
SOCKS_ERROR |
Definition at line 52 of file SocksProxy.cc.
SocksProxy::SocksProxy | ( | ) | [inline] |
Definition at line 57 of file SocksProxy.cc.
SocksProxy::~SocksProxy | ( | ) | [inline] |
Definition at line 63 of file SocksProxy.cc.
void SocksProxy::free | ( | void | ) |
Definition at line 113 of file SocksProxy.cc.
References free_MIOBuffer(), Continuation::mutex, and socksProxyAllocator.
Referenced by mainEvent().
void SocksProxy::init | ( | NetVConnection * | netVC | ) |
Definition at line 99 of file SocksProxy.cc.
References MIOBuffer::alloc_reader(), mainEvent(), Continuation::mutex, MUTEX_LOCK, NET_EVENT_ACCEPT, new_MIOBuffer, new_ProxyMutex(), SET_HANDLER, and this_ethread().
Referenced by new_SocksProxy().
int SocksProxy::mainEvent | ( | int | event, | |
void * | data | |||
) |
Definition at line 124 of file SocksProxy.cc.
References ACTION_RESULT_DONE, ALL_DONE, ats_ip4_set(), ats_ip_sa_cast(), NetVConnection::attributes, AUTH_DONE, IOBufferReader::block_read_avail(), Action::cancel(), NetProcessor::connect_re(), IOBufferReader::consume(), Debug, NetVConnection::do_io_close(), NetVConnection::do_io_read(), NetVConnection::do_io_write(), EVENT_DONE, EVENT_INTERVAL, MIOBuffer::fill(), free(), get_vc_event_name(), HRTIME_SECONDS, socks_conf_struct::http_port, HTTP_REQ, OneWayTunnel::init(), ink_assert, INT64_MAX, invokeSocksAuthHandler(), HttpSessionAccept::mainEvent(), memcpy, Continuation::mutex, VIO::nbytes, VIO::ndone, NET_EVENT_ACCEPT, NET_EVENT_OPEN, NET_EVENT_OPEN_FAILED, netProcessor, OneWayTunnel::OneWayTunnel_alloc(), IOBufferReader::read_avail(), MIOBuffer::reset(), SocksAddrType::reset(), RESP_TO_CLIENT, EThread::schedule_in(), sendResp(), SERVER_TUNNEL, setupHttpRequest(), OneWayTunnel::SetupTwoWayTunnel(), SOCKS4_VERSION, SOCKS5_VERSION, SOCKS_ACCEPT, NetVConnection::socks_addr, SOCKS_ATYPE_FQHN, SOCKS_ATYPE_IPV4, SOCKS_ATYPE_IPV6, SOCKS_AUTH_FILL_WRITE_BUF, SOCKS_AUTH_READ_COMPLETE, NetProcessor::socks_conf_stuff, SOCKS_CONNECT, SOCKS_ERROR, NetVCOptions::socks_support, socks_conf_struct::socks_timeout, NetVCOptions::socks_version, socksproxy_http_connections_stat, SOCKSPROXY_INC_STAT, socksproxy_tunneled_connections_stat, MIOBuffer::start(), IOBufferReader::start(), this_ethread(), detail::HttpSessionAcceptOptions::transport_type, SocksAddrType::type, VC_EVENT_ACTIVE_TIMEOUT, VC_EVENT_EOS, VC_EVENT_ERROR, VC_EVENT_INACTIVITY_TIMEOUT, VC_EVENT_READ_COMPLETE, VC_EVENT_READ_READY, VC_EVENT_WRITE_COMPLETE, VC_EVENT_WRITE_READY, and Warning.
Referenced by init().
int SocksProxy::sendResp | ( | bool | granted | ) |
Definition at line 415 of file SocksProxy.cc.
References NetVConnection::do_io_write(), MIOBuffer::fill(), MIOBuffer::reset(), SOCKS4_CONN_FAILED, SOCKS4_REQ_GRANTED, SOCKS4_VERSION, SOCKS5_CONN_FAILED, SOCKS5_REQ_GRANTED, and MIOBuffer::start().
Referenced by mainEvent().
int SocksProxy::setupHttpRequest | ( | unsigned char * | p | ) |
Definition at line 450 of file SocksProxy.cc.
References a, SocksAddrType::addr, ats_malloc(), SocksAddrType::buf, ink_assert, SocksAddrType::ipv4, memcpy, NetVConnection::socks_addr, SOCKS_ATYPE_FQHN, SOCKS_ATYPE_IPV4, SOCKS_ATYPE_IPV6, and SocksAddrType::type.
Referenced by mainEvent().