Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.639 2007/09/12 14:12:56 grubba Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.640 2007/09/14 11:23:36 grubba Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>   #include <timers.h>      #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)      // --- Locale defines ---   //<locale-token project="roxen_start"> LOC_S </locale-token>
Roxen.git/server/base_server/configuration.pike:499:    return allocate(10, Priority)();   }      // SNMP MIB for this configuration.   ADT.Trie mib = ADT.Trie();   int mib_version;      array(int) query_oid()   {    return SNMP.RIS_OID_WEBSERVER + -  ({ 2, query("snmp_site_id"), }); +  ({ 2 });   }    - array(int) generate_module_oid(RoxenModule me) + //! @returns + //! Returns an array with two elements: + //! @array + //! @item array(int) oid + //! @item array(int) oid_suffix + //! @endarray + array(int) generate_module_oid_segment(RoxenModule me)   {    string s = otomod[me];    array(string) a = s/"#"; -  array(string) n = a[0]/4.0; -  return query_oid() + -  ({ 8, sizeof(n), @map(n, Gmp.bignum, 256), ((int)a[1]) + 1 }); +  return ({ sizeof(a[0]), @((array(int))a[0]), ((int)a[1]) + 1 });   }      ADT.Trie generate_module_mib(array(int) oid, -  +  array(int) oid_suffix,    RoxenModule me,    ModuleInfo moduleinfo,    ModuleCopies module)   { -  +  array(int) segment = generate_module_oid_segment(me);    return SNMP.SimpleMIB(oid, -  +  oid_suffix + segment,    ({    UNDEFINED, -  +  SNMP.Integer(segment[-1]),    SNMP.String(otomod[me],    "moduleIdentifier"),    SNMP.Integer(moduleinfo->type,    "moduleType"),    SNMP.String(me->cvs_version || "",    "moduleVersion"),    }));   }      // Cache some configuration variables.
Roxen.git/server/base_server/configuration.pike:3766:       if(module_type & MODULE_LAST)    pri[pr]->last_modules += ({ me });       if(module_type & MODULE_FILTER)    pri[pr]->filter_modules += ({ me });       if(module_type & MODULE_FIRST)    pri[pr]->first_modules += ({ me });    -  mib->merge(generate_module_mib(generate_module_oid(me) + ({ 1 }), +  array(int) oid_suffix = ({ query("snmp_site_id") }); +  mib->merge(generate_module_mib(query_oid() + ({ 8, 1 }), oid_suffix,    me, moduleinfo, module));    if (me->query_snmp_mib) { -  mib->merge(me->query_snmp_mib(generate_module_oid(me) + ({ 2 }))); +  array(int) segment = generate_module_oid_segment(me); +  mib->merge(me->query_snmp_mib(query_oid() + ({ 8, 2 }) + +  segment[..sizeof(segment)-2], +  oid_suffix + ({ segment[-1] })));    }    mib_version++;       invalidate_cache();   }      void call_high_start_callbacks (RoxenModule me, ModuleInfo moduleinfo,    void|int newly_added)   {    // This is icky, but I don't know if it's safe to remove. /mast
Roxen.git/server/base_server/configuration.pike:4997:   // report_debug("[restore: %.1fms] ", (gethrtime()-st)/1000.0 );       // FIXME: The default value ought to be stable.    defvar("snmp_site_id", sizeof(roxen->configurations)+1,    DLOCALE(0, "SNMP: Site id"), TYPE_INT,    DLOCALE(0, "OID suffix to 1.3.6.1.4.1.8614.1.1.2 "    "identifying this site."));       // FIXME: The following should move to a stage where    // the config variables have been loaded. -  mib->merge(SNMP.SimpleMIB(query_oid(), +  mib->merge(SNMP.SimpleMIB(query_oid(), ({ query("snmp_site_id") }),    ({    UNDEFINED,    UNDEFINED,    query_name,    comment,    SNMP.Counter64(lambda() { return sent; }),    SNMP.Counter64(lambda() { return received; }),    SNMP.Counter64(lambda() { return hsent; }),    SNMP.Counter64(lambda() { return requests; }),    UNDEFINED, // NOTE: Reserved for modules!