C# Class 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.
Inheritance: SnmpPacket
Afficher le fichier Open project: griffina/SnmpSharpNet Class Usage Examples

Protected Properties

Свойство Type Description
_pdu TrapPdu
_snmpCommunity OctetString

Méthodes publiques

Méthode Description
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.

Method Details

SnmpV1TrapPacket() public méthode

Standard constructor.
public SnmpV1TrapPacket ( ) : System
Résultat System

SnmpV1TrapPacket() public méthode

Standard constructor.
public SnmpV1TrapPacket ( string snmpCommunity ) : System
snmpCommunity string SNMP community name for the packet
Résultat System

decode() public méthode

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
Résultat int

encode() public méthode

Encode SNMP packet for sending.
public encode ( ) : byte[]
Résultat byte[]

Property Details

_pdu protected_oe property

SNMP Protocol Data Unit
protected TrapPdu,SnmpSharpNet _pdu
Résultat TrapPdu

_snmpCommunity protected_oe property

SNMP community name
protected OctetString _snmpCommunity
Résultat OctetString