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

version» Context lines:

Roxen.git/server/etc/modules/SNMP.pmod:47:   class OwnerInfo   {    Configuration conf;    RoxenModule module;   }      // ASN1 datatypes.      class app_integer   { -  inherit Standards.ASN1.Types.asn1_integer : integer; +  inherit Standards.ASN1.Types.Integer : integer;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info; -  constant cls = 1; +     constant type_name = "APPLICATION INTEGER"; -  + #if __VERSION__ < 8.0 +  constant cls = 1;    constant tag = 0; -  + #else +  int cls = 1; +  int tag = 0; + #endif    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);    }
Roxen.git/server/etc/modules/SNMP.pmod:77:    {    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 Standards.ASN1.Types.OctetString : octet_string;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info; -  constant cls = 1; +     constant type_name = "APPLICATION OCTET_STRING"; -  + #if __VERSION__ < 8.0 +  constant cls = 1;    constant tag = 0; -  + #else +  int cls = 1; +  int tag = 0; + #endif    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("");    }
Roxen.git/server/etc/modules/SNMP.pmod:107:    {    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 Standards.ASN1.Types.Identifier : identifier;    inherit Documentation : doc;    inherit OwnerInfo : owner_info;    constant type_name = "OID";    protected void create(array(int) oid, string|void name,    string|void doc_string)    {    identifier::create(@oid);    doc::create(name, doc_string);    }    protected string _sprintf(int t)
Roxen.git/server/etc/modules/SNMP.pmod:130:    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 Standards.ASN1.Types.Integer : integer;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info;    constant type_name = "INTEGER";    protected void create(int|function(:int) val, string|void name,    string|void doc_string)    {    if (intp(val)) {    update::create(UNDEFINED);    integer::create(val);
Roxen.git/server/etc/modules/SNMP.pmod:159:    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 Standards.ASN1.Types.OctetString : octet_string;    inherit Documentation : doc;    inherit Updateable : update;    inherit OwnerInfo : owner_info;    constant type_name = "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);
Roxen.git/server/etc/modules/SNMP.pmod:189:    case 's': return (string)value;    default: return sprintf("%s[%d][%d](%O)",    type_name, cls, tag, (string)value);    }    }   }      class Counter   {    inherit app_integer; + #if __VERSION__ < 8.0    constant tag = 1; -  + #else +  int tag = 1; + #endif    constant type_name = "COUNTER";   }      class Gauge   {    inherit app_integer; -  + #if __VERSION__ < 8.0    constant tag = 2; -  + #else +  int tag = 2; + #endif    constant type_name = "GAUGE";   }      //! One tick is 1/100 seconds.   class Tick   {    inherit app_integer; -  + #if __VERSION__ < 8.0    constant tag = 3; -  + #else +  int tag = 3; + #endif    constant type_name = "TICK";    protected string _sprintf(int t)    {    if (t == 's') {    return Roxen.short_date((int)(time(1) - value/100));    }    return ::_sprintf(t);    }   }      class Opaque   {    inherit app_octet_string; -  + #if __VERSION__ < 8.0    constant tag = 4; -  + #else +  int tag = 4; + #endif    constant type_name = "OPAQUE";    protected string _sprintf(int t)    {    if (t == 's') return "";    return ::_sprintf(t);    }   }      class Counter64   {    inherit app_integer; -  + #if __VERSION__ < 8.0    constant tag = 6; -  + #else +  int tag = 6; + #endif    constant type_name = "COUNTER64";   }    -  + #if __VERSION__ < 8.0 + constant ContextOctetString = +  Protocols.LDAP.ldap_privates.asn1_context_octet_string; + constant ContextSequence = +  Protocols.LDAP.ldap_privates.asn1_context_sequence; + #else + class ContextOctetString + { +  inherit Standards.ASN1.Types.OctetString; +  +  int cls = 2; +  constant type_name = "CONTEXT OCTET STRING"; +  +  protected void create(int tag, string(8bit) val) +  { +  this_program::tag = tag; +  ::create(val); +  } + } +  + class ContextSequence + { +  inherit Standards.ASN1.Types.Sequence; +  +  int cls = 2; +  constant type_name = "CONTEXT SEQUENCE"; +  +  protected void create(int tag, array arg) +  { +  this_program::tag = tag; +  ::create(arg); +  } + } + #endif +    //! No such object marker. - Protocols.LDAP.ldap_privates.asn1_context_octet_string NO_SUCH_OBJECT = -  Protocols.LDAP.ldap_privates.asn1_context_octet_string(0, ""); + ContextOctetString NO_SUCH_OBJECT = ContextOctetString(0, "");      //! No such instance marker. - Protocols.LDAP.ldap_privates.asn1_context_octet_string NO_SUCH_INSTANCE = -  Protocols.LDAP.ldap_privates.asn1_context_octet_string(1, ""); + ContextOctetString NO_SUCH_INSTANCE = ContextOctetString(1, "");      //! End of MIB marker. - Protocols.LDAP.ldap_privates.asn1_context_octet_string END_OF_MIB = -  Protocols.LDAP.ldap_privates.asn1_context_octet_string(2, ""); + ContextOctetString END_OF_MIB = ContextOctetString(2, "");      //! The NULL counter.   Counter NULL_COUNTER = Counter(0);         class SimpleMIB   {    inherit ADT.Trie;       protected void init(array(int) oid,