-
Notifications
You must be signed in to change notification settings - Fork 0
easyextensionshelpers IpAddressHelpers
BigMakCode edited this page Aug 5, 2024
·
1 revision
IP address helpers.
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph EasyExtensions.Helpers
EasyExtensions.Helpers.IpAddressHelpers[[IpAddressHelpers]]
end
Returns | Name |
---|---|
IPAddress |
ExtractMask (string ip)Extract subnet mask from IP address. |
IPAddress |
GetMaskAddress (int subnetMask, AddressFamily addressFamily)Get subnet mask address. |
BigInteger |
IpToNumber (string ipAddress)Convert IP address to number. |
IPAddress |
NumberToIp (BigInteger ipNumber, AddressFamily addressFamily)Convert number to IP address. |
IP address helpers.
public static BigInteger IpToNumber(string ipAddress)
Type | Name | Description |
---|---|---|
string |
ipAddress | IP address. |
Convert IP address to number.
IP address as number.
public static IPAddress NumberToIp(BigInteger ipNumber, AddressFamily addressFamily)
Type | Name | Description |
---|---|---|
BigInteger |
ipNumber | IP address as number. |
AddressFamily |
addressFamily | Address family. |
Convert number to IP address.
IP address.
public static IPAddress GetMaskAddress(int subnetMask, AddressFamily addressFamily)
Type | Name | Description |
---|---|---|
int |
subnetMask | Subnet mask. |
AddressFamily |
addressFamily | Address family. |
Get subnet mask address.
Subnet address.
Name | Description |
---|---|
ArgumentOutOfRangeException | Thrown when subnet mask is invalid. |
public static IPAddress ExtractMask(string ip)
Type | Name | Description |
---|---|---|
string |
ip | IP address. |
Extract subnet mask from IP address.
Subnet mask, or null if not found.
Generated with ModularDoc