Class IPConfig
Represents IPv4 configuration.
Inheritance
System.Object
IPConfig
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.System.Network.Config
Assembly: Cosmos.System2.dll
Syntax
public class IPConfig
Constructors
| Improve this Doc View SourceIPConfig(Address, Address)
Creates a IPv4 Configuration with no default gateway.
Declaration
public IPConfig(Address ip, Address subnet)
Parameters
Type | Name | Description |
---|---|---|
Address | ip | IP Address |
Address | subnet | Subnet Mask |
IPConfig(Address, Address, Address)
Creates a IPv4 Configuration.
Declaration
public IPConfig(Address ip, Address subnet, Address gw)
Parameters
Type | Name | Description |
---|---|---|
Address | ip | IP Address |
Address | subnet | Subnet Mask |
Address | gw | Default gateway |
Properties
| Improve this Doc View SourceDefaultGateway
The default gateway address.
Declaration
public Address DefaultGateway { get; }
Property Value
Type | Description |
---|---|
Address |
IPAddress
The IP address.
Declaration
public Address IPAddress { get; }
Property Value
Type | Description |
---|---|
Address |
SubnetMask
The subnet mask.
Declaration
public Address SubnetMask { get; }
Property Value
Type | Description |
---|---|
Address |
Methods
| Improve this Doc View SourceEnable(NetworkDevice, Address, Address, Address)
Enables a network device with the specified IP configuration.
Declaration
public static bool Enable(NetworkDevice device, Address ip, Address subnet, Address gw)
Parameters
Type | Name | Description |
---|---|---|
NetworkDevice | device | The network device to enable. |
Address | ip | The IP address to assign to the device. |
Address | subnet | The subnet mask to use for the device. |
Address | gw | The default gateway address to use for the device. |
Returns
Type | Description |
---|---|
System.Boolean | true if the device was successfully enabled, false otherwise. |
FindNetwork(Address)
Finds the network address for the specified destination IP address.
Declaration
public static Address FindNetwork(Address destIP)
Parameters
Type | Name | Description |
---|---|---|
Address | destIP | The destination IP address. |
Returns
Type | Description |
---|---|
Address |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown on fatal error. |