Skip to content

easyextensionshelpers IpAddressHelpers

BigMakCode edited this page Aug 5, 2024 · 1 revision

IpAddressHelpers Public class

Description

IP address helpers.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph EasyExtensions.Helpers
  EasyExtensions.Helpers.IpAddressHelpers[[IpAddressHelpers]]
  end
Loading

Members

Methods

Public Static methods

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.

Details

Summary

IP address helpers.

Methods

IpToNumber

public static BigInteger IpToNumber(string ipAddress)
Arguments
Type Name Description
string ipAddress IP address.
Summary

Convert IP address to number.

Returns

IP address as number.

NumberToIp

public static IPAddress NumberToIp(BigInteger ipNumber, AddressFamily addressFamily)
Arguments
Type Name Description
BigInteger ipNumber IP address as number.
AddressFamily addressFamily Address family.
Summary

Convert number to IP address.

Returns

IP address.

GetMaskAddress

public static IPAddress GetMaskAddress(int subnetMask, AddressFamily addressFamily)
Arguments
Type Name Description
int subnetMask Subnet mask.
AddressFamily addressFamily Address family.
Summary

Get subnet mask address.

Returns

Subnet address.

Exceptions
Name Description
ArgumentOutOfRangeException Thrown when subnet mask is invalid.

ExtractMask

public static IPAddress ExtractMask(string ip)
Arguments
Type Name Description
string ip IP address.
Summary

Extract subnet mask from IP address.

Returns

Subnet mask, or null if not found.

Generated with ModularDoc

Clone this wiki locally