SNMP version 1 packet class. Supported types are SNMP-GET, SNMP-GETNEXT, SNMP-SET and SNMP-RESPONSE.

Namespace:  SnmpSharpNet
Assembly:  SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.5.0.0 (0.5.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public class SnmpV1Packet : SnmpPacket
Public Class SnmpV1Packet _
	Inherits SnmpPacket
public ref class SnmpV1Packet : public SnmpPacket

Members

               
 All Members  Constructors   Fields   Properties   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
SnmpV1Packet()()()
Standard constructor.
SnmpV1Packet(String)
Standard constructor.
_pdu
SNMP Protocol Data Unit
decode(array<Byte>[]()[], Int32)
Decode received SNMP packet.
(Overrides SnmpPacket..::.decode(array<Byte>[]()[], Int32).)
encode()()()
Encode SNMP packet for sending.
(Overrides SnmpPacket..::.encode()()().)
encode(MutableByte)
Wrap BER encoded SNMP information contained in the parameter MutableByte class. Information in the parameter is prepended by the SNMP version field and wrapped in a sequence header. Derived classes call this method to finalize SNMP packet encoding.
(Inherited from SnmpPacket.)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
GetHashCode()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
IsNotification
Packet is a notification
(Inherited from SnmpPacket.)
IsReport
Packet is a report
(Inherited from SnmpPacket.)
IsRequest
Packet is a request
(Inherited from SnmpPacket.)
IsResponse
Packet is a response
(Inherited from SnmpPacket.)
Pdu
Access to the packet Pdu.
(Overrides SnmpPacket..::.Pdu.)
SnmpCommunity
Get SNMP community value used by SNMP version 1 and version 2 protocols.
ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Version
SNMP Protocol version
(Inherited from SnmpPacket.)

Remarks

Available packet classes are: 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 version 1, 2 and 3 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. While using SnmpV3Packet class for full packet handling is possible, transport specific class UdpTarget uses SecureAgentParameters class to store protocol version 3 specific information that carries over from request to request when used on the same SNMP agent and therefore simplifies both initial definition of agents configuration (mostly security) as well as removes the need for repeated initialization of the packet class for subsequent requests. If you decide not to use transport helper class(es) like UdpTarget, BER encoding and decoding and packets is easily done with SnmpPacket derived classes. Example, SNMP version 1 packet encoding:
CopyC#
SnmpV1Packet packetv1 = new SnmpV1Packet();
packetv1.SnmpCommunity.Set("public");
packetv1.Pdu.Set(mypdu);
byte[] berpacket = packetv1.encode();
Example, SNMP version 1 packet decoding:
CopyC#
SnmpV1Packet packetv1 = new SnmpV1Packet();
packetv1.decode(inbuffer,inlen);

Inheritance Hierarchy

System..::.Object
  SnmpSharpNet..::.SnmpPacket
    SnmpSharpNet..::.SnmpV1Packet

See Also