C# Class WinLib.Network.IP

Exibir arquivo Open project: SortByte/Network-Manager Class Usage Examples

Public Methods

Method Description
CheckIfSameNetwork ( string sIPA, string sIPB, string sMask ) : bool
GetNetwork ( string sIP, string sPrefix ) : string
Ping ( IPAddress ip ) : int
PrefixToMask ( int prefix ) : string

Converts an IPv4 CIDR prefix number (0 - 32) to dot-decimal notation

ValidateIPv4 ( string &sIP, string &sMask ) : bool
ValidateIPv4 ( string &reason, string sIP, string sMask = "0.0.0.0" ) : bool
ValidateIPv4Mask ( string &sMask ) : bool
ValidateIPv6 ( string &sIP, string sPrefix = "0" ) : bool
ValidateIPv6 ( string sIP, string sPrefix, string &reason ) : bool
ValidateIPv6Prefix ( string &sPrefix ) : bool

Method Details

CheckIfSameNetwork() public static method

public static CheckIfSameNetwork ( string sIPA, string sIPB, string sMask ) : bool
sIPA string
sIPB string
sMask string
return bool

GetNetwork() public static method

public static GetNetwork ( string sIP, string sPrefix ) : string
sIP string
sPrefix string
return string

Ping() public static method

public static Ping ( IPAddress ip ) : int
ip System.Net.IPAddress
return int

PrefixToMask() public static method

Converts an IPv4 CIDR prefix number (0 - 32) to dot-decimal notation
public static PrefixToMask ( int prefix ) : string
prefix int
return string

ValidateIPv4() public static method

public static ValidateIPv4 ( string &sIP, string &sMask ) : bool
sIP string
sMask string
return bool

ValidateIPv4() public static method

public static ValidateIPv4 ( string &reason, string sIP, string sMask = "0.0.0.0" ) : bool
reason string
sIP string
sMask string
return bool

ValidateIPv4Mask() public static method

public static ValidateIPv4Mask ( string &sMask ) : bool
sMask string
return bool

ValidateIPv6() public static method

public static ValidateIPv6 ( string &sIP, string sPrefix = "0" ) : bool
sIP string
sPrefix string
return bool

ValidateIPv6() public static method

public static ValidateIPv6 ( string sIP, string sPrefix, string &reason ) : bool
sIP string
sPrefix string
reason string
return bool

ValidateIPv6Prefix() public static method

public static ValidateIPv6Prefix ( string &sPrefix ) : bool
sPrefix string
return bool