net.h File Reference

Common network I/O and utility functions. More...

#include <QHostAddress>

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)
bool net_get_public_ip (QString &ip)
bool net_test_connect (QHostAddress host, quint16 port, int timeout=250)


Detailed Description

Common network I/O and utility functions.

Version:
Id
net.h 1238 2006-09-25 17:50:57Z edmanm

Definition in file net.h.


Function Documentation

bool net_get_public_ip ( QString &  ip  ) 

Asks a pre-defined list of servers what they think this machine's public IP address is.

Parameters:
ip Stores the ip after a successful request
Returns:
false if none of the requests were successful

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().


Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0