protected unsafe OsxNetworkInterface(string name) : base(name) { Interop.Sys.NativeIPInterfaceStatistics nativeStats; if (Interop.Sys.GetNativeIPInterfaceStatistics(name, out nativeStats) == -1) { throw new NetworkInformationException(SR.net_PInvokeError); } _speed = (long)nativeStats.Speed; _ipProperties = new OsxIpInterfaceProperties(this, (int)nativeStats.Mtu); }
protected unsafe OsxNetworkInterface(string name) : base(name) { Interop.Sys.NativeIPInterfaceStatistics nativeStats; if (Interop.Sys.GetNativeIPInterfaceStatistics(name, out nativeStats) == -1) { throw new NetworkInformationException(SR.net_PInvokeError); } _speed = (long)nativeStats.Speed; _ipProperties = new OsxIpInterfaceProperties(this, (int)nativeStats.Mtu); }
protected unsafe OsxNetworkInterface(string name) : base(name) { Interop.Sys.NativeIPInterfaceStatistics nativeStats; if (Interop.Sys.GetNativeIPInterfaceStatistics(name, out nativeStats) == -1) { throw new NetworkInformationException(SR.net_PInvokeError); } if ((nativeStats.Flags & (ulong)Interop.Sys.InterfaceFlags.InterfaceError) != 0) { _operationalStatus = OperationalStatus.Unknown; } else { _operationalStatus = (nativeStats.Flags & (ulong)Interop.Sys.InterfaceFlags.InterfaceHasLink) != 0 ? OperationalStatus.Up : OperationalStatus.Down; } _supportsMulticast = (nativeStats.Flags & (ulong)Interop.Sys.InterfaceFlags.InterfaceSupportsMulticast) != 0; _speed = (long)nativeStats.Speed; _ipProperties = new OsxIpInterfaceProperties(this, (int)nativeStats.Mtu); }