[AGENT++] set_access requirements
Frank Fock
fock at agentpp.com
Mon Apr 19 01:38:21 CEST 2010
Hi Yasemin,
First, the MAX-ACCESS clause takes "read-only"
as value not "READ_ONLY".
The set_access(..) method should be called with
value "READONLY" only once (if the corresponding
MIB object has a maximum access of "read-only").
Switching the max. access value during runtime
does not make sense in most cases.
Best regards,
Frank
On 16.04.2010 10:21, Yasemin YILMAZ wrote:
> Hi all,
>
> I'm trying to understand AGENT++'s API usage through source code analysis. I
> wonder when set_access function must be call? In notification_log_mib
> implementation code, the function nlmLogVariableEntry::add_variable firstly
> sets NOACCESS;
>
> for (int j=nNlmLogVariableCounter32Val; j<r->size(); j++) {
> r->get_nth(j)->set_access(NOACCESS);
> }
>
> Then according to log variable's type, nlmLogVariableTable MIB table's
> columnar value is set and mib access is set to READ-ONLY;
>
> switch (vb.get_syntax()) {
> case sNMP_SYNTAX_INT32:
> r->get_nth(nNlmLogVariableInteger32Val)->
> replace_value(vb.clone_value());
> r->get_nth(nNlmLogVariableInteger32Val)->
> set_access(READONLY);
> r->get_nth(nNlmLogVariableValueType)->
> set_value(4);
> break;
> case sNMP_SYNTAX_TIMETICKS:
> ...
> }
>
> I have a MIB object as following and I want to this managed object can
> changeable from my snmp agent but snmp managers only read this information:
> myMemUsage OBJECT-TYPE
> SYNTAX Integer32
> MAX-ACCESS READ_ONLY
> STATUS current
> DESCRIPTION "memory usage"
> ::= { mySystemGroup 3 }
>
> Should I call set_access to set NOACCESS before setting a value and, after
> setting a value (calling the function set_value) should I call set_access to
> set READONLY?
>
> Can you explain please?
>
> Thanks in advance for your help,
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp
--
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com
More information about the AGENTPP
mailing list