--- /dev/null
+#ifndef SQUID_SNMPREQUEST_H_
+#define SQUID_SNMPREQUEST_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_session.h"
+
+// POD
+class SnmpRequest
+{
+public:
+ u_char *buf;
+ u_char *outbuf;
+ int len;
+ int sock;
+ long reqid;
+ int outlen;
+
+ Ip::Address from;
+
+ struct snmp_pdu *PDU;
+ ACLChecklist *acl_checklist;
+ u_char *community;
+
+ struct snmp_session session;
+};
+
+#endif /* SQUID_SNMP */
+
+#endif /* SQUID_SNMPREQUEST_H_ */
#include "snmp_agent.h"
#include "snmp_core.h"
#include "snmp/Forwarder.h"
+#include "SnmpRequest.h"
#include "SquidConfig.h"
#include "tools.h"
static oid *time_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
static oid *peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
static oid *client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
-static void snmpDecodePacket(snmp_request_t * rq);
-static void snmpConstructReponse(snmp_request_t * rq);
+static void snmpDecodePacket(SnmpRequest * rq);
+static void snmpConstructReponse(SnmpRequest * rq);
static oid_ParseFn *snmpTreeNext(oid * Current, snint CurrentLen, oid ** Next, snint * NextLen);
static oid_ParseFn *snmpTreeGet(oid * Current, snint CurrentLen);
{
LOCAL_ARRAY(char, buf, SNMP_REQUEST_SIZE);
Ip::Address from;
- snmp_request_t *snmp_rq;
+ SnmpRequest *snmp_rq;
int len;
debugs(49, 5, "snmpHandleUdp: Called.");
buf[len] = '\0';
debugs(49, 3, "snmpHandleUdp: FD " << sock << ": received " << len << " bytes from " << from << ".");
- snmp_rq = (snmp_request_t *)xcalloc(1, sizeof(snmp_request_t));
+ snmp_rq = (SnmpRequest *)xcalloc(1, sizeof(SnmpRequest));
snmp_rq->buf = (u_char *) buf;
snmp_rq->len = len;
snmp_rq->sock = sock;
* Turn SNMP packet into a PDU, check available ACL's
*/
static void
-snmpDecodePacket(snmp_request_t * rq)
+snmpDecodePacket(SnmpRequest * rq)
{
struct snmp_pdu *PDU;
u_char *Community;
* Packet OK, ACL Check OK, Create reponse.
*/
static void
-snmpConstructReponse(snmp_request_t * rq)
+snmpConstructReponse(SnmpRequest * rq)
{
struct snmp_pdu *RespPDU;