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>.
Loading...
Searching...
No Matches
QSocks5SocketEnginePrivate Class Reference

#include <qsocks5socketengine_p.h>

+ Inheritance diagram for QSocks5SocketEnginePrivate:
+ Collaboration diagram for QSocks5SocketEnginePrivate:

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
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Public Member Functions

 QSocks5SocketEnginePrivate ()
 
 ~QSocks5SocketEnginePrivate ()
 
void initialize (Socks5Mode socks5Mode)
 
void setErrorState (Socks5State state, const QString &extraMessage=QString())
 
void setErrorState (Socks5State state, Socks5Error socks5error)
 
void reauthenticate ()
 
void parseAuthenticationMethodReply ()
 
void parseAuthenticatingReply ()
 
void sendRequestMethod ()
 
void parseRequestMethodReply ()
 
void parseNewConnection ()
 
bool waitForConnected (QDeadlineTimer deadline, bool *timedOut)
 
void _q_controlSocketConnected ()
 
void _q_controlSocketReadNotification ()
 
void _q_controlSocketErrorOccurred (QAbstractSocket::SocketError)
 
void _q_udpSocketReadNotification ()
 
void _q_controlSocketBytesWritten ()
 
void _q_controlSocketDisconnected ()
 
void _q_controlSocketStateChanged (QAbstractSocket::SocketState)
 
void _q_emitPendingReadNotification ()
 
void emitReadNotification ()
 
void _q_emitPendingWriteNotification ()
 
void emitWriteNotification ()
 
void _q_emitPendingConnectionNotification ()
 
void emitConnectionNotification ()
 
- Public Member Functions inherited from QAbstractSocketEnginePrivate
 QAbstractSocketEnginePrivate ()
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Public Attributes

Socks5State socks5State
 
Socks5Mode mode
 
QNetworkProxy proxyInfo
 
bool readNotificationEnabled
 
bool writeNotificationEnabled
 
bool exceptNotificationEnabled
 
qintptr socketDescriptor
 
QSocks5Datadata
 
QSocks5ConnectDataconnectData
 
QSocks5UdpAssociateDataudpData
 
QSocks5BindDatabindData
 
QString peerName
 
QByteArray receivedHeaderFragment
 
bool readNotificationActivated
 
bool writeNotificationActivated
 
bool readNotificationPending
 
bool writeNotificationPending
 
bool connectionNotificationPending
 
- Public Attributes inherited from QAbstractSocketEnginePrivate
QAbstractSocket::SocketError socketError
 
bool hasSetSocketError
 
QString socketErrorString
 
QAbstractSocket::SocketState socketState
 
QAbstractSocket::SocketType socketType
 
QAbstractSocket::NetworkLayerProtocol socketProtocol
 
QHostAddress localAddress
 
quint16 localPort
 
QHostAddress peerAddress
 
quint16 peerPort
 
int inboundStreamCount
 
int outboundStreamCount
 
QAbstractSocketEngineReceiverreceiver
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (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)
 

Detailed Description

Definition at line 154 of file qsocks5socketengine_p.h.

Member Enumeration Documentation

◆ Socks5Error

Enumerator
SocksFailure 
ConnectionNotAllowed 
NetworkUnreachable 
HostUnreachable 
ConnectionRefused 
TTLExpired 
CommandNotSupported 
AddressTypeNotSupported 
LastKnownError 
UnknownError 

Definition at line 188 of file qsocks5socketengine_p.h.

◆ Socks5Mode

Enumerator
NoMode 
ConnectMode 
BindMode 
UdpAssociateMode 

Definition at line 179 of file qsocks5socketengine_p.h.

◆ Socks5State

Enumerator
Uninitialized 
ConnectError 
AuthenticationMethodsSent 
Authenticating 
AuthenticatingError 
RequestMethodSent 
RequestError 
Connected 
UdpAssociateSuccess 
BindSuccess 
ControlSocketError 
SocksError 
HostNameLookupError 

Definition at line 161 of file qsocks5socketengine_p.h.

Constructor & Destructor Documentation

◆ QSocks5SocketEnginePrivate()

QSocks5SocketEnginePrivate::QSocks5SocketEnginePrivate ( )

Definition at line 473 of file qsocks5socketengine.cpp.

References NoMode.

◆ ~QSocks5SocketEnginePrivate()

QSocks5SocketEnginePrivate::~QSocks5SocketEnginePrivate ( )

Definition at line 494 of file qsocks5socketengine.cpp.

Member Function Documentation

◆ _q_controlSocketBytesWritten()

void QSocks5SocketEnginePrivate::_q_controlSocketBytesWritten ( )

Definition at line 1187 of file qsocks5socketengine.cpp.

References Connected, ConnectMode, emitWriteNotification(), MaxWriteBufferSize, QSOCKS5_DEBUG, socks5State, and writeNotificationActivated.

Referenced by initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_controlSocketConnected()

void QSocks5SocketEnginePrivate::_q_controlSocketConnected ( )

Definition at line 1126 of file qsocks5socketengine.cpp.

References AuthenticationMethodsSent, QSOCKS5_DEBUG, S5_VERSION_5, and socks5State.

Referenced by initialize().

+ Here is the caller graph for this function:

◆ _q_controlSocketDisconnected()

void QSocks5SocketEnginePrivate::_q_controlSocketDisconnected ( )

Definition at line 1232 of file qsocks5socketengine.cpp.

References QSOCKS5_D_DEBUG.

Referenced by initialize().

+ Here is the caller graph for this function:

◆ _q_controlSocketErrorOccurred()

void QSocks5SocketEnginePrivate::_q_controlSocketErrorOccurred ( QAbstractSocket::SocketError error)

Definition at line 1201 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_controlSocketReadNotification()

void QSocks5SocketEnginePrivate::_q_controlSocketReadNotification ( )

Definition at line 1137 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_controlSocketStateChanged()

void QSocks5SocketEnginePrivate::_q_controlSocketStateChanged ( QAbstractSocket::SocketState state)

Definition at line 1237 of file qsocks5socketengine.cpp.

References QSOCKS5_D_DEBUG, and state.

Referenced by initialize().

+ Here is the caller graph for this function:

◆ _q_emitPendingConnectionNotification()

void QSocks5SocketEnginePrivate::_q_emitPendingConnectionNotification ( )

Definition at line 927 of file qsocks5socketengine.cpp.

References connectionNotificationPending, and QSOCKS5_D_DEBUG.

◆ _q_emitPendingReadNotification()

void QSocks5SocketEnginePrivate::_q_emitPendingReadNotification ( )

Definition at line 876 of file qsocks5socketengine.cpp.

References QRingBuffer::clear(), connectData, emitReadNotification(), QSOCKS5_D_DEBUG, QSocks5ConnectData::readBuffer, readNotificationEnabled, readNotificationPending, QAbstractSocket::RemoteHostClosedError, and QAbstractSocket::UnconnectedState.

+ Here is the call graph for this function:

◆ _q_emitPendingWriteNotification()

void QSocks5SocketEnginePrivate::_q_emitPendingWriteNotification ( )

◆ _q_udpSocketReadNotification()

void QSocks5SocketEnginePrivate::_q_udpSocketReadNotification ( )

Definition at line 1243 of file qsocks5socketengine.cpp.

References dump(), emitReadNotification(), QQueue< T >::enqueue(), QUdpSocket::hasPendingDatagrams(), QSocks5UdpAssociateData::pendingDatagrams, QUdpSocket::pendingDatagramSize(), pos, QByteArray(), QSOCKS5_D_DEBUG, QSOCKS5_DEBUG, qt_socks5_get_host_address_and_port(), QUdpSocket::readDatagram(), udpData, and QSocks5UdpAssociateData::udpSocket.

Referenced by initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emitConnectionNotification()

void QSocks5SocketEnginePrivate::emitConnectionNotification ( )

Definition at line 935 of file qsocks5socketengine.cpp.

References connectionNotificationPending, QMetaObject::invokeMethod(), QSOCKS5_D_DEBUG, and Qt::QueuedConnection.

Referenced by _q_controlSocketErrorOccurred(), parseAuthenticationMethodReply(), parseRequestMethodReply(), and reauthenticate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emitReadNotification()

void QSocks5SocketEnginePrivate::emitReadNotification ( )

Definition at line 895 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emitWriteNotification()

void QSocks5SocketEnginePrivate::emitWriteNotification ( )

Definition at line 916 of file qsocks5socketengine.cpp.

References QMetaObject::invokeMethod(), QSOCKS5_D_DEBUG, Qt::QueuedConnection, writeNotificationActivated, writeNotificationEnabled, and writeNotificationPending.

Referenced by _q_controlSocketBytesWritten(), and _q_controlSocketErrorOccurred().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

◆ parseAuthenticatingReply()

void QSocks5SocketEnginePrivate::parseAuthenticatingReply ( )

Definition at line 735 of file qsocks5socketengine.cpp.

References reauthenticate(), and sendRequestMethod().

Referenced by _q_controlSocketReadNotification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseAuthenticationMethodReply()

void QSocks5SocketEnginePrivate::parseAuthenticationMethodReply ( )

Definition at line 700 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseNewConnection()

void QSocks5SocketEnginePrivate::parseNewConnection ( )

◆ parseRequestMethodReply()

◆ reauthenticate()

void QSocks5SocketEnginePrivate::reauthenticate ( )

Definition at line 668 of file qsocks5socketengine.cpp.

References AuthenticatingError, emitConnectionNotification(), QNetworkProxy::hostName(), QNetworkProxy::password(), QNetworkProxy::port(), proxyInfo, QSOCKS5_DEBUG, setErrorState(), QNetworkProxy::setPassword(), QNetworkProxy::setUser(), socks5State, Uninitialized, and QNetworkProxy::user().

Referenced by parseAuthenticatingReply(), and parseAuthenticationMethodReply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendRequestMethod()

void QSocks5SocketEnginePrivate::sendRequestMethod ( )

Definition at line 746 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setErrorState() [1/2]

◆ setErrorState() [2/2]

void QSocks5SocketEnginePrivate::setErrorState ( Socks5State state,
Socks5Error socks5error )

◆ waitForConnected()

bool QSocks5SocketEnginePrivate::waitForConnected ( QDeadlineTimer deadline,
bool * timedOut )

Definition at line 1680 of file qsocks5socketengine.cpp.

References BindMode, BindSuccess, Connected, ConnectMode, ControlSocketError, deadline, QDeadlineTimer::remainingTime(), setErrorState(), QAbstractSocket::SocketTimeoutError, socks5State, UdpAssociateSuccess, and QAbstractSocket::UnconnectedState.

+ Here is the call graph for this function:

Member Data Documentation

◆ bindData

QSocks5BindData* QSocks5SocketEnginePrivate::bindData

Definition at line 237 of file qsocks5socketengine_p.h.

Referenced by initialize(), and parseRequestMethodReply().

◆ connectData

◆ connectionNotificationPending

bool QSocks5SocketEnginePrivate::connectionNotificationPending

◆ data

QSocks5Data* QSocks5SocketEnginePrivate::data

Definition at line 232 of file qsocks5socketengine_p.h.

◆ exceptNotificationEnabled

bool QSocks5SocketEnginePrivate::exceptNotificationEnabled

Definition at line 228 of file qsocks5socketengine_p.h.

◆ mode

Socks5Mode QSocks5SocketEnginePrivate::mode

Definition at line 186 of file qsocks5socketengine_p.h.

◆ peerName

QString QSocks5SocketEnginePrivate::peerName

Definition at line 238 of file qsocks5socketengine_p.h.

Referenced by parseRequestMethodReply(), and sendRequestMethod().

◆ proxyInfo

QNetworkProxy QSocks5SocketEnginePrivate::proxyInfo

Definition at line 226 of file qsocks5socketengine_p.h.

Referenced by initialize(), and reauthenticate().

◆ readNotificationActivated

bool QSocks5SocketEnginePrivate::readNotificationActivated
mutable

Definition at line 241 of file qsocks5socketengine_p.h.

Referenced by emitReadNotification().

◆ readNotificationEnabled

bool QSocks5SocketEnginePrivate::readNotificationEnabled

◆ readNotificationPending

bool QSocks5SocketEnginePrivate::readNotificationPending

◆ receivedHeaderFragment

QByteArray QSocks5SocketEnginePrivate::receivedHeaderFragment

Definition at line 239 of file qsocks5socketengine_p.h.

Referenced by parseRequestMethodReply().

◆ socketDescriptor

qintptr QSocks5SocketEnginePrivate::socketDescriptor

Definition at line 230 of file qsocks5socketengine_p.h.

◆ socks5State

◆ udpData

QSocks5UdpAssociateData* QSocks5SocketEnginePrivate::udpData

Definition at line 235 of file qsocks5socketengine_p.h.

Referenced by _q_udpSocketReadNotification(), and initialize().

◆ writeNotificationActivated

bool QSocks5SocketEnginePrivate::writeNotificationActivated
mutable

Definition at line 242 of file qsocks5socketengine_p.h.

Referenced by _q_controlSocketBytesWritten(), and emitWriteNotification().

◆ writeNotificationEnabled

bool QSocks5SocketEnginePrivate::writeNotificationEnabled

◆ writeNotificationPending

bool QSocks5SocketEnginePrivate::writeNotificationPending

The documentation for this class was generated from the following files: