ServerNetworkInterface
Record in Oadm.Sdk.Network · Oadm.Sdk.dll
One network interface of the OADM server (for core plugins that serve the network, e.g. NTP or DHCP server pages).
public sealed record ServerNetworkInterface(string Id, string Name, string Description, IReadOnlyList<IPAddress> Addresses, bool IsUp, bool IsLoopback)Parameters
Id: Stable id of the OS (NetworkInterface.Id: a GUID on Windows, the name on Linux/macOS).Name: “Ethernet”, “eth0”, “en0”.Description: Adapter description (“Intel(R) Ethernet Connection I219-LM”); may equal the name.Addresses: Unicast addresses, IPv4 first; IPv6 link-local addresses carry their scope id.IsUp: Operational status is Up.IsLoopback: Loopback interface (127.0.0.1, ::1).
Properties
Section titled “Properties”Addresses
Section titled “Addresses”IReadOnlyList<IPAddress> Addresses { get; init; }Unicast addresses, IPv4 first; IPv6 link-local addresses carry their scope id.
Description
Section titled “Description”string Description { get; init; }Adapter description (“Intel(R) Ethernet Connection I219-LM”); may equal the name.
DnsServers
Section titled “DnsServers”IReadOnlyList<IPAddress> DnsServers { get; init; }DNS servers the OS uses on this interface (IPv4 first).
DnsSuffix
Section titled “DnsSuffix”string? DnsSuffix { get; init; }DNS suffix (domain name) of the interface, null when none.
Gateways
Section titled “Gateways”IReadOnlyList<IPAddress> Gateways { get; init; }Default gateways of the interface (IPv4 first).
string Id { get; init; }Stable id of the OS (NetworkInterface.Id: a GUID on Windows, the name on Linux/macOS).
Ipv4Index
Section titled “Ipv4Index”int Ipv4Index { get; init; }IPv4 interface index of the OS (-1 unknown): binds a socket to this interface (macOS IP_BOUND_IF, packet info).
IsLoopback
Section titled “IsLoopback”bool IsLoopback { get; init; }Loopback interface (127.0.0.1, ::1).
bool IsUp { get; init; }Operational status is Up.
string Name { get; init; }“Ethernet”, “eth0”, “en0”.
PrefixLengths
Section titled “PrefixLengths”IReadOnlyDictionary<IPAddress, int> PrefixLengths { get; init; }Prefix length per unicast address (IPv4 /24 = 24); addresses without a known prefix are missing.
PrimaryAddress
Section titled “PrimaryAddress”IPAddress? PrimaryAddress { get; }The first IPv4 address, else the first non-link-local IPv6 address, else the first address.
PrimaryIpv4
Section titled “PrimaryIpv4”IPAddress? PrimaryIpv4 { get; }The first IPv4 address, null when the interface has none.
Methods
Section titled “Methods”PrefixLengthOf
Section titled “PrefixLengthOf”int? PrefixLengthOf(IPAddress address)Prefix length of address, null when unknown.