#include <QTcpSocket>
#include <QHostInfo>
#include <QList>
#include <QUrl>
#include "net.h"
#include "http.h"
Go to the source code of this file.
Functions | |
| QHostAddress | net_local_address () |
| bool | net_is_private_address (QHostAddress addr) |
| bool | net_is_valid_ip (QString ip) |
| QList< QUrl > | get_check_ip_sites () |
| bool | net_get_public_ip (QString &ip) |
| bool | net_test_connect (QHostAddress host, quint16 port, int timeout) |
Definition in file net.cpp.
| QList<QUrl> get_check_ip_sites | ( | ) |
Returns a pre-defined, static list of servers whom we can ask for our public IP address.
Definition at line 78 of file net.cpp.
Referenced by net_get_public_ip().
| bool net_get_public_ip | ( | QString & | ip | ) |
Asks a pre-defined list of servers what they think this machine's public IP address is.
| ip | Stores the ip after a successful request |
Definition at line 97 of file net.cpp.
References get_check_ip_sites(), and net_is_valid_ip().
Referenced by ServerPage::getServerPublicIP(), and ServerPage::updateServerIP().
| bool net_is_private_address | ( | QHostAddress | addr | ) |
Returns true if the given address is a private IP address.
Definition at line 55 of file net.cpp.
Referenced by ServerPage::getServerAddress(), and ServerPage::updateServerIP().
| bool net_is_valid_ip | ( | QString | ip | ) |
Returns true if the given string representation of an IP address is valid.
Definition at line 70 of file net.cpp.
Referenced by net_get_public_ip().
| QHostAddress net_local_address | ( | ) |
Returns the IP address of the local machine.
Definition at line 39 of file net.cpp.
Referenced by ServerPage::getServerAddress(), ServerSettings::ServerSettings(), and ServerPage::updateServerIP().
| bool net_test_connect | ( | QHostAddress | host, | |
| quint16 | port, | |||
| int | timeout | |||
| ) |
Attempts a connection to host on port. Returns true if the connection was successful, or false if the connection attempt failed.
Definition at line 115 of file net.cpp.
Referenced by TorControl::isRunning().
1.5.1