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.9 2007/11/03 14:20:03 grubba Exp $ + // $Id: SNMP.pmod,v 1.10 2008/08/15 12:33:54 mast 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:54:      class app_integer   {    inherit Standards.ASN1.Types.asn1_integer : integer;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info;    constant cls = 1;    constant type_name = "APPLICATION INTEGER";    constant tag = 0; -  static void create(int|function(:int) val, string|void name, string|void doc_string) +  protected void create(int|function(:int) val, string|void name, +  string|void doc_string)    {    if (intp(val)) {    update::create(UNDEFINED);    integer::create(val);    } else {    update::create(val);    integer::create(0);    }    doc::create(name, doc_string);    } -  static string _sprintf(int t) +  protected string _sprintf(int t)    {    switch(t) {    case 's': return (string)value;    default: return sprintf("%s[%d][%d](%O)", type_name, cls, tag, value);    }    }   }      class app_octet_string   {    inherit Standards.ASN1.Types.asn1_octet_string : octet_string;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info;    constant cls = 1;    constant type_name = "APPLICATION OCTET_STRING";    constant tag = 0; -  static void create(string|function(:string) val, string|void name, string|void doc_string) +  protected void create(string|function(:string) val, string|void name, +  string|void doc_string)    {    if (stringp(val)) {    update::create(UNDEFINED);    octet_string::create(val);    } else {    update::create(val);    octet_string::create("");    }    doc::create(name, doc_string);    } -  static string _sprintf(int t) +  protected string _sprintf(int t)    {    switch(t) {    case 's': return (string)value;    default: return sprintf("%s[%d][%d](%O)", type_name, cls, tag, value);    }    }   }      class OID   {    inherit Standards.ASN1.Types.asn1_identifier : identifier;    inherit Documentation : doc;    inherit OwnerInfo : owner_info;    constant type_name = "OID"; -  static void create(array(int) oid, string|void name, string|void doc_string) +  protected void create(array(int) oid, string|void name, +  string|void doc_string)    {    identifier::create(@oid);    doc::create(name, doc_string);    } -  static string _sprintf(int t) +  protected string _sprintf(int t)    {    switch(t) {    case 's': return ((array(string))id) * ".";    default: return sprintf("%s[%d][%d](%O)",    type_name, cls, tag,    ((array(string))id) * ".");    }    }   }      class Integer   {    inherit Standards.ASN1.Types.asn1_integer : integer;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info;    constant type_name = "INTEGER"; -  static void create(int|function(:int) val, string|void name, string|void doc_string) +  protected void create(int|function(:int) val, string|void name, +  string|void doc_string)    {    if (intp(val)) {    update::create(UNDEFINED);    integer::create(val);    } else {    update::create(val);    integer::create(0);    }    doc::create(name, doc_string);    } -  static string _sprintf(int t) +  protected string _sprintf(int t)    {    switch(t) {    case 'd':    case 's': return (string)value;    default: return sprintf("%s[%d][%d](%O)", type_name, cls, tag, value);    }    }   }      class String   {    inherit Standards.ASN1.Types.asn1_octet_string : octet_string;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info;    constant type_name = "STRING"; -  static void create(string|function(:string) val, string|void name, string|void doc_string) +  protected void create(string|function(:string) val, string|void name, +  string|void doc_string)    {    if (stringp(val)) {    update::create(UNDEFINED);    octet_string::create(val);    } else {    update::create(val);    octet_string::create("");    }    doc::create(name, doc_string);    } -  static string _sprintf(int t) +  protected string _sprintf(int t)    {    switch(t) {    case 's': return (string)value;    default: return sprintf("%s[%d][%d](%O)",    type_name, cls, tag, (string)value);    }    }   }      class Counter
Roxen.git/server/etc/modules/SNMP.pmod:201:    constant tag = 2;    constant type_name = "GAUGE";   }      //! One tick is 1/100 seconds.   class Tick   {    inherit app_integer;    constant tag = 3;    constant type_name = "TICK"; -  static string _sprintf(int t) +  protected string _sprintf(int t)    {    if (t == 's') {    return Roxen.short_date(time(1) - ((int)value)/100);    }    return ::_sprintf(t);    }   }      class Opaque   {    inherit app_octet_string;    constant tag = 4;    constant type_name = "OPAQUE"; -  static string _sprintf(int t) +  protected string _sprintf(int t)    {    if (t == 's') return "";    return ::_sprintf(t);    }   }      class Counter64   {    inherit app_integer;    constant tag = 6;
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, +  protected void create(array(int) oid,    array(int) oid_suffix,    array(Standards.ASN1.Types.Object|function)|    mapping(int:Standards.ASN1.Types.Object|function) values)    {    ::create(oid);    foreach(values; int i; function|Standards.ASN1.Types.Object val) {    if (!zero_type(val)) {    insert(oid + ({ i }) + oid_suffix + ({ 0 }), val);    }    }
Roxen.git/server/etc/modules/SNMP.pmod:395: Inside #if 0 // Not ready for production yet.
   indexers += ({ desc });    }    while (parse_info && parse_info->offset < i) {    parse_info = parse_info->trie[oid[parse_info->offset]];    }    if (parse_info) break;    }    return res * ".";   }    - static void create() + protected void create()   {    add_oid_path(RIS_OID_WEBSERVER,    "iso.organizations.dod.internet.private."    "enterprises.roxenis.app.webserver");   }      #endif /* 0 */