snmp_core.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 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/Strategy.h"
15 #include "cache_snmp.h"
16 #include "comm/forward.h"
17 #include "ip/forward.h"
18 
19 class MemBuf;
20 
21 #define SNMP_REQUEST_SIZE 4096
22 #define MAX_PROTOSTAT 5
23 
25 typedef struct _mib_tree_entry mib_tree_entry;
26 typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
27 typedef enum {atNone = 0, atSum, atAverage, atMax, atMin} AggrType;
28 
31  int len;
34  int children;
35 
37 
40 };
41 
42 struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
43 AggrType snmpAggrType(oid* Current, snint CurrentLen);
44 
46 
47 extern PF snmpHandleUdp;
48 void snmpInit(void);
49 void snmpOpenPorts(void);
50 void snmpClosePorts(void);
51 const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
52 void addr2oid(Ip::Address &addr, oid *Dest);
53 void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
54 
55 class ACLSNMPCommunityStrategy: public ACLStrategy<char const *>
56 {
57 public:
58  virtual int match (ACLData<MatchType> *&data, ACLFilledChecklist *checklist) override;
59 };
60 
61 #endif /* SQUID_SNMP_CORE_H */
62 
u_int oid
Definition: asn1.h:42
int64_t snint
Definition: cache_snmp.h:14
virtual int match(ACLData< MatchType > *&data, ACLFilledChecklist *checklist) override
Definition: snmp_core.cc:1133
A matching algorithm.
Definition: Strategy.h:22
Definition: MemBuf.h:24
void PF(int, void *)
Definition: forward.h:18
unsigned char code
Definition: html_quote.c:20
Comm::ConnectionPointer snmpOutgoingConn
Definition: snmp_core.cc:36
void snmpInit(void)
Definition: snmp_core.cc:68
PF snmpHandleUdp
void snmpOpenPorts(void)
Definition: snmp_core.cc:256
void snmpClosePorts(void)
Definition: snmp_core.cc:319
void addr2oid(Ip::Address &addr, oid *Dest)
Definition: snmp_core.cc:1079
void oid2addr(oid *Dest, Ip::Address &addr, u_int code)
Definition: snmp_core.cc:1111
oid *() instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn)
Definition: snmp_core.h:26
AggrType snmpAggrType(oid *Current, snint CurrentLen)
Definition: snmp_core.cc:569
AggrType
Definition: snmp_core.h:27
@ atSum
Definition: snmp_core.h:27
@ atMin
Definition: snmp_core.h:27
@ atNone
Definition: snmp_core.h:27
@ atMax
Definition: snmp_core.h:27
@ atAverage
Definition: snmp_core.h:27
const char * snmpDebugOid(oid *Name, snint Len, MemBuf &outbuf)
Definition: snmp_core.cc:1052
variable_list *() oid_ParseFn(variable_list *, snint *)
Definition: snmp_core.h:24
struct snmp_pdu * snmpAgentResponse(struct snmp_pdu *PDU)
Definition: snmp_core.cc:456
Definition: snmp_core.h:29
oid_ParseFn * parsefunction
Definition: snmp_core.h:32
instance_Fn * instancefunction
Definition: snmp_core.h:33
oid * name
Definition: snmp_core.h:30
int len
Definition: snmp_core.h:31
struct _mib_tree_entry ** leaves
Definition: snmp_core.h:36
AggrType aggrType
Definition: snmp_core.h:39
int children
Definition: snmp_core.h:34
struct _mib_tree_entry * parent
Definition: snmp_core.h:38

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors