IPGlobalStatistics Klasa

Definicja

Dostarcza dane statystyczne protokołu internetowego (IP).

public ref class IPGlobalStatistics abstract
public abstract class IPGlobalStatistics
type IPGlobalStatistics = class
Public MustInherit Class IPGlobalStatistics
Dziedziczenie
IPGlobalStatistics

Przykłady

W poniższym przykładzie kodu są wyświetlane statystyki adresów IP.

void ShowIPStatistics( NetworkInterfaceComponent version )
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IPGlobalStatistics ^ ipstat = nullptr;
   switch ( version )
   {
      case NetworkInterfaceComponent::IPv4:
         ipstat = properties->GetIPv4GlobalStatistics();
         Console::WriteLine( "{0}IPv4 Statistics ", Environment::NewLine );
         break;

      case NetworkInterfaceComponent::IPv6:
         ipstat = properties->GetIPv4GlobalStatistics();
         Console::WriteLine( "{0}IPv6 Statistics ", Environment::NewLine );
         break;

      default:
         throw gcnew ArgumentException( "version" );
         break;
   }

   Console::WriteLine( "  Forwarding enabled ...................... : {0}",
      ipstat->ForwardingEnabled );
   Console::WriteLine( "  Interfaces .............................. : {0}",
      ipstat->NumberOfInterfaces );
   Console::WriteLine( "  IP addresses ............................ : {0}",
      ipstat->NumberOfIPAddresses );
   Console::WriteLine( "  Routes .................................. : {0}",
      ipstat->NumberOfRoutes );
   Console::WriteLine( "  Default TTL ............................. : {0}",
      ipstat->DefaultTtl );
   Console::WriteLine( "" );
   Console::WriteLine( "  Inbound Packet Data:" );
   Console::WriteLine( "      Received ............................ : {0}",
      ipstat->ReceivedPackets );
   Console::WriteLine( "      Forwarded ........................... : {0}",
      ipstat->ReceivedPacketsForwarded );
   Console::WriteLine( "      Delivered ........................... : {0}",
      ipstat->ReceivedPacketsDelivered );
   Console::WriteLine( "      Discarded ........................... : {0}",
      ipstat->ReceivedPacketsDiscarded );
   Console::WriteLine( "      Header Errors ....................... : {0}",
      ipstat->ReceivedPacketsWithHeadersErrors );
   Console::WriteLine( "      Address Errors ...................... : {0}",
      ipstat->ReceivedPacketsWithAddressErrors );
   Console::WriteLine( "      Unknown Protocol Errors ............. : {0}",
      ipstat->ReceivedPacketsWithUnknownProtocol );
   Console::WriteLine( "" );
   Console::WriteLine( "  Outbound Packet Data:" );
   Console::WriteLine( "      Requested ........................... : {0}",
      ipstat->OutputPacketRequests );
   Console::WriteLine( "      Discarded ........................... : {0}",
      ipstat->OutputPacketsDiscarded );
   Console::WriteLine( "      No Routing Discards ................. : {0}",
      ipstat->OutputPacketsWithNoRoute );
   Console::WriteLine( "      Routing Entry Discards .............. : {0}",
      ipstat->OutputPacketRoutingDiscards );
   Console::WriteLine( "" );
   Console::WriteLine( "  Reassembly Data:" );
   Console::WriteLine( "      Reassembly Timeout .................. : {0}",
      ipstat->PacketReassemblyTimeout );
   Console::WriteLine( "      Reassemblies Required ............... : {0}",
      ipstat->PacketReassembliesRequired );
   Console::WriteLine( "      Packets Reassembled ................. : {0}",
      ipstat->PacketsReassembled );
   Console::WriteLine( "      Packets Fragmented .................. : {0}",
      ipstat->PacketsFragmented );
   Console::WriteLine( "      Fragment Failures ................... : {0}",
      ipstat->PacketFragmentFailures );
   Console::WriteLine( "" );
}
public static void ShowIPStatistics(NetworkInterfaceComponent version)
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = null;
    switch (version)
    {
        case NetworkInterfaceComponent.IPv4:
             ipstat = properties.GetIPv4GlobalStatistics();
           Console.WriteLine("{0}IPv4 Statistics ",Environment.NewLine);
            break;
        case NetworkInterfaceComponent.IPv6:
            ipstat = properties.GetIPv4GlobalStatistics();
            Console.WriteLine("{0}IPv6 Statistics ",Environment.NewLine);
            break;
        default:
            throw new ArgumentException("version");
        //    break;
    }
    Console.WriteLine("  Forwarding enabled ...................... : {0}",
        ipstat.ForwardingEnabled);
    Console.WriteLine("  Interfaces .............................. : {0}",
        ipstat.NumberOfInterfaces);
    Console.WriteLine("  IP addresses ............................ : {0}",
        ipstat.NumberOfIPAddresses);
    Console.WriteLine("  Routes .................................. : {0}",
        ipstat.NumberOfRoutes);
    Console.WriteLine("  Default TTL ............................. : {0}",
        ipstat.DefaultTtl);
    Console.WriteLine("");
    Console.WriteLine("  Inbound Packet Data:");
    Console.WriteLine("      Received ............................ : {0}",
        ipstat.ReceivedPackets);
    Console.WriteLine("      Forwarded ........................... : {0}",
        ipstat.ReceivedPacketsForwarded);
    Console.WriteLine("      Delivered ........................... : {0}",
        ipstat.ReceivedPacketsDelivered);
    Console.WriteLine("      Discarded ........................... : {0}",
        ipstat.ReceivedPacketsDiscarded);
    Console.WriteLine("      Header Errors ....................... : {0}",
        ipstat.ReceivedPacketsWithHeadersErrors);
    Console.WriteLine("      Address Errors ...................... : {0}",
        ipstat.ReceivedPacketsWithAddressErrors);
    Console.WriteLine("      Unknown Protocol Errors ............. : {0}",
        ipstat.ReceivedPacketsWithUnknownProtocol);
    Console.WriteLine("");
    Console.WriteLine("  Outbound Packet Data:");
    Console.WriteLine("      Requested ........................... : {0}",
         ipstat.OutputPacketRequests);
    Console.WriteLine("      Discarded ........................... : {0}",
        ipstat.OutputPacketsDiscarded);
    Console.WriteLine("      No Routing Discards ................. : {0}",
        ipstat.OutputPacketsWithNoRoute);
    Console.WriteLine("      Routing Entry Discards .............. : {0}",
        ipstat.OutputPacketRoutingDiscards);
    Console.WriteLine("");
    Console.WriteLine("  Reassembly Data:");
    Console.WriteLine("      Reassembly Timeout .................. : {0}",
        ipstat.PacketReassemblyTimeout);
    Console.WriteLine("      Reassemblies Required ............... : {0}",
        ipstat.PacketReassembliesRequired);
    Console.WriteLine("      Packets Reassembled ................. : {0}",
        ipstat.PacketsReassembled);
    Console.WriteLine("      Packets Fragmented .................. : {0}",
        ipstat.PacketsFragmented);
    Console.WriteLine("      Fragment Failures ................... : {0}",
        ipstat.PacketFragmentFailures);
    Console.WriteLine("");
}

