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"
16#include "cache_snmp.h"
17#include "comm/forward.h"
18#include "ip/forward.h"
19#include "snmp_vars.h"
20
21class MemBuf;
22
23#define SNMP_REQUEST_SIZE 4096
24#define MAX_PROTOSTAT 5
25
28typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
29typedef enum {atNone = 0, atSum, atAverage, atMax, atMin} AggrType;
30
43
44struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
45AggrType snmpAggrType(oid* Current, snint CurrentLen);
46
48
49extern PF snmpHandleUdp;
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);
53
54namespace Acl
55{
56
58class SnmpCommunityCheck: public ParameterizedNode< ACLData<const char *> >
59{
60public:
61 /* Acl::Node API */
62 int match(ACLChecklist *) override;
63};
64
65} // namespace Acl
66
67#endif /* SQUID_SRC_SNMP_CORE_H */
68
u_int oid
Definition asn1.h:42
int64_t snint
Definition cache_snmp.h:14
an "snmp_community" ACL
Definition snmp_core.h:59
int match(ACLChecklist *) override
Matches the actual data in checklist against this Acl::Node.
void PF(int, void *)
Definition forward.h:18
Definition Acl.cc:33
Comm::ConnectionPointer snmpOutgoingConn
Definition snmp_core.cc:40
const char * snmpDebugOid(oid *Name, snint Len, MemBuf &outbuf)
PF snmpHandleUdp
oid *() instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn)
Definition snmp_core.h:28
struct snmp_pdu * snmpAgentResponse(struct snmp_pdu *PDU)
Definition snmp_core.cc:471
void addr2oid(Ip::Address &addr, oid *Dest)
void oid2addr(oid *Dest, Ip::Address &addr, u_int code)
variable_list *() oid_ParseFn(variable_list *, snint *)
Definition snmp_core.h:26
AggrType snmpAggrType(oid *Current, snint CurrentLen)
Definition snmp_core.cc:584
AggrType
Definition snmp_core.h:29
@ atSum
Definition snmp_core.h:29
@ atMin
Definition snmp_core.h:29
@ atNone
Definition snmp_core.h:29
@ atMax
Definition snmp_core.h:29
@ atAverage
Definition snmp_core.h:29
Definition snmp_core.h:31
oid_ParseFn * parsefunction
Definition snmp_core.h:34
instance_Fn * instancefunction
Definition snmp_core.h:35
oid * name
Definition snmp_core.h:32
int len
Definition snmp_core.h:33
struct _mib_tree_entry ** leaves
Definition snmp_core.h:38
AggrType aggrType
Definition snmp_core.h:41
int children
Definition snmp_core.h:36
struct _mib_tree_entry * parent
Definition snmp_core.h:40