[AGENT++] set_access requirements

Yasemin YILMAZ yasemin.yilmaz at arise.com.tr
Fri Apr 16 08:47:40 CEST 2010


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,




More information about the AGENTPP mailing list