Squid Web Cache
master
Loading...
Searching...
No Matches
snmp_core.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2026 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
#include <optional>
22
23
class
MemBuf
;
24
25
#define SNMP_REQUEST_SIZE 4096
26
#define MAX_PROTOSTAT 5
27
28
typedef
variable_list
*(
oid_ParseFn
) (
variable_list
*,
snint
*);
29
typedef
struct
_mib_tree_entry
mib_tree_entry
;
30
typedef
oid
*(
instance_Fn
) (
oid
*
name
,
snint
*
len
,
mib_tree_entry
* current,
oid_ParseFn
** Fn);
31
typedef
enum
{
atNone
= 0,
atSum
,
atAverage
,
atMax
,
atMin
}
AggrType
;
32
33
struct
_mib_tree_entry
{
34
oid
*
name
;
35
int
len
;
36
oid_ParseFn
*
parsefunction
;
37
instance_Fn
*
instancefunction
;
38
int
children
;
39
40
struct
_mib_tree_entry
**
leaves
;
41
42
struct
_mib_tree_entry
*
parent
;
43
AggrType
aggrType
;
44
};
45
46
struct
snmp_pdu
*
snmpAgentResponse
(
struct
snmp_pdu
* PDU);
47
AggrType
snmpAggrType
(
oid
* Current,
snint
CurrentLen);
48
49
extern
Comm::ConnectionPointer
snmpOutgoingConn
;
50
51
extern
PF
snmpHandleUdp
;
52
const
char
*
snmpDebugOid
(
const
oid
*,
snint
Len,
MemBuf
&outbuf);
53
void
addr2oid
(
Ip::Address
&addr,
oid
*Dest);
54
57
std::optional<Ip::Address>
oid2addr
(
const
oid
*,
size_t
);
58
59
namespace
Acl
60
{
61
63
class
SnmpCommunityCheck
:
public
ParameterizedNode
< ACLData<const char *> >
64
{
65
public
:
66
/* Acl::Node API */
67
int
match
(
ACLChecklist
*)
override
;
68
};
69
70
}
// namespace Acl
71
72
#endif
/* SQUID_SRC_SNMP_CORE_H */
73
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:64
Acl::SnmpCommunityCheck::match
int match(ACLChecklist *) override
Matches the actual data in checklist against this Acl::Node.
Definition
snmp_core.cc:1134
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
snmpHandleUdp
PF snmpHandleUdp
instance_Fn
oid *() instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn)
Definition
snmp_core.h:30
snmpDebugOid
const char * snmpDebugOid(const oid *, snint Len, MemBuf &outbuf)
Definition
snmp_core.cc:1050
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:1076
oid_ParseFn
variable_list *() oid_ParseFn(variable_list *, snint *)
Definition
snmp_core.h:28
snmpAggrType
AggrType snmpAggrType(oid *Current, snint CurrentLen)
Definition
snmp_core.cc:584
AggrType
AggrType
Definition
snmp_core.h:31
atSum
@ atSum
Definition
snmp_core.h:31
atMin
@ atMin
Definition
snmp_core.h:31
atNone
@ atNone
Definition
snmp_core.h:31
atMax
@ atMax
Definition
snmp_core.h:31
atAverage
@ atAverage
Definition
snmp_core.h:31
oid2addr
std::optional< Ip::Address > oid2addr(const oid *, size_t)
Definition
snmp_core.cc:1108
snmp_vars.h
_mib_tree_entry
Definition
snmp_core.h:33
_mib_tree_entry::parsefunction
oid_ParseFn * parsefunction
Definition
snmp_core.h:36
_mib_tree_entry::instancefunction
instance_Fn * instancefunction
Definition
snmp_core.h:37
_mib_tree_entry::name
oid * name
Definition
snmp_core.h:34
_mib_tree_entry::len
int len
Definition
snmp_core.h:35
_mib_tree_entry::leaves
struct _mib_tree_entry ** leaves
Definition
snmp_core.h:40
_mib_tree_entry::aggrType
AggrType aggrType
Definition
snmp_core.h:43
_mib_tree_entry::children
int children
Definition
snmp_core.h:38
_mib_tree_entry::parent
struct _mib_tree_entry * parent
Definition
snmp_core.h:42
snmp_pdu
Definition
snmp_pdu.h:50
variable_list
Definition
snmp_vars.h:44
squid
src
snmp_core.h
Generated by
1.9.8