+ public abstract class GatewayIPAddressInformation {
+ protected GatewayIPAddressInformation();
+ public abstract IPAddress Address { get; }
+ }
+ public class GatewayIPAddressInformationCollection : ICollection<GatewayIPAddressInformation>, IEnumerable, IEnumerable<GatewayIPAddressInformation> {
+ public abstract NetBiosNodeType NodeType { get; }
+ public abstract TcpConnectionInformation[] GetActiveTcpConnections();
+ public abstract IPEndPoint[] GetActiveTcpListeners();
+ public abstract IPEndPoint[] GetActiveUdpListeners();
+ public abstract IcmpV4Statistics GetIcmpV4Statistics();
+ public abstract IcmpV6Statistics GetIcmpV6Statistics();
+ public static IPGlobalProperties GetIPGlobalProperties();
+ public abstract IPGlobalStatistics GetIPv4GlobalStatistics();
+ public abstract IPGlobalStatistics GetIPv6GlobalStatistics();
+ public abstract TcpStatistics GetTcpIPv4Statistics();
+ public abstract TcpStatistics GetTcpIPv6Statistics();
+ public abstract UdpStatistics GetUdpIPv4Statistics();
+ public abstract UdpStatistics GetUdpIPv6Statistics();
+ public virtual Task<UnicastIPAddressInformationCollection> GetUnicastAddressesAsync();
+ }
+ public abstract class IPGlobalStatistics {
+ protected IPGlobalStatistics();
+ public abstract int DefaultTtl { get; }
+ public abstract bool ForwardingEnabled { get; }
+ public abstract int NumberOfInterfaces { get; }
+ public abstract int NumberOfIPAddresses { get; }
+ public abstract int NumberOfRoutes { get; }
+ public abstract long OutputPacketRequests { get; }
+ public abstract long OutputPacketRoutingDiscards { get; }
+ public abstract long OutputPacketsDiscarded { get; }
+ public abstract long OutputPacketsWithNoRoute { get; }
+ public abstract long PacketFragmentFailures { get; }
+ public abstract long PacketReassembliesRequired { get; }
+ public abstract long PacketReassemblyFailures { get; }
+ public abstract long PacketReassemblyTimeout { get; }
+ public abstract long PacketsFragmented { get; }
+ public abstract long PacketsReassembled { get; }
+ public abstract long ReceivedPackets { get; }
+ public abstract long ReceivedPacketsDelivered { get; }
+ public abstract long ReceivedPacketsDiscarded { get; }
+ public abstract long ReceivedPacketsForwarded { get; }
+ public abstract long ReceivedPacketsWithAddressErrors { get; }
+ public abstract long ReceivedPacketsWithHeadersErrors { get; }
+ public abstract long ReceivedPacketsWithUnknownProtocol { get; }
+ }
+ public abstract class IPInterfaceProperties {
+ protected IPInterfaceProperties();
+ public abstract IPAddressInformationCollection AnycastAddresses { get; }
+ public abstract IPAddressCollection DhcpServerAddresses { get; }
+ public abstract IPAddressCollection DnsAddresses { get; }
+ public abstract string DnsSuffix { get; }
+ public abstract GatewayIPAddressInformationCollection GatewayAddresses { get; }
+ public abstract bool IsDnsEnabled { get; }
+ public abstract bool IsDynamicDnsEnabled { get; }
+ public abstract MulticastIPAddressInformationCollection MulticastAddresses { get; }
+ public abstract UnicastIPAddressInformationCollection UnicastAddresses { get; }
+ public abstract IPAddressCollection WinsServersAddresses { get; }
+ public abstract IPv4InterfaceProperties GetIPv4Properties();
+ public abstract IPv6InterfaceProperties GetIPv6Properties();
+ }
+ public abstract class IPInterfaceStatistics {
+ protected IPInterfaceStatistics();
+ public abstract long BytesReceived { get; }
+ public abstract long BytesSent { get; }
+ public abstract long IncomingPacketsDiscarded { get; }
+ public abstract long IncomingPacketsWithErrors { get; }
+ public abstract long IncomingUnknownProtocolPackets { get; }
+ public abstract long NonUnicastPacketsReceived { get; }
+ public abstract long NonUnicastPacketsSent { get; }
+ public abstract long OutgoingPacketsDiscarded { get; }
+ public abstract long OutgoingPacketsWithErrors { get; }
+ public abstract long OutputQueueLength { get; }
+ public abstract long UnicastPacketsReceived { get; }
+ public abstract long UnicastPacketsSent { get; }
+ }
+ public enum IPStatus {
+ BadDestination = 11018,
+ BadHeader = 11042,
+ BadOption = 11007,
+ BadRoute = 11012,
+ DestinationHostUnreachable = 11003,
+ DestinationNetworkUnreachable = 11002,
+ DestinationPortUnreachable = 11005,
+ DestinationProhibited = 11004,
+ DestinationProtocolUnreachable = 11004,
+ DestinationScopeMismatch = 11045,
+ DestinationUnreachable = 11040,
+ HardwareError = 11008,
+ IcmpError = 11044,
+ NoResources = 11006,
+ PacketTooBig = 11009,
+ ParameterProblem = 11015,
+ SourceQuench = 11016,
+ Success = 0,
+ TimedOut = 11010,
+ TimeExceeded = 11041,
+ TtlExpired = 11013,
+ TtlReassemblyTimeExceeded = 11014,
+ Unknown = -1,
+ UnrecognizedNextHeader = 11043,
+ }
+ public abstract class IPv4InterfaceProperties {
+ protected IPv4InterfaceProperties();
+ public abstract int Index { get; }
+ public abstract bool IsAutomaticPrivateAddressingActive { get; }
+ public abstract bool IsAutomaticPrivateAddressingEnabled { get; }
+ public abstract bool IsDhcpEnabled { get; }
+ public abstract bool IsForwardingEnabled { get; }
+ public abstract int Mtu { get; }
+ public abstract bool UsesWins { get; }
+ }
+ public abstract class IPv6InterfaceProperties {
+ protected IPv6InterfaceProperties();
+ public abstract int Index { get; }
+ public abstract int Mtu { get; }
+ public virtual long GetScopeId(ScopeLevel scopeLevel);
+ }
+ public abstract class MulticastIPAddressInformation : IPAddressInformation {
+ protected MulticastIPAddressInformation();
+ public abstract long AddressPreferredLifetime { get; }
+ public abstract long AddressValidLifetime { get; }
+ public abstract long DhcpLeaseLifetime { get; }
+ public abstract DuplicateAddressDetectionState DuplicateAddressDetectionState { get; }
+ public abstract PrefixOrigin PrefixOrigin { get; }
+ public abstract SuffixOrigin SuffixOrigin { get; }
+ }
+ public class MulticastIPAddressInformationCollection : ICollection<MulticastIPAddressInformation>, IEnumerable, IEnumerable<MulticastIPAddressInformation> {
+ public delegate void NetworkAddressChangedEventHandler(object sender, EventArgs e);
+ public static class NetworkChange {
+ public static event NetworkAddressChangedEventHandler NetworkAddressChanged;
+ }
+ public class NetworkInformationException : Exception {
+ public NetworkInformationException();
+ public NetworkInformationException(int errorCode);
+ public int ErrorCode { get; }
+ }
+ public abstract class NetworkInterface {
+ protected NetworkInterface();
+ public virtual string Description { get; }
+ public virtual string Id { get; }
+ public static int IPv6LoopbackInterfaceIndex { get; }
+ public virtual bool IsReceiveOnly { get; }
+ public static int LoopbackInterfaceIndex { get; }
+ public virtual string Name { get; }
+ public virtual NetworkInterfaceType NetworkInterfaceType { get; }
+ public virtual OperationalStatus OperationalStatus { get; }
+ public virtual long Speed { get; }
+ public virtual bool SupportsMulticast { get; }
+ public static NetworkInterface[] GetAllNetworkInterfaces();
+ public virtual IPInterfaceProperties GetIPProperties();
+ public virtual IPInterfaceStatistics GetIPStatistics();
+ public static bool GetIsNetworkAvailable();
+ public virtual PhysicalAddress GetPhysicalAddress();
+ public virtual bool Supports(NetworkInterfaceComponent networkInterfaceComponent);
+ }
+ public enum NetworkInterfaceComponent {
+ IPv4 = 0,
+ IPv6 = 1,
+ }
+ public enum NetworkInterfaceType {
+ AsymmetricDsl = 94,
+ Atm = 37,
+ BasicIsdn = 20,
+ Ethernet = 6,
+ Ethernet3Megabit = 26,
+ FastEthernetFx = 69,
+ FastEthernetT = 62,
+ Fddi = 15,
+ GenericModem = 48,
+ GigabitEthernet = 117,
+ HighPerformanceSerialBus = 144,
+ IPOverAtm = 114,
+ Isdn = 63,
+ Loopback = 24,
+ MultiRateSymmetricDsl = 143,
+ Ppp = 23,
+ PrimaryIsdn = 21,
+ RateAdaptDsl = 95,
+ Slip = 28,
+ SymmetricDsl = 96,
+ TokenRing = 9,
+ Tunnel = 131,
+ Unknown = 1,
+ VeryHighSpeedDsl = 97,
+ Wireless80211 = 71,
+ Wman = 237,
+ Wwanpp = 243,
+ Wwanpp2 = 244,
+ }
+ public enum OperationalStatus {
+ Dormant = 5,
+ Down = 2,
+ LowerLayerDown = 7,
+ NotPresent = 6,
+ Testing = 3,
+ Unknown = 4,
+ Up = 1,
+ }
+ public class PhysicalAddress {
+ public static readonly PhysicalAddress None;
+ public PhysicalAddress(byte[] address);
+ public override bool Equals(object comparand);
+ public byte[] GetAddressBytes();
+ public override int GetHashCode();
+ public static PhysicalAddress Parse(string address);
+ public override string ToString();
+ }
+ public class Ping : IDisposable {
+ public Ping();
+ public void Dispose();
+ protected virtual void Dispose(bool disposing);
+ public Task<PingReply> SendPingAsync(IPAddress address);
+ public Task<PingReply> SendPingAsync(IPAddress address, int timeout);
+ public Task<PingReply> SendPingAsync(IPAddress address, int timeout, byte[] buffer);
+ public Task<PingReply> SendPingAsync(IPAddress address, int timeout, byte[] buffer, PingOptions options);
+ public Task<PingReply> SendPingAsync(string hostNameOrAddress);
+ public Task<PingReply> SendPingAsync(string hostNameOrAddress, int timeout);
+ public Task<PingReply> SendPingAsync(string hostNameOrAddress, int timeout, byte[] buffer);
+ public Task<PingReply> SendPingAsync(string hostNameOrAddress, int timeout, byte[] buffer, PingOptions options);
+ }
+ public class PingException : InvalidOperationException {
+ public PingException(string message);
+ public PingException(string message, Exception innerException);
+ }
+ public class PingOptions {
+ public PingOptions();
+ public PingOptions(int ttl, bool dontFragment);
+ public bool DontFragment { get; set; }
+ public int Ttl { get; set; }
+ }
+ public class PingReply {
+ public IPAddress Address { get; }
+ public byte[] Buffer { get; }
+ public PingOptions Options { get; }
+ public long RoundtripTime { get; }
+ public IPStatus Status { get; }
+ }
+ public enum PrefixOrigin {
+ Dhcp = 3,
+ Manual = 1,
+ Other = 0,
+ RouterAdvertisement = 4,
+ WellKnown = 2,
+ }
+ public enum ScopeLevel {
+ Admin = 4,
+ Global = 14,
+ Interface = 1,
+ Link = 2,
+ None = 0,
+ Organization = 8,
+ Site = 5,
+ Subnet = 3,
+ }
+ public enum SuffixOrigin {
+ LinkLayerAddress = 4,
+ Manual = 1,
+ OriginDhcp = 3,
+ Other = 0,
+ Random = 5,
+ WellKnown = 2,
+ }
+ public abstract class TcpConnectionInformation {
+ protected TcpConnectionInformation();
+ public abstract IPEndPoint LocalEndPoint { get; }
+ public abstract IPEndPoint RemoteEndPoint { get; }
+ public abstract TcpState State { get; }
+ }
+ public enum TcpState {
+ Closed = 1,
+ CloseWait = 8,
+ Closing = 9,
+ DeleteTcb = 12,
+ Established = 5,
+ FinWait1 = 6,
+ FinWait2 = 7,
+ LastAck = 10,
+ Listen = 2,
+ SynReceived = 4,
+ SynSent = 3,
+ TimeWait = 11,
+ Unknown = 0,
+ }
+ public abstract class TcpStatistics {
+ protected TcpStatistics();
+ public abstract long ConnectionsAccepted { get; }
+ public abstract long ConnectionsInitiated { get; }
+ public abstract long CumulativeConnections { get; }
+ public abstract long CurrentConnections { get; }
+ public abstract long ErrorsReceived { get; }
+ public abstract long FailedConnectionAttempts { get; }
+ public abstract long MaximumConnections { get; }
+ public abstract long MaximumTransmissionTimeout { get; }
+ public abstract long MinimumTransmissionTimeout { get; }
+ public abstract long ResetConnections { get; }
+ public abstract long ResetsSent { get; }
+ public abstract long SegmentsReceived { get; }
+ public abstract long SegmentsResent { get; }
+ public abstract long SegmentsSent { get; }
+ }
+ public abstract class UdpStatistics {
+ protected UdpStatistics();
+ public abstract long DatagramsReceived { get; }
+ public abstract long DatagramsSent { get; }
+ public abstract long IncomingDatagramsDiscarded { get; }
+ public abstract long IncomingDatagramsWithErrors { get; }
+ public abstract int UdpListeners { get; }
+ }
+ public abstract class UnicastIPAddressInformation : IPAddressInformation {
+ protected UnicastIPAddressInformation();
+ public abstract long AddressPreferredLifetime { get; }
+ public abstract long AddressValidLifetime { get; }
+ public abstract long DhcpLeaseLifetime { get; }
+ public abstract DuplicateAddressDetectionState DuplicateAddressDetectionState { get; }
+ public abstract IPAddress IPv4Mask { get; }
+ public virtual int PrefixLength { get; }
+ public abstract PrefixOrigin PrefixOrigin { get; }
+ public abstract SuffixOrigin SuffixOrigin { get; }
+ }
+ public class UnicastIPAddressInformationCollection : ICollection<UnicastIPAddressInformation>, IEnumerable, IEnumerable<UnicastIPAddressInformation> {