]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved SNMP-related prototypes to a new home.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 31 Aug 2012 15:45:51 +0000 (17:45 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 31 Aug 2012 15:45:51 +0000 (17:45 +0200)
13 files changed:
include/cache_snmp.h
src/Makefile.am
src/client_db.cc
src/client_db.h
src/dns_internal.cc
src/fqdncache.cc
src/ipcache.cc
src/main.cc
src/protos.h
src/snmp_agent.cc
src/snmp_agent.h [new file with mode: 0644]
src/snmp_core.cc
src/snmp_core.h

index 86acc263db2315304fd34ef195ccefded62549ba..e60d4323690c6d40f3742d49ba9c4ef6a2c278a1 100644 (file)
@@ -1,16 +1,9 @@
-/*
- * $Id$
- */
 #ifndef SQUID_CACHE_SNMP_H
 #define SQUID_CACHE_SNMP_H
 
 #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)
index 6320bfa9947a2eb6a6184c89a1a48ec111461816..7b9c23a62f0a35e5e9d80065fb3e01942e3af04f 100644 (file)
@@ -59,6 +59,7 @@ DIST_SUBDIRS += ssl
 SNMP_ALL_SOURCE = \
        snmp_core.h \
        snmp_core.cc \
+       snmp_agent.h \
        snmp_agent.cc
 if ENABLE_SNMP
 SNMP_SOURCE = $(SNMP_ALL_SOURCE)
index d3eb6e6ab43523effba53752afce2d30f4c46314..3dba7bf50e626bed42a3e46c7dfe96ac5ab1117e 100644 (file)
 #include "Store.h"
 #include "tools.h"
 
+#if SQUID_SNMP
+#include "snmp_core.h"
+#endif
+
 static hash_table *client_table = NULL;
 
 static ClientInfo *clientdbAdd(const Ip::Address &addr);
index c764e0dd0b47628011af18af9dcd0a1a5c3faf2b..7b0f03f5d3ca87a553e7cc3eedda3fef1e484c82 100644 (file)
@@ -52,4 +52,8 @@ extern void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit
 extern ClientInfo * clientdbGetInfo(const Ip::Address &addr);
 #endif
 
+#if SQUID_SNMP
+extern Ip::Address *client_entry(Ip::Address *current);
+#endif
+
 #endif /* SQUID_CLIENT_DB_H_ */
index f8583f8cfd99598f524e1c5604f363948b8dd4ad..bfce017bd1a6fdd3dd45a89ab906e7b5323f4e87 100644 (file)
 #include "util.h"
 #include "wordlist.h"
 
+#if SQUID_SNMP
+#include "snmp_core.h"
+#endif
+
 #if HAVE_ARPA_NAMESER_H
 #include <arpa/nameser.h>
 #endif
index 0a258ab76b109c43369f7a7c11390d61d3bfdbe3..bb07a3985e740df5a1ef2c8da4494b91cfbfceec 100644 (file)
 #include "Store.h"
 #include "wordlist.h"
 
+#if SQUID_SNMP
+#include "snmp_core.h"
+#endif
+
 /**
  \defgroup FQDNCacheAPI FQDN Cache API
  \ingroup Components
index b032ed203d210e6f64fdf60601f5128c6e498a40..2b0da1101562ea53c4569016fda7b9ef655055a0 100644 (file)
 #include "Store.h"
 #include "wordlist.h"
 
+#if SQUID_SNMP
+#include "snmp_core.h"
+#endif
+
 /**
  \defgroup IPCacheAPI IP Cache API
  \ingroup Components
index 20a16fdc9db2e76738ac09c7a64f0003ce019a01..824105acc1665f4a71d09d6142bea10ef1a7f66b 100644 (file)
 #if USE_SQUID_ESI
 #include "esi/Module.h"
 #endif
+#if SQUID_SNMP
+#include "snmp_core.h"
+#endif
 
 #if HAVE_PATHS_H
 #include <paths.h>
index c99fa1042f63641718c3e562c791a82a52d2b511..4163dc4bdfed4433f633d7554d9e71ed79b966ae 100644 (file)
 #include "wordlist.h"
 #include "anyp/ProtocolType.h"
 
-#if SQUID_SNMP
-SQUIDCEXTERN PF snmpHandleUdp;
-SQUIDCEXTERN void snmpInit(void);
-SQUIDCEXTERN void snmpOpenPorts(void);
-SQUIDCEXTERN void snmpClosePorts(void);
-SQUIDCEXTERN const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
-
-SQUIDCEXTERN void addr2oid(Ip::Address &addr, oid *Dest);
-SQUIDCEXTERN void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
-
-SQUIDCEXTERN Ip::Address *client_entry(Ip::Address *current);
-extern variable_list *snmp_basicFn(variable_list *, snint *);
-extern variable_list *snmp_confFn(variable_list *, snint *);
-extern variable_list *snmp_sysFn(variable_list *, snint *);
-extern variable_list *snmp_prfSysFn(variable_list *, snint *);
-extern variable_list *snmp_prfProtoFn(variable_list *, snint *);
-extern variable_list *snmp_prfPeerFn(variable_list *, snint *);
-extern variable_list *snmp_netIpFn(variable_list *, snint *);
-extern variable_list *snmp_netFqdnFn(variable_list *, snint *);
-extern variable_list *snmp_netDnsFn(variable_list *, snint *);
-extern variable_list *snmp_meshPtblFn(variable_list *, snint *);
-extern variable_list *snmp_meshCtblFn(variable_list *, snint *);
-#endif /* SQUID_SNMP */
-
 #include "comm/forward.h"
 
 extern void shut_down(int);
index 97d0e4139c4c8198314220501187d7bf9d9e2966..2f73f6d873775092fcfa6db9f158c613f07b4949 100644 (file)
@@ -38,6 +38,8 @@
 #include "mem_node.h"
 #include "neighbors.h"
 #include "protos.h"
+#include "snmp_agent.h"
+#include "snmp_core.h"
 #include "StatCounters.h"
 #include "StatHist.h"
 #include "SquidMath.h"
diff --git a/src/snmp_agent.h b/src/snmp_agent.h
new file mode 100644 (file)
index 0000000..7440e15
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef SQUID_SNMP_AGENT_H_
+#define SQUID_SNMP_AGENT_H_
+/*
+ * DEBUG: section 
+ * AUTHOR: 
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+#if SQUID_SNMP
+
+#include "snmp_vars.h"
+
+extern variable_list *snmp_confFn(variable_list *, snint *);
+extern variable_list *snmp_sysFn(variable_list *, snint *);
+extern variable_list *snmp_prfSysFn(variable_list *, snint *);
+extern variable_list *snmp_prfProtoFn(variable_list *, snint *);
+extern variable_list *snmp_netIpFn(variable_list *, snint *);
+extern variable_list *snmp_netFqdnFn(variable_list *, snint *);
+extern variable_list *snmp_netDnsFn(variable_list *, snint *);
+extern variable_list *snmp_meshPtblFn(variable_list *, snint *);
+extern variable_list *snmp_meshCtblFn(variable_list *, snint *);
+
+#endif /* SQUID_SNMP */
+#endif /* SQUID_SNMP_AGENT_H_ */
index ccc42c066860c6d3955b93f9ab5d9fd2aabee320..c2530a5da75640afbb51f1fa6b24fbc71b3505fb 100644 (file)
@@ -32,6 +32,7 @@
 #include "squid.h"
 #include "acl/FilledChecklist.h"
 #include "base/CbcPointer.h"
+#include "client_db.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
@@ -39,6 +40,7 @@
 #include "ip/Address.h"
 #include "ip/tools.h"
 #include "protos.h"
+#include "snmp_agent.h"
 #include "snmp_core.h"
 #include "snmp/Forwarder.h"
 #include "tools.h"
index ce1947b8dc5f6d2d76a6dcef711f64c3378a840d..cfec2acfc78950bcf4e5aa8eede82c0e3ef4c34b 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * DEBUG: section 49    SNMP Interface
  *
  */
@@ -35,5 +33,13 @@ extern struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
 extern AggrType snmpAggrType(oid* Current, snint CurrentLen);
 
 extern Comm::ConnectionPointer snmpOutgoingConn;
+extern PF snmpHandleUdp;
+extern void snmpInit(void);
+extern void snmpOpenPorts(void);
+extern void snmpClosePorts(void);
+extern const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
+extern void addr2oid(Ip::Address &addr, oid *Dest);
+extern void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
+
 
 #endif /* SQUID_SNMP_CORE_H */