snmp_core.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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_SNMP_CORE_H
12#define SQUID_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
33 int len;
37
39
42};
43
44struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
45AggrType snmpAggrType(oid* Current, snint CurrentLen);
46
48
49extern PF snmpHandleUdp;
50void snmpInit(void);
51void snmpOpenPorts(void);
52void snmpClosePorts(void);
53const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
54void addr2oid(Ip::Address &addr, oid *Dest);
55void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
56
57namespace Acl
58{
59
61class SnmpCommunityCheck: public ParameterizedNode< ACLData<const char *> >
62{
63public:
64 /* ACL API */
65 int match(ACLChecklist *) override;
66};
67
68} // namespace Acl
69
70#endif /* SQUID_SNMP_CORE_H */
71
u_int oid
Definition: asn1.h:42
int64_t snint
Definition: cache_snmp.h:14
an "snmp_community" ACL
Definition: snmp_core.h:62
int match(ACLChecklist *) override
Matches the actual data in checklist against this ACL.
Definition: snmp_core.cc:1137
Definition: MemBuf.h:24
void PF(int, void *)
Definition: forward.h:18
Definition: Acl.cc:31
int code
Definition: smb-errors.c:145
Comm::ConnectionPointer snmpOutgoingConn
Definition: snmp_core.cc:39
const char * snmpDebugOid(oid *Name, snint Len, MemBuf &outbuf)
Definition: snmp_core.cc:1056
void snmpInit(void)
Definition: snmp_core.cc:71
PF snmpHandleUdp
oid *() instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn)
Definition: snmp_core.h:28
void snmpOpenPorts(void)
Definition: snmp_core.cc:259
void snmpClosePorts(void)
Definition: snmp_core.cc:323
struct snmp_pdu * snmpAgentResponse(struct snmp_pdu *PDU)
Definition: snmp_core.cc:460
void addr2oid(Ip::Address &addr, oid *Dest)
Definition: snmp_core.cc:1083
void oid2addr(oid *Dest, Ip::Address &addr, u_int code)
Definition: snmp_core.cc:1115
variable_list *() oid_ParseFn(variable_list *, snint *)
Definition: snmp_core.h:26
AggrType snmpAggrType(oid *Current, snint CurrentLen)
Definition: snmp_core.cc:573
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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors