Skip to content

FirewallRule

Record in Oadm.Sdk.Network · Oadm.Sdk.dll

An inbound allow rule for the server executable on one local port or a range of ports (profiles Domain and Private). Name identifies the rule (“OADM Server (NTP, UDP 123)”): opening replaces a rule of that name, closing removes it.

public sealed record FirewallRule(string Name, FirewallProtocol Protocol, int Port)

Parameters

  • Name: The rule name, which identifies it.
  • Protocol: TCP or UDP.
  • Port: The local port; the first port of a range.
int? LastPort { get; init; }

The last port of a range (FirewallRule.Port to this one); null for one port. SDK 0.6.0.

string Name { get; init; }

The rule name, which identifies it.

int Port { get; init; }

The local port; the first port of a range.

string PortText { get; }

The ports as a firewall writes them: “123” or “50000-50799”.

FirewallProtocol Protocol { get; init; }

TCP or UDP.

static FirewallRule ForService(string service, FirewallProtocol protocol, int port)

“OADM Server (NTP, UDP 123)”.

static FirewallRule ForServiceRange(string service, FirewallProtocol protocol, int first, int last)

“OADM Server (Load test, UDP 50000-50799)”: the ports first to last (one port when they are equal). SDK 0.6.0.