Class NetworkStack
Manages the Cosmos networking stack.
Inheritance
Inherited Members
Namespace: Cosmos.System.Network
Assembly: Cosmos.System2.dll
Syntax
public static class NetworkStack
Fields
| Improve this Doc View SourceDebugger
Debugger instance of the "System" ring, with the "NetworkStack" tag.
Declaration
public static readonly Debugger Debugger
Field Value
Type | Description |
---|---|
Debugger |
Methods
| Improve this Doc View SourceConfigEmpty()
Check if the current network configuration is empty.
Declaration
public static bool ConfigEmpty()
Returns
Type | Description |
---|---|
System.Boolean |
ConfigIP(NetworkDevice, IPConfig)
Configures an IP configuration on the given network device.
Declaration
public static void ConfigIP(NetworkDevice nic, IPConfig config)
Parameters
Type | Name | Description |
---|---|---|
NetworkDevice | nic | The NetworkDevice that will have the assigned configuration. |
IPConfig | config | The Cosmos.System.Network.Config instance that defines the IP Address, Subnet Mask and Default Gateway for the device |
Remarks
Multiple IP configurations can be made, similar to *nix environments.
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
System.ArgumentOutOfRangeException | Thrown on fatal error. |
System.IO.IOException | Thrown on IO error. |
System.OverflowException | Thrown on fatal error. |
HandlePacket(Byte[])
Handle a network packet.
Declaration
public static void HandlePacket(byte[] packetData)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | packetData | Packet data array. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown on fatal error. |
System.IO.IOException | Thrown on IO error. |
System.ArgumentException | Thrown on fatal error. |
System.OverflowException | Thrown on fatal error. |
Initialize()
Initializes the network stack.
Declaration
public static void Initialize()
RemoveAllConfigIP()
Remove all IP configurations.
Declaration
public static void RemoveAllConfigIP()
RemoveIPConfig(NetworkDevice)
Removes the IP configuration of a specific network device.
Declaration
public static void RemoveIPConfig(NetworkDevice nic)
Parameters
Type | Name | Description |
---|---|---|
NetworkDevice | nic | The target device. |
Update()
Updates the network stack. This method should be called continously by other parts of the network stack.
Declaration
public static void Update()
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown on fatal error. |
System.ArgumentOutOfRangeException | Thrown on memory error. |
System.OverflowException | Thrown if data length of any packet in the queue is bigger than System.Int32.MaxValue. |