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

version» Context lines:

Roxen.git/server/etc/modules/SNMP.pmod:51:   }      // ASN1 datatypes.      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"; -  + #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:81:    }    }   }      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"; -  + #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: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";   }      //! No such object marker.   Protocols.LDAP.ldap_privates.asn1_context_octet_string NO_SUCH_OBJECT =    Protocols.LDAP.ldap_privates.asn1_context_octet_string(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, "");