Dangerous SNMP
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MessageProcessor Class Referenceabstract

A MessaqeProcessor is responsible for creating an envelope around a particular payload and also removing such an envelope. More...

#include <messageprocessor.hpp>

Public Types

enum  Version { SNMPv1 = 0, SNMPv2 = 1, SNMPv3 = 3 }
 

Public Member Functions

Version version () const
 This returns the SNMP version of the Message Processor. More...
 
virtual std::vector< char > encode (const SecurityModel *securityModel, ConfirmedClass::Type confirmedClass, const std::vector< char > &pduBytes)=0 throw ( Exception )
 This encodes a new message. More...
 
virtual std::unique_ptr
< ByteStream
decode (const SecurityModel *securityModel, ByteStream &byteStream, std::unique_ptr< SecurityModel > &incomingSecurityModel)=0 throw ( Exception )
 This decodes a message. More...
 

Protected Attributes

Version _version
 

Detailed Description

A MessaqeProcessor is responsible for creating an envelope around a particular payload and also removing such an envelope.

The payload is "version"-agnostic; that is, all the MessageProcessor has to do is encode the payload in some fashion; it will not modify that payload.

A MessageProcessor subclass corresponds to a particular SNMP version. SNMPv1 -> MessageProcessorV1 SNMPv2 -> MessageProcessorV2 SNMPv3 -> MessageProcessorV3

Member Function Documentation

virtual std::unique_ptr<ByteStream> decode ( const SecurityModel securityModel,
ByteStream byteStream,
std::unique_ptr< SecurityModel > &  incomingSecurityModel 
)
throw (Exception
)
pure virtual

This decodes a message.

Parameters
securityModelThe security model to use.
byteStreamThe ByteStream to use to read the message.
incomingSecurityModelThe security model to populate with the message's information.
Returns
A pointer to a ByteStream containing the PDU data to parse.
Exceptions
Exception
virtual std::vector<char> encode ( const SecurityModel securityModel,
ConfirmedClass::Type  confirmedClass,
const std::vector< char > &  pduBytes 
)
throw (Exception
)
pure virtual

This encodes a new message.

Parameters
securityModelThe security model to use.
confirmedClassThe appropriate ConfirmedClass type.
pduBytesThe PDU data to encode.
Returns
A vector of the encoded bytes.
Exceptions
Exception
Version version ( ) const
inline

This returns the SNMP version of the Message Processor.

Returns
The enumeration value for the version.

The documentation for this class was generated from the following file: