![]() |
Qt 6.x
The Qt SDK
|
#include <qsocks5socketengine_p.h>
Public Types | |
enum | Socks5State { Uninitialized = 0 , ConnectError , AuthenticationMethodsSent , Authenticating , AuthenticatingError , RequestMethodSent , RequestError , Connected , UdpAssociateSuccess , BindSuccess , ControlSocketError , SocksError , HostNameLookupError } |
enum | Socks5Mode { NoMode , ConnectMode , BindMode , UdpAssociateMode } |
enum | Socks5Error { SocksFailure = 0x01 , ConnectionNotAllowed = 0x02 , NetworkUnreachable = 0x03 , HostUnreachable = 0x04 , ConnectionRefused = 0x05 , TTLExpired = 0x06 , CommandNotSupported = 0x07 , AddressTypeNotSupported = 0x08 , LastKnownError = AddressTypeNotSupported , UnknownError } |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Additional Inherited Members | |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
Definition at line 151 of file qsocks5socketengine_p.h.
Enumerator | |
---|---|
SocksFailure | |
ConnectionNotAllowed | |
NetworkUnreachable | |
HostUnreachable | |
ConnectionRefused | |
TTLExpired | |
CommandNotSupported | |
AddressTypeNotSupported | |
LastKnownError | |
UnknownError |
Definition at line 185 of file qsocks5socketengine_p.h.
Enumerator | |
---|---|
NoMode | |
ConnectMode | |
BindMode | |
UdpAssociateMode |
Definition at line 176 of file qsocks5socketengine_p.h.
Definition at line 158 of file qsocks5socketengine_p.h.
QSocks5SocketEnginePrivate::QSocks5SocketEnginePrivate | ( | ) |
Definition at line 470 of file qsocks5socketengine.cpp.
References NoMode.
QSocks5SocketEnginePrivate::~QSocks5SocketEnginePrivate | ( | ) |
Definition at line 491 of file qsocks5socketengine.cpp.
void QSocks5SocketEnginePrivate::_q_controlSocketBytesWritten | ( | ) |
Definition at line 1184 of file qsocks5socketengine.cpp.
References Connected, ConnectMode, emitWriteNotification(), MaxWriteBufferSize, QSOCKS5_DEBUG, socks5State, and writeNotificationActivated.
Referenced by initialize().
void QSocks5SocketEnginePrivate::_q_controlSocketConnected | ( | ) |
Definition at line 1123 of file qsocks5socketengine.cpp.
References AuthenticationMethodsSent, QSOCKS5_DEBUG, S5_VERSION_5, and socks5State.
Referenced by initialize().
void QSocks5SocketEnginePrivate::_q_controlSocketDisconnected | ( | ) |
Definition at line 1229 of file qsocks5socketengine.cpp.
References QSOCKS5_D_DEBUG.
Referenced by initialize().
void QSocks5SocketEnginePrivate::_q_controlSocketErrorOccurred | ( | QAbstractSocket::SocketError | error | ) |
Definition at line 1198 of file qsocks5socketengine.cpp.
References Authenticating, AuthenticationMethodsSent, QRingBuffer::clear(), connectData, Connected, ConnectError, ControlSocketError, emitConnectionNotification(), emitReadNotification(), emitWriteNotification(), error, QSOCKS5_D_DEBUG, QSocks5ConnectData::readBuffer, readNotificationPending, QAbstractSocket::RemoteHostClosedError, RequestMethodSent, setErrorState(), QAbstractSocket::SocketTimeoutError, socks5State, and Uninitialized.
Referenced by initialize().
void QSocks5SocketEnginePrivate::_q_controlSocketReadNotification | ( | ) |
Definition at line 1134 of file qsocks5socketengine.cpp.
References _q_controlSocketReadNotification(), QRingBuffer::append(), Authenticating, AuthenticationMethodsSent, BindMode, BindSuccess, connectData, Connected, dump(), emitReadNotification(), parseAuthenticatingReply(), parseAuthenticationMethodReply(), parseRequestMethodReply(), Q_FALLTHROUGH, QSOCKS5_D_DEBUG, QSOCKS5_DEBUG, qWarning, QSocks5ConnectData::readBuffer, RequestMethodSent, s5StateToString, and socks5State.
Referenced by _q_controlSocketReadNotification(), and initialize().
void QSocks5SocketEnginePrivate::_q_controlSocketStateChanged | ( | QAbstractSocket::SocketState | state | ) |
Definition at line 1234 of file qsocks5socketengine.cpp.
References QSOCKS5_D_DEBUG, and state.
Referenced by initialize().
void QSocks5SocketEnginePrivate::_q_emitPendingConnectionNotification | ( | ) |
Definition at line 924 of file qsocks5socketengine.cpp.
References connectionNotificationPending, and QSOCKS5_D_DEBUG.
void QSocks5SocketEnginePrivate::_q_emitPendingReadNotification | ( | ) |
Definition at line 873 of file qsocks5socketengine.cpp.
References QRingBuffer::clear(), connectData, emitReadNotification(), QSOCKS5_D_DEBUG, QSocks5ConnectData::readBuffer, readNotificationEnabled, readNotificationPending, QAbstractSocket::RemoteHostClosedError, and QAbstractSocket::UnconnectedState.
void QSocks5SocketEnginePrivate::_q_emitPendingWriteNotification | ( | ) |
Definition at line 903 of file qsocks5socketengine.cpp.
References QSOCKS5_D_DEBUG, writeNotificationEnabled, and writeNotificationPending.
void QSocks5SocketEnginePrivate::_q_udpSocketReadNotification | ( | ) |
Definition at line 1240 of file qsocks5socketengine.cpp.
References QSocks5RevivedDatagram::address, QByteArray::constData(), QByteArray::data(), QSocks5RevivedDatagram::data, dump(), emitReadNotification(), QQueue< T >::enqueue(), QUdpSocket::hasPendingDatagrams(), QSocks5UdpAssociateData::pendingDatagrams, QUdpSocket::pendingDatagramSize(), QSocks5RevivedDatagram::port, pos, QSOCKS5_D_DEBUG, QSOCKS5_DEBUG, qt_socks5_get_host_address_and_port(), QUdpSocket::readDatagram(), QByteArray::size(), udpData, and QSocks5UdpAssociateData::udpSocket.
Referenced by initialize().
void QSocks5SocketEnginePrivate::emitConnectionNotification | ( | ) |
Definition at line 932 of file qsocks5socketengine.cpp.
References connectionNotificationPending, QMetaObject::invokeMethod(), QSOCKS5_D_DEBUG, and Qt::QueuedConnection.
Referenced by _q_controlSocketErrorOccurred(), parseAuthenticationMethodReply(), parseRequestMethodReply(), and reauthenticate().
void QSocks5SocketEnginePrivate::emitReadNotification | ( | ) |
Definition at line 892 of file qsocks5socketengine.cpp.
References QMetaObject::invokeMethod(), QSOCKS5_D_DEBUG, Qt::QueuedConnection, readNotificationActivated, readNotificationEnabled, and readNotificationPending.
Referenced by _q_controlSocketErrorOccurred(), _q_controlSocketReadNotification(), _q_emitPendingReadNotification(), _q_udpSocketReadNotification(), and parseRequestMethodReply().
void QSocks5SocketEnginePrivate::emitWriteNotification | ( | ) |
Definition at line 913 of file qsocks5socketengine.cpp.
References QMetaObject::invokeMethod(), QSOCKS5_D_DEBUG, Qt::QueuedConnection, writeNotificationActivated, writeNotificationEnabled, and writeNotificationPending.
Referenced by _q_controlSocketBytesWritten(), and _q_controlSocketErrorOccurred().
void QSocks5SocketEnginePrivate::initialize | ( | Socks5Mode | socks5Mode | ) |
Definition at line 495 of file qsocks5socketengine.cpp.
References _q_controlSocketBytesWritten(), _q_controlSocketConnected(), _q_controlSocketDisconnected(), _q_controlSocketErrorOccurred(), _q_controlSocketReadNotification(), _q_controlSocketStateChanged(), _q_udpSocketReadNotification(), bindData, BindMode, QObject::connect(), connectData, connected, ConnectMode, QSocks5Data::controlSocket, Qt::DirectConnection, QString::isEmpty(), QNetworkProxy::NoProxy, QNetworkProxy::password(), proxyInfo, QSOCKS5_D_DEBUG, QAbstractSocket::setProxy(), SIGNAL, SLOT, UdpAssociateMode, udpData, QSocks5UdpAssociateData::udpSocket, and QNetworkProxy::user().
void QSocks5SocketEnginePrivate::parseAuthenticatingReply | ( | ) |
Definition at line 732 of file qsocks5socketengine.cpp.
References reauthenticate(), and sendRequestMethod().
Referenced by _q_controlSocketReadNotification().
void QSocks5SocketEnginePrivate::parseAuthenticationMethodReply | ( | ) |
Definition at line 697 of file qsocks5socketengine.cpp.
References Authenticating, AuthenticatingError, emitConnectionNotification(), QSOCKS5_D_DEBUG, reauthenticate(), S5_AUTHMETHOD_NONE, S5_AUTHMETHOD_NOTACCEPTABLE, S5_VERSION_5, sendRequestMethod(), setErrorState(), QAbstractSocket::SocketAccessError, QAbstractSocketEnginePrivate::socketError, socks5State, and SocksError.
Referenced by _q_controlSocketReadNotification().
void QSocks5SocketEnginePrivate::parseNewConnection | ( | ) |
void QSocks5SocketEnginePrivate::parseRequestMethodReply | ( | ) |
Definition at line 788 of file qsocks5socketengine.cpp.
References QByteArray::at(), bindData, BindMode, BindSuccess, QByteArray::clear(), Connected, QAbstractSocket::ConnectedState, ConnectionNotAllowed, ConnectMode, dump(), emitConnectionNotification(), emitReadNotification(), HostNameLookupError, i, QAbstractSocketEnginePrivate::inboundStreamCount, QString::isEmpty(), QAbstractSocket::ListeningState, QAbstractSocketEnginePrivate::localAddress, QAbstractSocketEnginePrivate::localPort, QAbstractSocketEnginePrivate::outboundStreamCount, QSocks5BindData::peerAddress, peerName, QSocks5BindData::peerPort, pos, QByteArray::prepend(), QSOCKS5_DEBUG, qt_socks5_get_host_address_and_port(), receivedHeaderFragment, QByteArray::remove(), RequestError, RequestMethodSent, S5_SUCCESS, S5_VERSION_5, setErrorState(), QByteArray::size(), socks5State, SocksError, SocksFailure, and UdpAssociateSuccess.
Referenced by _q_controlSocketReadNotification().
void QSocks5SocketEnginePrivate::reauthenticate | ( | ) |
Definition at line 665 of file qsocks5socketengine.cpp.
References AuthenticatingError, emitConnectionNotification(), QNetworkProxy::hostName(), QString::isEmpty(), QAuthenticator::password(), QNetworkProxy::password(), QNetworkProxy::port(), proxyInfo, QSOCKS5_DEBUG, setErrorState(), QNetworkProxy::setPassword(), QNetworkProxy::setUser(), socks5State, Uninitialized, QAuthenticator::user(), and QNetworkProxy::user().
Referenced by parseAuthenticatingReply(), and parseAuthenticationMethodReply().
void QSocks5SocketEnginePrivate::sendRequestMethod | ( | ) |
Definition at line 743 of file qsocks5socketengine.cpp.
References BindMode, ConnectMode, dump(), QString::isEmpty(), QAbstractSocketEnginePrivate::localAddress, QAbstractSocketEnginePrivate::localPort, QAbstractSocketEnginePrivate::peerAddress, peerName, QAbstractSocketEnginePrivate::peerPort, QSOCKS5_DEBUG, qt_socks5_set_host_address_and_port(), qt_socks5_set_host_name_and_port(), RequestMethodSent, S5_BIND, S5_CONNECT, S5_UDP_ASSOCIATE, S5_VERSION_5, and socks5State.
Referenced by parseAuthenticatingReply(), and parseAuthenticationMethodReply().
void QSocks5SocketEnginePrivate::setErrorState | ( | Socks5State | state, |
const QString & | extraMessage = QString() |
||
) |
Definition at line 544 of file qsocks5socketengine.cpp.
References Authenticating, AuthenticatingError, AuthenticationMethodsSent, BindSuccess, Connected, ConnectError, QAbstractSocket::ConnectionRefusedError, ControlSocketError, HostNameLookupError, QAbstractSocket::HostNotFoundError, QString::isEmpty(), QAbstractSocket::ProxyAuthenticationRequiredError, QAbstractSocket::ProxyConnectionClosedError, QAbstractSocket::ProxyConnectionRefusedError, QAbstractSocket::ProxyConnectionTimeoutError, QAbstractSocket::ProxyNotFoundError, QAbstractSocket::ProxyProtocolError, Q_FALLTHROUGH, QAbstractSocket::RemoteHostClosedError, RequestError, RequestMethodSent, QAbstractSocket::SocketTimeoutError, socks5State, SocksError, state, UdpAssociateSuccess, QAbstractSocket::UnconnectedState, and Uninitialized.
Referenced by _q_controlSocketErrorOccurred(), parseAuthenticationMethodReply(), parseRequestMethodReply(), reauthenticate(), setErrorState(), and waitForConnected().
void QSocks5SocketEnginePrivate::setErrorState | ( | Socks5State | state, |
Socks5Error | socks5error | ||
) |
Definition at line 619 of file qsocks5socketengine.cpp.
References AddressTypeNotSupported, arg, CommandNotSupported, ConnectionNotAllowed, ConnectionRefused, QAbstractSocket::ConnectionRefusedError, QAbstractSocket::HostNotFoundError, HostUnreachable, QAbstractSocket::NetworkError, NetworkUnreachable, setErrorState(), QAbstractSocket::SocketAccessError, SocksFailure, state, TTLExpired, QAbstractSocket::UnknownSocketError, and QAbstractSocket::UnsupportedSocketOperationError.
bool QSocks5SocketEnginePrivate::waitForConnected | ( | int | msecs, |
bool * | timedOut | ||
) |
Definition at line 1682 of file qsocks5socketengine.cpp.
References BindMode, BindSuccess, Connected, ConnectMode, ControlSocketError, QElapsedTimer::elapsed(), qt_subtract_from_timeout(), setErrorState(), QAbstractSocket::SocketTimeoutError, socks5State, QElapsedTimer::start(), UdpAssociateSuccess, and QAbstractSocket::UnconnectedState.
QSocks5BindData* QSocks5SocketEnginePrivate::bindData |
Definition at line 234 of file qsocks5socketengine_p.h.
Referenced by initialize(), and parseRequestMethodReply().
QSocks5ConnectData* QSocks5SocketEnginePrivate::connectData |
Definition at line 230 of file qsocks5socketengine_p.h.
Referenced by _q_controlSocketErrorOccurred(), _q_controlSocketReadNotification(), _q_emitPendingReadNotification(), and initialize().
bool QSocks5SocketEnginePrivate::connectionNotificationPending |
Definition at line 247 of file qsocks5socketengine_p.h.
Referenced by _q_emitPendingConnectionNotification(), and emitConnectionNotification().
QSocks5Data* QSocks5SocketEnginePrivate::data |
Definition at line 229 of file qsocks5socketengine_p.h.
bool QSocks5SocketEnginePrivate::exceptNotificationEnabled |
Definition at line 225 of file qsocks5socketengine_p.h.
Socks5Mode QSocks5SocketEnginePrivate::mode |
Definition at line 183 of file qsocks5socketengine_p.h.
QString QSocks5SocketEnginePrivate::peerName |
Definition at line 235 of file qsocks5socketengine_p.h.
Referenced by parseRequestMethodReply(), and sendRequestMethod().
QNetworkProxy QSocks5SocketEnginePrivate::proxyInfo |
Definition at line 223 of file qsocks5socketengine_p.h.
Referenced by initialize(), and reauthenticate().
|
mutable |
Definition at line 238 of file qsocks5socketengine_p.h.
Referenced by emitReadNotification().
bool QSocks5SocketEnginePrivate::readNotificationEnabled |
Definition at line 225 of file qsocks5socketengine_p.h.
Referenced by _q_emitPendingReadNotification(), and emitReadNotification().
bool QSocks5SocketEnginePrivate::readNotificationPending |
Definition at line 241 of file qsocks5socketengine_p.h.
Referenced by _q_controlSocketErrorOccurred(), _q_emitPendingReadNotification(), and emitReadNotification().
QByteArray QSocks5SocketEnginePrivate::receivedHeaderFragment |
Definition at line 236 of file qsocks5socketengine_p.h.
Referenced by parseRequestMethodReply().
qintptr QSocks5SocketEnginePrivate::socketDescriptor |
Definition at line 227 of file qsocks5socketengine_p.h.
Socks5State QSocks5SocketEnginePrivate::socks5State |
Definition at line 174 of file qsocks5socketengine_p.h.
Referenced by _q_controlSocketBytesWritten(), _q_controlSocketConnected(), _q_controlSocketErrorOccurred(), _q_controlSocketReadNotification(), parseAuthenticationMethodReply(), parseRequestMethodReply(), reauthenticate(), sendRequestMethod(), setErrorState(), and waitForConnected().
QSocks5UdpAssociateData* QSocks5SocketEnginePrivate::udpData |
Definition at line 232 of file qsocks5socketengine_p.h.
Referenced by _q_udpSocketReadNotification(), and initialize().
|
mutable |
Definition at line 239 of file qsocks5socketengine_p.h.
Referenced by _q_controlSocketBytesWritten(), and emitWriteNotification().
bool QSocks5SocketEnginePrivate::writeNotificationEnabled |
Definition at line 225 of file qsocks5socketengine_p.h.
Referenced by _q_emitPendingWriteNotification(), and emitWriteNotification().
bool QSocks5SocketEnginePrivate::writeNotificationPending |
Definition at line 244 of file qsocks5socketengine_p.h.
Referenced by _q_emitPendingWriteNotification(), and emitWriteNotification().