]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added skeletons, conn.setup etc for future snmp support
authorkostas <>
Tue, 21 Oct 1997 04:31:36 +0000 (04:31 +0000)
committerkostas <>
Tue, 21 Oct 1997 04:31:36 +0000 (04:31 +0000)
src/main.cc
src/protos.h
src/structs.h

index 2d5176ac1a8edb8c620a58748eddd5f03b82269a..7a6571026c3e2ff19ab58ff20e05732dfd0e6e49 100644 (file)
@@ -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();
index c139bba8fb0b40db02bdd44603ca6f3e9f387875..8775862fd734c168f662bbbf80d4d9a0a06b3e7a 100644 (file)
@@ -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,
index e08f424dd8a7ed06b96f8f1909784bab446d68cd..ff11c9bdc2098305ba4a3ab3586138253d42bbce 100644 (file)
@@ -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;