Roxen.git / server / etc / modules / SNMP.pmod

version» Context lines:

Roxen.git/server/etc/modules/SNMP.pmod:1:   //   // SNMP helper stuff.   // - // $Id: SNMP.pmod,v 1.1 2008/04/07 13:04:47 grubba Exp $ + // $Id: SNMP.pmod,v 1.2 2010/05/04 13:48:35 grubba Exp $   //   // 2007-08-29 Henrik Grubbström   //      // Some OIDs      //! iso.organizations.dod.internet   constant INTERNET_OID = ({ 1, 3, 6, 1 });      //! iso.organizations.dod.internet.private.enterprises.roxenis
Roxen.git/server/etc/modules/SNMP.pmod:249:    Protocols.LDAP.ldap_privates.asn1_context_octet_string(2, "");      //! The NULL counter.   Counter NULL_COUNTER = Counter(0);         class SimpleMIB   {    inherit ADT.Trie;    -  static void create(array(int) oid, +  static void init(array(int) oid,    array(int) oid_suffix, -  array(Standards.ASN1.Types.Object|function)| -  mapping(int:Standards.ASN1.Types.Object|function) values) +  array(Standards.ASN1.Types.Object| +  function|array|mapping)| +  mapping(int:Standards.ASN1.Types.Object| +  function|array|mapping) values)    { -  ::create(oid); -  foreach(values; int i; function|Standards.ASN1.Types.Object val) { -  if (!zero_type(val)) { +  foreach(values; int i; +  function|Standards.ASN1.Types.Object|array|mapping val) { +  if (arrayp(val) || mappingp(val)) { +  init(oid + ({ i }), oid_suffix, val); +  } else if (!zero_type(val)) {    insert(oid + ({ i }) + oid_suffix + ({ 0 }), val);    }    }    }    -  +  static void create(array(int) oid, +  array(int) oid_suffix, +  array(Standards.ASN1.Types.Object| +  function|array|mapping)| +  mapping(int:Standards.ASN1.Types.Object| +  function|array|mapping) values) +  { +  ::create(oid); +  init(oid, oid_suffix, values); +  } +     Standards.ASN1.Types.Object lookup(array(int) key)    {    function|Standards.ASN1.Types.Object res = ::lookup(key);    if (zero_type(res)) return UNDEFINED;    if (functionp(res)) return res();    return res;    }   }      void set_owner(ADT.Trie mib, Configuration conf, RoxenModule|void module)