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"
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
23class MemBuf;
24
25#define SNMP_REQUEST_SIZE 4096
26#define MAX_PROTOSTAT 5
27
30typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
31typedef enum {atNone = 0, atSum, atAverage, atMax, atMin} AggrType;
32
45
46struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
47AggrType snmpAggrType(oid* Current, snint CurrentLen);
48
50
51extern PF snmpHandleUdp;
52const char * snmpDebugOid(const oid *, snint Len, MemBuf &outbuf);
53void addr2oid(Ip::Address &addr, oid *Dest);
54
57std::optional<Ip::Address> oid2addr(const oid *, size_t);
58
59namespace Acl
60{
61
63class SnmpCommunityCheck: public ParameterizedNode< ACLData<const char *> >
64{
65public:
66 /* Acl::Node API */
67 int match(ACLChecklist *) override;
68};
69
70} // namespace Acl
71
72#endif /* SQUID_SRC_SNMP_CORE_H */
73
u_int oid
Definition asn1.h:42
int64_t snint
Definition cache_snmp.h:14
an "snmp_community" ACL
Definition snmp_core.h:64
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
PF snmpHandleUdp
oid *() instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn)
Definition snmp_core.h:30
const char * snmpDebugOid(const oid *, snint Len, MemBuf &outbuf)
struct snmp_pdu * snmpAgentResponse(struct snmp_pdu *PDU)
Definition snmp_core.cc:471
void addr2oid(Ip::Address &addr, oid *Dest)
variable_list *() oid_ParseFn(variable_list *, snint *)
Definition snmp_core.h:28
AggrType snmpAggrType(oid *Current, snint CurrentLen)
Definition snmp_core.cc:584
AggrType
Definition snmp_core.h:31
@ atSum
Definition snmp_core.h:31
@ atMin
Definition snmp_core.h:31
@ atNone
Definition snmp_core.h:31
@ atMax
Definition snmp_core.h:31
@ atAverage
Definition snmp_core.h:31
std::optional< Ip::Address > oid2addr(const oid *, size_t)
Definition snmp_core.h:33
oid_ParseFn * parsefunction
Definition snmp_core.h:36
instance_Fn * instancefunction
Definition snmp_core.h:37
oid * name
Definition snmp_core.h:34
int len
Definition snmp_core.h:35
struct _mib_tree_entry ** leaves
Definition snmp_core.h:40
AggrType aggrType
Definition snmp_core.h:43
int children
Definition snmp_core.h:38
struct _mib_tree_entry * parent
Definition snmp_core.h:42