NetSamples.Common.Net
Class Network

A class that provides information about the network configuration for the local machine. Uses the IP Helper DLL wrapper.

Field Summary
bool dns
System.Net.IPAddress[] dnsServerList
string domainName
uint ERROR_BUFFER_OVERFLOW
uint ERROR_IO_PENDING
string hostName
bool loaded
NetSamples.Common.Net.Network.NodeType nodeType
bool proxy
bool routing
string scopeId

Constructor Summary
Network()
        Initializes a new instance of the Network class.

Property Summary
System.Collections.ICollection Adapters
         The network adapters
System.Collections.ICollection Addresses
         The addresses for the machine
bool DnsEnabled
         Tests whether DNS is enabled
System.Net.IPAddress[] DnsServerList
         Gets the list of DNS Servers
string DomainName
         The Domain Name
string HostName
         The Host name
int InterfaceCount
         The number of network interfaces
System.Collections.ICollection Interfaces
         The network interfaces
bool ProxyEnabled
         Determines if a proxy is enabled
bool RoutingEnabled
         Determines whether Routing is enabled
string ScopeId
         The Scope ID
NetSamples.Common.Net.Network.NodeType Type
         The Node Type

Method Summary
NetSamples.Common.Net.NetworkInterface BestInterface(System.Net.IPAddress destination)
         Gets the best interface to use for the destination address.
bool IsLocalAddress(System.Net.IPAddress address)
         Determines whether the supplied IP Address matches of the machines addresses.
bool IsMulticastAddress(System.Net.IPAddress address)
         Determines whether the supplied IP Address is a multicast address.
bool IsPrivateNetworkAddress(System.Net.IPAddress address)
         Tests whether an IPAddress is in one of the address ranges designated by RFC1912 as a private address.
void LoadNetworkParams()
         Loads the core network information for the machine. Note that the Network class is not compatible with Windows NT 4.0 as the IP Helper library is not available on that platform.
bool RttHopCount(System.Net.IPAddress destination, uint maxhops, uint rtt, uint hopcount)
         Gets the RTT and Hop count for the destination address.

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

dns

private bool dns


dnsServerList

private System.Net.IPAddress[] dnsServerList


domainName

private string domainName


ERROR_BUFFER_OVERFLOW

protected uint ERROR_BUFFER_OVERFLOW


ERROR_IO_PENDING

protected uint ERROR_IO_PENDING


hostName

private string hostName


loaded

private bool loaded


nodeType

private NetSamples.Common.Net.Network.NodeType nodeType


proxy

private bool proxy


routing

private bool routing


scopeId

private string scopeId

Constructor Detail

Network

public Network()

Initializes a new instance of the Network class.

Property Detail

Adapters

public System.Collections.ICollection Adapters

The network adapters


Addresses

public System.Collections.ICollection Addresses

The addresses for the machine


DnsEnabled

public bool DnsEnabled

Tests whether DNS is enabled


DnsServerList

public System.Net.IPAddress[] DnsServerList

Gets the list of DNS Servers


DomainName

public string DomainName

The Domain Name


HostName

public string HostName

The Host name


InterfaceCount

public int InterfaceCount

The number of network interfaces


Interfaces

public System.Collections.ICollection Interfaces

The network interfaces


ProxyEnabled

public bool ProxyEnabled

Determines if a proxy is enabled


RoutingEnabled

public bool RoutingEnabled

Determines whether Routing is enabled


ScopeId

public string ScopeId

The Scope ID


Type

public NetSamples.Common.Net.Network.NodeType Type

The Node Type

Method Detail

BestInterface

public NetSamples.Common.Net.NetworkInterface BestInterface(System.Net.IPAddress destination)

Gets the best interface to use for the destination address.


IsLocalAddress

public bool IsLocalAddress(System.Net.IPAddress address)

Determines whether the supplied IP Address matches of the machines addresses.


IsMulticastAddress

public bool IsMulticastAddress(System.Net.IPAddress address)

Determines whether the supplied IP Address is a multicast address.


IsPrivateNetworkAddress

public bool IsPrivateNetworkAddress(System.Net.IPAddress address)

Tests whether an IPAddress is in one of the address ranges designated by RFC1912 as a private address.


LoadNetworkParams

protected void LoadNetworkParams()

Loads the core network information for the machine. Note that the Network class is not compatible with Windows NT 4.0 as the IP Helper library is not available on that platform.


RttHopCount

public bool RttHopCount(System.Net.IPAddress destination,
                        uint maxhops,
                        uint rtt,
                        uint hopcount)

Gets the RTT and Hop count for the destination address.