Bagikan melalui


IPGlobalStatistics Kelas

Definisi

Menyediakan data statistik Protokol Internet (IP).

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

Contoh

Contoh kode berikut menampilkan statistik 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.GetIPv6GlobalStatistics();
            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("");
}

Keterangan

Kelas ini digunakan oleh GetIPv4GlobalStatistics metode dan GetIPv6GlobalStatistics untuk mengembalikan informasi lalu lintas IP.

Protokol Internet digunakan untuk memindahkan paket IP dari komputer sumber ke komputer tujuan. IP juga menangani pembagian paket yang terlalu besar menjadi beberapa paket yang cukup kecil untuk transportasi, dalam proses yang dikenal sebagai fragmentasi.

Properti di kelas ini berkorelasi dengan objek Basis Informasi Manajemen untuk IP yang ditentukan dalam IETF RFC 2011.

Konstruktor

IPGlobalStatistics()

Menginisialisasi instans baru kelas IPGlobalStatistics.

Properti

DefaultTtl

Mendapatkan nilai time-to-live (TTL) default untuk paket Protokol Internet (IP).

ForwardingEnabled

Boolean Mendapatkan nilai yang menentukan apakah penerusan paket Protokol Internet (IP) diaktifkan.

NumberOfInterfaces

Mendapatkan jumlah antarmuka jaringan.

NumberOfIPAddresses

Mendapatkan jumlah alamat Protokol Internet (IP) yang ditetapkan ke komputer lokal.

NumberOfRoutes

Mendapatkan jumlah rute dalam tabel perutean Protokol Internet (IP).

OutputPacketRequests

Mendapatkan jumlah paket Protokol Internet (IP) keluar.

OutputPacketRoutingDiscards

Mendapatkan jumlah rute yang telah dibuang dari tabel perutean.

OutputPacketsDiscarded

Mendapatkan jumlah paket Internet Protocol (IP) yang ditransmisikan yang telah dibuang.

OutputPacketsWithNoRoute

Mendapatkan jumlah paket Protokol Internet (IP) yang komputer lokalnya tidak dapat menentukan rute ke alamat tujuan.

PacketFragmentFailures

Mendapatkan jumlah paket Protokol Internet (IP) yang tidak dapat difragmentasi.

PacketReassembliesRequired

Mendapatkan jumlah paket Protokol Internet (IP) yang diperlukan untuk disusun ulang.

PacketReassemblyFailures

Mendapatkan jumlah paket Protokol Internet (IP) yang tidak berhasil disusun ulang.

PacketReassemblyTimeout

Mendapatkan jumlah waktu maksimum di mana semua fragmen paket Protokol Internet (IP) harus tiba.

PacketsFragmented

Mendapatkan jumlah paket Protokol Internet (IP) yang terfragmentasi.

PacketsReassembled

Mendapatkan jumlah paket Protokol Internet (IP) yang disusun ulang.

ReceivedPackets

Mendapatkan jumlah paket Protokol Internet (IP) yang diterima.

ReceivedPacketsDelivered

Mendapatkan jumlah paket Protokol Internet (IP) yang dikirimkan.

ReceivedPacketsDiscarded

Mendapatkan jumlah paket Protokol Internet (IP) yang telah diterima dan dibuang.

ReceivedPacketsForwarded

Mendapatkan jumlah paket Protokol Internet (IP) yang diteruskan.

ReceivedPacketsWithAddressErrors

Mendapatkan jumlah paket Protokol Internet (IP) dengan kesalahan alamat yang diterima.

ReceivedPacketsWithHeadersErrors

Mendapatkan jumlah paket Protokol Internet (IP) dengan kesalahan header yang diterima.

ReceivedPacketsWithUnknownProtocol

Mendapatkan jumlah paket Protokol Internet (IP) yang diterima pada komputer lokal dengan protokol yang tidak diketahui di header.

Metode

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan dari instans Type saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari saat ini Object.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk