C# Класс SnmpSharpNet.SnmpV1TrapPacket

SNMP version 1 TRAP packet class.
Available packet classes are:
  • SnmpV1Packet
  • SnmpV1TrapPacket
  • SnmpV2Packet
  • SnmpV3Packet
This class is provided to simplify encoding and decoding of packets and to provide consistent interface for users who wish to handle transport part of protocol on their own without using the UdpTarget class. SnmpPacket and derived classes have been developed to implement SNMP packet support. For SNMP version 1 and 2 packet, SnmpV1Packet and SnmpV2Packet classes provides sufficient support for encoding and decoding data to/from BER buffers to satisfy requirements of most applications. SNMP version 3 on the other hand requires a lot more information to be passed to the encoder method and returned by the decode method. Attempt of implementing SNMP version 3 as part of SnmpV3Packet class was operational but required too many function arguments to operate so a different interface was developed using dedicated SnmpV3Packet class.
Наследование: SnmpPacket
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_pdu TrapPdu
_snmpCommunity OctetString

Открытые методы

Метод Описание
SnmpV1TrapPacket ( ) : System

Standard constructor.

SnmpV1TrapPacket ( string snmpCommunity ) : System

Standard constructor.

decode ( byte buffer, int length ) : int

Decode received packet. This method overrides the base implementation that cannot be used with this type of the packet.

encode ( ) : byte[]

Encode SNMP packet for sending.

Описание методов

SnmpV1TrapPacket() публичный Метод

Standard constructor.
public SnmpV1TrapPacket ( ) : System
Результат System

SnmpV1TrapPacket() публичный Метод

Standard constructor.
public SnmpV1TrapPacket ( string snmpCommunity ) : System
snmpCommunity string SNMP community name for the packet
Результат System

decode() публичный Метод

Decode received packet. This method overrides the base implementation that cannot be used with this type of the packet.
public decode ( byte buffer, int length ) : int
buffer byte Packet buffer
length int Buffer length
Результат int

encode() публичный Метод

Encode SNMP packet for sending.
public encode ( ) : byte[]
Результат byte[]

Описание свойств

_pdu защищенное свойство

SNMP Protocol Data Unit
protected TrapPdu,SnmpSharpNet _pdu
Результат TrapPdu

_snmpCommunity защищенное свойство

SNMP community name
protected OctetString _snmpCommunity
Результат OctetString