Uwagi

Ta klasa jest używana przez GetIPv4GlobalStatistics metody i GetIPv6GlobalStatistics do zwracania informacji o ruchu IP.

Protokół internetowy służy do przenoszenia pakietów IP z komputera źródłowego na komputer docelowy. Adres IP obsługuje również dzielenie pakietu, który jest zbyt duży na wiele pakietów, które są wystarczająco małe do transportu, w procesie znanym jako fragmentacja.

Właściwości w tej klasie są skorelowane z obiektami bazy informacji zarządzania dla adresu IP zdefiniowanego w dokumencie IETF RFC 2011.

Konstruktory

IPGlobalStatistics()

Inicjuje nowe wystąpienie klasy IPGlobalStatistics.

Właściwości

DefaultTtl

Pobiera domyślną wartość czasu wygaśnięcia (TTL) dla pakietów protokołu internetowego (IP).

ForwardingEnabled

Pobiera wartość określającą Boolean , czy przekazywanie pakietów protokołu internetowego (IP) jest włączone.

NumberOfInterfaces

Pobiera liczbę interfejsów sieciowych.

NumberOfIPAddresses

Pobiera liczbę adresów IP przypisanych do komputera lokalnego.

NumberOfRoutes

Pobiera liczbę tras w tabeli routingu protokołu internetowego (IP).

OutputPacketRequests

Pobiera liczbę wychodzących pakietów protokołu internetowego (IP).

OutputPacketRoutingDiscards

Pobiera liczbę tras, które zostały odrzucone z tabeli routingu.

OutputPacketsDiscarded

Pobiera liczbę przesłanych pakietów protokołu internetowego (IP), które zostały odrzucone.

OutputPacketsWithNoRoute

Pobiera liczbę pakietów protokołu internetowego (IP), dla których komputer lokalny nie może określić trasy do adresu docelowego.

PacketFragmentFailures

Pobiera liczbę pakietów protokołu internetowego (IP), których nie można rozdrobnić.

PacketReassembliesRequired

Pobiera liczbę pakietów protokołu internetowego (IP), które wymagały ponownego ponownego rozsyłania.

PacketReassemblyFailures

Pobiera liczbę pakietów protokołu internetowego (IP), które nie zostały pomyślnie ponownie rozsyłane.

PacketReassemblyTimeout

Pobiera maksymalny czas, w którym wszystkie fragmenty pakietu protokołu internetowego (IP) muszą zostać dostarczone.

PacketsFragmented

Pobiera liczbę pakietów protokołu internetowego (IP) pofragmentowanych.

PacketsReassembled

Pobiera liczbę pakietów protokołu internetowego (IP) ponownie rozsyłanych.

ReceivedPackets

Pobiera liczbę odebranych pakietów protokołu internetowego (IP).

ReceivedPacketsDelivered

Pobiera liczbę dostarczonych pakietów protokołu internetowego (IP).

ReceivedPacketsDiscarded

Pobiera liczbę pakietów protokołu internetowego (IP), które zostały odebrane i odrzucone.

ReceivedPacketsForwarded

Pobiera liczbę przesłanych dalej pakietów protokołu internetowego (IP).

ReceivedPacketsWithAddressErrors

Pobiera liczbę pakietów protokołu internetowego (IP) z błędami, które zostały odebrane.

ReceivedPacketsWithHeadersErrors

Pobiera liczbę pakietów protokołu internetowego (IP) z błędami nagłówka, które zostały odebrane.

ReceivedPacketsWithUnknownProtocol

Pobiera liczbę pakietów protokołu internetowego (IP) odebranych na komputerze lokalnym z nieznanym protokołem w nagłówku.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy