Squid Web Cache
master
Loading...
Searching...
No Matches
snmp_core.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
/* DEBUG: section 49 SNMP Interface */
10
11
#ifndef SQUID_SRC_SNMP_CORE_H
12
#define SQUID_SRC_SNMP_CORE_H
13
14
#include "
acl/Data.h
"
15
#include "
acl/ParameterizedNode.h
"
16
#include "
cache_snmp.h
"
17
#include "
comm/forward.h
"
18
#include "
ip/forward.h
"
19
#include "
snmp_vars.h
"
20
21
class
MemBuf
;
22
23
#define SNMP_REQUEST_SIZE 4096
24
#define MAX_PROTOSTAT 5
25
26
typedef
variable_list
*(
oid_ParseFn
) (
variable_list
*,
snint
*);
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
;
30
31
struct
_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
44
struct
snmp_pdu
*
snmpAgentResponse
(
struct
snmp_pdu
* PDU);
45
AggrType
snmpAggrType
(
oid
* Current,
snint
CurrentLen);
46
47
extern
Comm::ConnectionPointer
snmpOutgoingConn
;
48
49
extern
PF
snmpHandleUdp
;
50
const
char
*
snmpDebugOid
(
oid
* Name,
snint
Len,
MemBuf
&outbuf);
51
void
addr2oid
(
Ip::Address
&addr,
oid
*Dest);
52
void
oid2addr
(
oid
*Dest,
Ip::Address
&addr, u_int code);
53
54
namespace
Acl
55
{
56
58
class
SnmpCommunityCheck
:
public
ParameterizedNode
< ACLData<const char *> >
59
{
60
public
:
61
/* Acl::Node API */
62
int
match
(
ACLChecklist
*)
override
;
63
};
64
65
}
// namespace Acl
66
67
#endif
/* SQUID_SRC_SNMP_CORE_H */
68
Data.h
ParameterizedNode.h
oid
u_int oid
Definition
asn1.h:42
cache_snmp.h
snint
int64_t snint
Definition
cache_snmp.h:14
ACLChecklist
Definition
Checklist.h:31
Acl::ParameterizedNode
Definition
ParameterizedNode.h:24
Acl::SnmpCommunityCheck
an "snmp_community" ACL
Definition
snmp_core.h:59
Acl::SnmpCommunityCheck::match
int match(ACLChecklist *) override
Matches the actual data in checklist against this Acl::Node.
Definition
snmp_core.cc:1131
Ip::Address
Definition
Address.h:43
MemBuf
Definition
MemBuf.h:24
RefCount< Comm::Connection >
forward.h
PF
void PF(int, void *)
Definition
forward.h:18
forward.h
Acl
Definition
Acl.cc:33
snmpOutgoingConn
Comm::ConnectionPointer snmpOutgoingConn
Definition
snmp_core.cc:40
snmpDebugOid
const char * snmpDebugOid(oid *Name, snint Len, MemBuf &outbuf)
Definition
snmp_core.cc:1051
snmpHandleUdp
PF snmpHandleUdp
instance_Fn
oid *() instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn)
Definition
snmp_core.h:28
snmpAgentResponse
struct snmp_pdu * snmpAgentResponse(struct snmp_pdu *PDU)
Definition
snmp_core.cc:471
addr2oid
void addr2oid(Ip::Address &addr, oid *Dest)
Definition
snmp_core.cc:1077
oid2addr
void oid2addr(oid *Dest, Ip::Address &addr, u_int code)
Definition
snmp_core.cc:1109
oid_ParseFn
variable_list *() oid_ParseFn(variable_list *, snint *)
Definition
snmp_core.h:26
snmpAggrType
AggrType snmpAggrType(oid *Current, snint CurrentLen)
Definition
snmp_core.cc:584
AggrType
AggrType
Definition
snmp_core.h:29
atSum
@ atSum
Definition
snmp_core.h:29
atMin
@ atMin
Definition
snmp_core.h:29
atNone
@ atNone
Definition
snmp_core.h:29
atMax
@ atMax
Definition
snmp_core.h:29
atAverage
@ atAverage
Definition
snmp_core.h:29
snmp_vars.h
_mib_tree_entry
Definition
snmp_core.h:31
_mib_tree_entry::parsefunction
oid_ParseFn * parsefunction
Definition
snmp_core.h:34
_mib_tree_entry::instancefunction
instance_Fn * instancefunction
Definition
snmp_core.h:35
_mib_tree_entry::name
oid * name
Definition
snmp_core.h:32
_mib_tree_entry::len
int len
Definition
snmp_core.h:33
_mib_tree_entry::leaves
struct _mib_tree_entry ** leaves
Definition
snmp_core.h:38
_mib_tree_entry::aggrType
AggrType aggrType
Definition
snmp_core.h:41
_mib_tree_entry::children
int children
Definition
snmp_core.h:36
_mib_tree_entry::parent
struct _mib_tree_entry * parent
Definition
snmp_core.h:40
snmp_pdu
Definition
snmp_pdu.h:50
variable_list
Definition
snmp_vars.h:44
squid
src
snmp_core.h
Generated by
1.9.8