14 #define DEFAULT_MAC_ADDRESS QString("00:00:00:00:00:00") 15 #define DEFAULT_STREAMED_BUFFER_SIZE (1024 * 1024 * 10) 16 #define DEFAULT_STREAMED_READ_SIZE (32768) 17 #define DEFAULT_MAX_REDIRECTIONS 3 18 #define DEFAULT_USER_AGENT QByteArray("Wget/1.12 (linux-gnu))") 40 static QString
IPAddressToLiteral (
const QHostAddress& Address,
int Port,
bool UseLocalhost =
true);
41 static bool IsExternal (
const QHostAddress &Address);
42 static bool IsLinkLocal (
const QHostAddress &Address);
43 static bool IsLocal (
const QHostAddress &Address);
44 static bool IsGlobal (
const QHostAddress &Address);
64 void Error (QNetworkReply::NetworkError Code);
65 void SSLErrors (
const QList<QSslError> &Errors);
69 void Authenticate (QNetworkReply* Reply, QAuthenticator* Authenticator);
99 QNetworkConfigurationManager m_manager;
100 QNetworkConfiguration m_configuration;
101 QStringList m_hostNames;
103 QMap<QNetworkReply*,TorcNetworkRequest*> m_requests;
104 QMap<TorcNetworkRequest*,QNetworkReply*> m_reverseRequests;
105 QMap<TorcNetworkRequest*,QObject*> m_asynchronousRequests;
111 #endif // TORCNETWORK_H void ConfigurationChanged(const QNetworkConfiguration &Config)
void NewAsyncRequest(TorcNetworkRequest *Request, QObject *Parent)
void CancelRequest(TorcNetworkRequest *Request)
static void Setup(bool Create)
void UpdateConfiguration(bool Creating=false)
A wrapper around QNetworkRequest.
static bool GetAsynchronous(TorcNetworkRequest *Request, QObject *Parent)
Queue an asynchronous HTTP request.
void ConfigurationRemoved(const QNetworkConfiguration &Config)
static QStringList GetHostNames(void)
Retrieve the list of currently identified host names.
static bool IsGlobal(const QHostAddress &Address)
static QString IPAddressToLiteral(const QHostAddress &Address, int Port, bool UseLocalhost=true)
Convert an IP address to a string literal.
void UpdateCompleted(void)
static bool IsAvailable(void)
bool IsOwnAddressPriv(const QHostAddress &Address)
void ConfigurationAdded(const QNetworkConfiguration &Config)
static QList< QSslError > AllowableSslErrors(const QList< QSslError > &Errors)
static void AddHostName(const QString &Host)
Register a known host name for this application.
void PokeRequest(TorcNetworkRequest *Request)
bool Redirected(TorcNetworkRequest *Request, QNetworkReply *Reply)
static bool IsLinkLocal(const QHostAddress &Address)
void Authenticate(QNetworkReply *Reply, QAuthenticator *Authenticator)
void DownloadProgress(qint64 Received, qint64 Total)
static bool IsExternal(const QHostAddress &Address)
Returns true if the address is accessible from other devices.
void NewRequest(TorcNetworkRequest *Request)
void SSLErrors(const QList< QSslError > &Errors)
bool CheckHeaders(TorcNetworkRequest *Request, QNetworkReply *Reply)
static void Poke(TorcNetworkRequest *Request)
void Error(QNetworkReply::NetworkError Code)
Subclass of QNetworkAccessManager for sending network requests and monitoring the network state...
static void Cancel(TorcNetworkRequest *Request)
static bool Get(TorcNetworkRequest *Request)
static bool IsOwnAddress(const QHostAddress &Address)
void CloseConnections(void)
Cancel all current network requests.
static void RemoveHostName(const QString &Host)
Remove a host name from the known list of host names.
void OnlineStateChanged(bool Online)
A static class used to create the TorcNetwork singleton in the admin thread.
void NewHostName(const QHostInfo &Info)
Receives host name updates from QHostInfo.
static bool IsLocal(const QHostAddress &Address)