]> git.ipfire.org Git - thirdparty/squid.git/blame - src/snmp_core.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / snmp_core.h
CommitLineData
51ea0904 1/*
bbc27441 2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
51ea0904 3 *
bbc27441
AJ
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.
51ea0904 7 */
e0d28505 8
bbc27441
AJ
9/* DEBUG: section 49 SNMP Interface */
10
51ea0904
CT
11#ifndef SQUID_SNMP_CORE_H
12#define SQUID_SNMP_CORE_H
e0d28505 13
51ea0904 14#include "cache_snmp.h"
e0d28505 15#include "comm/forward.h"
af69c635
FC
16#include "typedefs.h"
17
13501b47
A
18namespace Ip
19{
20class Address;
af69c635
FC
21}
22class MemBuf;
e0d28505 23
51ea0904
CT
24#define SNMP_REQUEST_SIZE 4096
25#define MAX_PROTOSTAT 5
26
51ea0904
CT
27typedef struct _mib_tree_entry mib_tree_entry;
28typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
29typedef enum {atNone = 0, atSum, atAverage, atMax, atMin} AggrType;
e0d28505 30
51ea0904
CT
31struct _mib_tree_entry {
32 oid *name;
33 int len;
34 oid_ParseFn *parsefunction;
35 instance_Fn *instancefunction;
36 int children;
37
38 struct _mib_tree_entry **leaves;
39
40 struct _mib_tree_entry *parent;
41 AggrType aggrType;
42};
43
8a648e8d
FC
44struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
45AggrType snmpAggrType(oid* Current, snint CurrentLen);
51ea0904 46
1b76e6c1 47extern Comm::ConnectionPointer snmpOutgoingConn;
af69c635 48
9c0a2256 49extern PF snmpHandleUdp;
8a648e8d
FC
50void snmpInit(void);
51void snmpOpenPorts(void);
52void snmpClosePorts(void);
53const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
54void addr2oid(Ip::Address &addr, oid *Dest);
55void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
9c0a2256 56
51ea0904 57#endif /* SQUID_SNMP_CORE_H */
f53969cc 58