程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> VC >> 關於VC++ >> 使用SNMP編輯(添加/刪除/修改)ARP表

使用SNMP編輯(添加/刪除/修改)ARP表

編輯:關於VC++

介紹

這個工具像Windows命令行工具arp.exe一樣顯示和修改IP/物理地址轉表(ARP表).

該工具將做兩件事情:

1)顯示ARP表

2)添加、刪除、修改ARP表

這兩項工作通過SNMP(簡單網絡管理協議)擴展庫來完成。

通過SNMP處理IP和MAC地址

你可以通過SNMP讀取或修改ARP表,通過SNMP得到或設置對象信息。SNMP命令的請求與響應是依靠MIB(管理信息庫)來完成的。

MIB為樹裝結構,MIB擁有所有為我們所用的可管理對象,更多的信息可以參考RFC1213(http://www.ietf.org/rfc/rfc1213.txt),

也可以查看文件:%SystemRoot%\system32\*.mib,您可以用notepad.exe打開並查看%SystemRoot%\system32\mib_ii.mib中的所有條目。

下面是MIB ipNetToMediaEntry條目

ipNetToMediaEntry OBJECT-TYPE
       SYNTAX IpNetToMediaEntry
       ACCESS not-accessible
       STATUS mandatory
       DESCRIPTION
           "Each entry contains one IpAddress to 'physical'
           address equivalence."
       INDEX  { ipNetToMediaIfIndex,
            ipNetToMediaNetAddress }
       ::= { ipNetToMediaTable 1 }

MIB通過OID(對象標識)數字來存取對象,每個對象擁有一個數字,子對象擁有父對象的數字和自己的數字,數字之間用"."來分割。例如:父對象數字為"1",子對象數字為"3",則子對象OID為"1.3",子對象的子對象可以是"1.3.6",..."1.3.6.1.2.1"等等...

下面是對象樹的簡單框圖:

類的初始化

我們使用SnmpExtensionQuery函數來發送SNMP請求,使用之前我們必須調用SnmpExtensionInit來初始化SNMP擴展代理DLL。

這兩個函數包含於Microsoft的inetmib1.dll中.

因此我們在類的構造函數中加載動態庫並得到函數的地址,然後調用SnmpExtensionInit初始化SNMP擴展代理DLL。

下面是CARP類的構造函數

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CARP::CARP()
{
  // Load dynamic library: inetmib1.dll
  hMIBLibrary  = LoadLibrary(TEXT("inetmib1.dll"));
  // If library loaded, get addresses of (SnmpExtensionInit, pfnSnmpExtensionQuery) functions
  if (hMIBLibrary)
  {
    pfnSnmpExtensionInit  = (PFNSNMPEXTENSIONINIT) GetProcAddress(hMIBLibrary, "SnmpExtensionInit");
    pfnSnmpExtensionQuery  = (PFNSNMPEXTENSIONQUERY) GetProcAddress(hMIBLibrary, "SnmpExtensionQuery");
    // If success get addresses and initialize SNMP, bInitialized = true
    if (pfnSnmpExtensionInit && pfnSnmpExtensionQuery)
    {
      HANDLE       hPollForTrapEvent;
      AsnObjectIdentifier aoiSupportedView;
      bInitialized    = pfnSnmpExtensionInit(0, &hPollForTrapEvent, &aoiSupportedView);
    }
  }
  else
  {
    // If fail to get addresses, bInitialized = false
    bInitialized      = FALSE;
    AfxMessageBox(_T("Load library fail"));
  }
}

得到ARP條目

函數GetEntries類似arp.exe -a,可以得到ARP條目,函數有三個參數:

PTable指針指向arpTable結構數組,用於填充IP和MAC地址。

TableLength是數組長度

AdapterIndex是NIC適配器的編號。

我使用3個OID來得到ARP表條目:

OID[0] = "1.3.6.1.2.1.4.22.1.1" ,得到接口索引號。

然後和OID[1] = "1.3.6.1.2.1.4.22.1.2"比較,得到IP和MAC地址

OID[2] = "1.3.6.1.2.1.4.22.1.4", 得到條目類型(靜態或動態)//-----------------------------------------------------------------------
// Function:     GetEntries: Read ARP table for specific NIC interface.
//
// Parameters:
//  pTable     Pointer to array of arpTable struct
//  TableLength   Length of the array
//  AdapterIndex  NIC Adapter index number
//
// Returns:
//          Number of read ARP entries
//-----------------------------------------------------------------------
int CARP::GetEntries(arpTable* pTable, int TableLength, int AdapterIndex)
{
  // Be sure initialize SNMP true
  if (!bInitialized)
    return 0;
  SnmpVarBindList    SVBList[3];
  SnmpVarBind      SVBVars[3];
  UINT          OID[3][10];
  AsnInteger32      aiErrorStatus[3], aiErrorIndex[3];
  AsnObjectIdentifier  AsnOID0 = {sizeof(OID[0])/sizeof(UINT), OID[0]};
  AsnObjectIdentifier  AsnOID1 = {sizeof(OID[1])/sizeof(UINT), OID[1]};
  AsnObjectIdentifier  AsnOID2 = {sizeof(OID[2])/sizeof(UINT), OID[2]};
  unsigned long     pIPAddress;
  unsigned long     pMACAddress;
  int          iEntries;

  //-----------------------------------------------------------------------
  //  Fill array of 3 OIDs
  //
  //  OID[0]  : "1.3.6.1.2.1.4.22.1.1", ipNetToMediaIfIndex
  //        The interface on which this entry's equivalence is effective
  //
  //  OID[1]  : "1.3.6.1.2.1.4.22.1.2", ipNetToMediaPhysAddress
  //        The media-dependent 'physical' address
  //
  //  OID[2]  : "1.3.6.1.2.1.4.22.1.4", ipNetToMediaType
  //        Entry type: 1:Other, 2:Invalid(Remove), 3:Dynamic, 4:Static
  //
  for (int count=0; count<3; count++)
  {
    OID[count][0]    = 1;
    OID[count][1]    = 3;
    OID[count][2]    = 6;
    OID[count][3]    = 1;
    OID[count][4]    = 2;
    OID[count][5]    = 1;
    OID[count][6]    = 4;
    OID[count][7]    = 22;
    OID[count][8]    = 1;
    switch(count)
    {
    case 0:
      // Adapter interface
      OID[count][9]  = 1;
      break;
    case 1:
      // MAC address
      OID[count][9]  = 2;
      break;
    case 2:
      // Entry Type
      OID[count][9]  = 4;
      break;
    }
  }
  ZeroMemory(pTable, sizeof(arpTable)*TableLength);
  SVBList[0].len = 1;
  SVBList[0].list = &SVBVars[0];
  SnmpUtilOidCpy(&SVBVars[0].name, &AsnOID0);
  SVBList[1].len = 1;
  SVBList[1].list = &SVBVars[1];
  SnmpUtilOidCpy(&SVBVars[1].name, &AsnOID1);
  SVBList[2].len = 1;
  SVBList[2].list = &SVBVars[2];
  SnmpUtilOidCpy(&SVBVars[2].name, &AsnOID2);
  iEntries    = 0;
  do
  {
    aiErrorStatus[0]  = 0;
    aiErrorIndex[0]   = 0;
    aiErrorStatus[1]  = 0;
    aiErrorIndex[1]   = 0;
    aiErrorStatus[2]  = 0;
    aiErrorIndex[2]   = 0;
    // Query information of 3 OIDs
    if (pfnSnmpExtensionQuery(SNMP_PDU_GETNEXT, &SVBList[0], &aiErrorStatus[0], &aiErrorIndex[0]))
      if (pfnSnmpExtensionQuery(SNMP_PDU_GETNEXT, &SVBList[1], &aiErrorStatus[1], &aiErrorIndex[1]))
        if (pfnSnmpExtensionQuery(SNMP_PDU_GETNEXT, &SVBList[2], &aiErrorStatus[2], &aiErrorIndex[2]))
          if (aiErrorStatus[0] == SNMP_ERRORSTATUS_NOERROR &&
            aiErrorStatus[1] == SNMP_ERRORSTATUS_NOERROR &&
            aiErrorStatus[2] == SNMP_ERRORSTATUS_NOERROR) // Check for error
          {
            //-----------------------------------------------------------------------
            // From MSDN Help: http://msdn2.microsoft.com/en-us/library/aa378021.aspx
            //
            // If the extension agent cannot resolve the variable bindings on a Get Next request,
            // it must change the name field of the SnmpVarBind structure to the value of the object
            // identifier immediately following that of the currently supported MIB subtree view.
            // For example, if the extension agent supports view ".1.3.6.1.4.1.77.1", a Get Next
            // request on ".1.3.6.1.4.1.77.1.5.1" would result in a modified name field of ".1.3.6.1.4.1.77.2".
            // This signals the SNMP service to continue the attempt to resolve the variable bindings
            // with other extension agents
            //-----------------------------------------------------------------------
            if(SnmpUtilOidNCmp(&SVBVars[0].name, &AsnOID0, AsnOID0.idLength))
              break;
            if(SnmpUtilOidNCmp(&SVBVars[1].name, &AsnOID1, AsnOID1.idLength))
              break;
            if(SnmpUtilOidNCmp(&SVBVars[2].name, &AsnOID2, AsnOID2.idLength))
              break;
            // Verify selected Adapter interface
            if (AdapterIndex == SVBList[0].list->value.asnValue.number)
            {
              // pIPAddress get pointer ro IP Address
              pIPAddress    = (unsigned long)SVBList[1].list->name.ids;
              pTable[iEntries].IPAddress[0]  = *(unsigned char *)(pIPAddress + 44);
              pTable[iEntries].IPAddress[1]  = *(unsigned char *)(pIPAddress + 48);
              pTable[iEntries].IPAddress[2]  = *(unsigned char *)(pIPAddress + 52);
              pTable[iEntries].IPAddress[3]  = *(unsigned char *)(pIPAddress + 56);
              // pIPAddress get pointer ro MAC Address
              pMACAddress    = (unsigned long)SVBList[1].list->value.asnValue.string.stream;
              if (pMACAddress)
              {
                pTable[iEntries].MACAddress[0]  = *(unsigned char *)(pMACAddress + 0);
                pTable[iEntries].MACAddress[1]  = *(unsigned char *)(pMACAddress + 1);
                pTable[iEntries].MACAddress[2]  = *(unsigned char *)(pMACAddress + 2);
                pTable[iEntries].MACAddress[3]  = *(unsigned char *)(pMACAddress + 3);
                pTable[iEntries].MACAddress[4]  = *(unsigned char *)(pMACAddress + 4);
                pTable[iEntries].MACAddress[5]  = *(unsigned char *)(pMACAddress + 5);
              }
              // Entry Type
              pTable[iEntries].Type  = (unsigned long)SVBList[2].list->value.asnValue.number;
              // Type must be one of (1, 2, 3, 4)
              if (pTable[iEntries].Type>=1 && pTable[iEntries].Type<=4)
                iEntries++;    // Move to next array position
            }
          }
          else
            break;  // If error exit do-while
  }
  while(iEntries < TableLength);
  // Frees the memory allocated for the specified object identifiers
  SnmpUtilOidFree(&SVBVars[2].name);
  SnmpUtilOidFree(&SVBVars[1].name);
  SnmpUtilOidFree(&SVBVars[0].name);
  return iEntries;  // Return number of Entries
}

編輯ARP表條目

EditEntry函數可以添加、修改、刪除ARP條目。

添加動態條目,就像:arp.exe 1.2.3.4 11-22-33-44-55-66

添加靜態條目,就像:arp.exe –s 1.2.3.4 11-22-33-44-55-66

刪除條目,就像:arp.exe –d 1.2.3.4

添加新條目,如果IP地址在ARP表中不存在則添加進去,如果已經存在則被更新。

刪除條目,只需要提供NIC接口中的IP地址,MAC地址不需要提供。

函數有四個參數:4字節的IPAddress,6字節的MACAddress,條目類型(2:刪除,

3:動態,4:靜態)

AdapterIndex:NIC適配器編號

我使用4個OID設置ARP表條目:

OID[0] = "1.3.6.1.2.1.4.22.1.1", 設置接口編號

OID[1] = "1.3.6.1.2.1.4.22.1.2", 設置MAC地址

OID[3] = "1.3.6.1.2.1.4.22.1.3", 設置IP地址

OID[2] = "1.3.6.1.2.1.4.22.1.4", 設置條目類型 (靜態或動態), 或刪除

//-----------------------------------------------------------------------
// Function:  EditEntry: Add/Modify/Remove ARP entry for specific NIC interface.
//
// Parameters:
//  IPAddress    Array of 4 BYTES, 4 octs of IP Address
//  MACAddress   Array of 4 BYTES, 6 octs of MAC Address
//  Type      Entry type (2:Remove, 3:Dynamic, 4:Static)
//  AdapterIndex  NIC Adapter index number
//
// Returns:
//          TRUE if set successfully, FALSE otherwise.
//-----------------------------------------------------------------------
BOOL CARP::EditEntry(unsigned char IPAddress[4], unsigned char MACAddress[6], unsigned long Type, int AdapterIndex)
{
  if (!bInitialized)
    return 0;
  SnmpVarBindList   SVBList;
  SnmpVarBind     SVBVars[4];
  UINT        OID[4][10];
  AsnInteger32    aiErrorStatus, aiErrorIndex;
  BOOL        bReturn  = FALSE;
  //-----------------------------------------------------------------------
  //  Fill array of 4 OIDs
  //
  //  OID[0]  : "1.3.6.1.2.1.4.22.1.1", ipNetToMediaIfIndex
  //        The interface on which this entry's equivalence is effective
  //
  //  OID[1]  : "1.3.6.1.2.1.4.22.1.2", ipNetToMediaPhysAddress
  //        The media-dependent 'physical' address
  //
  //  OID[2]  : "1.3.6.1.2.1.4.22.1.3", ipNetToMediaNetAddress
  //        The IpAddress corresponding to the media-dependent 'physical' address
  //
  //  OID[3]  : "1.3.6.1.2.1.4.22.1.4", ipNetToMediaType
  //        Entry type: 1:Other, 2:Invalid(Remove), 3:Dynamic, 4:Static
  //-----------------------------------------------------------------------
  for (int count=0; count<4; count++)
  {
    OID[count][0]    = 1;
    OID[count][1]    = 3;
    OID[count][2]    = 6;
    OID[count][3]    = 1;
    OID[count][4]    = 2;
    OID[count][5]    = 1;
    OID[count][6]    = 4;
    OID[count][7]    = 22;
    OID[count][8]    = 1;
    OID[count][9]    = 1 + count;
    switch(count)
    {
    case 0:
      //  OID[0]  : "1.3.6.1.2.1.4.22.1.1", ipNetToMediaIfIndex
      //        The interface on which this entry's equivalence is effective
      SVBVars[count].value.asnType        = ASN_INTEGER;
      SVBVars[count].value.asnValue.number    = AdapterIndex;
      break;
    case 1:
      //  OID[1]  : "1.3.6.1.2.1.4.22.1.2", ipNetToMediaPhysAddress
      //        The media-dependent 'physical' address
      SVBVars[count].value.asnType        = ASN_OCTETSTRING;
      SVBVars[count].value.asnValue.string.stream = MACAddress;
      SVBVars[count].value.asnValue.string.length = 6;  // MAC Address length
      SVBVars[count].value.asnValue.string.dynamic= FALSE;
      break;
    case 2:
      //  OID[2]  : "1.3.6.1.2.1.4.22.1.3", ipNetToMediaNetAddress
      //        The IpAddress corresponding to the media-dependent 'physical' address
      SVBVars[count].value.asnType        = ASN_IPADDRESS;
      SVBVars[count].value.asnValue.string.stream = IPAddress;
      SVBVars[count].value.asnValue.string.length = 4;  // IP Address length
      SVBVars[count].value.asnValue.string.dynamic= FALSE;
      break;
    case 3:
      //  OID[3]  : "1.3.6.1.2.1.4.22.1.4", ipNetToMediaType
      //        Entry type: 2:Remove, 3:Dynamic, 4:Static
      SVBVars[count].value.asnType        = ASN_INTEGER;
      SVBVars[count].value.asnValue.number    = Type;
      break;
    }
    AsnObjectIdentifier  AsnOID = {sizeof(OID[count])/sizeof(UINT), OID[count]};
    SnmpUtilOidCpy(&SVBVars[count].name, &AsnOID);
  }
  SVBList.len   = 4;
  SVBList.list  = SVBVars;
  aiErrorStatus  = 0;
  aiErrorIndex  = 0;
  // Set information of entry (4 OIDs)
  if (pfnSnmpExtensionQuery(SNMP_PDU_SET, &SVBList, &aiErrorStatus, &aiErrorIndex))
    if (aiErrorStatus == SNMP_ERRORSTATUS_NOERROR)
      bReturn = TRUE; // If success set bReturn = true
  // Frees the memory allocated for the specified object identifiers
  SnmpUtilOidFree(&SVBVars[3].name);
  SnmpUtilOidFree(&SVBVars[2].name);
  SnmpUtilOidFree(&SVBVars[1].name);
  SnmpUtilOidFree(&SVBVars[0].name);
  return bReturn;    // TRUE if set successfully, FALSE otherwise.
}

你也可以用同樣的方法采用合適的OID,添加、修改、刪除路由表信息,具體參考RFC1213。

mib-2          node     1.3.6.1.2.1
system         node     1.3.6.1.2.1.1
sysDescr        scalar    1.3.6.1.2.1.1.1
sysObjectID       scalar    1.3.6.1.2.1.1.2
sysUpTime        scalar    1.3.6.1.2.1.1.3
sysContact       scalar    1.3.6.1.2.1.1.4
sysName         scalar    1.3.6.1.2.1.1.5
sysLocation       scalar    1.3.6.1.2.1.1.6
sysServices       scalar    1.3.6.1.2.1.1.7
interfaces       node     1.3.6.1.2.1.2
ifNumber        scalar    1.3.6.1.2.1.2.1
ifTable         table    1.3.6.1.2.1.2.2
ifEntry         row     1.3.6.1.2.1.2.2.1
ifIndex         column    1.3.6.1.2.1.2.2.1.1
ifDescr         column    1.3.6.1.2.1.2.2.1.2
ifType         column    1.3.6.1.2.1.2.2.1.3
ifMtu          column    1.3.6.1.2.1.2.2.1.4
ifSpeed         column    1.3.6.1.2.1.2.2.1.5
ifPhysAddress      column    1.3.6.1.2.1.2.2.1.6
ifAdminStatus      column    1.3.6.1.2.1.2.2.1.7
ifOperStatus      column    1.3.6.1.2.1.2.2.1.8
ifLastChange      column    1.3.6.1.2.1.2.2.1.9
ifInOctets       column    1.3.6.1.2.1.2.2.1.10
ifInUcastPkts      column    1.3.6.1.2.1.2.2.1.11
ifInNUcastPkts     column    1.3.6.1.2.1.2.2.1.12
ifInDiscards      column    1.3.6.1.2.1.2.2.1.13
ifInErrors       column    1.3.6.1.2.1.2.2.1.14
ifInUnknownProtos    column    1.3.6.1.2.1.2.2.1.15
ifOutOctets       column    1.3.6.1.2.1.2.2.1.16
ifOutUcastPkts     column    1.3.6.1.2.1.2.2.1.17
ifOutNUcastPkts     column    1.3.6.1.2.1.2.2.1.18
ifOutDiscards      column    1.3.6.1.2.1.2.2.1.19
ifOutErrors       column    1.3.6.1.2.1.2.2.1.20
ifOutQLen        column    1.3.6.1.2.1.2.2.1.21
ifSpecific       column    1.3.6.1.2.1.2.2.1.22
at           node     1.3.6.1.2.1.3
atTable         table    1.3.6.1.2.1.3.1
atEntry         row     1.3.6.1.2.1.3.1.1
atIfIndex        column    1.3.6.1.2.1.3.1.1.1
atPhysAddress      column    1.3.6.1.2.1.3.1.1.2
atNetAddress      column    1.3.6.1.2.1.3.1.1.3
ip           node     1.3.6.1.2.1.4
ipForwarding      scalar    1.3.6.1.2.1.4.1
ipDefaultTTL      scalar    1.3.6.1.2.1.4.2
ipInReceives      scalar    1.3.6.1.2.1.4.3
ipInHdrErrors      scalar    1.3.6.1.2.1.4.4
ipInAddrErrors     scalar    1.3.6.1.2.1.4.5
ipForwDatagrams     scalar    1.3.6.1.2.1.4.6
ipInUnknownProtos    scalar    1.3.6.1.2.1.4.7
ipInDiscards      scalar    1.3.6.1.2.1.4.8
ipInDelivers      scalar    1.3.6.1.2.1.4.9
ipOutRequests      scalar    1.3.6.1.2.1.4.10
ipOutDiscards      scalar    1.3.6.1.2.1.4.11
ipOutNoRoutes      scalar    1.3.6.1.2.1.4.12
ipReasmTimeout     scalar    1.3.6.1.2.1.4.13
ipReasmReqds      scalar    1.3.6.1.2.1.4.14
ipReasmOKs       scalar    1.3.6.1.2.1.4.15
ipReasmFails      scalar    1.3.6.1.2.1.4.16
ipFragOKs        scalar    1.3.6.1.2.1.4.17
ipFragFails       scalar    1.3.6.1.2.1.4.18
ipFragCreates      scalar    1.3.6.1.2.1.4.19
ipAddrTable       table    1.3.6.1.2.1.4.20
ipAddrEntry       row     1.3.6.1.2.1.4.20.1
ipAdEntAddr       column    1.3.6.1.2.1.4.20.1.1
ipAdEntIfIndex     column    1.3.6.1.2.1.4.20.1.2
ipAdEntNetMask     column    1.3.6.1.2.1.4.20.1.3
ipAdEntBcastAddr    column    1.3.6.1.2.1.4.20.1.4
ipAdEntReasmMaxSize   column    1.3.6.1.2.1.4.20.1.5
ipRouteTable      table    1.3.6.1.2.1.4.21
ipRouteEntry      row     1.3.6.1.2.1.4.21.1
ipRouteDest       column    1.3.6.1.2.1.4.21.1.1
ipRouteIfIndex     column    1.3.6.1.2.1.4.21.1.2
ipRouteMetric1     column    1.3.6.1.2.1.4.21.1.3
ipRouteMetric2     column    1.3.6.1.2.1.4.21.1.4
ipRouteMetric3     column    1.3.6.1.2.1.4.21.1.5
ipRouteMetric4     column    1.3.6.1.2.1.4.21.1.6
ipRouteNextHop     column    1.3.6.1.2.1.4.21.1.7
ipRouteType       column    1.3.6.1.2.1.4.21.1.8
ipRouteProto      column    1.3.6.1.2.1.4.21.1.9
ipRouteAge       column    1.3.6.1.2.1.4.21.1.10
ipRouteMask       column    1.3.6.1.2.1.4.21.1.11
ipRouteMetric5     column    1.3.6.1.2.1.4.21.1.12
ipRouteInfo       column    1.3.6.1.2.1.4.21.1.13
ipNetToMediaTable    table    1.3.6.1.2.1.4.22
ipNetToMediaEntry    row     1.3.6.1.2.1.4.22.1
ipNetToMediaIfIndex   column    1.3.6.1.2.1.4.22.1.1
ipNetToMediaPhysAddress column    1.3.6.1.2.1.4.22.1.2
ipNetToMediaNetAddress column    1.3.6.1.2.1.4.22.1.3
ipNetToMediaType    column    1.3.6.1.2.1.4.22.1.4
ipRoutingDiscards    scalar    1.3.6.1.2.1.4.23
icmp          node     1.3.6.1.2.1.5
icmpInMsgs       scalar    1.3.6.1.2.1.5.1
icmpInErrors      scalar    1.3.6.1.2.1.5.2
icmpInDestUnreachs   scalar    1.3.6.1.2.1.5.3
icmpInTimeExcds     scalar    1.3.6.1.2.1.5.4
icmpInParmProbs     scalar    1.3.6.1.2.1.5.5
icmpInSrcQuenchs    scalar    1.3.6.1.2.1.5.6
icmpInRedirects     scalar    1.3.6.1.2.1.5.7
icmpInEchos       scalar    1.3.6.1.2.1.5.8
icmpInEchoReps     scalar    1.3.6.1.2.1.5.9
icmpInTimestamps    scalar    1.3.6.1.2.1.5.10
icmpInTimestampReps   scalar    1.3.6.1.2.1.5.11
icmpInAddrMasks     scalar    1.3.6.1.2.1.5.12
icmpInAddrMaskReps   scalar    1.3.6.1.2.1.5.13
icmpOutMsgs       scalar    1.3.6.1.2.1.5.14
icmpOutErrors      scalar    1.3.6.1.2.1.5.15
icmpOutDestUnreachs   scalar    1.3.6.1.2.1.5.16
icmpOutTimeExcds    scalar    1.3.6.1.2.1.5.17
icmpOutParmProbs    scalar    1.3.6.1.2.1.5.18
icmpOutSrcQuenchs    scalar    1.3.6.1.2.1.5.19
icmpOutRedirects    scalar    1.3.6.1.2.1.5.20
icmpOutEchos      scalar    1.3.6.1.2.1.5.21
icmpOutEchoReps     scalar    1.3.6.1.2.1.5.22
icmpOutTimestamps    scalar    1.3.6.1.2.1.5.23
icmpOutTimestampReps  scalar    1.3.6.1.2.1.5.24
icmpOutAddrMasks    scalar    1.3.6.1.2.1.5.25
icmpOutAddrMaskReps   scalar    1.3.6.1.2.1.5.26
tcp           node     1.3.6.1.2.1.6
tcpRtoAlgorithm     scalar    1.3.6.1.2.1.6.1
tcpRtoMin        scalar    1.3.6.1.2.1.6.2
tcpRtoMax        scalar    1.3.6.1.2.1.6.3
tcpMaxConn       scalar    1.3.6.1.2.1.6.4
tcpActiveOpens     scalar    1.3.6.1.2.1.6.5
tcpPassiveOpens     scalar    1.3.6.1.2.1.6.6
tcpAttemptFails     scalar    1.3.6.1.2.1.6.7
tcpEstabResets     scalar    1.3.6.1.2.1.6.8
tcpCurrEstab      scalar    1.3.6.1.2.1.6.9
tcpInSegs        scalar    1.3.6.1.2.1.6.10
tcpOutSegs       scalar    1.3.6.1.2.1.6.11
tcpRetransSegs     scalar    1.3.6.1.2.1.6.12
tcpConnTable      table    1.3.6.1.2.1.6.13
tcpConnEntry      row     1.3.6.1.2.1.6.13.1
tcpConnState      column    1.3.6.1.2.1.6.13.1.1
tcpConnLocalAddress   column    1.3.6.1.2.1.6.13.1.2
tcpConnLocalPort    column    1.3.6.1.2.1.6.13.1.3
tcpConnRemAddress    column    1.3.6.1.2.1.6.13.1.4
tcpConnRemPort     column    1.3.6.1.2.1.6.13.1.5
tcpInErrs        scalar    1.3.6.1.2.1.6.14
tcpOutRsts       scalar    1.3.6.1.2.1.6.15
udp           node     1.3.6.1.2.1.7
udpInDatagrams     scalar    1.3.6.1.2.1.7.1
udpNoPorts       scalar    1.3.6.1.2.1.7.2
udpInErrors       scalar    1.3.6.1.2.1.7.3
udpOutDatagrams     scalar    1.3.6.1.2.1.7.4
udpTable        table    1.3.6.1.2.1.7.5
udpEntry        row     1.3.6.1.2.1.7.5.1
udpLocalAddress     column    1.3.6.1.2.1.7.5.1.1
udpLocalPort      column    1.3.6.1.2.1.7.5.1.2
egp           node     1.3.6.1.2.1.8
egpInMsgs        scalar    1.3.6.1.2.1.8.1
egpInErrors       scalar    1.3.6.1.2.1.8.2
egpOutMsgs       scalar    1.3.6.1.2.1.8.3
egpOutErrors      scalar    1.3.6.1.2.1.8.4
egpNeighTable      table    1.3.6.1.2.1.8.5
egpNeighEntry      row     1.3.6.1.2.1.8.5.1
egpNeighState      column    1.3.6.1.2.1.8.5.1.1
egpNeighAddr      column    1.3.6.1.2.1.8.5.1.2
egpNeighAs       column    1.3.6.1.2.1.8.5.1.3
egpNeighInMsgs     column    1.3.6.1.2.1.8.5.1.4
egpNeighInErrs     column    1.3.6.1.2.1.8.5.1.5
egpNeighOutMsgs     column    1.3.6.1.2.1.8.5.1.6
egpNeighOutErrs     column    1.3.6.1.2.1.8.5.1.7
egpNeighInErrMsgs    column    1.3.6.1.2.1.8.5.1.8
egpNeighOutErrMsgs   column    1.3.6.1.2.1.8.5.1.9
egpNeighStateUps    column    1.3.6.1.2.1.8.5.1.10
egpNeighStateDowns   column    1.3.6.1.2.1.8.5.1.11
egpNeighIntervalHello  column    1.3.6.1.2.1.8.5.1.12
egpNeighIntervalPoll  column    1.3.6.1.2.1.8.5.1.13
egpNeighMode      column    1.3.6.1.2.1.8.5.1.14
egpNeighEventTrigger  column    1.3.6.1.2.1.8.5.1.15
egpAs          scalar    1.3.6.1.2.1.8.6
transmission      node     1.3.6.1.2.1.10
snmp          node     1.3.6.1.2.1.11
snmpInPkts       scalar    1.3.6.1.2.1.11.1
snmpOutPkts       scalar    1.3.6.1.2.1.11.2
snmpInBadVersions    scalar    1.3.6.1.2.1.11.3
snmpInBadCommunityNames scalar    1.3.6.1.2.1.11.4
snmpInBadCommunityUses scalar    1.3.6.1.2.1.11.5
snmpInASNParseErrs   scalar    1.3.6.1.2.1.11.6
snmpInTooBigs      scalar    1.3.6.1.2.1.11.8
snmpInNoSuchNames    scalar    1.3.6.1.2.1.11.9
snmpInBadValues     scalar    1.3.6.1.2.1.11.10
snmpInReadOnlys     scalar    1.3.6.1.2.1.11.11
snmpInGenErrs      scalar    1.3.6.1.2.1.11.12
snmpInTotalReqVars   scalar    1.3.6.1.2.1.11.13
snmpInTotalSetVars   scalar    1.3.6.1.2.1.11.14
snmpInGetRequests    scalar    1.3.6.1.2.1.11.15
snmpInGetNexts     scalar    1.3.6.1.2.1.11.16
snmpInSetRequests    scalar    1.3.6.1.2.1.11.17
snmpInGetResponses   scalar    1.3.6.1.2.1.11.18
snmpInTraps       scalar    1.3.6.1.2.1.11.19
snmpOutTooBigs     scalar    1.3.6.1.2.1.11.20
snmpOutNoSuchNames   scalar    1.3.6.1.2.1.11.21
snmpOutBadValues    scalar    1.3.6.1.2.1.11.22
snmpOutGenErrs     scalar    1.3.6.1.2.1.11.24
snmpOutGetRequests   scalar    1.3.6.1.2.1.11.25
snmpOutGetNexts     scalar    1.3.6.1.2.1.11.26
snmpOutSetRequests   scalar    1.3.6.1.2.1.11.27
snmpOutGetResponses   scalar    1.3.6.1.2.1.11.28
snmpOutTraps      scalar    1.3.6.1.2.1.11.29
snmpEnableAuthenTraps  scalar    1.3.6.1.2.1.11.30

(全文完)

本文配套源碼

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved