} conf_if_list;
extern conf_if_list *if_list;
-
+extern void init_mib(const char *);
extern int read_objid(char *input, oid * output, int *out_len);
extern void snmp_add_null_var(struct snmp_pdu *, oid *, int);
extern void sprint_objid(char *buf, oid * id, int idlen);
* ** Write data into file
*/
int
-Util_file_write (char *file, int offset, char *data, int dataSz))
+Util_file_write (char *file, int offset, char *data, int dataSz);
/* ---------------------------------------------------------------------- */
-
-
-
-
-
-
-
-
-
#endif
mib.o: mib.c
$(CC) $(CFLAGS) $(MIBDEFS) -c mib.c
+distclean: celan
+ -rm -f Makefile
clean:
rm -f core *.o ${TARG} shared/*.o *.a *.so*
init_mib(const char *file)
{
char *prefix;
+ if (Mib!=NULL)
+ return;
Mib = 0;
if (file)
#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.in,v 1.102 1997/11/23 06:47:18 wessels Exp $
+# $Id: Makefile.in,v 1.103 1997/12/01 22:45:47 wessels Exp $
#
# Uncomment and customize the following to suit your needs:
#
USE_ASYNC_IO = # -DUSE_ASYNC_IO=1
# define all three for SNMP support
-#SQUID_SNMP = -DSQUID_SNMP=1
-#SQUID_MIB = mib.txt
-#SQUID_SNMP_LIBS = -L../snmplib -lsnmp
+SQUID_SNMP = -DSQUID_SNMP=1
+SQUID_MIB = mib.txt
+SQUID_SNMP_LIBS = -L../snmplib -lsnmp
DEFINES = $(HOST_OPT) \
$(ICMP_OPT) $(DELAY_HACK) $(USERAGENT_OPT) \
VPATH = @srcdir@
DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf
-DEFAULT_SNMP_CONF = $(sysconfdir)/snmp.conf
DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf
DEFAULT_DNSSERVER = $(libexecdir)/dnsserver
DEFAULT_CACHE_LOG = $(localstatedir)/logs/cache.log
DEFAULT_UNLINKD = $(libexecdir)/unlinkd
DEFAULT_ICON_DIR = $(sysconfdir)/icons
DEFAULT_ERROR_DIR = $(sysconfdir)/errors
-DEFAULT_MIB_PATH = $(sysconfdir)/squidmib.txt
+DEFAULT_MIB_PATH = $(sysconfdir)/mib.txt
CC = @CC@
MAKEDEPEND = @MAKEDEPEND@
s%@DEFAULT_STORE_LOG@%$(DEFAULT_STORE_LOG)%g;\
s%@DEFAULT_PID_FILE@%$(DEFAULT_PID_FILE)%g;\
s%@DEFAULT_SWAP_DIR@%$(DEFAULT_SWAP_DIR)%g;\
- s%@DEFAULT_SNMP_CONF@%$(DEFAULT_SNMP_CONF)%g;\
s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g;\
s%@DEFAULT_MIB_PATH@%$(DEFAULT_MIB_PATH)%g;\
s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g" < cf.data.pre >$@
echo "$(INSTALL_FILE) squid.conf $(sysconfdir)"; \
$(INSTALL_FILE) squid.conf $(sysconfdir); \
fi
- $(INSTALL_FILE) snmp.conf $(sysconfdir)/snmp.conf.default
- @if test -f $(sysconfdir)/snmp.conf ; then \
- echo "$@ will not overwrite existing $(sysconfdir)/snmp.conf" ; \
- else \
- echo "$(INSTALL_FILE) snmp.conf $(sysconfdir)"; \
- $(INSTALL_FILE) snmp.conf $(sysconfdir); \
- fi
$(INSTALL_FILE) mime.conf $(sysconfdir)/mime.conf.default
@if test -f $(sysconfdir)/mime.conf ; then \
/*
- * $Id: access_log.cc,v 1.12 1997/11/30 02:26:41 wessels Exp $
+ * $Id: access_log.cc,v 1.13 1997/12/01 22:45:48 wessels Exp $
*
* DEBUG: section 46 Access Log
* AUTHOR: Duane Wessels
"UDP_DENIED",
"UDP_INVALID",
"UDP_MISS_NOFETCH",
+ "LOG_METER_EXPIRES",
"LOG_TYPE_MAX"
};
/*
- * $Id: cache_cf.cc,v 1.234 1997/11/23 06:48:39 wessels Exp $
+ * $Id: cache_cf.cc,v 1.235 1997/12/01 22:45:49 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
*/
#include "squid.h"
+#include "snmp.h"
+#include "snmp_config.h"
static const char *const T_SECOND_STR = "second";
static const char *const T_MINUTE_STR = "minute";
static void wordlistAdd(wordlist **, const char *);
static void configDoConfigure(void);
+static void parse_snmp_conf(snmpconf **);
static void parse_refreshpattern(refresh_t **);
static int parseTimeUnits(const char *unit);
static void parseTimeLine(time_t * tptr, const char *units);
static size_t parseBytesUnits(const char *unit);
static void free_all(void);
static void requirePathnameExists(const char *name, const char *path);
+/*
+extern int create_view ( char **);
+extern int create_user ( char **);
+extern int create_community (char **);
+extern void tokenize ( char *, char **, int );
+*/
+extern struct tree *Mib;
static void
self_destruct(void)
storeAppendPrintf(entry, "%s -- UNIMPLEMENTED\n", name);
}
+static void
+parse_snmp_conf(snmpconf **s)
+{
+ static char buff[256];
+ static char *tokens[10], *p;
+ if (Mib==NULL)
+ {
+ if (Config.Snmp.mibPath)
+ init_mib(Config.Snmp.mibPath) ;
+ else
+ fatal("snmp_mib_path should be defined before any snmp_agent_conf\n");
+ }
+ p=strtok(NULL, null_string);
+ strcpy(buff,p);
+ tokenize(buff, tokens, 10 );
+
+ if ( !strcmp("view", tokens[0]) ) {
+ if (create_view(tokens) < 0 )
+ debug(49,5)("snmp: parse_snmpconf(): error\n");
+ } else if ( !strcmp("user", tokens[0])) {
+ if (create_user(tokens) < 0 )
+ debug(49,5)("snmp: parse_snmpconf(): error\n");
+ } else if ( !strcmp("community", tokens[0] )) {
+ if ( create_community(tokens) < 0 )
+ debug(49,5)("snmp: parse_snmpconf(): error\n");
+ } else
+ debug(49,5)("snmp: unknown directive %s\n",tokens[0]);
+}
+
static void
parse_acl(acl ** acl)
{
#define dump_eol dump_string
#define free_eol free_string
+static void
+dump_snmp_conf(StoreEntry *entry, const char *name, snmpconf *head)
+{
+ storeAppendPrintf(entry, "%s -- UNIMPLEMENTED\n", name);
+}
+
static void
dump_refreshpattern(StoreEntry * entry, const char *name, refresh_t * head)
{
safe_free(pattern);
}
+static void
+free_snmp_conf(snmpconf **head)
+{
+ snmpconf *t;
+ while (( t= *head ) != NULL ) {
+ *head=t->next;
+ safe_free(t->line);
+ safe_free(t);
+ }
+}
+
static void
free_refreshpattern(refresh_t ** head)
{
maximum_single_addr_tries 3
DOC_END
+NAME: snmp_port
+TYPE: ushort
+LOC: Config.Port.snmp
+DEFAULT: 3401
+DOC_START
+ Port for snmp. <=0 to disable.
+DOC_END
+
+NAME: snmp_config_file
+TYPE: string
+LOC: Config.Snmp.configFile
+DEFAULT: @DEFAULT_SNMP_CONF@
+DOC_START
+ External snmp configuration file, CMU-snmpd style.
+DOC_END
+
+NAME: snmp_do_queueing
+TYPE: onoff
+LOC: Config.Snmp.do_queueing
+DEFAULT: on
+DOC_START
+ If disabled, snmp packets will not be queued but delivered
+ immediately. This could be performant when you want to monitor
+ a cache in trouble, but this could also bring squid to block.
+DOC_END
+
+NAME: forward_snmpd_port
+TYPE: ushort
+LOC: Config.Snmp.localPort
+DEFAULT: 0
+DOC_START
+ This configures whether we should be forwarding SNMP requests
+ to another snmpd. The reason for putting this piece of functionality
+ into squid was to enable access to the system's installed
+ snmpd with minimal changes.
+ This option is turned off by default, check with your /etc/services
+ for your system's snmp port (usually 161).
+ We do not use getservbyname() to allow you to set squid into port 161
+ and your system's snmpd to another port by changing /etc/services.
+
+ WARNING: Because of squid acting as a proxy snmpd for system
+ you have to do security checks on THIS snmpd for all objects.
+ Check your snmp_config_file
+DOC_END
+
+NAME: snmp_mib_path
+TYPE: string
+LOC: Config.Snmp.mibPath
+DEFAULT: @DEFAULT_MIB_PATH@
+DOC_START
+ The location of squid's mib.
+DOC_END
+
NAME: snmp_port
TYPE: ushort
LOC: Config.Port.snmp
snmp_config_file
DOC_END
-NAME: snmp_mib_path
+NAME: trap_sink
TYPE: string
-LOC: Config.Snmp.mibPath
-DEFAULT: @DEFAULT_MIB_PATH@
+LOC: Config.Snmp.trap_sink
+DEFAULT: 127.0.0.1
DOC_START
- The location of squid's mib.
+ Hostname or ip address of trap sink for snmp
DOC_END
+NAME: snmp_trap_community
+TYPE: string
+LOC: Config.Snmp.trap_community
+DEFAULT: public
+DOC_START
+ Community name for traps
+DOC_END
+
+NAME: snmp_enable_authen_traps
+TYPE: onoff
+LOC: Config.Snmp.conf_authtraps
+DEFAULT: off
+DOC_START
+ Enable SNMP authenticated traps
+DOC_END
+
+NAME: snmp_agent_conf
+TYPE: snmp_conf
+LOC: Config.Snmp.snmpconf
+DEFAULT: none
+DOC_START
+ Define snmp views, users and communities
+ Example:
+ snmp_agent_conf view all .1.3.6 included
+ snmp_agent_conf view squid .1.3.6 included
+ snmp_agent_conf user squid - all all public
+ snmp_agent_conf user all all all all squid
+ snmp_agent_conf community public squid squid
+ snmp_agent_conf community readwrite all all
+DOC_END
EOF
/*
- * $Id: cf_gen.cc,v 1.15 1997/11/05 05:29:19 wessels Exp $
+ * $Id: cf_gen.cc,v 1.16 1997/12/01 22:45:50 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Max Okumoto
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
+#include "snmp.h"
+#include "snmp_config.h"
#define MAX_LINE 1024 /* longest configuration line */
#define _PATH_PARSER "cf_parser.c"
LOG_UDP_DENIED,
LOG_UDP_INVALID,
LOG_UDP_MISS_NOFETCH,
+ LOG_METER_EXPIRES,
LOG_TYPE_MAX
} log_type;
ACCESS_ALLOWED,
ACCESS_REQ_PROXY_AUTH
} allow_t;
+
+enum {
+SNMP_C_VIEW,
+SNMP_C_USER,
+SNMP_C_COMMUNITY
+};
/*
- * $Id: fqdncache.cc,v 1.69 1997/11/28 08:19:56 wessels Exp $
+ * $Id: fqdncache.cc,v 1.70 1997/12/01 22:45:51 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
static fqdncache_entry *fqdncache_parsebuffer(const char *buf, dnsserver_t *);
static int fqdncache_purgelru(void);
static void fqdncache_release(fqdncache_entry *);
-static fqdncache_entry *fqdncache_GetFirst(void);
-static fqdncache_entry *fqdncache_GetNext(void);
+ fqdncache_entry *fqdncache_GetFirst(void);
+ fqdncache_entry *fqdncache_GetNext(void);
static fqdncache_entry *fqdncache_create(const char *name);
static void fqdncache_add_to_hash(fqdncache_entry *);
static void fqdncache_call_pending(fqdncache_entry *);
return f;
}
-static fqdncache_entry *
+ fqdncache_entry *
fqdncache_GetFirst(void)
{
return (fqdncache_entry *) hash_first(fqdn_table);
}
-static fqdncache_entry *
+ fqdncache_entry *
fqdncache_GetNext(void)
{
return (fqdncache_entry *) hash_next(fqdn_table);
/*
- * $Id: ipcache.cc,v 1.146 1997/11/28 08:20:29 wessels Exp $
+ * $Id: ipcache.cc,v 1.147 1997/12/01 22:45:52 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
int release_locked;
} IpcacheStats;
-static dlink_list lru_list;
+ dlink_list lru_list;
static int ipcache_testname(void);
#if OLD_CODE
-- File: SQUID.MIB
-- kostas@nlanr.net
-- Created : 11/ 2/97 kostas@nlanr.net
--- Last Update: 11/18/97 kostas@nlanr.net
+-- Last Update: 12/1/97 kostas@nlanr.net
+SQUID-MIB DEFINITIONS ::= BEGIN
+ IMPORTS
+ TimeTicks,
+ Counter FROM RFC1155-SMI
+ DisplayString FROM RFC1158-MIB
+ mib-2 FROM RFC1213-MIB
+ OBJECT-TYPE FROM RFC-1212
+ TRAP-TYPE FROM RFC-1215;
+
+--
+-- definitions included for standalone agent/managers
+--
mgmt OBJECT IDENTIFIER ::= { iso org(3) dod(6) internet(1) 2 }
mib OBJECT IDENTIFIER ::= { mgmt 1 }
private OBJECT IDENTIFIER ::= { internet 4 }
enterprises OBJECT IDENTIFIER ::= { private 1 }
nsfnet OBJECT IDENTIFIER ::= { experimental 25 }
+squid OBJECT IDENTIFIER ::= { nsfnet 17 }
-
--- SQUID-MIB DEFINITIONS ::= BEGIN
--- IMPORTS
--- TimeTicks,
--- Counter FROM RFC1155-SMI
--- DisplayString FROM RFC1158-MIB
--- mib-2 FROM RFC1213-MIB
--- OBJECT-TYPE FROM RFC-1212
--- TRAP-TYPE FROM RFC-1215;
- squid OBJECT IDENTIFIER ::= { nsfnet 17 }
-
+--
+-- Major MIB groups
+--
cacheSystem OBJECT IDENTIFIER ::= { squid 1 }
cacheConfig OBJECT IDENTIFIER ::= { squid 2 }
cachePerf OBJECT IDENTIFIER ::= { squid 3 }
- cacheAccounting OBJECT IDENTIFIER ::= { squid 4 }
+ cacheAccounting OBJECT IDENTIFIER ::= { squid 6 }
cacheSecurity OBJECT IDENTIFIER ::= { squid 5 }
- cacheNetwork OBJECT IDENTIFIER ::= { squid 6 }
+ cacheNetwork OBJECT IDENTIFIER ::= { squid 4 }
+
--
-- cacheSystem group
--
-- config group
--
--- Contains configuration information including peers, acls etc.
+-- Contains configuration information including peers etc.
cacheAdmin OBJECT-TYPE
::= { cacheStorageConfig 6 }
cacheWaisRelayHost OBJECT-TYPE
- SYNTAX OCTET STRING
+ SYNTAX DisplayString
ACCESS read-only
STATUS mandatory
DESCRIPTION
cacheTimeoutValues OBJECT IDENTIFIER ::= { cacheConfig 6 }
-
cacheReadTimeout OBJECT-TYPE
SYNTAX Integer
ACCESS read-only
cacheLoggingLevel OBJECT-TYPE
- SYNTAX Integer
+ SYNTAX DisplayString
ACCESS read-write
STATUS mandatory
DESCRIPTION
cachePeerState INTEGER
}
+ cachePeerId OBJECT-TYPE
+ SYNTAX Integer
+ ACCESS read-only
+ STATUS current
+ ::= { cachePeerEntry 1 }
cachePeerName OBJECT-TYPE
SYNTAX DisplayString
ACCESS read-only
STATUS current
- ::= { cachePeerEntry 1 }
+ ::= { cachePeerEntry 2 }
cachePeerIP OBJECT-TYPE
SYNTAX IpAddress
ACCESS read-only
STATUS current
- ::= { cachePeerEntry 2 }
-
- cachePeerPortHttp OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS current
::= { cachePeerEntry 3 }
- cachePeerPortIcp OBJECT-TYPE
+ cachePeerPortHttp OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS current
::= { cachePeerEntry 4 }
- cachePeerType OBJECT-TYPE
+ cachePeerPortIcp OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS current
::= { cachePeerEntry 5 }
+-- cachePeerType OBJECT-TYPE
+-- SYNTAX INTEGER
+-- ACCESS read-only
+-- STATUS current
+-- ::= { cachePeerEntry 6 }
+
cachePeerState OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-only
STATUS current
- ::= { cachePeerEntry 6 }
+ ::= { cachePeerEntry 7 }
cachePeerType OBJECT-TYPE
SYNTAX INTEGER {
- parent(1), sibling(2), multicast(3), none(4)
+ parent(1),
+ sibling(2),
+ multicast(3),
+ none(4)
}
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
" Peer Type "
- ::= { cachePeerEntry 4 }
+ ::= { cachePeerEntry 6 }
--
-- cacheNetwork group
-- IP cache info
- IPcacheTable OBJECT-TYPE
+ ipCacheTable OBJECT-TYPE
SYNTAX SEQUENCE OF iPcacheEntry
ACCESS read-only
STATUS current
STATUS current
DESCRIPTION
" An entry in cachePeerTable "
- INDEX { IPcacheEntryIP }
- ::= { IPcacheTable 1 }
+ INDEX { IPcacheEntryId }
+ ::= { ipCacheTable 1 }
IPcacheEntry ::= SEQUENCE {
+ IPcacheEntryId Integer,
IPcacheEntryName OCTET STRING,
IPcacheEntryIP IpAddress,
IPcacheEntryState INTEGER,
" State of IP cache entry "
::= { iPcacheEntry 3 }
+ IPcacheEntryId OBJECT-TYPE
+ SYNTAX Integer
+ ACCESS read-only
+ STATUS current
+ ::= { iPcacheEntry 1 }
+
IPcacheEntryName OBJECT-TYPE
SYNTAX OCTET STRING
ACCESS read-only
STATUS current
- ::= { iPcacheEntry 1 }
+ ::= { iPcacheEntry 2 }
IPcacheEntryIP OBJECT-TYPE
SYNTAX IpAddress
ACCESS read-only
STATUS current
- ::= { iPcacheEntry 2 }
+ ::= { iPcacheEntry 3 }
IPcacheEntryState OBJECT-TYPE
SYNTAX Integer
ACCESS read-only
STATUS current
- ::= { iPcacheEntry 3 }
+ ::= { iPcacheEntry 4 }
-- fqdn cache info
- FQDNcacheTable OBJECT-TYPE
+ fQDNcacheTable OBJECT-TYPE
SYNTAX SEQUENCE OF fQDNcacheEntry
ACCESS read-only
STATUS current
STATUS current
DESCRIPTION
" An entry in cachePeerTable "
- INDEX { FQDNcacheEntryName }
- ::= { IPcacheTable 1 }
+ INDEX { FQDNcacheEntryId }
+ ::= { fQDNcacheTable 1 }
FQDNcacheEntry ::= SEQUENCE {
+ FQDNcacheEntryId Integer,
FQDNcacheEntryName OCTET STRING,
FQDNcacheEntryIP IpAddress,
FQDNcacheEntryLastRef TimeTicks,
FQDNcacheEntryState INTEGER
}
+ FQDNcacheEntryId OBJECT-TYPE
+ SYNTAX Integer
+ ACCESS read-only
+ STATUS current
+ ::= { fQDNcacheEntry 1 }
+
FQDNcacheEntryName OBJECT-TYPE
SYNTAX OCTET STRING
ACCESS read-only
STATUS current
- ::= { fQDNcacheEntry 1 }
+ ::= { fQDNcacheEntry 2 }
FQDNcacheEntryIP OBJECT-TYPE
SYNTAX IpAddress
ACCESS read-only
STATUS current
- ::= { fQDNcacheEntry 2 }
+ ::= { fQDNcacheEntry 3 }
FQDNcacheEntryLastRef OBJECT-TYPE
SYNTAX TimeTicks
ACCESS read-only
STATUS current
- ::= { fQDNcacheEntry 3}
+ ::= { fQDNcacheEntry 4}
FQDNcacheEntryExpires OBJECT-TYPE
SYNTAX TimeTicks
ACCESS read-only
STATUS current
- ::= { fQDNcacheEntry 4}
+ ::= { fQDNcacheEntry 5}
FQDNcacheEntryState OBJECT-TYPE
SYNTAX Integer
ACCESS read-only
STATUS current
- ::= { fQDNcacheEntry 5}
+ ::= { fQDNcacheEntry 6}
STATUS current
DESCRIPTION
" state of FQDN cache entry "
- ::= { fQDNcacheEntry 3 }
+ ::= { fQDNcacheEntry 7 }
cacheTCPconnections OBJECT-TYPE
" Throughput of incoming traffic in 5 min intervals "
::= { cacheNetwork 6 }
--- cacheOutThroughput OBJECT-TYPE
----- SYNTAX Integer32
- -- ACCESS read-only
- -- STATUS current
- -- DESCRIPTION
--- "Throughput of outgoing traffic in 5 min intevals"
--- ::= { cacheNetwork 7 }
+ cacheOutThroughput OBJECT-TYPE
+ SYNTAX Integer32
+ ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ " Throughput of outgoing traffic in 5 min intevals"
+ ::= { cacheNetwork 7 }
--
-- performance group { squid 3 }
::= { cacheSysPerf 7 }
cacheNumObjCount OBJECT-TYPE
- SYNTAX Counter32 MAX-ACCESS read-only
+ SYNTAX Counter32
+ MAX-ACCESS read-only
STATUS current
DESCRIPTION
" Number of objects "
::= { cacheSysPerf 8 }
+ cacheCurrentMemSize OBJECT-TYPE
+ SYNTAX Counter32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheSysPerf 9 }
+
+ cacheCurrentLRUExpiration OBJECT-TYPE
+ SYNTAX TimeTicks
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheSysPerf 10 }
+
+ cacheCurrentUnlinkRequests OBJECT-TYPE
+ SYNTAX Counter32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheSysPerf 11 }
+
+ cacheCurrentUnusedFileDescrCount OBJECT-TYPE
+ SYNTAX Gauge32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheSysPerf 12 }
+
+ cacheCurrentReservedFileDescrCount OBJECT-TYPE
+ SYNTAX Gauge32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheSysPerf 13 }
--
-- cacheProtoStats
STATUS mandatory
::= { cacheProtoStatEntry 9 }
+
+ cacheProtoAggregateStats OBJECT IDENTIFIER ::= { cacheProtoStats 2 }
+
+ cacheClientHttpRequests OBJECT-TYPE
+ SYNTAX Counter32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheProtoAggregateStats 1 }
+
+ cacheICPpktsSent OBJECT-TYPE
+ SYNTAX Counter32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheProtoAggregateStats 2 }
+
+ cacheICPpktsRecv OBJECT-TYPE
+ SYNTAX Counter32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheProtoAggregateStats 3 }
+
+ cacheCurrentSwapSize OBJECT-TYPE
+ SYNTAX Counter32
+ ACCESS read-only
+ STATUS mandatory
+ ::= { cacheProtoAggregateStats 4 }
+
+
--
-- cachePeerStats
DESCRIPTION
" Table containing aggregate statistics
per supported protocol "
- ::= { cacheProtoStats 2 }
+ ::= { cachePeerStats 1 }
cachePeerStatEntry OBJECT-TYPE
SYNTAX CachePeerStatEntry
cacheProtoAclMask IpAddress
cacheProtoAclType INTEGER
}
-
+END
/*
- * $Id: net_db.cc,v 1.51 1997/11/05 05:29:32 wessels Exp $
+ * $Id: net_db.cc,v 1.52 1997/12/01 22:45:53 wessels Exp $
*
* DEBUG: section 37 Network Measurement Database
* AUTHOR: Duane Wessels
#include "squid.h"
-#if USE_ICMP
-static hash_table *addr_table = NULL;
+#if USE_ICMP
+hash_table *addr_table = NULL;
static hash_table *host_table = NULL;
static struct in_addr networkFromInaddr(struct in_addr a);
static void netdbRelease(netdbEntry * n);
-static netdbEntry *netdbGetFirst(hash_table * table);
-static netdbEntry *netdbGetNext(hash_table * table);
static void netdbHashInsert(netdbEntry * n, struct in_addr addr);
static void netdbHashDelete(const char *key);
static void netdbHashLink(netdbEntry * n, const char *hostname);
return hptr ? (netdbEntry *) hptr->item : NULL;
}
-static netdbEntry *
+netdbEntry *
netdbGetFirst(hash_table * table)
{
return (netdbEntry *) hash_first(table);
}
-static netdbEntry *
+netdbEntry *
netdbGetNext(hash_table * table)
{
return (netdbEntry *) hash_next(table);
extern int netdbHostHops(const char *host);
extern int netdbHostRtt(const char *host);
extern void netdbUpdatePeer(request_t *, peer * e, int rtt, int hops);
+extern netdbEntry *netdbGetFirst(hash_table * table);
+extern netdbEntry *netdbGetNext(hash_table * table);
extern void objcachePasswdAdd(cachemgr_passwd **, char *, wordlist *);
extern void objcachePasswdDestroy(cachemgr_passwd ** a);
extern int storeWriteCleanLogs(int reopen);
extern HASHCMP urlcmp;
extern EVH storeMaintainSwapSpace;
+
extern void storeExpireNow(StoreEntry *);
extern void storeReleaseRequest(StoreEntry *);
extern void storeRotateLog(void);
int parse_var_op_list();
void setVariable();
-#if kinetics
-char version_descr[];
-oid version_id[];
-int version_id_len;
-#endif
-
struct pbuf *definitelyGetBuf();
int get_community();
create_report( session, out_sn_data, out_length, -ret, reqid );
return 1;
} else {
+ debug(49,5)("snmp_agent_parse: asn_parse failed\n");
return 0;
}
} else if( ret > 0 ) {
increment_stat( ret );
+ debug(49,5)("snmp_agent_parse: authorization failed>0 ");
return 0;
}
} else if( version == SNMP_VERSION_1 ) {
if( (ret = get_community( sid )) != 0 ) {
increment_stat(ret);
+ debug(49,5)("snmp_agent_parse: get_community failed\n");
return 0;
}
session->version = SNMP_VERSION_1;
if( msgtype == GETBULK_REQ_MSG ) {
if( session->version == SNMP_VERSION_1 )
+ {
+ debug(49,5)("snmp_agent_parse: getbulk but version 1\n");
return 0;
+ }
} else if (msgtype != GET_REQ_MSG && msgtype != GETNEXT_REQ_MSG && msgtype != SET_REQ_MSG ) {
+ debug(49,5)("snmp_agent_parse: unknown request type\n");
return 0;
}
sn_data = asn_parse_int(sn_data, &length, &type, &reqid, sizeof(reqid));
*out_length = packet_end - out_auth;
return 1;
}
+ debug(49,5)("snmp_agent_parse: problem in ERR_NOERROR\n");
return 0;
} else {
parse_var_op_list(sn_data, length, out_sn_data, *out_length,
*out_length = packet_end - out_auth;
return 1;
}
+ debug(49,5)("snmp_agent_parse: create_identical failed\n");
return 0;
default:
+ debug(49,5)("snmp_agent_parse: hey, something's wrong\n");
return 0;
}
if (sn_data == NULL)
return PARSE_ERROR;
/* now attempt to retrieve the variable on the local entity */
+ debug(49,5)("snmp:before getStatPtr...\n");
statP = getStatPtr(var_name, &var_name_len, &statType, &statLen, &acl,
exact, &write_method, session->version, &noSuchObject,
msgtype==SET_REQ_MSG ? session->writeView : session->readView );
int length, headerLength;
u_char *headerPtr, *reqidPtr, *errstatPtr, *errindexPtr, *varListPtr;
- bcopy((char *)snmp_in, (char *)snmp_out, snmp_length);
+ memcpy((char *)snmp_out, (char *)snmp_in, snmp_length);
length = snmp_length;
headerPtr = snmp_auth_parse(snmp_out, &length, sid, &sidlen, (long *)&dummy);
sid[sidlen] = 0;
u_char *sessionid;
{
communityEntry *cp;
-
- for( cp = communities; cp; cp = cp->next ) {
+ debug(49,5)("get_community: %s on %d\n",sessionid, getpid());
+ for( cp = Config.Snmp.communities; cp; cp = cp->next ) {
+ debug(49,5)("get_community: %s\n", cp->name);
if (!strcmp(cp->name, (char *)sessionid))
break;
}
/*
- * $Id: squid.h,v 1.137 1997/11/30 02:52:09 wessels Exp $
+ * $Id: squid.h,v 1.138 1997/12/01 22:45:57 wessels Exp $
*
* AUTHOR: Duane Wessels
*
#define storeKeyHashCmp urlcmp
#define storeKeyHashHash hash4
#endif
+#ifdef SQUID_SNMP
+#include "snmp.h"
+#include "snmp_config.h"
+#endif
/* Needed for poll() on Linux at least */
#if HAVE_POLL
/*
- * $Id: stat.cc,v 1.176 1997/11/28 08:11:58 wessels Exp $
+ * $Id: stat.cc,v 1.177 1997/12/01 22:45:57 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
static void proto_newobject(cacheinfo *, protocol_t, int, int);
static void proto_purgeobject(cacheinfo *, protocol_t, int);
static void proto_touchobject(cacheinfo *, protocol_t, int);
-static int memoryAccounted(void);
+ int memoryAccounted(void);
static void statAvgTick(void *notused);
#ifdef XMALLOC_STATISTICS
storeAppendPrintf(sentry, close_bracket);
}
-static int
+ int
memoryAccounted(void)
{
return (int)
struct _acl_deny_info_list *next;
};
+struct _snmpconf {
+ char *line;
+ int type;
+ struct _snmpconf *next;
+};
+
struct _acl {
char name[ACL_NAME_SZ];
squid_acl type;
char *configFile;
char *agentInfo;
char *mibPath;
+ char *trap_community;
+ char *trap_sink;
u_short localPort;
int do_queueing;
+ int conf_authtraps;
+ struct _snmpconf *snmpconf;
+ viewEntry *views;
+ usecEntry *users;
+ communityEntry *communities;
} Snmp;
struct {
char *log;
struct _netdbEntry {
char *key;
- struct _net_db *next;
+ struct _netdbEntry *next;
char network[16];
int pings_sent;
int pings_recv;
/*
- * $Id: tools.cc,v 1.131 1997/11/28 08:12:02 wessels Exp $
+ * $Id: tools.cc,v 1.132 1997/12/01 22:45:59 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
#if HAVE_MSTATS && HAVE_GNUMALLOC_H
struct mstats ms = mstats();
fprintf(debug_log, "\ttotal space in arena: %6d KB\n",
- ms.bytes_total >> 10);
+ (int) (ms.bytes_total >> 10));
fprintf(debug_log, "\tTotal free: %6d KB %d%%\n",
- ms.bytes_free >> 10,
+ (int) (ms.bytes_free >> 10),
percent(ms.bytes_free, ms.bytes_total));
#elif HAVE_MALLINFO
struct mallinfo mp;
typedef struct _acl_name_list acl_name_list;
typedef struct _acl_deny_info_list acl_deny_info_list;
typedef struct _acl acl;
+typedef struct _snmpconf snmpconf;
typedef struct _acl_list acl_list;
typedef struct _acl_access acl_access;
typedef struct _aclCheck_t aclCheck_t;
/* 32 bit integer compatability hack */
#if SIZEOF_INT == 4
-typedef int num32;
-typedef unsigned int u_num32;
+/*typedef int num32;
+typedef unsigned int u_num32;*/
#elif SIZEOF_LONG == 4
typedef long num32;
typedef unsigned long u_num32;