From 678c6099db41e0ed968d00c6524b0392555c0c33 Mon Sep 17 00:00:00 2001 From: kostas <> Date: Tue, 21 Oct 1997 04:31:36 +0000 Subject: [PATCH] Added skeletons, conn.setup etc for future snmp support --- src/main.cc | 22 +++++++++++++++++++++- src/protos.h | 3 +++ src/structs.h | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 2d5176ac1a..7a6571026c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.173 1997/08/25 22:35:57 wessels Exp $ + * $Id: main.cc,v 1.174 1997/10/20 22:31:36 kostas Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -388,6 +388,26 @@ serverConnectionsOpen(void) theOutICPAddr = xaddr.sin_addr; } } +#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 */ + + clientdbInit(); icmpOpen(); netdbInit(); diff --git a/src/protos.h b/src/protos.h index c139bba8fb..8775862fd7 100644 --- a/src/protos.h +++ b/src/protos.h @@ -257,6 +257,9 @@ extern void icpUdpSend _PARAMS((int fd, protocol_t)); extern PF icpHandleUdp; extern PF httpAccept; +#ifdef SQUID_SNMP +extern PF snmpAccept; +#endif /* SQUID_SNMP */ extern void icpSendERROR _PARAMS((int fd, log_type errorCode, const char *text, diff --git a/src/structs.h b/src/structs.h index e08f424dd8..ff11c9bdc2 100644 --- a/src/structs.h +++ b/src/structs.h @@ -127,6 +127,9 @@ struct _SquidConfig { struct { ushortlist *http; u_short icp; +#ifdef SQUID_SNMP + u_short snmp; +#endif } Port; struct { char *log; @@ -168,6 +171,9 @@ struct _SquidConfig { struct in_addr tcp_incoming; struct in_addr tcp_outgoing; struct in_addr udp_incoming; +#ifdef SQUID_SNMP + struct in_addr snmp_incoming; +#endif /* SQUID_SNMP */ struct in_addr udp_outgoing; struct in_addr client_netmask; } Addrs; -- 2.47.2