net-snmp 5.7
|
Adding and removing MIB nodes to the database under their contexts. More...
Functions | |
int | netsnmp_register_mib (const char *moduleName, struct variable *var, size_t varsize, size_t numvars, oid *mibloc, size_t mibloclen, int priority, int range_subid, oid range_ubound, netsnmp_session *ss, const char *context, int timeout, int flags, netsnmp_handler_registration *reginfo, int perform_callback) |
Registers a MIB handler. | |
void | register_mib_reattach (void) |
Call callbacks to reattach all our nodes. | |
void | register_mib_detach (void) |
Mark all our registered OIDs as detached. | |
int | register_mib_context (const char *moduleName, struct variable *var, size_t varsize, size_t numvars, const oid *mibloc, size_t mibloclen, int priority, int range_subid, oid range_ubound, netsnmp_session *ss, const char *context, int timeout, int flags) |
Register a new module into the MIB database, with all possible custom options. | |
int | register_mib_range (const char *moduleName, struct variable *var, size_t varsize, size_t numvars, const oid *mibloc, size_t mibloclen, int priority, int range_subid, oid range_ubound, netsnmp_session *ss) |
Register a new module into the MIB database, as being responsible for a range of OIDs (typically a single row of a table). | |
int | register_mib_priority (const char *moduleName, struct variable *var, size_t varsize, size_t numvars, const oid *mibloc, size_t mibloclen, int priority) |
Register a new module into the MIB database, with a non-default priority. | |
int | register_mib (const char *moduleName, struct variable *var, size_t varsize, size_t numvars, const oid *mibloc, size_t mibloclen) |
Register a new module into the MIB database, using default priority and context. | |
int | unregister_mib_context (oid *name, size_t len, int priority, int range_subid, oid range_ubound, const char *context) |
Unregisters a module registered against a given OID (or range) in a specified context. | |
int | netsnmp_unregister_mib_table_row (oid *name, size_t len, int priority, int var_subid, oid range_ubound, const char *context) |
int | unregister_mib_range (oid *name, size_t len, int priority, int range_subid, oid range_ubound) |
Unregisters a module registered against a given OID (or range) in the default context. | |
int | unregister_mib_priority (oid *name, size_t len, int priority) |
Unregisters a module registered against a given OID at the specified priority. | |
int | unregister_mib (oid *name, size_t len) |
Unregisters a module registered against a given OID at the default priority. | |
void | unregister_mibs_by_session (netsnmp_session *ss) |
Unregisters subtree of OIDs bounded to given session. | |
int | in_a_view (oid *name, size_t *namelen, netsnmp_pdu *pdu, int type) |
Determines if given PDU is allowed to see (or update) a given OID. | |
int | check_access (netsnmp_pdu *pdu) |
Determines if the given PDU request could potentially succeed. | |
int | netsnmp_acm_check_subtree (netsnmp_pdu *pdu, oid *name, size_t namelen) |
Determines if the given PDU request could potentially access the specified MIB subtree. | |
netsnmp_feature_child_of (get_session_for_oid, netsnmp_unused) | |
void | setup_tree (void) |
int | remove_tree_entry (oid *name, size_t len) |
void | shutdown_tree (void) |
void | dump_idx_registry (void) |
void | dump_registry (void) |
Adding and removing MIB nodes to the database under their contexts.
int check_access | ( | netsnmp_pdu * | pdu | ) |
Determines if the given PDU request could potentially succeed.
(Preliminary, OID-independent validation)
pdu | PDU requesting access |
Definition at line 2066 of file agent_registry.c.
int in_a_view | ( | oid * | name, |
size_t * | namelen, | ||
netsnmp_pdu * | pdu, | ||
int | type | ||
) |
Determines if given PDU is allowed to see (or update) a given OID.
name | The OID to check access for. On return, this parameter holds the OID actually matched |
namelen | Number of sub-identifiers in the OID. On return, this parameter holds the length of the matched OID |
pdu | PDU requesting access to the OID. |
type | ANS.1 type of the value at given OID. (Used for catching SNMPv1 requests for SMIv2-only objects) |
Definition at line 2012 of file agent_registry.c.
int netsnmp_acm_check_subtree | ( | netsnmp_pdu * | pdu, |
oid * | name, | ||
size_t | namelen | ||
) |
Determines if the given PDU request could potentially access the specified MIB subtree.
pdu | PDU requesting access |
name | The OID to check access for. |
namelen | Number of sub-identifiers in the OID. |
Definition at line 2110 of file agent_registry.c.
int netsnmp_register_mib | ( | const char * | moduleName, |
struct variable * | var, | ||
size_t | varsize, | ||
size_t | numvars, | ||
oid * | mibloc, | ||
size_t | mibloclen, | ||
int | priority, | ||
int | range_subid, | ||
oid | range_ubound, | ||
netsnmp_session * | ss, | ||
const char * | context, | ||
int | timeout, | ||
int | flags, | ||
netsnmp_handler_registration * | reginfo, | ||
int | perform_callback | ||
) |
Registers a MIB handler.
reginfo | Registration handler structure. In a case of failure, it will be freed. |
Definition at line 1098 of file agent_registry.c.
int register_mib | ( | const char * | moduleName, |
struct variable * | var, | ||
size_t | varsize, | ||
size_t | numvars, | ||
const oid * | mibloc, | ||
size_t | mibloclen | ||
) |
Register a new module into the MIB database, using default priority and context.
moduleName | Text name of the module. The given name will be used to identify the module inside the agent. |
var | Array of variables to be registered in the module. |
varsize | Size of a single variable in var array. The size is normally equal to sizeof(struct variable), but if we wish to use shorter (or longer) OIDs, then we could use different variant of the variable structure. |
numvars | Number of variables in the var array. This is how many variables the function will try to register. |
mibloc | Base OID of the module. All OIDs in var array should be sub-oids of the base OID. |
mibloclen | Length of the base OID. Number of integers making up the base OID. |
Definition at line 1557 of file agent_registry.c.
int register_mib_context | ( | const char * | moduleName, |
struct variable * | var, | ||
size_t | varsize, | ||
size_t | numvars, | ||
const oid * | mibloc, | ||
size_t | mibloclen, | ||
int | priority, | ||
int | range_subid, | ||
oid | range_ubound, | ||
netsnmp_session * | ss, | ||
const char * | context, | ||
int | timeout, | ||
int | flags | ||
) |
Register a new module into the MIB database, with all possible custom options.
moduleName | Text name of the module. The given name will be used to identify the module inside the agent. |
var | Array of variables to be registered in the module. |
varsize | Size of a single variable in var array. The size is normally equal to sizeof(struct variable), but if we wish to use shorter (or longer) OIDs, then we could use different variant of the variable structure. |
numvars | Number of variables in the var array. This is how many variables the function will try to register. |
mibloc | Base OID of the module. All OIDs in var array should be sub-oids of the base OID. |
mibloclen | Length of the base OID. Number of integers making up the base OID. |
priority | Registration priority. Used to achieve a desired configuration when different sessions register identical or overlapping regions. Primarily used with AgentX subagent registrations. |
range_subid | If non-zero, the module is registered against a range of OIDs, with this parameter identifying the relevant subidentifier - see RFC 2741 for details. Typically used to register a single row of a table. If zero, then register the module against the full OID subtree. |
range_ubound | The end of the range being registered (see RFC 2741) If range_subid is zero, then this parameter is ignored. |
ss | |
timeout | |
flags |
Definition at line 1403 of file agent_registry.c.
void register_mib_detach | ( | void | ) |
Mark all our registered OIDs as detached.
This is only really useful for subagent protocols, when a connection is lost or the subagent is being shut down.
Definition at line 1341 of file agent_registry.c.
int register_mib_priority | ( | const char * | moduleName, |
struct variable * | var, | ||
size_t | varsize, | ||
size_t | numvars, | ||
const oid * | mibloc, | ||
size_t | mibloclen, | ||
int | priority | ||
) |
Register a new module into the MIB database, with a non-default priority.
moduleName | Text name of the module. The given name will be used to identify the module inside the agent. |
var | Array of variables to be registered in the module. |
varsize | Size of a single variable in var array. The size is normally equal to sizeof(struct variable), but if we wish to use shorter (or longer) OIDs, then we could use different variant of the variable structure. |
numvars | Number of variables in the var array. This is how many variables the function will try to register. |
mibloc | Base OID of the module. All OIDs in var array should be sub-oids of the base OID. |
mibloclen | Length of the base OID. Number of integers making up the base OID. |
priority | Registration priority. Used to achieve a desired configuration when different sessions register identical or overlapping regions. Primarily used with AgentX subagent registrations. |
Definition at line 1517 of file agent_registry.c.
int register_mib_range | ( | const char * | moduleName, |
struct variable * | var, | ||
size_t | varsize, | ||
size_t | numvars, | ||
const oid * | mibloc, | ||
size_t | mibloclen, | ||
int | priority, | ||
int | range_subid, | ||
oid | range_ubound, | ||
netsnmp_session * | ss | ||
) |
Register a new module into the MIB database, as being responsible for a range of OIDs (typically a single row of a table).
moduleName | Text name of the module. The given name will be used to identify the module inside the agent. |
var | Array of variables to be registered in the module. |
varsize | Size of a single variable in var array. The size is normally equal to sizeof(struct variable), but if we wish to use shorter (or longer) OIDs, then we could use different variant of the variable structure. |
numvars | Number of variables in the var array. This is how many variables the function will try to register. |
mibloc | Base OID of the module. All OIDs in var array should be sub-oids of the base OID. |
mibloclen | Length of the base OID. Number of integers making up the base OID. |
priority | Registration priority. Used to achieve a desired configuration when different sessions register identical or overlapping regions. Primarily used with AgentX subagent registrations. |
range_subid | If non-zero, the module is registered against a range of OIDs, with this parameter identifying the relevant subidentifier - see RFC 2741 for details. Typically used to register a single row of a table. If zero, then register the module against the full OID subtree. |
range_ubound | The end of the range being registered (see RFC 2741) If range_subid is zero, then this parameter is ignored. |
ss |
Definition at line 1468 of file agent_registry.c.
void register_mib_reattach | ( | void | ) |
Call callbacks to reattach all our nodes.
Definition at line 1308 of file agent_registry.c.
int unregister_mib | ( | oid * | name, |
size_t | len | ||
) |
Unregisters a module registered against a given OID at the default priority.
name | the specific OID to unregister if it conatins the associated context. |
len | the length of the OID, use OID_LENGTH macro. |
Definition at line 1923 of file agent_registry.c.
int unregister_mib_context | ( | oid * | name, |
size_t | len, | ||
int | priority, | ||
int | range_subid, | ||
oid | range_ubound, | ||
const char * | context | ||
) |
Unregisters a module registered against a given OID (or range) in a specified context.
Typically used when a module has multiple contexts defined. The parameters priority, range_subid, range_ubound and context should match those used to register the module originally.
name | the specific OID to unregister if it conatins the associated context. |
len | the length of the OID, use OID_LENGTH macro. |
priority | a value between 1 and 255, used to achieve a desired configuration when different sessions register identical or overlapping regions. Subagents with no particular knowledge of priority should register with the default value of 127. |
range_subid | permits specifying a range in place of one of a subtree sub-identifiers. When this value is zero, no range is being specified. |
range_ubound | the upper bound of a sub-identifier's range. This field is present only if range_subid is not 0. |
context | a context name that has been created |
Definition at line 1663 of file agent_registry.c.
int unregister_mib_priority | ( | oid * | name, |
size_t | len, | ||
int | priority | ||
) |
Unregisters a module registered against a given OID at the specified priority.
The priority parameter should match that used to register the module originally.
name | the specific OID to unregister if it conatins the associated context. |
len | the length of the OID, use OID_LENGTH macro. |
priority | a value between 1 and 255, used to achieve a desired configuration when different sessions register identical or overlapping regions. Subagents with no particular knowledge of priority should register with the default value of 127. |
Definition at line 1902 of file agent_registry.c.
int unregister_mib_range | ( | oid * | name, |
size_t | len, | ||
int | priority, | ||
int | range_subid, | ||
oid | range_ubound | ||
) |
Unregisters a module registered against a given OID (or range) in the default context.
Typically used when a module has multiple contexts defined. The parameters priority, range_subid, and range_ubound should match those used to register the module originally.
name | the specific OID to unregister if it conatins the associated context. |
len | the length of the OID, use OID_LENGTH macro. |
priority | a value between 1 and 255, used to achieve a desired configuration when different sessions register identical or overlapping regions. Subagents with no particular knowledge of priority should register with the default value of 127. |
range_subid | permits specifying a range in place of one of a subtree sub-identifiers. When this value is zero, no range is being specified. |
range_ubound | the upper bound of a sub-identifier's range. This field is present only if range_subid is not 0. |
Definition at line 1873 of file agent_registry.c.
void unregister_mibs_by_session | ( | netsnmp_session * | ss | ) |
Unregisters subtree of OIDs bounded to given session.
ss | Session which OIDs will be removed from tree. |
Definition at line 1936 of file agent_registry.c.