67 #ifdef SNMP_PP_NAMESPACE 73 #define PDU_MAX_RID 32767 74 #define PDU_MIN_RID 1000
103 Pdu(
Vb* pvbs,
const int pvb_count);
110 Pdu(
const Pdu &pdu) : vbs(0), vbs_size(0), vb_count(0) { *
this = pdu; };
122 Pdu& operator=(
const Pdu &pdu);
129 Pdu& operator+=(
const Vb &vb);
152 int get_vblist(
Vb* pvbs,
const int pvb_count)
const;
166 int set_vblist(
Vb const * pvbs,
const int pvb_count);
176 int get_vb(
Vb &vb,
const int index)
const;
187 const Vb &
get_vb(
const int index)
const {
return *vbs[index]; };
199 int set_vb(
Vb const &vb,
const int index);
277 unsigned short get_type()
const {
return pdu_type; };
282 void set_type(
unsigned short type) { pdu_type = type; };
287 bool valid()
const {
return validity; };
295 int trim(
const int count=1);
303 int delete_vb(
const int position);
321 { notify_id = id;
return (notify_id.len() ==
id.len()); };
329 {
id = notify_id;
return (notify_id.len() ==
id.len()); };
337 { notify_enterprise = e;
return (notify_enterprise.len() == e.
len()); };
345 { e = notify_enterprise;
return (notify_enterprise.len() == e.
len()); };
371 { context_name = name;
return (context_name.valid() && name.
valid()); };
379 { context_name = name;
return context_name.valid(); };
387 { name = context_name;
return (context_name.valid() && name.
valid()); };
402 return (context_engine_id.valid() &&
id.valid()); };
410 { context_engine_id = id;
return context_engine_id.valid(); };
418 return (context_engine_id.valid() &&
id.valid()); };
462 int get_v1_trap_address(
GenAddress &address)
const;
467 int set_v1_trap_address(
const Address &address);
474 int get_asn1_length()
const;
484 static bool match_type(
const int request,
const int response);
522 #ifdef SNMP_PP_NAMESPACE 526 #endif // _SNMP_PDU_H_
const OctetStr & get_context_engine_id() const
Get the context engine id of the Pdu.
void set_type(unsigned short type)
Set the pdu type.
bool set_notify_enterprise(const Oid &e)
Set the notify enterprise.
void set_notify_timestamp(const TimeTicks &ts)
Set notify timestamp.
Vb & operator[](const int i)
Get a Vb.
bool get_notify_id(Oid &id) const
Get the notify id.
void clear_error()
Clear error status and error index.
unsigned long get_message_id() const
Get the SNMPv3 message id (msgID)
Pdu(const Pdu &pdu)
Constructor with another Pdu instance.
bool set_context_name(const char *name)
Set the context name of the Pdu.
bool set_context_engine_id(const OctetStr &id)
Set the context engine id of the Pdu.
The Vb class is the encapsulation of the SNMP variable binding.
int get_vb_count() const
Get the number of vbs.
GenAddress v1_trap_address
bool valid() const
Returns validity of Pdu instance.
void get_notify_timestamp(TimeTicks &ts) const
Get notify timestamp.
void set_error_status(const int err)
Set the error status.
void clear_error_index()
Clear the error index.
int get_error_index() const
Get the error index.
The timeticks class allows all the functionality of unsigned integers but is recognized as a distinct...
bool set_context_engine_id(const char *id)
Set the context engine id of the Pdu.
The Object Identifier Class.
unsigned short get_type() const
Get the pdu type.
void set_error_index(const int index)
Set the error index.
int get_security_level() const
Return the security level of the Pdu.
Base class of all Address classes.
void clear_error_status()
Clear the error status.
const OctetStr & get_context_name() const
Get the context name of the Pdu.
TimeTicks notify_timestamp
bool set_context_name(const OctetStr &name)
Set the context name of the Pdu.
void set_security_level(const int level)
Set the security level that should be used when this Pdu is sent.
bool get_notify_enterprise(Oid &e) const
Get the notify enterprise.
unsigned long len() const
Get the length of the oid.
void set_message_id(const unsigned long msg_id)
Set the SNMPv3 message id (msgID)
bool valid() const
Return validity of the object.
void set_request_id(const unsigned long rid)
Set the request id.
void set_maxsize_scopedpdu(unsigned long l)
Set the maximum size of the scoped pdu to be included in a possible response message.
bool set_notify_id(const Oid &id)
Set the notify id.
bool get_context_name(OctetStr &name) const
Get the context name of the Pdu.
unsigned long get_request_id() const
Get the request id.
Pdu * clone() const
Clone a Pdu object.
bool get_context_engine_id(OctetStr &id) const
Get the context engine id of the Pdu.
unsigned long get_maxsize_scopedpdu() const
Get the maximum size of the scoped pdu to be included in a possible response message.
unsigned long maxsize_scopedpdu
const Vb & get_vb(const int index) const
Return a reference to a particular Vb.
int get_error_status() const
Get the error status.
OctetStr context_engine_id