C# Class BF2Statistics.Net.Networking

Show file Open project: BF2Statistics/ControlCenter

Public Methods

Method Description
GetIpAddress ( string text ) : IPAddress

Takes a domain name, or IP address, and returns the Correct IP address. If multiple IP addresses are found, the first one is returned

IP2Long ( string ip ) : long

Converts a string IP address into MySQL INET_ATOA long

IsLanIP ( IPAddress address ) : bool

Returns whether the supplied IP Address in on the local Lan network

http://stackoverflow.com/questions/7232287/check-if-ip-is-in-lan-behind-firewalls-and-routers

IsLocalIpAddress ( string host ) : bool

Returns whether the IP address specified is a Local Ip Address

LongToIP ( long longIP ) : string

Converts a long to an IP Address

TryGetIpAddress ( string text, IPAddress &Ip ) : bool

Takes a domain name, or IP address, and returns the Correct IP address. If multiple IP addresses are found, the first one is returned

ValidateAddressAsync ( string address, IPAddress expectedAddress ) : Task

Asnychronously validates a hostname to an IPAddress

Private Methods

Method Description
CheckMask ( IPAddress address, IPAddress mask, IPAddress target ) : bool

Method Details

GetIpAddress() public static method

Takes a domain name, or IP address, and returns the Correct IP address. If multiple IP addresses are found, the first one is returned
public static GetIpAddress ( string text ) : IPAddress
text string Domain name or IP Address
return System.Net.IPAddress

IP2Long() public static method

Converts a string IP address into MySQL INET_ATOA long
public static IP2Long ( string ip ) : long
ip string THe IP Address
return long

IsLanIP() public static method

Returns whether the supplied IP Address in on the local Lan network
http://stackoverflow.com/questions/7232287/check-if-ip-is-in-lan-behind-firewalls-and-routers
public static IsLanIP ( IPAddress address ) : bool
address System.Net.IPAddress
return bool

IsLocalIpAddress() public static method

Returns whether the IP address specified is a Local Ip Address
public static IsLocalIpAddress ( string host ) : bool
host string The ip address to check
return bool

LongToIP() public static method

Converts a long to an IP Address
public static LongToIP ( long longIP ) : string
longIP long
return string

TryGetIpAddress() public static method

Takes a domain name, or IP address, and returns the Correct IP address. If multiple IP addresses are found, the first one is returned
public static TryGetIpAddress ( string text, IPAddress &Ip ) : bool
text string
Ip System.Net.IPAddress
return bool

ValidateAddressAsync() public static method

Asnychronously validates a hostname to an IPAddress
public static ValidateAddressAsync ( string address, IPAddress expectedAddress ) : Task
address string The hostname to validate
expectedAddress System.Net.IPAddress The expected Ip Address
return Task