IPInfo Class
Properties Methods Events Configuration Settings Errors
The IPInfo class is used to resolve host names to host addresses and vice-versa using asynchronous DNS. The class provides access to other TCP/IP database functions as well.
Syntax
IPInfo
Remarks
The IPInfo class operates asynchronously. Requests are posted to the class by setting a property like HostName or HostAddress and then waiting for the RequestComplete event. The RequestId property identifies the request.
Up to 100 simultaneous requests can be queued at any moment. PendingRequests shows the number of pending requests, and may also be used to adjust the size of the queue (by dumping a number of the pending requests).
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
AdapterBroadcastAddress | The broadcast address of the adapter. |
AdapterCount | The number of adapters in the system. |
AdapterDescription | The description of the adapter identified by AdapterIndex . |
AdapterDeviceIndex | The system index of the adapter identified by AdapterIndex . |
AdapterDHCPEnabled | Shows whether or not the adapter identified by AdapterIndex has DHCP Enabled. |
AdapterDHCPServer | The DHCP server of the adapter identified by AdapterIndex . |
AdapterDNSServers | The DNS server list for the adapter identified by AdapterIndex . |
AdapterGateway | The default gateway of the adapter identified by AdapterIndex . |
AdapterIndex | Sets the current adapter. |
AdapterIPAddress | The IP address of the adapter identified by AdapterIndex . |
AdapterIPv6Address | The IPv6 address of the adapter identified by AdapterIndex . |
AdapterIPv6LinkLocalAddress | The IPv6 link local address of the adapter identified by AdapterIndex . |
AdapterLeaseExpires | The expiration date and time of the lease obtained by the adapter identified by AdapterIndex . |
AdapterLeaseObtained | The date and time of when the current lease was obtained by the adapter identified by AdapterIndex . |
AdapterName | The name of the adapter identified by AdapterIndex . |
AdapterOtherIPAddresses | Other IP addresses leased by the adapter specified by AdapterIndex , if any. |
AdapterPhysicalAddress | The physical address of the adapter identified by AdapterIndex . |
AdapterPrimaryWINSServer | The primary WINS server of the adapter identified by AdapterIndex . |
AdapterSecondaryWINSServer | The secondary WINS server of the adapter identified by AdapterIndex . |
AdapterStatus | Returns the current status of the adapter. |
AdapterSubnetMask | The subnet of the adapter identified by AdapterIndex . |
AdapterType | The type of adapter identified by AdapterIndex . |
AdapterUsesWINS | Shows whether or not the adapter identified by AdapterIndex uses WINS. |
AdapterZoneId | The zone Id of the adapter identified by AdapterIndex . |
ARPProxy | Shows whether the local computer is acting as an ARP proxy. |
DHCPScope | The DHCP Scope of the DHCP server. |
DNSEnabled | Shows whether DNS is enabled on the local computer. |
DNSServer | The address of the DNS Server. |
DomainName | The current network domain on which the system resides. |
HostAddress | An Internet Address in dotted format. When set, it initiates a search for the corresponding host name. |
HostAliases | Other names corresponding to the host with the name HostName. |
HostName | The Domain Name of an Internet host. When set, it initiates a search for the corresponding address(es). |
LocalHost | The name of the local host. |
NodeType | The type of node for the system. |
OtherAddresses | Other addresses for the host identified by HostName (for multihomed hosts). |
OtherDNSServers | Other DNS servers configured for the host machine. |
PendingRequests | The number of requests awaiting completion. |
RequestId | The handle of the last request. |
RoutingEnabled | Shows whether routing is enabled on the local computer. |
ServiceAliases | Other names by which the service specified by ServiceName / ServicePort is known. |
ServiceName | A name for a service. When set, it initiates a search for the corresponding port number and protocol. |
ServicePort | A port number for a service. When set, it initiates a search for the corresponding service name and protocol. |
ServiceProtocol | The protocol of the service specified by ServiceName / ServicePort . |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
DHCPRelease | Releases the IP Address of the current adapter specified by AdapterIndex . |
DHCPRenew | Renews the IP Address of the current adapter specified by AdapterIndex . |
DisplayDNSCache | Displays cached DNS entries. |
DoEvents | Processes events from the internal message queue. |
FlushDNSCache | Flush the DNS cache. |
GetMAC | Returns the MAC address of the network interface at IPAddress . |
Reset | Resets the class, stopping all pending requests and refreshing network information. |
ResolveAddress | Resolves an IP address. |
ResolveName | Resolves a host name. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
DNSCacheEntry | Fires once for each cached DNS entry. |
Error | Information about errors during data delivery. |
RequestComplete | Fired after an asynchronous request completes. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
AdapterDADState | Specifies the Duplicate Address Detection state of the IP address of the adapter specified by AdapterIndex. |
AdapterIPv6DADState | Specifies the Duplicate Address Detection state of the IPv6 address of the adapter specified by AdapterIndex. |
AdapterOtherDADStates | Specifies the Duplicate Address Detection states of the IP addresses leased by the adapter specified by AdapterIndex, if any. |
ARPAddress | Specifies the IP Address of the interface to be used for the GetMAC method. |
UseOldApi | If set the class will use the old API to get Adapter information. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |
AdapterBroadcastAddress Property (IPInfo Class)
The broadcast address of the adapter.
Syntax
QString GetAdapterBroadcastAddress();
Default Value
""
Remarks
This property contains the broadcast address of the adapter specified by AdapterIndex.
This property is read-only.
Data Type
String
AdapterCount Property (IPInfo Class)
The number of adapters in the system.
Syntax
int GetAdapterCount();
Default Value
0
Remarks
This property shows how many adapters are installed in the system. You can set the AdapterIndex from 0 to the AdapterCount, and then examine the Adapter properties such as AdapterDescription, AdapterName, and AdapterIPAddress to retrieve information about each adapter.
This property is read-only.
Data Type
Integer
AdapterDescription Property (IPInfo Class)
The description of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterDescription();
Default Value
""
Remarks
This property contains the description of the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterDeviceIndex Property (IPInfo Class)
The system index of the adapter identified by AdapterIndex .
Syntax
int GetAdapterDeviceIndex();
Default Value
0
Remarks
This property contains the system index of the adapter identified by AdapterIndex, as returned by the system.
This property is read-only.
Data Type
Integer
AdapterDHCPEnabled Property (IPInfo Class)
Shows whether or not the adapter identified by AdapterIndex has DHCP Enabled.
Syntax
bool GetAdapterDHCPEnabled();
Default Value
false
Remarks
This property indicates whether or not the adapter identified by AdapterIndex has DHCP Enabled. Dynamic Host Configuration Protocol (DHCP) is used for automatically assigning IP Addresses on a network.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
Boolean
AdapterDHCPServer Property (IPInfo Class)
The DHCP server of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterDHCPServer();
Default Value
""
Remarks
This property contains the DHCP server of the adapter identified by AdapterIndex. Dynamic Host Configuration Protocol (DHCP) is used for automatically assigning IP Addresses on a network.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterDNSServers Property (IPInfo Class)
The DNS server list for the adapter identified by AdapterIndex .
Syntax
QString GetAdapterDNSServers();
Default Value
""
Remarks
This property contains a space separated list of DNS servers for the adapter specified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterGateway Property (IPInfo Class)
The default gateway of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterGateway();
Default Value
""
Remarks
This property contains the default gateway of the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterIndex Property (IPInfo Class)
Sets the current adapter.
Syntax
int GetAdapterIndex();
int SetAdapterIndex(int iAdapterIndex);
Default Value
0
Remarks
When this property is set, the class asks the system for information on the adapter with an index of AdapterIndex. If the system has information, the Adapter properties will be populated with the data returned.
AdapterCount is the number of adapters located in the system.
Data Type
Integer
AdapterIPAddress Property (IPInfo Class)
The IP address of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterIPAddress();
Default Value
""
Remarks
This property contains the IP address of the adapter identified by AdapterIndex, as returned by the system.
This property is read-only.
Data Type
String
AdapterIPv6Address Property (IPInfo Class)
The IPv6 address of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterIPv6Address();
Default Value
""
Remarks
The IPv6 address of the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
NOTE: This functionality is only available on XP or newer OS versions.
This property is read-only.
Data Type
String
AdapterIPv6LinkLocalAddress Property (IPInfo Class)
The IPv6 link local address of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterIPv6LinkLocalAddress();
Default Value
""
Remarks
The IPv6 link local address of the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterLeaseExpires Property (IPInfo Class)
The expiration date and time of the lease obtained by the adapter identified by AdapterIndex .
Syntax
QString GetAdapterLeaseExpires();
Default Value
""
Remarks
This property contains the expiration date and time of the lease obtained by the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterLeaseObtained Property (IPInfo Class)
The date and time of when the current lease was obtained by the adapter identified by AdapterIndex .
Syntax
QString GetAdapterLeaseObtained();
Default Value
""
Remarks
This property contains the date and time of when the current lease was obtained by the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterName Property (IPInfo Class)
The name of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterName();
Default Value
""
Remarks
This property contains the name of the adapter identified by AdapterIndex, as returned by the system.
This property is read-only.
Data Type
String
AdapterOtherIPAddresses Property (IPInfo Class)
Other IP addresses leased by the adapter specified by AdapterIndex , if any.
Syntax
QString GetAdapterOtherIPAddresses();
Default Value
""
Remarks
This property contains a space separated list of any other IP addresses leased by the adapter specified by AdapterIndex, if any.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterPhysicalAddress Property (IPInfo Class)
The physical address of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterPhysicalAddress();
Default Value
""
Remarks
This property contains the physical address of the adapter identified by AdapterIndex, as returned from the system.
This property is not supported in MacOS or iOS.
This property is read-only.
Data Type
String
AdapterPrimaryWINSServer Property (IPInfo Class)
The primary WINS server of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterPrimaryWINSServer();
Default Value
""
Remarks
This property contains the primary WINS server of the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterSecondaryWINSServer Property (IPInfo Class)
The secondary WINS server of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterSecondaryWINSServer();
Default Value
""
Remarks
This property contains the secondary WINS server of the adapter identified by AdapterIndex, as returned by the system.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
AdapterStatus Property (IPInfo Class)
Returns the current status of the adapter.
Syntax
QString GetAdapterStatus();
Default Value
""
Remarks
This proprety holds the current status of the adapter specified by AdapterIndex.
Possible values are as follows:
- "Up"
- "Down"
- "Testing"
- "Unknown"
- "Dormant"
- "NotPresent"
- "LowerLayerDown"
This property is not applicable when UseOldApi is true.
This property is read-only.
Data Type
String
AdapterSubnetMask Property (IPInfo Class)
The subnet of the adapter identified by AdapterIndex .
Syntax
QString GetAdapterSubnetMask();
Default Value
""
Remarks
This property contains the subnet of the adapter identified by AdapterIndex, as returned by the system.
This property is read-only.
Data Type
String
AdapterType Property (IPInfo Class)
The type of adapter identified by AdapterIndex .
Syntax
QString GetAdapterType();
Default Value
""
Remarks
This property contains the type of adapter identified by AdapterIndex, as returned by the system.
Possible values include:
OTHER | Other |
ETHERNET | Ethernet |
TOKENRING | Token Ring |
FDDI | Fiber Distributed Data Interface |
PPP | Point-to-Point Protocol |
LOOPBACK | Loopback |
SLIP | Serial Line Internet Protocol |
Possible values include (Unix OS):
UP | Interface is up |
BROADCAST | Broadcast address valid |
DEBUG | Turn on debugging |
LOOPBACK | Interface is a loopback device |
POINTOPOINT | Interface is a point-to-point link |
RUNNING | Resources allocated |
NOARP | No address resolution protocol |
PROMISC | Receive all packets |
NOTRAILERS | Avoid use of trailers |
ALLMULTI | Receive all multicast packets |
MASTER | Master of a load balancer |
SLAVE | Slave of a load balancer |
MULTICAST | Supports multicast |
PORTSEL | Can set media type |
AUTOMEDIA | Auto media select active |
DYNAMIC | Dialup device with dynamic addresses |
This property is read-only.
Data Type
String
AdapterUsesWINS Property (IPInfo Class)
Shows whether or not the adapter identified by AdapterIndex uses WINS.
Syntax
bool GetAdapterUsesWINS();
Default Value
false
Remarks
This property indicates whether or not the adapter identified by AdapterIndex uses WINS. Windows Internet Name Service (WINS) is a name resolution service which is used to resolve Windows network hostnames to IP addresses.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
Boolean
AdapterZoneId Property (IPInfo Class)
The zone Id of the adapter identified by AdapterIndex .
Syntax
int GetAdapterZoneId();
Default Value
0
Remarks
Also known as a scope Id, the zone Id specifies the ipv6 zone to which the current adapter belongs. The values of the zone Id are defined relative to the sending host. When using an IPv6 enabled XP operating system, the zone Id of the sender MUST be appended after a "%" to the desired ipv6 address. This is an integer value on windows systems.
NOTE: This functionality is only available in Windows.
NOTE: This functionality is only available on XP or newer OS versions.
This property is read-only.
Data Type
Integer
ARPProxy Property (IPInfo Class)
Shows whether the local computer is acting as an ARP proxy.
Syntax
bool GetARPProxy();
Default Value
false
Remarks
This property indicates whether the local computer is acting as an ARP proxy. If true, the local computer will act as an ARP proxy, and will respond to ARP requests with its own hardware address.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
Boolean
DHCPScope Property (IPInfo Class)
The DHCP Scope of the DHCP server.
Syntax
QString GetDHCPScope();
Default Value
""
Remarks
This property contains a range of IP addresses which the Dynamic Host Configuration Protocol (DHCP) server can lease to clients.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
DNSEnabled Property (IPInfo Class)
Shows whether DNS is enabled on the local computer.
Syntax
bool GetDNSEnabled();
Default Value
false
Remarks
This property indicates whether DNS is enabled on the local computer. If true, DNS is enabled, and name resolution will be available.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
Boolean
DNSServer Property (IPInfo Class)
The address of the DNS Server.
Syntax
QString GetDNSServer();
Default Value
""
Remarks
The class attempts to find the default DNS server for the machine where it is installed, and provide it in this property.
If the class cannot determine the default DNS server address, this property value will be an empty string.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
DomainName Property (IPInfo Class)
The current network domain on which the system resides.
Syntax
QString GetDomainName();
Default Value
""
Remarks
This property contains the domain name to which the system is joined.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
HostAddress Property (IPInfo Class)
An Internet Address in dotted format. When set, it initiates a search for the corresponding host name.
Syntax
QString GetHostAddress();
int SetHostAddress(QString qsHostAddress);
Default Value
""
Remarks
This property contains the IP address (in internet dotted format aaa.bbb.ccc.ddd) of the host whose domain name is specified by HostName
If HostAddress is set to an IP address, a search is initiated for the corresponding host names(s).
The RequestComplete event is fired when the search is complete. The RequestId property identifies the pending request.
Example (Resolve an Address)
IPInfoControl.HostAddress = "10.0.1.10"
While IPInfoControl.PendingRequests > 0
IPInfoControl.DoEvents()
End While
ResolvedName = IPInfoControl.HostName
Data Type
String
HostAliases Property (IPInfo Class)
Other names corresponding to the host with the name HostName.
Syntax
QString GetHostAliases();
Default Value
""
Remarks
This property contains a list of alternate names for the host specified by HostName and HostAddress separated by spaces.
This property is read-only.
Data Type
String
HostName Property (IPInfo Class)
The Domain Name of an Internet host. When set, it initiates a search for the corresponding address(es).
Syntax
QString GetHostName();
int SetHostName(QString qsHostName);
Default Value
""
Remarks
This property contains the domain name of the host whose IP address is specified by HostAddress.
If this property is set to a domain name, a search is initiated for the corresponding host address(s).
The RequestComplete event is fired when the search is complete. The RequestId property identifies the pending request.
Example (Resolve a Name)
IPInfoControl.HostName = "MyHostName"
While IPInfoControl.PendingRequests > 0
IPInfoControl.DoEvents()
End While
ResolvedAddress = IPInfoControl.HostAddress
Data Type
String
LocalHost Property (IPInfo Class)
The name of the local host.
Syntax
QString GetLocalHost();
Default Value
""
Remarks
This property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, it will contain the value of that address.
This property is read-only.
Data Type
String
NodeType Property (IPInfo Class)
The type of node for the system.
Syntax
QString GetNodeType();
Default Value
""
Remarks
This property contains the type of node for the system. Possible values include 'BROADCAST', 'PEERTOPEER', 'MIXED', 'HYBRID'.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
OtherAddresses Property (IPInfo Class)
Other addresses for the host identified by HostName (for multihomed hosts).
Syntax
QString GetOtherAddresses();
Default Value
""
Remarks
This property contains a list of alternate addresses for the host specified by HostName and HostAddress separated by spaces. Most hosts have only one IP interface. This property is useful when querying multihomed hosts (hosts with more than one interface).
This property is read-only.
Data Type
String
OtherDNSServers Property (IPInfo Class)
Other DNS servers configured for the host machine.
Syntax
QString GetOtherDNSServers();
Default Value
""
Remarks
This property contains a space-separated list of DNS servers configured for the host machine. Note that the primary server is provided in the DNSServer property.
NOTE: This functionality is only available in Windows.
This property is read-only and not available at design time.
Data Type
String
PendingRequests Property (IPInfo Class)
The number of requests awaiting completion.
Syntax
int GetPendingRequests();
int SetPendingRequests(int iPendingRequests);
Default Value
0
Remarks
This property serves two functions: it shows the number of requests that are pending completion, but it can also be used to adjust the size of the queue by dumping part of or all the pending requests.
To cancel all the pending requests at any moment, simply set PendingRequests to 0.
NOTE: This functionality is only available in Windows.
Data Type
Integer
RequestId Property (IPInfo Class)
The handle of the last request.
Syntax
int GetRequestId();
Default Value
0
Remarks
This property contains the handle of the last request.
This handle can be later used to identify the request when the RequestComplete event is fired.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
Integer
RoutingEnabled Property (IPInfo Class)
Shows whether routing is enabled on the local computer.
Syntax
bool GetRoutingEnabled();
Default Value
false
Remarks
This property indicates whether routing is enabled on the local computer.
NOTE: This functionality is only available in Windows.
This property is read-only and not available at design time.
Data Type
Boolean
ServiceAliases Property (IPInfo Class)
Other names by which the service specified by ServiceName / ServicePort is known.
Syntax
QString GetServiceAliases();
Default Value
""
Remarks
This property contains a list of alternate service names separated by spaces. In most cases, this list is empty.
NOTE: This functionality is only available in Windows.
This property is read-only.
Data Type
String
ServiceName Property (IPInfo Class)
A name for a service. When set, it initiates a search for the corresponding port number and protocol.
Syntax
QString GetServiceName();
int SetServiceName(QString qsServiceName);
Default Value
""
Remarks
This property contains the name of the specified service located at ServicePort.
If this property is set to a service name, a search is initiated for the corresponding ServicePort and other information related to the service (if any).
The RequestComplete event is fired when the search is complete. RequestId identifies the pending request.
NOTE: This functionality is only available in Windows.
Data Type
String
ServicePort Property (IPInfo Class)
A port number for a service. When set, it initiates a search for the corresponding service name and protocol.
Syntax
int GetServicePort();
int SetServicePort(int iServicePort);
Default Value
0
Remarks
This property contains the port number for the service specified by ServiceName.
If this property is set to a port number, a search is initiated for the ServiceName and other information related to the service (if any).
The RequestComplete event is fired when the search is complete. RequestId identifies the pending request.
NOTE: This functionality is only available in Windows.
Data Type
Integer
ServiceProtocol Property (IPInfo Class)
The protocol of the service specified by ServiceName / ServicePort .
Syntax
QString GetServiceProtocol();
int SetServiceProtocol(QString qsServiceProtocol);
Default Value
""
Remarks
This property contains the protocol for the service specified by ServiceName.
Setting this property to a particular protocol name (for example 'udp' or 'tcp') will force a search for a service for that protocol only. If this property is set to "" (empty string) then the first entry for the service will be returned and this property will be set to the corresponding protocol.
NOTE: This functionality is only available in Windows.
Data Type
String
Config Method (IPInfo Class)
Sets or retrieves a configuration setting.
Syntax
QString Config(const QString& qsConfigurationString);
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
Error Handling
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
DHCPRelease Method (IPInfo Class)
Releases the IP Address of the current adapter specified by AdapterIndex .
Syntax
int DHCPRelease();
Remarks
This method releases the IP Address of the current adapter specified by AdapterIndex. If AdapterDHCPEnabled is true, the lease of the IP Address assigned to the current adapter specified by AdapterIndex is released.
NOTE: This functionality is only available in Windows.
Error Handling
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
DHCPRenew Method (IPInfo Class)
Renews the IP Address of the current adapter specified by AdapterIndex .
Syntax
int DHCPRenew();
Remarks
This method renews the IP Address of the current adapter specified by AdapterIndex. If AdapterDHCPEnabled is true, the lease of the IP Address assigned to the current adapter specified by AdapterIndex is renewed.
NOTE: This functionality is only available in Windows.
Error Handling
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
DisplayDNSCache Method (IPInfo Class)
Displays cached DNS entries.
Syntax
QString DisplayDNSCache();
Remarks
This method displays details of the locally cached DNS records.
This method will return a string with information about the DNS cache. In addition the DNSCacheEntry event will fire once per cached entry.
The returned value is in the format:
docs.google.com ---------------------------------------- Record Name . . . . . : docs.google.com Record Type . . . . . : 1(A) Time To Live . . . . : 48 Data Length . . . . . : 4 Section . . . . . . . : Answer A Record . . . . . . : 216.58.218.238
NOTE: This functionality is only available in Windows.
Error Handling
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
DoEvents Method (IPInfo Class)
Processes events from the internal message queue.
Syntax
int DoEvents();
Remarks
When DoEvents is called, the class processes any available events. If no events are available, it waits for a preset period of time, and then returns.
Error Handling
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
FlushDNSCache Method (IPInfo Class)
Flush the DNS cache.
Syntax
bool FlushDNSCache();
Remarks
This method flushes the DNS cache for the system.
NOTE: This functionality is only available in Windows.
Error Handling
This method returns a Boolean value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
GetMAC Method (IPInfo Class)
Returns the MAC address of the network interface at IPAddress .
Syntax
QString GetMAC(const QString& qsIPAddress);
Remarks
This method returns the unique Media Access Control (MAC) address of the network interface at IPAddress.
NOTE: This functionality is only available in Windows.
Error Handling
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
Reset Method (IPInfo Class)
Resets the class, stopping all pending requests and refreshing network information.
Syntax
int Reset();
Remarks
This method resets the class, stopping all pending requests and refreshing network information. If the network configuration has changed, call this method to retrieve the latest information.
Error Handling
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ResolveAddress Method (IPInfo Class)
Resolves an IP address.
Syntax
QString ResolveAddress(const QString& qsHostAddress);
Remarks
This method resolves the IP Address HostAddress and sets HostName to the name of the host corresponding to HostAddress.
Calling this method is equivalent to setting the HostAddress property to HostAddress.
Example (Resolve an Address)
IPInfoControl.ResolveAddress ("10.0.1.10")
While (IPInfoControl.PendingRequests > 0)
IPInfoControl.DoEvents
Wend
Debug.Print IPInfoControl.HostName
Error Handling
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
ResolveName Method (IPInfo Class)
Resolves a host name.
Syntax
QString ResolveName(const QString& qsHostName);
Remarks
This method resolves the host name HostName and sets HostAddress to the IP Address of the host corresponding to HostName.
Calling this method is equivalent to setting the HostName property to HostName.
Example (Resolve a Name)
IPInfoControl.ResolveName ("MyHostName")
While (IPInfoControl.PendingRequests > 0)
IPInfoControl.DoEvents
Wend
Debug.Print IPInfoControl.HostAddress
Error Handling
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
DNSCacheEntry Event (IPInfo Class)
Fires once for each cached DNS entry.
Syntax
class IPInfoDNSCacheEntryEventParams { public: const QString &RecordName(); int RecordType(); int TimeToLive(); int DataLength(); const QString &Section(); const QString &RecordValue(); const QString &RecordInfo(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void DNSCacheEntry(IPInfoDNSCacheEntryEventParams *e);
// Or, subclass IPInfo and override this emitter function. virtual int FireDNSCacheEntry(IPInfoDNSCacheEntryEventParams *e) {...}
Remarks
This event fires once for each entry in the local DNS cache when DisplayDNSCache is called.
RecordName is the host name to which the record applies.
RecordType is the type of response. For instance 1 is an A record.
TimeToLive is the time in seconds after which the cached entry expires.
DataLength is the length of the data in bytes. For instance if the RecordType is A and an IPv4 address is cached DataLength would be 4. CNAME and PTR records will contain the length of the address in memory where the value is held.
Section is the section of the DNS response from which the record is taken. Most commonly this is the "Answer" section.
RecordValue is the actual value that is cached. For instance this may be an IP address for A records.
RecordInfo is a text representation of the other parameters. This is suitable for use in a log file, or to display.
Error Event (IPInfo Class)
Information about errors during data delivery.
Syntax
class IPInfoErrorEventParams { public: int ErrorCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Error(IPInfoErrorEventParams *e);
// Or, subclass IPInfo and override this emitter function. virtual int FireError(IPInfoErrorEventParams *e) {...}
Remarks
The Error event is fired in case of exceptional conditions during message processing. Normally the class fails with an error.
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
RequestComplete Event (IPInfo Class)
Fired after an asynchronous request completes.
Syntax
class IPInfoRequestCompleteEventParams { public: int RequestId(); int StatusCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void RequestComplete(IPInfoRequestCompleteEventParams *e);
// Or, subclass IPInfo and override this emitter function. virtual int FireRequestComplete(IPInfoRequestCompleteEventParams *e) {...}
Remarks
The RequestId parameter specifies the request that just completed. The class properties that relate to this request are completed with the returned values. (For example, in the case of domain name resolution, HostName, HostAddress, HostAliases, and OtherAddresses are set to the resolved values.)
If the request completed normally, StatusCode is 0, and Description is "OK". If not, StatusCode has the error code returned by the system. Description contains a description of this code.
Please refer to the Error Codes section for more information.
NOTE: This functionality is only available in Windows.
Configuration Settings (IPInfo Class)
The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.IPInfo Configuration Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AdapterDADState:
Specifies the Duplicate Address Detection state of the IP address of the adapter specified by AdapterIndex.The possible values are as follows:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AdapterIPv6DADState:
Specifies the Duplicate Address Detection state of the IPv6 address of the adapter specified by AdapterIndex.The possible values are as follows:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AdapterOtherDADStates:
Specifies the Duplicate Address Detection states of the IP addresses leased by the adapter specified by AdapterIndex, if any.The possible values are as follows:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ARPAddress: Specifies the IP Address of the interface to be used for the GetMAC method.By default, when GetMAC is called the class will attempt the address resolution from the first adapter listed by the system. In multi-homed machines it may be necessary to specify the IP address of the interface to be used as the source of the address resolution request. Set this setting to the local IP address of the adapter to be used when making this request. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UseOldApi:
If set the class will use the old API to get Adapter information.The class uses new system calls to obtain IPv6 as well as IPv4 adapter information.
Some of the new System calls are not supported on the XP Windows operating system however.
Set this config to true to use the old System calls when retrieving adapter information.
NOTE: This functionality is only available in Windows. NOTE: This setting should only be needed when using the XP operating system. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Base Configuration Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BuildInfo: Information about the product's build.When queried, this setting will return a string containing information about the product's build. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CodePage:
The system code page used for Unicode to Multibyte translations.The default code page is Unicode UTF-8 (65001).
The following is a list of valid code page identifiers:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LicenseInfo:
Information about the current license.When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UseInternalSecurityAPI: Tells the class whether or not to use the system security libraries or an internal implementation. By default the class will use the system security libraries to perform cryptographic functions where applicable. Setting this to true tells the class to use the internal implementation instead of using the system's security API. |
Trappable Errors (IPInfo Class)
IPInfo Errors
131 Request queue is full. | |
132 Message for unknown request. | |
134 Invalid address string. | |
310 Adapter information is unavailable. |
SSL Errors
270 Cannot load specified security library. | |
271 Cannot open certificate store. | |
272 Cannot find specified certificate. | |
273 Cannot acquire security credentials. | |
274 Cannot find certificate chain. | |
275 Cannot verify certificate chain. | |
276 Error during handshake. | |
280 Error verifying certificate. | |
281 Could not find client certificate. | |
282 Could not find server certificate. | |
283 Error encrypting data. | |
284 Error decrypting data. |
TCP/IP Errors
10004 [10004] Interrupted system call. | |
10009 [10009] Bad file number. | |
10013 [10013] Access denied. | |
10014 [10014] Bad address. | |
10022 [10022] Invalid argument. | |
10024 [10024] Too many open files. | |
10035 [10035] Operation would block. | |
10036 [10036] Operation now in progress. | |
10037 [10037] Operation already in progress. | |
10038 [10038] Socket operation on non-socket. | |
10039 [10039] Destination address required. | |
10040 [10040] Message too long. | |
10041 [10041] Protocol wrong type for socket. | |
10042 [10042] Bad protocol option. | |
10043 [10043] Protocol not supported. | |
10044 [10044] Socket type not supported. | |
10045 [10045] Operation not supported on socket. | |
10046 [10046] Protocol family not supported. | |
10047 [10047] Address family not supported by protocol family. | |
10048 [10048] Address already in use. | |
10049 [10049] Can't assign requested address. | |
10050 [10050] Network is down. | |
10051 [10051] Network is unreachable. | |
10052 [10052] Net dropped connection or reset. | |
10053 [10053] Software caused connection abort. | |
10054 [10054] Connection reset by peer. | |
10055 [10055] No buffer space available. | |
10056 [10056] Socket is already connected. | |
10057 [10057] Socket is not connected. | |
10058 [10058] Can't send after socket shutdown. | |
10059 [10059] Too many references, can't splice. | |
10060 [10060] Connection timed out. | |
10061 [10061] Connection refused. | |
10062 [10062] Too many levels of symbolic links. | |
10063 [10063] File name too long. | |
10064 [10064] Host is down. | |
10065 [10065] No route to host. | |
10066 [10066] Directory not empty | |
10067 [10067] Too many processes. | |
10068 [10068] Too many users. | |
10069 [10069] Disc Quota Exceeded. | |
10070 [10070] Stale NFS file handle. | |
10071 [10071] Too many levels of remote in path. | |
10091 [10091] Network subsystem is unavailable. | |
10092 [10092] WINSOCK DLL Version out of range. | |
10093 [10093] Winsock not loaded yet. | |
11001 [11001] Host not found. | |
11002 [11002] Non-authoritative 'Host not found' (try again or check DNS setup). | |
11003 [11003] Non-recoverable errors: FORMERR, REFUSED, NOTIMP. | |
11004 [11004] Valid name, no data record (check DNS setup). |