SNMP++  3.3.4
v3MP::EngineIdTable Class Reference

The engine id table is used to store known engine ids with corresponding hostadress and port. More...

Collaboration diagram for v3MP::EngineIdTable:

Classes

struct  Entry_T
 

Public Member Functions

 EngineIdTable (int initial_size=10)
 
 ~EngineIdTable ()
 
int add_entry (const OctetStr &engine_id, const OctetStr &host, int port)
 Add an entry to the table. More...
 
int get_entry (OctetStr &engine_id, const OctetStr &hostport) const
 Get the engine_id of the SNMP entity at the given host/port. More...
 
int get_entry (OctetStr &engine_id, const OctetStr &host, int port) const
 Get the engineID of the SNMP entity at the given host/port. More...
 
int reset ()
 Remove all entries from the engine id table. More...
 
int delete_entry (const OctetStr &engine_id)
 Remove the given engine id from the table. More...
 
int delete_entry (const OctetStr &host, int port)
 Remove the entry for the given address/port from the table. More...
 

Private Member Functions

bool initialize_table (const int size)
 

Private Attributes

struct Entry_Ttable
 
int max_entries
 the maximum number of entries More...
 
int entries
 the current amount of entries More...
 
SNMP_PP_MUTABLE SnmpSynchronized lock
 

Detailed Description

The engine id table is used to store known engine ids with corresponding hostadress and port.

Definition at line 421 of file mp_v3.h.

Constructor & Destructor Documentation

v3MP::EngineIdTable::EngineIdTable ( int  initial_size = 10)
v3MP::EngineIdTable::~EngineIdTable ( )

Member Function Documentation

int v3MP::EngineIdTable::add_entry ( const OctetStr engine_id,
const OctetStr host,
int  port 
)

Add an entry to the table.

Parameters
engine_id- The engineID
host- The numerical IP address
port- The port
Returns
- SNMPv3_MP_ERROR, SNMPv3_MP_OK
int v3MP::EngineIdTable::delete_entry ( const OctetStr engine_id)

Remove the given engine id from the table.

Parameters
engine_id- The engine id to remove
Returns
- SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR, SNMPv3_MP_OK
int v3MP::EngineIdTable::delete_entry ( const OctetStr host,
int  port 
)

Remove the entry for the given address/port from the table.

Parameters
host- Numeric IP address
port- listen port of the snmp entity
Returns
- SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR, SNMPv3_MP_OK
int v3MP::EngineIdTable::get_entry ( OctetStr engine_id,
const OctetStr hostport 
) const

Get the engine_id of the SNMP entity at the given host/port.

Parameters
engine_id- OUT: The engineID
hostport- The numerical IP address and port (syntax: a.b.c.d/port)
Returns
- SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR, SNMPv3_MP_OK
int v3MP::EngineIdTable::get_entry ( OctetStr engine_id,
const OctetStr host,
int  port 
) const

Get the engineID of the SNMP entity at the given host/port.

Parameters
engine_id- OUT: The engineID
host- The numerical IP address
port- The port
Returns
- SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR, SNMPv3_MP_OK
bool v3MP::EngineIdTable::initialize_table ( const int  size)
private
int v3MP::EngineIdTable::reset ( )

Remove all entries from the engine id table.

Returns
- SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR, SNMPv3_MP_OK

Member Data Documentation

int v3MP::EngineIdTable::entries
private

the current amount of entries

Definition at line 505 of file mp_v3.h.

SNMP_PP_MUTABLE SnmpSynchronized v3MP::EngineIdTable::lock
private

Definition at line 506 of file mp_v3.h.

int v3MP::EngineIdTable::max_entries
private

the maximum number of entries

Definition at line 504 of file mp_v3.h.

struct Entry_T* v3MP::EngineIdTable::table
private

Definition at line 503 of file mp_v3.h.


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