Struct Subnet
Structure representing a range of network addresses.
Inherited Members
Namespace: SociallyDistant.Core.OS.Network
Assembly: SociallyDistant.Framework.dll
Syntax
[Serializable]
public struct Subnet : ISerializable, IEquatable<Subnet>
Fields
HigherRange
The last address in the network.
Declaration
public uint HigherRange
Field Value
Type | Description |
---|---|
uint |
LowerRange
The first address in the network.
Declaration
public uint LowerRange
Field Value
Type | Description |
---|---|
uint |
Mask
The network's subnet mask.
Declaration
public uint Mask
Field Value
Type | Description |
---|---|
uint |
NetworkAddress
Value representing the network portion of all IP addresses in the range.
Declaration
public uint NetworkAddress
Field Value
Type | Description |
---|---|
uint |
Properties
CidrNotation
Gets the CIDR notation of this network.
Declaration
public string CidrNotation { get; }
Property Value
Type | Description |
---|---|
string |
FirstHost
Gets the first-possible address that can be assigned as a host.
Declaration
public uint FirstHost { get; }
Property Value
Type | Description |
---|---|
uint |
GroupSize
Gets the amount of possible addresses.
Declaration
public uint GroupSize { get; }
Property Value
Type | Description |
---|---|
uint |
LastHost
Gets the last address that can be assigned as a host.
Declaration
public uint LastHost { get; }
Property Value
Type | Description |
---|---|
uint |
NetworkId
I don't know what this is.
Declaration
public uint NetworkId { get; }
Property Value
Type | Description |
---|---|
uint |
UsableAddressSize
Gets the number of addresses that may be assigned to a host.
Declaration
public uint UsableAddressSize { get; }
Property Value
Type | Description |
---|---|
uint |
Methods
Equals(Subnet)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Subnet other)
Parameters
Type | Name | Description |
---|---|---|
Subnet | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
FromAddressAndMask(uint, uint)
Creates a Subnet value from an IP address and subnet mask.
Declaration
public static Subnet FromAddressAndMask(uint address, uint mask)
Parameters
Type | Name | Description |
---|---|---|
uint | address | |
uint | mask |
Returns
Type | Description |
---|---|
Subnet |
Remarks
Ritchie has a headache at the current point in time where this text is being written. Documentation quality is suffering, but the music choixces are growing ever-more interesting.
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
Read(IDataReader)
Declaration
public void Read(IDataReader reader)
Parameters
Type | Name | Description |
---|---|---|
IDataReader | reader |
Write(IDataWriter)
Declaration
public void Write(IDataWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IDataWriter | writer |