-/*
- * $Id: cache_snmp.h,v 1.30 2007/12/14 23:11:44 amosjeffries Exp $
- */
#ifndef SQUID_CACHE_SNMP_H
#define SQUID_CACHE_SNMP_H
-#ifdef SQUID_SNMP
+#if SQUID_SNMP
-#if SIZEOF_LONG == 8
-#define snint int
-#else
-#define snint long
-#endif
+typedef int64_t snint;
#ifndef MIN
#define MIN(a,b) (a<b?a:b)
#endif
#include "snmp.h"
-#include "snmp_impl.h"
-#if 0
-#include "asn1.h"
-#endif
#include "snmp_api.h"
-
-#include "snmp_vars.h"
+#include "snmp_impl.h"
/* MIB definitions
* SQUID-MIB
#define SQ_MESH SQUIDMIB, 5 /* cacheMesh group { squid 5 } */
#define LEN_SQ_MESH LEN_SQUIDMIB+1
-/*
+/**
* cacheSystem group { squid 1 }
*/
-
enum {
- SYS_START,
- SYSVMSIZ, /* cacheSysVMsize */
- SYSSTOR, /* cacheSysStorage */
- SYS_UPTIME,/* cacheUptime */
+ SYS_START = 0,
+ SYSVMSIZ = 1, /**< cacheSysVMsize */
+ SYSSTOR = 2, /**< cacheSysStorage */
+ SYS_UPTIME = 3, /**< cacheUptime */
SYS_END
};
#define LEN_SYS LEN_SQ_SYS + 1
#define LEN_SYS_INST LEN_SQ_SYS + 2
-/*
+/**
* cacheConfig group { squid 2 }
*/
-
enum {
- CONF_START,
- CONF_ADMIN, /* cacheAdmin */
- CONF_VERSION, /* cacheSoftware */
- CONF_VERSION_ID, /* cacheVersionId */
- CONF_LOG_FAC, /* cacheLoggingFacility */
- CONF_STORAGE, /* cacheStorageConfig group */
- CONF_UNIQNAME, /* cacheUniqName */
+ CONF_START = 0,
+ CONF_ADMIN = 1, /**< cacheAdmin */
+ CONF_VERSION = 2, /**< cacheSoftware */
+ CONF_VERSION_ID = 3, /**< cacheVersionId */
+ CONF_LOG_FAC = 4, /**< cacheLoggingFacility */
+ CONF_STORAGE = 5, /**< cacheStorageConfig group */
+ CONF_UNIQNAME = 6, /**< cacheUniqName */
CONF_END
};
#define LEN_CONF LEN_SQ_CONF + 1
#define LEN_CONF_INST LEN_SQ_CONF + 2
-
-/*
+/**
* cacheStorageConfig group { cacheConfig 5 }
*/
enum {
- CONF_ST_START,
- CONF_ST_MMAXSZ, /* cacheMemMaxSize */
- CONF_ST_SWMAXSZ, /* cacheSwapMaxSize */
- CONF_ST_SWHIWM, /* cacheSwapHighWM */
- CONF_ST_SWLOWM, /* cacheSwapLowWM */
+ CONF_ST_START = 0,
+ CONF_ST_MMAXSZ = 1, /* cacheMemMaxSize */
+ CONF_ST_SWMAXSZ = 2, /* cacheSwapMaxSize */
+ CONF_ST_SWHIWM = 3, /* cacheSwapHighWM */
+ CONF_ST_SWLOWM = 4, /* cacheSwapLowWM */
CONF_ST_END
};
*/
enum {
- PERF_START,
- PERF_SYS, /* cacheSysPerf */
- PERF_PROTO, /* cacheProtoStats */
+ PERF_START = 0,
+ PERF_SYS = 1, /* cacheSysPerf */
+ PERF_PROTO = 2, /* cacheProtoStats */
PERF_END
};
-
/* cacheSysPerf */
enum {
- PERF_SYS_START,
- PERF_SYS_PF, /* cacheSysPageFaults */
- PERF_SYS_NUMR, /* cacheSysNumReads */
- PERF_SYS_MEMUSAGE, /* cacheMemUsage */
- PERF_SYS_CPUTIME, /* cacheCpuTime */
- PERF_SYS_CPUUSAGE, /* cacheCpuUsage */
- PERF_SYS_MAXRESSZ, /* cacheMaxResSize */
- PERF_SYS_NUMOBJCNT, /* cacheNumObjCount */
- PERF_SYS_CURLRUEXP, /* cacheCurrentLRUExpiration */
- PERF_SYS_CURUNLREQ, /* cacheCurrentUnlinkRequests */
- PERF_SYS_CURUNUSED_FD, /* cacheCurrentUnusedFDescrCnt */
- PERF_SYS_CURRESERVED_FD, /* cacheCurrentResFileDescrCnt */
- PERF_SYS_CURUSED_FD, /* cacheCurrentFileDescrCnt */
- PERF_SYS_CURMAX_FD, /* cacheCurrentFileDescrMax */
+ PERF_SYS_START = 0,
+ PERF_SYS_PF = 1, /* cacheSysPageFaults */
+ PERF_SYS_NUMR = 2, /* cacheSysNumReads */
+ PERF_SYS_MEMUSAGE = 3, /* cacheMemUsage */
+ PERF_SYS_CPUTIME = 4, /* cacheCpuTime */
+ PERF_SYS_CPUUSAGE = 5, /* cacheCpuUsage */
+ PERF_SYS_MAXRESSZ = 6, /* cacheMaxResSize */
+ PERF_SYS_NUMOBJCNT = 7, /* cacheNumObjCount */
+ PERF_SYS_CURLRUEXP = 8, /* cacheCurrentLRUExpiration */
+ PERF_SYS_CURUNLREQ = 9, /* cacheCurrentUnlinkRequests */
+ PERF_SYS_CURUNUSED_FD = 10, /* cacheCurrentUnusedFDescrCnt */
+ PERF_SYS_CURRESERVED_FD = 11, /* cacheCurrentResFileDescrCnt */
+ PERF_SYS_CURUSED_FD = 12, /* cacheCurrentFileDescrCnt */
+ PERF_SYS_CURMAX_FD = 13, /* cacheCurrentFileDescrMax */
PERF_SYS_END
};
/* cacheProtoStats */
enum {
PERF_PROTOSTAT_START,
- PERF_PROTOSTAT_AGGR, /* cacheProtoAggregateStats */
- PERF_PROTOSTAT_MEDIAN, /* cacheMedianSvcTable */
+ PERF_PROTOSTAT_AGGR = 1, /* cacheProtoAggregateStats */
+ PERF_PROTOSTAT_MEDIAN = 2, /* cacheMedianSvcTable */
PERF_PROTOSTAT_END
};
/* cacheProtoAggregateStats */
enum {
- PERF_PROTOSTAT_AGGR_START,
- PERF_PROTOSTAT_AGGR_HTTP_REQ, /* cacheProtoClientHttpRequests */
- PERF_PROTOSTAT_AGGR_HTTP_HITS, /* cacheHttpHits */
- PERF_PROTOSTAT_AGGR_HTTP_ERRORS, /* cacheHttpErrors */
- PERF_PROTOSTAT_AGGR_HTTP_KBYTES_IN, /* cacheHttpInKb */
- PERF_PROTOSTAT_AGGR_HTTP_KBYTES_OUT, /* cacheHttpOutKb */
- PERF_PROTOSTAT_AGGR_ICP_S, /* cacheIcpPktsSent */
- PERF_PROTOSTAT_AGGR_ICP_R, /* cacheIcpPktsRecv */
- PERF_PROTOSTAT_AGGR_ICP_SKB, /* cacheIcpKbSent */
- PERF_PROTOSTAT_AGGR_ICP_RKB, /* cacheIcpKbRecv */
- PERF_PROTOSTAT_AGGR_REQ, /* cacheServerRequests */
- PERF_PROTOSTAT_AGGR_ERRORS, /* cacheServerErrors */
- PERF_PROTOSTAT_AGGR_KBYTES_IN, /* cacheServerInKb */
- PERF_PROTOSTAT_AGGR_KBYTES_OUT, /* cacheServerOutKb */
- PERF_PROTOSTAT_AGGR_CURSWAP, /* cacheCurrentSwapSize */
- PERF_PROTOSTAT_AGGR_CLIENTS, /* cacheClients */
+ PERF_PROTOSTAT_AGGR_START = 0,
+ PERF_PROTOSTAT_AGGR_HTTP_REQ = 1, /* cacheProtoClientHttpRequests */
+ PERF_PROTOSTAT_AGGR_HTTP_HITS = 2, /* cacheHttpHits */
+ PERF_PROTOSTAT_AGGR_HTTP_ERRORS = 3, /* cacheHttpErrors */
+ PERF_PROTOSTAT_AGGR_HTTP_KBYTES_IN = 4, /* cacheHttpInKb */
+ PERF_PROTOSTAT_AGGR_HTTP_KBYTES_OUT = 5, /* cacheHttpOutKb */
+ PERF_PROTOSTAT_AGGR_ICP_S = 6, /* cacheIcpPktsSent */
+ PERF_PROTOSTAT_AGGR_ICP_R = 7, /* cacheIcpPktsRecv */
+ PERF_PROTOSTAT_AGGR_ICP_SKB = 8, /* cacheIcpKbSent */
+ PERF_PROTOSTAT_AGGR_ICP_RKB = 9, /* cacheIcpKbRecv */
+ PERF_PROTOSTAT_AGGR_REQ = 10, /* cacheServerRequests */
+ PERF_PROTOSTAT_AGGR_ERRORS = 11, /* cacheServerErrors */
+ PERF_PROTOSTAT_AGGR_KBYTES_IN = 12, /* cacheServerInKb */
+ PERF_PROTOSTAT_AGGR_KBYTES_OUT = 13, /* cacheServerOutKb */
+ PERF_PROTOSTAT_AGGR_CURSWAP = 14, /* cacheCurrentSwapSize */
+ PERF_PROTOSTAT_AGGR_CLIENTS = 15, /* cacheClients */
PERF_PROTOSTAT_AGGR_END
};
-
-/* CacheMedianSvcEntry */
+/* cacheMedianSvcEntry */
enum {
- PERF_MEDIAN_START,
- PERF_MEDIAN_TIME, /* cacheMedianTime */
- PERF_MEDIAN_HTTP_ALL, /* cacheHttpAllSvcTime */
- PERF_MEDIAN_HTTP_MISS, /* cacheHttpMissSvcTime */
- PERF_MEDIAN_HTTP_NM, /* cacheHttpNmSvcTime */
- PERF_MEDIAN_HTTP_HIT, /* cacheHttpHitSvcTime */
- PERF_MEDIAN_ICP_QUERY, /* cacheIcpQuerySvcTime */
- PERF_MEDIAN_ICP_REPLY, /* cacheIcpReplySvcTime */
- PERF_MEDIAN_DNS, /* cacheDnsSvcTime */
- PERF_MEDIAN_RHR, /* cacheRequestHitRatio */
- PERF_MEDIAN_BHR, /* cacheRequestByteRatio */
- PERF_MEDIAN_HTTP_NH, /* cacheHttpNhSvcTime */
+ PERF_MEDIAN_START = 0,
+ PERF_MEDIAN_TIME = 1, /* cacheMedianTime */
+ PERF_MEDIAN_HTTP_ALL = 2, /* cacheHttpAllSvcTime */
+ PERF_MEDIAN_HTTP_MISS = 3, /* cacheHttpMissSvcTime */
+ PERF_MEDIAN_HTTP_NM = 4, /* cacheHttpNmSvcTime */
+ PERF_MEDIAN_HTTP_HIT = 5, /* cacheHttpHitSvcTime */
+ PERF_MEDIAN_ICP_QUERY = 6, /* cacheIcpQuerySvcTime */
+ PERF_MEDIAN_ICP_REPLY = 7, /* cacheIcpReplySvcTime */
+ PERF_MEDIAN_DNS = 8, /* cacheDnsSvcTime */
+ PERF_MEDIAN_RHR = 9, /* cacheRequestHitRatio */
+ PERF_MEDIAN_BHR = 10, /* cacheRequestByteRatio */
+ PERF_MEDIAN_HTTP_NH = 11, /* cacheHttpNhSvcTime */
PERF_MEDIAN_END
};
-
-
-
/*
* cacheNetwork group { squid 4 }
*/
-
enum {
- NET_START,
- NET_IP_CACHE, /* cacheIpCache */
- NET_FQDN_CACHE, /* cacheFqdnCache */
- NET_DNS_CACHE, /* cacheDns */
+ NET_START = 0,
+ NET_IP_CACHE = 1, /* cacheIpCache */
+ NET_FQDN_CACHE = 2, /* cacheFqdnCache */
+ NET_DNS_CACHE = 3, /* cacheDns */
NET_END
};
/* cacheIpCache */
enum {
- IP_START,
- IP_ENT, /* cacheIpEntrie */
- IP_REQ, /* cacheIpRequests */
- IP_HITS, /* acheIpHits */
- IP_PENDHIT, /* cacheIpPendingHits */
- IP_NEGHIT, /* cacheIpNegativeHit */
- IP_MISS, /* cacheIpMisses */
- IP_GHBN, /* cacheBlockingGetHostByName */
- IP_LOC, /* cacheAttemptReleaseLckEntries */
+ IP_START = 0,
+ IP_ENT = 1, /* cacheIpEntrie */
+ IP_REQ = 2, /* cacheIpRequests */
+ IP_HITS = 3, /* acheIpHits */
+ IP_PENDHIT = 4, /* cacheIpPendingHits */
+ IP_NEGHIT = 5, /* cacheIpNegativeHit */
+ IP_MISS = 6, /* cacheIpMisses */
+ IP_GHBN = 7, /* cacheBlockingGetHostByName */
+ IP_LOC = 8, /* cacheAttemptReleaseLckEntries */
IP_END
};
/* cacheFqdnCache */
enum {
- FQDN_START,
- FQDN_ENT, /* cacheFqdnEntries */
- FQDN_REQ, /* cacheFqdnRequests */
- FQDN_HITS, /* cacheFqdnHits */
- FQDN_PENDHIT, /* cacheFqdnPendingHits */
- FQDN_NEGHIT, /* cacheFqdnNegativeHits */
- FQDN_MISS, /* cacheFqdnMisses */
- FQDN_GHBN, /* cacheBlockingGetHostByAddr */
+ FQDN_START = 0,
+ FQDN_ENT = 1, /* cacheFqdnEntries */
+ FQDN_REQ = 2, /* cacheFqdnRequests */
+ FQDN_HITS = 3, /* cacheFqdnHits */
+ FQDN_PENDHIT = 4, /* cacheFqdnPendingHits */
+ FQDN_NEGHIT = 5, /* cacheFqdnNegativeHits */
+ FQDN_MISS = 6, /* cacheFqdnMisses */
+ FQDN_GHBN = 7, /* cacheBlockingGetHostByAddr */
FQDN_END
};
-
/* cacheDNS */
enum {
- DNS_START,
- DNS_REQ, /* cacheDnsRequests */
- DNS_REP, /* cacheDnsReplies */
- DNS_SERVERS, /* cacheDnsNumberServers */
+ DNS_START = 0,
+ DNS_REQ = 1, /* cacheDnsRequests */
+ DNS_REP = 2, /* cacheDnsReplies */
+ DNS_SERVERS = 3, /* cacheDnsNumberServers */
DNS_END
};
-
-
-
/*
* cacheMesh group { squid 5 }
*/
enum {
- MESH_START,
- MESH_PTBL, /* cachePeerTable */
- MESH_CTBL, /* cacheClientTable */
+ MESH_START = 0,
+ MESH_PTBL = 1, /* cachePeerTable */
+ MESH_CTBL = 2, /* cacheClientTable */
MESH_END
};
-/* cachePeerEntry */
+/* CachePeerTableEntry (version 3) */
enum {
- MESH_PTBL_START,
- MESH_PTBL_INDEX, /* cachePeerIndex */
- MESH_PTBL_NAME, /* cachePeerName */
- MESH_PTBL_ADDR_TYPE, /* cachePeerAddressType */
- MESH_PTBL_ADDR, /* cachePeerAddress */
- MESH_PTBL_HTTP, /* cachePortHttp */
- MESH_PTBL_ICP, /* cachePeerPortIcp */
- MESH_PTBL_TYPE, /* cachePeerType */
- MESH_PTBL_STATE, /* cachePeerStat */
- MESH_PTBL_SENT, /* cachePeerPingsSent */
- MESH_PTBL_PACKED, /* cachePeerPingsAcked */
- MESH_PTBL_FETCHES, /* cachePeerFetches */
- MESH_PTBL_RTT, /* cachePeerRtt */
- MESH_PTBL_IGN, /* cachePeerIgnored */
- MESH_PTBL_KEEPAL_S, /* cachePeerKeepAlSent */
- MESH_PTBL_KEEPAL_R, /* cachePeerKeepAlRecv */
+ MESH_PTBL_START = 0,
+ MESH_PTBL_INDEX = 1, /* cachePeerIndex */
+ MESH_PTBL_NAME = 2, /* cachePeerName */
+ MESH_PTBL_ADDR_TYPE = 3, /* cachePeerAddressType */
+ MESH_PTBL_ADDR = 4, /* cachePeerAddress */
+ MESH_PTBL_HTTP = 5, /* cachePortHttp */
+ MESH_PTBL_ICP = 6, /* cachePeerPortIcp */
+ MESH_PTBL_TYPE = 7, /* cachePeerType */
+ MESH_PTBL_STATE = 8, /* cachePeerStat */
+ MESH_PTBL_SENT = 9, /* cachePeerPingsSent */
+ MESH_PTBL_PACKED = 10, /* cachePeerPingsAcked */
+ MESH_PTBL_FETCHES = 11, /* cachePeerFetches */
+ MESH_PTBL_RTT = 12, /* cachePeerRtt */
+ MESH_PTBL_IGN = 13, /* cachePeerIgnored */
+ MESH_PTBL_KEEPAL_S = 14, /* cachePeerKeepAlSent */
+ MESH_PTBL_KEEPAL_R = 15, /* cachePeerKeepAlRecv */
MESH_PTBL_END
};
/* cacheClientEntry */
enum {
- MESH_CTBL_START,
- MESH_CTBL_ADDR_TYPE, /* cacheClientAddressType */
- MESH_CTBL_ADDR, /* cacheClientAddress */
- MESH_CTBL_HTREQ, /* cacheClientHttpRequests */
- MESH_CTBL_HTBYTES, /* cacheClientHttpKb */
- MESH_CTBL_HTHITS, /* cacheClientHttpHits */
- MESH_CTBL_HTHITBYTES, /* cacheClientHTTPHitKb */
- MESH_CTBL_ICPREQ, /* cacheClientIcpRequests */
- MESH_CTBL_ICPBYTES, /* cacheClientIcpKb */
- MESH_CTBL_ICPHITS, /* cacheClientIcpHits */
- MESH_CTBL_ICPHITBYTES,/* cacheClientIcpHitKb */
+ MESH_CTBL_START = 0,
+ MESH_CTBL_ADDR_TYPE = 1, /* cacheClientAddressType */
+ MESH_CTBL_ADDR = 2, /* cacheClientAddress */
+ MESH_CTBL_HTREQ = 3, /* cacheClientHttpRequests */
+ MESH_CTBL_HTBYTES = 4, /* cacheClientHttpKb */
+ MESH_CTBL_HTHITS = 5, /* cacheClientHttpHits */
+ MESH_CTBL_HTHITBYTES = 6, /* cacheClientHTTPHitKb */
+ MESH_CTBL_ICPREQ = 7, /* cacheClientIcpRequests */
+ MESH_CTBL_ICPBYTES = 8, /* cacheClientIcpKb */
+ MESH_CTBL_ICPHITS = 9, /* cacheClientIcpHits */
+ MESH_CTBL_ICPHITBYTES = 10, /* cacheClientIcpHitKb */
MESH_CTBL_END
};
-
-
#endif /* SQUID_SNMP */
#endif /* SQUID_CACHE_SNMP_H */