# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SNMPLIB='libsnmp.a'
+
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
s%@CACHE_HTTP_PORT@%$CACHE_HTTP_PORT%g
s%@CACHE_ICP_PORT@%$CACHE_ICP_PORT%g
s%@CC@%$CC%g
+s%@SNMPLIB@%$SNMPLIB%g
s%@CPP@%$CPP%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
./lib/Makefile \
./include/config.h \
./scripts/Makefile \
+ ./snmplib/Makefile \
./scripts/RunCache \
./scripts/RunAccel \
./src/Makefile \
dnl
dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
dnl
-dnl $Id: configure.in,v 1.82 1997/10/31 05:15:06 wessels Exp $
+dnl $Id: configure.in,v 1.83 1997/11/21 00:29:32 wessels Exp $
dnl
dnl
dnl
AC_INIT(src/main.c)
AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.82 $)dnl
+AC_REVISION($Revision: 1.83 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AC_CONFIG_AUX_DIR(aux)
XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o"
fi
fi
+SNMPLIB='libsnmp.a'
+AC_SUBST(SNMPLIB)
+
AC_SUBST(XTRA_OBJS)
if test -z "$XTRA_LIBS"; then
./scripts/RunAccel \
./src/Makefile \
./contrib/Makefile \
+ ./snmplib/Makefile \
./icons/Makefile \
./errors/Makefile \
)
<sect1>Client Side
<P>
- These routines exist primarily in two source files: <em/cp.c/, and
+ These routines exist primarily in two source files: <em/.cp.c/, and
<em/client_side.c/. The name <em/icp.c/ is misleading, as it
has more to do with accepting HTTP requests than the ICP protocol.
#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.in,v 1.96 1997/11/20 06:25:24 wessels Exp $
+# $Id: Makefile.in,v 1.97 1997/11/21 00:29:34 wessels Exp $
#
# Uncomment and customize the following to suit your needs:
#
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
CC = @CC@
MAKEDEPEND = @MAKEDEPEND@
url.o \
useragent.o \
wais.o \
+ $(SNMP_OBJS) \
$(XTRA_OBJS)
+SNMP_OBJS = \
+ snmp.o \
+ snmp_vars.o \
+ snmp_agent.o \
+ snmp_config.o
+
DEFAULTS = \
-DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\"
$(OBJS): ../include/version.h
squid: $(OBJS)
- $(CC) -o $@ $(LDFLAGS) $(OBJS) $(SQUID_LIBS)
+ $(CC) -o $@ $(LDFLAGS) $(OBJS) $(SQUID_LIBS) $(SQUID_SNMP_LIBS)
globals.o: globals.c Makefile
$(CC) -c $< $(CFLAGS) $(DEFAULTS)
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 >$@
install-mkdirs:
$(RM) -f $(libexecdir)/-$$f; \
fi; \
done
+ $(INSTALL_FILE) mib.txt $(sysconfdir)/mib.txt
$(INSTALL_FILE) squid.conf $(sysconfdir)/squid.conf.default
@if test -f $(sysconfdir)/squid.conf ; then \
echo "$@ will not overwrite existing $(sysconfdir)/squid.conf" ; \
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 \
echo "$@ will not overwrite existing $(sysconfdir)/mime.conf" ; \
/*
- * $Id: client.cc,v 1.40 1997/11/03 22:43:08 wessels Exp $
+ * $Id: client.cc,v 1.41 1997/11/21 00:29:34 wessels Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
fprintf(stderr, "client: ERROR: Cannot connect to %s:%d: Host unknown.\n", hostname, port);
} else {
char tbuf[BUFSIZ];
- sprintf(tbuf, "client: ERROR: Cannot connect to %s:%d",
+ snprintf(tbuf, BUFSIZ, "client: ERROR: Cannot connect to %s:%d",
hostname, port);
perror(tbuf);
}
/*
- * $Id: globals.h,v 1.19 1997/11/20 06:25:26 wessels Exp $
+ * $Id: globals.h,v 1.20 1997/11/21 00:29:35 wessels Exp $
*/
extern FILE *debug_log; /* NULL */
extern int syslog_enable; /* 0 */
extern int theInIcpConnection; /* -1 */
extern int theOutIcpConnection; /* -1 */
+#ifdef SQUID_SNMP
+extern int theInSnmpConnection; /* -1 */
+extern int theOutSnmpConnection; /* -1 */
+extern char *snmp_agentinfo;
+#endif
extern int vhost_mode; /* 0 */
extern int vizSock; /* -1 */
extern iostats IOStats;
extern struct in_addr local_addr;
extern struct in_addr no_addr;
extern struct in_addr theOutICPAddr;
+extern struct in_addr theOutSNMPAddr;
extern struct timeval current_time;
extern struct timeval squid_start;
extern time_t squid_curtime; /* 0 */
/*
- * $Id: main.cc,v 1.192 1997/11/15 00:14:49 wessels Exp $
+ * $Id: main.cc,v 1.193 1997/11/21 00:29:36 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
static void sendSignal(void);
static void serverConnectionsOpen(void);
static void watch_child(char **);
-
+#ifdef SQUID_SNMP
+extern void init_snmp();
+extern void initSquidSnmp();
+#endif
static void
usage(void)
{
}
}
#ifdef SQUID_SNMP
- if (Config.Port.snmp) {
- enter_suid();
- fd = comm_open(SOCK_STREAM,
- 0,
- Config.Addrs.snmp_incoming,
- SQUID_SNMP_PORT,
- COMM_NONBLOCKING,
- "SNMP Socket");
- leave_suid();
- if (fd < 0)
- continue;
- comm_listen(fd);
- commSetSelect(fd, COMM_SELECT_READ, snmpAccept, NULL, 0);
- debug(1, 1) ("Accepting SNMP connections on port %d, FD %d.\n",
- (int) SQUID_SNMP_PORT, fd);
- }
-#endif /* SQUID_SNMP */
-
+ initSquidSnmp();
+#endif
clientdbInit();
icmpOpen();
statAvgInit();
}
configured_once = 1;
+
+#ifdef SQUID_SNMP
+ init_snmp();
+#endif
}
int
extern PF httpAccept;
extern DEFER httpAcceptDefer;
#ifdef SQUID_SNMP
-extern PF snmpAccept;
+/*extern PF snmpHandleUdp;*/
+/*extern void initSquidSnmp();*/
#endif /* SQUID_SNMP */
+
+extern void icpSendERROR(int fd,
+ log_type errorCode,
+ const char *text,
+ clientHttpRequest *,
+ int httpCode);
extern void AppendUdp(icpUdpData *);
extern PF icpUdpReply;
extern void icpHandleIcpV3(int, struct sockaddr_in, char *, int);
u_short snmp;
#endif
} Port;
+ struct {
+ char *configFile;
+ char *agentInfo;
+ char *mibPath;
+ u_short localPort;
+ int do_queueing;
+ } Snmp;
struct {
char *log;
char *access;
struct in_addr tcp_incoming;
struct in_addr tcp_outgoing;
struct in_addr udp_incoming;
+ struct in_addr udp_outgoing;
#ifdef SQUID_SNMP
struct in_addr snmp_incoming;
+ struct in_addr snmp_outgoing;
#endif /* SQUID_SNMP */
- struct in_addr udp_outgoing;
struct in_addr client_netmask;
} Addrs;
size_t tcpRcvBufsz;