fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
fCraft.IPAddressUtil Class Reference

Provides utility methods for working with IP addresses and ranges. More...

Static Public Member Functions

static bool IsLocal ([NotNull] this IPAddress addr)
 Checks whether an IP address may belong to LAN or localhost (192.168.0.0/16, 10.0.0.0/24, or 127.0.0.0/24).
 
static uint AsUInt ([NotNull] this IPAddress thisAddr)
 Represents an IPv4 address as an unsigned integer.
 
static int AsInt ([NotNull] this IPAddress thisAddr)
 Represents an IPv4 address as a signed integer.
 
static bool IsIP ([NotNull] string ipString)
 Checks to see if the specified string is a valid IPv4 address.
 
static bool Match ([NotNull] this IPAddress thisAddr, uint otherAddr, uint mask)
 
static IPAddress RangeMin ([NotNull] this IPAddress thisAddr, byte range)
 Finds the starting IPv4 address of the given address range.
 
static IPAddress RangeMax ([NotNull] this IPAddress thisAddr, byte range)
 Finds the ending IPv4 address of the given address range.
 
static uint NetMask (byte range)
 Creates an IPv4 mask for the given CIDR range.
 

Detailed Description

Provides utility methods for working with IP addresses and ranges.

Member Function Documentation

static int fCraft.IPAddressUtil.AsInt ( [NotNull] this IPAddress  thisAddr)
static

Represents an IPv4 address as a signed integer.

Exceptions
ArgumentNullExceptionthisAddr is null.
static uint fCraft.IPAddressUtil.AsUInt ( [NotNull] this IPAddress  thisAddr)
static

Represents an IPv4 address as an unsigned integer.

Exceptions
ArgumentNullExceptionthisAddr is null.
static bool fCraft.IPAddressUtil.IsIP ( [NotNull] string  ipString)
static

Checks to see if the specified string is a valid IPv4 address.

Parameters
ipStringString representation of the IPv4 address.
Returns
Whether or not the string is a valid IPv4 address.
static bool fCraft.IPAddressUtil.IsLocal ( [NotNull] this IPAddress  addr)
static

Checks whether an IP address may belong to LAN or localhost (192.168.0.0/16, 10.0.0.0/24, or 127.0.0.0/24).

Parameters
addrIPv4 address to check.
Returns
True if given IP is local; otherwise false.
Exceptions
ArgumentNullExceptionaddr is null.
static bool fCraft.IPAddressUtil.Match ( [NotNull] this IPAddress  thisAddr,
uint  otherAddr,
uint  mask 
)
static
static uint fCraft.IPAddressUtil.NetMask ( byte  range)
static

Creates an IPv4 mask for the given CIDR range.

Exceptions
ArgumentOutOfRangeExceptionrange is over 32
static IPAddress fCraft.IPAddressUtil.RangeMax ( [NotNull] this IPAddress  thisAddr,
byte  range 
)
static

Finds the ending IPv4 address of the given address range.

Exceptions
ArgumentNullExceptionthisAddr is null
ArgumentOutOfRangeExceptionrange is over 32
static IPAddress fCraft.IPAddressUtil.RangeMin ( [NotNull] this IPAddress  thisAddr,
byte  range 
)
static

Finds the starting IPv4 address of the given address range.

Exceptions
ArgumentNullExceptionthisAddr is null
ArgumentOutOfRangeExceptionrange is over 32

The documentation for this class was generated from the following file: