SNMP 2.0.0
Loading...
Searching...
No Matches
SNMP::Trap Struct Reference

Helper struct to handle trap PDU. More...

#include <src/BER.h>

Public Types

enum  : uint8_t {
  ColdStart , WarmStart , LinkDown , LinkUp ,
  AuthenticationFailure , EGPNeighborLoss , EnterpriseSpecific
}
 Enumerates all possible generic trap codes. More...
 

Public Member Functions

 Trap ()
 Initializes to default values.
 

Public Attributes

const char * _enterprise
 
IPAddress _agentAddr
 
uint8_t _genericTrap
 
uint8_t _specificTrap
 
uint32_t _timeStamp
 

Detailed Description

Helper struct to handle trap PDU.

Defines all needed to create an SNMP trap.

Definition at line 123 of file BER.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : uint8_t

Enumerates all possible generic trap codes.

Enumerator
ColdStart 

0

WarmStart 

1

LinkDown 

2

LinkUp 

3

AuthenticationFailure 

4

EGPNeighborLoss 

5

EnterpriseSpecific 

6

Definition at line 127 of file BER.h.

Constructor & Destructor Documentation

◆ Trap()

SNMP::Trap::Trap ( )
inline

Initializes to default values.

  • Enterprise is set to null.
  • Generic trap is set to ColdStart.
  • Specific trap is set to 0.
  • Timestamp is set to 0;

Definition at line 145 of file BER.h.

References _enterprise, _genericTrap, _specificTrap, _timeStamp, and ColdStart.

Member Data Documentation

◆ _agentAddr

IPAddress SNMP::Trap::_agentAddr

Network address of the agent.

Definition at line 155 of file BER.h.

Referenced by SNMP::Message::build(), SNMP::Message::parse(), and SNMP::Message::setAgentAddress().

◆ _enterprise

const char* SNMP::Trap::_enterprise

Enterprise OID.

Definition at line 153 of file BER.h.

Referenced by SNMP::Message::build(), SNMP::Message::parse(), SNMP::Message::setEnterprise(), and Trap().

◆ _genericTrap

uint8_t SNMP::Trap::_genericTrap

Generic trap code.

Definition at line 157 of file BER.h.

Referenced by SNMP::Message::build(), SNMP::Message::parse(), SNMP::Message::setTrap(), and Trap().

◆ _specificTrap

uint8_t SNMP::Trap::_specificTrap

Specific trap code.

Definition at line 159 of file BER.h.

Referenced by SNMP::Message::build(), SNMP::Message::parse(), SNMP::Message::setTrap(), and Trap().

◆ _timeStamp

uint32_t SNMP::Trap::_timeStamp

Time elapsed since device startup.

Definition at line 161 of file BER.h.

Referenced by SNMP::Message::parse(), and Trap().


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