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