Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
QtNetwork.QNetworkInterface Class Reference

The QNetworkInterface class provides a listing of the host's IP addresses and network interfaces. More...

Inheritance diagram for QtNetwork.QNetworkInterface:
Collaboration diagram for QtNetwork.QNetworkInterface:

Public Types

enum  InterfaceFlag {
  CanBroadcast = 4, CanMulticast = 32, IsLoopBack = 8, IsPointToPoint = 16,
  IsRunning = 2, IsUp = 1
}
  More...
 

Public Member Functions

 QNetworkInterface ()
  More...
 
 QNetworkInterface (QNetworkInterface other)
  More...
 
virtual void CreateProxy ()
 
new void Dispose ()
 

Static Public Member Functions

static QNetworkInterface InterfaceFromIndex (int index)
  More...
 
static QNetworkInterface InterfaceFromName (string name)
  More...
 

Protected Member Functions

 QNetworkInterface (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

System.Collections.Generic.List
< QNetworkAddressEntry
AddressEntries [get]
  More...
 
static
System.Collections.Generic.List
< QHostAddress
AllAddresses [get]
  More...
 
static
System.Collections.Generic.List
< QNetworkInterface
AllInterfaces [get]
  More...
 
QNetworkInterface.InterfaceFlag Flags [get]
  More...
 
string HardwareAddress [get]
  More...
 
string HumanReadableName [get]
  More...
 
int Index [get]
  More...
 
bool IsValid [get]
  More...
 
string Name [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QNetworkInterface class provides a listing of the host's IP addresses and network interfaces.

QNetworkInterface represents one network interface attached to the host where the program is being run. Each network interface may contain zero or more IP addresses, each of which is optionally associated with a netmask and/or a broadcast address. The list of such trios can be obtained with addressEntries(). Alternatively, when the netmask or the broadcast addresses aren't necessary, use the allAddresses() convenience function to obtain just the IP addresses.

QNetworkInterface also reports the interface's hardware address with hardwareAddress().

Not all operating systems support reporting all features. Only the IPv4 addresses are guaranteed to be listed by this class in all platforms. In particular, IPv6 address listing is only supported on Windows XP and more recent versions, Linux, MacOS X and the BSDs.

See also QNetworkAddressEntry.

Member Enumeration Documentation

Specifies the flags associated with this network interface. The possible values are:

Note that one network interface cannot be both broadcast-based and point-to-point.

Enumerator
CanBroadcast 

The network interface works in broadcast mode

CanMulticast 

The network interface supports multicasting

IsLoopBack 

The network interface is a loopback interface: that is, it's a virtual interface whose destination is the host computer itself

IsPointToPoint 

The network interface is a point-to-point interface: that is, there is one, single other address that can be directly reached by it.

IsRunning 

The network interface has resources allocated

IsUp 

The network interface is active

Constructor & Destructor Documentation

QtNetwork.QNetworkInterface.QNetworkInterface ( System.Type  dummy)
protected
QtNetwork.QNetworkInterface.QNetworkInterface ( )

Constructs an empty network interface object.

Here is the call graph for this function:

QtNetwork.QNetworkInterface.QNetworkInterface ( QNetworkInterface  other)

Creates a copy of the QNetworkInterface object contained in other.

Here is the call graph for this function:

Member Function Documentation

virtual void QtNetwork.QNetworkInterface.CreateProxy ( )
virtual

Here is the caller graph for this function:

new void QtNetwork.QNetworkInterface.Dispose ( )
static QNetworkInterface QtNetwork.QNetworkInterface.InterfaceFromIndex ( int  index)
static

Returns a QNetworkInterface object for the interface whose internal ID is index. Network interfaces have a unique identifier called the "interface index" to distinguish it from other interfaces on the system. Often, this value is assigned progressively and interfaces being removed and then added again get a different value every time.

This index is also found in the IPv6 address' scope ID field.

static QNetworkInterface QtNetwork.QNetworkInterface.InterfaceFromName ( string  name)
static

Returns a QNetworkInterface object for the interface named name. If no such interface exists, this function returns an invalid QNetworkInterface object.

See also name() and isValid().

Member Data Documentation

SmokeInvocation QtNetwork.QNetworkInterface.interceptor
protected

Property Documentation

System.Collections.Generic.List<QNetworkAddressEntry> QtNetwork.QNetworkInterface.AddressEntries
getadd

Returns the list of IP addresses that this interface possesses along with their associated netmasks and broadcast addresses.

If the netmask or broadcast address information is not necessary, you can call the allAddresses() function to obtain just the IP addresses.

System.Collections.Generic.List<QHostAddress> QtNetwork.QNetworkInterface.AllAddresses
staticget

This convenience function returns all IP addresses found on the host machine. It is equivalent to calling addressEntries() on all the objects returned by allInterfaces() to obtain lists of QHostAddress objects then calling QHostAddress::ip() on each of these.

System.Collections.Generic.List<QNetworkInterface> QtNetwork.QNetworkInterface.AllInterfaces
staticget

Returns a listing of all the network interfaces found on the host machine.

QNetworkInterface.InterfaceFlag QtNetwork.QNetworkInterface.Flags
get

Returns the flags associated with this network interface.

string QtNetwork.QNetworkInterface.HardwareAddress
get

Returns the low-level hardware address for this interface. On Ethernet interfaces, this will be a MAC address in string representation, separated by colons.

Other interface types may have other types of hardware addresses. Implementations should not depend on this function returning a valid MAC address.

string QtNetwork.QNetworkInterface.HumanReadableName
get

Returns the human-readable name of this network interface on Windows, such as "Local Area Connection", if the name could be determined. If it couldn't, this function returns the same as name(). The human-readable name is a name that the user can modify in the Windows Control Panel, so it may change during the execution of the program.

On Unix, this function currently always returns the same as name(), since Unix systems don't store a configuration for human-readable names.

This function was introduced in Qt 4.5.

int QtNetwork.QNetworkInterface.Index
get

Returns the interface system index, if known. This is an integer assigned by the operating system to identify this interface and it generally doesn't change. It matches the scope ID field in IPv6 addresses.

If the index isn't known, this function returns 0.

This function was introduced in Qt 4.5.

bool QtNetwork.QNetworkInterface.IsValid
get

Returns true if this QNetworkInterface object contains valid information about a network interface.

string QtNetwork.QNetworkInterface.Name
get

Returns the name of this network interface. On Unix systems, this is a string containing the type of the interface and optionally a sequence number, such as "eth0", "lo" or "pcn0". On Windows, it's an internal ID that cannot be changed by the user.

virtual System.IntPtr QtNetwork.QNetworkInterface.SmokeObject
getset