AGENT++
4.0.3
|
#include <vacm.h>
Classes | |
struct | ClassPointers |
Public Member Functions | |
Vacm () | |
Vacm (Mib &) | |
virtual | ~Vacm () |
virtual int | isAccessAllowed (const int securityModel, const NS_SNMP OctetStr &securityName, const int securityLevel, const int viewType, const NS_SNMP OctetStr &context, const Oidx &o) |
Does the user have the rights to access the Oid. | |
virtual int | isAccessAllowed (const NS_SNMP OctetStr &viewName, const Oidx &o) |
Is the oid within the view. | |
virtual int | getViewName (const int securityModel, const NS_SNMP OctetStr &securityName, const int securityLevel, const int viewType, const NS_SNMP OctetStr &context, NS_SNMP OctetStr &viewName) |
Get the view name for the given params. | |
void | incUnknownContexts () |
NS_SNMP SnmpInt32 | getUnknownContexts () |
bool | addNewContext (const NS_SNMP OctetStr &newContext) |
Add a new context to the VacmContextTable. | |
void | deleteContext (const NS_SNMP OctetStr &context) |
Delete the given context from the VacmContextTable. | |
bool | addNewGroup (const int securityModel, const NS_SNMP OctetStr &securityName, const NS_SNMP OctetStr &groupName, const int storageType) |
Add a new security name to group mapping to the VacmSecurityToGroupTable. | |
void | deleteGroup (const int securityModel, const NS_SNMP OctetStr &securityName) |
Delete the given securityName from the VacmSecurityToGroupTable. | |
bool | addNewAccessEntry (const NS_SNMP OctetStr &groupName, const NS_SNMP OctetStr &prefix, const int securityModel, const int securityLevel, const int match, const NS_SNMP OctetStr &readView, const NS_SNMP OctetStr &writeView, const NS_SNMP OctetStr ¬ifyView, const int storageType) |
Add a new entry to the VacmAccessTable. | |
void | deleteAccessEntry (const NS_SNMP OctetStr &groupName, const NS_SNMP OctetStr &prefix, const int securityModel, const int securityLevel) |
Delete a entry from the VacmAccessTable. | |
bool | addNewView (const NS_SNMP OctetStr &viewName, const Oidx &subtree, const NS_SNMP OctetStr &mask, const int type, const int storageType) |
Add a new view to the VacmViewTreeFamilyTable. | |
void | deleteView (const NS_SNMP OctetStr &viewName, const Oidx &subtree) |
Delete the subtree from the view from the VacmViewTreeFamilyTable. | |
ClassPointers | get_vacm_tables () |
Get the pointers to the VACM SNMP tables used by the VACM. | |
void | clear () |
Delete any content of the VACM tables and thus completely reset the VACM configuration. | |
Static Public Member Functions | |
static const char * | getErrorMsg (int nr) |
Protected Attributes | |
ClassPointers | vcp |
Vacm::Vacm | ( | ) |
Vacm::Vacm | ( | Mib & | ) |
|
virtual |
bool Vacm::addNewAccessEntry | ( | const NS_SNMP OctetStr & | groupName, |
const NS_SNMP OctetStr & | prefix, | ||
const int | securityModel, | ||
const int | securityLevel, | ||
const int | match, | ||
const NS_SNMP OctetStr & | readView, | ||
const NS_SNMP OctetStr & | writeView, | ||
const NS_SNMP OctetStr & | notifyView, | ||
const int | storageType | ||
) |
Add a new entry to the VacmAccessTable.
[in] | groupName | vacmGroupName |
[in] | prefix | vacmAccessContextPrefix |
[in] | securityModel | vacmAccessSecurityModel |
[in] | securityLevel | vacmAccessSecurityLevel |
[in] | match | vacmAccessContextMatch |
[in] | readView | vacmAccessReadViewName |
[in] | writeView | vacmAccessWriteViewName |
[in] | notifyView | vacmAccessNotifyViewName |
[in] | storageType | vacmAccessStorageType (storageType_volatile, ...) |
bool Vacm::addNewContext | ( | const NS_SNMP OctetStr & | newContext | ) |
Add a new context to the VacmContextTable.
[in] | newContext | vacmContextName |
bool Vacm::addNewGroup | ( | const int | securityModel, |
const NS_SNMP OctetStr & | securityName, | ||
const NS_SNMP OctetStr & | groupName, | ||
const int | storageType | ||
) |
Add a new security name to group mapping to the VacmSecurityToGroupTable.
[in] | securityModel | vacmSecurityModel |
[in] | securityName | vacmSecurityName |
[in] | groupName | vacmGroupName |
[in] | storageType | vacmSecurityToGroupStorageType |
bool Vacm::addNewView | ( | const NS_SNMP OctetStr & | viewName, |
const Oidx & | subtree, | ||
const NS_SNMP OctetStr & | mask, | ||
const int | type, | ||
const int | storageType | ||
) |
Add a new view to the VacmViewTreeFamilyTable.
[in] | viewName | vacmViewTreeFamilyViewName |
[in] | subtree | vacmViewTreeFamilySubtree |
[in] | mask | vacmViewTreeFamilyMask |
[in] | type | vacmViewTreeFamilyType (view_included or view_excluded) |
[in] | storageType | vacmViewTreeFamilyStorageType (storageType_volatile, ...) |
void Vacm::clear | ( | ) |
Delete any content of the VACM tables and thus completely reset the VACM configuration.
This method is not synchronized. When called while the VACM is potentially being used by other threads, lock the tables by
mib->lock_mib(); ClassPointers vacmTables = vacm->get_vacm_tables(); vacmTables.contextTable->start_synch(); vacmTabes.securityToGroupTable->start_synch(); vacmTables.accessTable->start_synch(); vacmTables.viewTreeFamilyTable->start_synch(); vacm->clear(); vacmTables.contextTable->end_synch(); vacmTabes.securityToGroupTable->end_synch(); vacmTables.accessTable->end_synch(); vacmTables.viewTreeFamilyTable->end_synch(); mib->unlock_mib();
void Vacm::deleteAccessEntry | ( | const NS_SNMP OctetStr & | groupName, |
const NS_SNMP OctetStr & | prefix, | ||
const int | securityModel, | ||
const int | securityLevel | ||
) |
Delete a entry from the VacmAccessTable.
[in] | groupName | vacmGroupName |
[in] | prefix | vacmAccessContextPrefix |
[in] | securityModel | vacmAccessSecurityModel |
[in] | securityLevel | vacmAccessSecurityLevel |
void Vacm::deleteContext | ( | const NS_SNMP OctetStr & | context | ) |
Delete the given context from the VacmContextTable.
[in] | context | vacmContextName |
void Vacm::deleteGroup | ( | const int | securityModel, |
const NS_SNMP OctetStr & | securityName | ||
) |
Delete the given securityName from the VacmSecurityToGroupTable.
Delete the subtree from the view from the VacmViewTreeFamilyTable.
[in] | viewName | vacmViewTreeFamilyViewName |
[in] | subtree | vacmViewTreeFamilySubtree |
|
inline |
Get the pointers to the VACM SNMP tables used by the VACM.
|
inlinestatic |
NS_SNMP SnmpInt32 Vacm::getUnknownContexts | ( | ) |
|
virtual |
Get the view name for the given params.
[in] | securityModel | The security model used |
[in] | securityName | The security name of the user |
[in] | securityLevel | The security level |
[in] | viewType | Select one of mibView_read, write or notify |
[in] | context | The MIB context |
[out] | viewName | If found, the name of the matching view |
void Vacm::incUnknownContexts | ( | ) |
|
virtual |
Does the user have the rights to access the Oid.
All parameters are used to check if access is allowed.
[in] | securityModel | The security model used |
[in] | securityName | The security name of the user |
[in] | securityLevel | The security level |
[in] | viewType | Read, write or notify view |
[in] | context | The MIB context |
[in] | o | The Oid the user wants to access |
Is the oid within the view.
Check if the given Oid is within the named view.
[in] | viewName | Name of the view |
[in] | o | Oid to check |
|
protected |