Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include "qsocks5socketengine_p.h"
#include "qtcpsocket.h"
#include "qudpsocket.h"
#include "qtcpserver.h"
#include "qdebug.h"
#include "qhash.h"
#include "qqueue.h"
#include "qdeadlinetimer.h"
#include "qelapsedtimer.h"
#include "qmutex.h"
#include "qthread.h"
#include "qcoreapplication.h"
#include "qurl.h"
#include "qauthenticator.h"
#include "private/qiodevice_p.h"
#include "private/qringbuffer_p.h"
#include <qendian.h>
#include <qnetworkinterface.h>
#include <QtCore/qpointer.h>
#include <memory>
#include "moc_qsocks5socketengine_p.cpp"
Go to the source code of this file.
Classes | |
struct | QSocks5Data |
struct | QSocks5ConnectData |
struct | QSocks5BindData |
struct | QSocks5RevivedDatagram |
struct | QSocks5UdpAssociateData |
class | QSocks5BindStore |
Macros | |
#define | MAX_DATA_DUMP 256 |
#define | Q_INIT_CHECK(returnValue) |
#define | S5_VERSION_5 0x05 |
#define | S5_CONNECT 0x01 |
#define | S5_BIND 0x02 |
#define | S5_UDP_ASSOCIATE 0x03 |
#define | S5_IP_V4 0x01 |
#define | S5_DOMAINNAME 0x03 |
#define | S5_IP_V6 0x04 |
#define | S5_SUCCESS 0x00 |
#define | S5_R_ERROR_SOCKS_FAILURE 0x01 |
#define | S5_R_ERROR_CON_NOT_ALLOWED 0x02 |
#define | S5_R_ERROR_NET_UNREACH 0x03 |
#define | S5_R_ERROR_HOST_UNREACH 0x04 |
#define | S5_R_ERROR_CONN_REFUSED 0x05 |
#define | S5_R_ERROR_TTL 0x06 |
#define | S5_R_ERROR_CMD_NOT_SUPPORTED 0x07 |
#define | S5_R_ERROR_ADD_TYPE_NOT_SUPORTED 0x08 |
#define | S5_AUTHMETHOD_NONE 0x00 |
#define | S5_AUTHMETHOD_PASSWORD 0x02 |
#define | S5_AUTHMETHOD_NOTACCEPTABLE 0xFF |
#define | S5_PASSWORDAUTH_VERSION 0x01 |
#define | QSOCKS5_DEBUG if (0) qDebug() |
#define | QSOCKS5_Q_DEBUG if (0) qDebug() |
#define | QSOCKS5_D_DEBUG if (0) qDebug() |
Functions | |
static QString | dump (const QByteArray &) |
static bool | qt_socks5_set_host_address_and_port (const QHostAddress &address, quint16 port, QByteArray *pBuf) |
static bool | qt_socks5_set_host_name_and_port (const QString &hostname, quint16 port, QByteArray *pBuf) |
static int | qt_socks5_get_host_address_and_port (const QByteArray &buf, QHostAddress *pAddress, quint16 *pPort, int *pPos) |
static int | nextDescriptor () |
Variables | |
static const int | MaxWriteBufferSize = 128*1024 |
static constexpr auto | Socks5BlockingBindTimeout = 5s |
static QString | s5StateToString (QSocks5SocketEnginePrivate::Socks5State) |
#define MAX_DATA_DUMP 256 |
Definition at line 37 of file qsocks5socketengine.cpp.
#define Q_INIT_CHECK | ( | returnValue | ) |
Definition at line 40 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEngine::hasPendingDatagrams().
Definition at line 111 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::_q_controlSocketDisconnected(), QSocks5SocketEnginePrivate::_q_controlSocketErrorOccurred(), QSocks5SocketEnginePrivate::_q_controlSocketReadNotification(), QSocks5SocketEnginePrivate::_q_controlSocketStateChanged(), QSocks5SocketEnginePrivate::_q_emitPendingConnectionNotification(), QSocks5SocketEnginePrivate::_q_emitPendingReadNotification(), QSocks5SocketEnginePrivate::_q_emitPendingWriteNotification(), QSocks5SocketEnginePrivate::_q_udpSocketReadNotification(), QSocks5SocketEnginePrivate::emitConnectionNotification(), QSocks5SocketEnginePrivate::emitReadNotification(), QSocks5SocketEnginePrivate::emitWriteNotification(), QSocks5SocketEnginePrivate::initialize(), and QSocks5SocketEnginePrivate::parseAuthenticationMethodReply().
Definition at line 109 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::_q_controlSocketBytesWritten(), QSocks5SocketEnginePrivate::_q_controlSocketConnected(), QSocks5SocketEnginePrivate::_q_controlSocketReadNotification(), QSocks5SocketEnginePrivate::_q_udpSocketReadNotification(), QSocks5SocketEngine::connectToHost(), QSocks5SocketEngineHandler::createSocketEngine(), QSocks5SocketEngineHandler::createSocketEngine(), QSocks5SocketEnginePrivate::parseRequestMethodReply(), qt_socks5_get_host_address_and_port(), qt_socks5_set_host_address_and_port(), qt_socks5_set_host_name_and_port(), QSocks5SocketEngine::read(), QSocks5SocketEnginePrivate::reauthenticate(), QSocks5BindStore::retrieve(), QSocks5SocketEnginePrivate::sendRequestMethod(), QSocks5BindStore::timerEvent(), QSocks5SocketEngine::waitForRead(), QSocks5SocketEngine::waitForWrite(), and QSocks5SocketEngine::writeDatagram().
Definition at line 110 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEngine::accept(), QSocks5SocketEngine::bind(), QSocks5SocketEngine::close(), QSocks5SocketEngine::initialize(), QSocks5SocketEngine::listen(), QSocks5SocketEngine::read(), QSocks5SocketEngine::setReadNotificationEnabled(), and QSocks5SocketEngine::write().
#define S5_AUTHMETHOD_NONE 0x00 |
Definition at line 62 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::parseAuthenticationMethodReply().
#define S5_AUTHMETHOD_NOTACCEPTABLE 0xFF |
Definition at line 64 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::parseAuthenticationMethodReply().
#define S5_AUTHMETHOD_PASSWORD 0x02 |
Definition at line 63 of file qsocks5socketengine.cpp.
#define S5_BIND 0x02 |
Definition at line 47 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::sendRequestMethod().
#define S5_CONNECT 0x01 |
Definition at line 46 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::sendRequestMethod().
#define S5_DOMAINNAME 0x03 |
Definition at line 50 of file qsocks5socketengine.cpp.
Referenced by qt_socks5_get_host_address_and_port(), and qt_socks5_set_host_name_and_port().
#define S5_IP_V4 0x01 |
Definition at line 49 of file qsocks5socketengine.cpp.
Referenced by qt_socks5_get_host_address_and_port(), and qt_socks5_set_host_address_and_port().
#define S5_IP_V6 0x04 |
Definition at line 51 of file qsocks5socketengine.cpp.
Referenced by qt_socks5_get_host_address_and_port(), and qt_socks5_set_host_address_and_port().
#define S5_PASSWORDAUTH_VERSION 0x01 |
Definition at line 66 of file qsocks5socketengine.cpp.
Referenced by QSocks5PasswordAuthenticator::beginAuthenticate(), and QSocks5PasswordAuthenticator::continueAuthenticate().
#define S5_R_ERROR_ADD_TYPE_NOT_SUPORTED 0x08 |
Definition at line 60 of file qsocks5socketengine.cpp.
#define S5_R_ERROR_CMD_NOT_SUPPORTED 0x07 |
Definition at line 59 of file qsocks5socketengine.cpp.
#define S5_R_ERROR_CON_NOT_ALLOWED 0x02 |
Definition at line 54 of file qsocks5socketengine.cpp.
#define S5_R_ERROR_CONN_REFUSED 0x05 |
Definition at line 57 of file qsocks5socketengine.cpp.
#define S5_R_ERROR_HOST_UNREACH 0x04 |
Definition at line 56 of file qsocks5socketengine.cpp.
#define S5_R_ERROR_NET_UNREACH 0x03 |
Definition at line 55 of file qsocks5socketengine.cpp.
#define S5_R_ERROR_SOCKS_FAILURE 0x01 |
Definition at line 53 of file qsocks5socketengine.cpp.
#define S5_R_ERROR_TTL 0x06 |
Definition at line 58 of file qsocks5socketengine.cpp.
#define S5_SUCCESS 0x00 |
Definition at line 52 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::parseRequestMethodReply().
#define S5_UDP_ASSOCIATE 0x03 |
Definition at line 48 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::sendRequestMethod().
#define S5_VERSION_5 0x05 |
|
inlinestatic |
Definition at line 114 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::_q_controlSocketReadNotification(), QSocks5SocketEnginePrivate::_q_udpSocketReadNotification(), QQuick3DRenderStats::endRender(), QQuick3DRenderStats::endSync(), QSocks5SocketEnginePrivate::parseRequestMethodReply(), QtModuleInfoStore::populate(), QSocks5SocketEngine::read(), QSocks5SocketEnginePrivate::sendRequestMethod(), QQmlJS::Dom::Token::toString(), QSocks5SocketEngine::write(), and QSocks5SocketEngine::writeDatagram().
|
static |
Definition at line 968 of file qsocks5socketengine.cpp.
References QBasicAtomicInteger< T >::fetchAndAddRelaxed().
Referenced by QSocks5SocketEngine::initialize().
|
static |
Definition at line 185 of file qsocks5socketengine.cpp.
References add(), i, pos, qDebug, QSOCKS5_DEBUG, ret, S5_DOMAINNAME, S5_IP_V4, and S5_IP_V6.
Referenced by QSocks5SocketEnginePrivate::_q_udpSocketReadNotification(), and QSocks5SocketEnginePrivate::parseRequestMethodReply().
|
static |
Definition at line 121 of file qsocks5socketengine.cpp.
References QByteArray::fromRawData(), QAbstractSocket::IPv4Protocol, QAbstractSocket::IPv6Protocol, ptr(), QSOCKS5_DEBUG, S5_IP_V4, and S5_IP_V6.
Referenced by QSocks5SocketEnginePrivate::sendRequestMethod(), and QSocks5SocketEngine::writeDatagram().
|
static |
Definition at line 154 of file qsocks5socketengine.cpp.
References QByteArray::append(), QByteArray::fromRawData(), ptr(), QSOCKS5_DEBUG, S5_DOMAINNAME, and QUrl::toAce().
Referenced by QSocks5SocketEnginePrivate::sendRequestMethod().
|
static |
Definition at line 33 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::_q_controlSocketBytesWritten(), QSocks5SocketEngine::waitForWrite(), and QSocks5SocketEngine::write().
|
inlinestatic |
Definition at line 113 of file qsocks5socketengine.cpp.
Referenced by QSocks5SocketEnginePrivate::_q_controlSocketReadNotification().
|
staticconstexpr |
Definition at line 38 of file qsocks5socketengine.cpp.