]>
Commit | Line | Data |
---|---|---|
51ea0904 | 1 | /* |
51ea0904 CT |
2 | * DEBUG: section 49 SNMP Interface |
3 | * | |
4 | */ | |
e0d28505 | 5 | |
51ea0904 CT |
6 | #ifndef SQUID_SNMP_CORE_H |
7 | #define SQUID_SNMP_CORE_H | |
e0d28505 | 8 | |
51ea0904 | 9 | #include "cache_snmp.h" |
e0d28505 | 10 | #include "comm/forward.h" |
af69c635 FC |
11 | #include "typedefs.h" |
12 | ||
13 | namespace Ip { | |
14 | class Address; | |
15 | } | |
16 | class MemBuf; | |
e0d28505 | 17 | |
51ea0904 CT |
18 | #define SNMP_REQUEST_SIZE 4096 |
19 | #define MAX_PROTOSTAT 5 | |
20 | ||
51ea0904 CT |
21 | typedef struct _mib_tree_entry mib_tree_entry; |
22 | typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn); | |
23 | typedef enum {atNone = 0, atSum, atAverage, atMax, atMin} AggrType; | |
e0d28505 | 24 | |
51ea0904 CT |
25 | struct _mib_tree_entry { |
26 | oid *name; | |
27 | int len; | |
28 | oid_ParseFn *parsefunction; | |
29 | instance_Fn *instancefunction; | |
30 | int children; | |
31 | ||
32 | struct _mib_tree_entry **leaves; | |
33 | ||
34 | struct _mib_tree_entry *parent; | |
35 | AggrType aggrType; | |
36 | }; | |
37 | ||
38 | extern struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU); | |
39 | extern AggrType snmpAggrType(oid* Current, snint CurrentLen); | |
40 | ||
1b76e6c1 | 41 | extern Comm::ConnectionPointer snmpOutgoingConn; |
af69c635 | 42 | |
9c0a2256 FC |
43 | extern PF snmpHandleUdp; |
44 | extern void snmpInit(void); | |
45 | extern void snmpOpenPorts(void); | |
46 | extern void snmpClosePorts(void); | |
47 | extern const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf); | |
48 | extern void addr2oid(Ip::Address &addr, oid *Dest); | |
49 | extern void oid2addr(oid *Dest, Ip::Address &addr, u_int code); | |
50 | ||
51ea0904 | 51 | #endif /* SQUID_SNMP_CORE_H */ |