2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 49 SNMP Interface */
11 #ifndef SQUID_SNMP_CORE_H
12 #define SQUID_SNMP_CORE_H
14 #include "cache_snmp.h"
15 #include "comm/forward.h"
24 #define SNMP_REQUEST_SIZE 4096
25 #define MAX_PROTOSTAT 5
27 typedef struct _mib_tree_entry mib_tree_entry
;
28 typedef oid
*(instance_Fn
) (oid
* name
, snint
* len
, mib_tree_entry
* current
, oid_ParseFn
** Fn
);
29 typedef enum {atNone
= 0, atSum
, atAverage
, atMax
, atMin
} AggrType
;
31 struct _mib_tree_entry
{
34 oid_ParseFn
*parsefunction
;
35 instance_Fn
*instancefunction
;
38 struct _mib_tree_entry
**leaves
;
40 struct _mib_tree_entry
*parent
;
44 struct snmp_pdu
* snmpAgentResponse(struct snmp_pdu
* PDU
);
45 AggrType
snmpAggrType(oid
* Current
, snint CurrentLen
);
47 extern Comm::ConnectionPointer snmpOutgoingConn
;
49 extern PF snmpHandleUdp
;
51 void snmpOpenPorts(void);
52 void snmpClosePorts(void);
53 const char * snmpDebugOid(oid
* Name
, snint Len
, MemBuf
&outbuf
);
54 void addr2oid(Ip::Address
&addr
, oid
*Dest
);
55 void oid2addr(oid
*Dest
, Ip::Address
&addr
, u_int code
);
57 #endif /* SQUID_SNMP_CORE_H */