#include "acl/Data.h"
#include "acl/ParameterizedNode.h"
#include "cache_snmp.h"
#include "comm/forward.h"
#include "ip/forward.h"
#include "snmp_vars.h"
Go to the source code of this file.
Classes | |
struct | _mib_tree_entry |
class | Acl::SnmpCommunityCheck |
an "snmp_community" ACL More... | |
Namespaces | |
namespace | Acl |
Macros | |
#define | SNMP_REQUEST_SIZE 4096 |
#define | MAX_PROTOSTAT 5 |
Typedefs | |
typedef variable_list *() | oid_ParseFn(variable_list *, snint *) |
typedef struct _mib_tree_entry | mib_tree_entry |
typedef oid *() | instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn) |
Enumerations | |
enum | AggrType { atNone = 0 , atSum , atAverage , atMax , atMin } |
Functions | |
struct snmp_pdu * | snmpAgentResponse (struct snmp_pdu *PDU) |
AggrType | snmpAggrType (oid *Current, snint CurrentLen) |
void | snmpInit (void) |
void | snmpOpenPorts (void) |
void | snmpClosePorts (void) |
const char * | snmpDebugOid (oid *Name, snint Len, MemBuf &outbuf) |
void | addr2oid (Ip::Address &addr, oid *Dest) |
void | oid2addr (oid *Dest, Ip::Address &addr, u_int code) |
Variables | |
Comm::ConnectionPointer | snmpOutgoingConn |
PF | snmpHandleUdp |
Macro Definition Documentation
◆ MAX_PROTOSTAT
#define MAX_PROTOSTAT 5 |
Definition at line 24 of file snmp_core.h.
◆ SNMP_REQUEST_SIZE
#define SNMP_REQUEST_SIZE 4096 |
Definition at line 23 of file snmp_core.h.
Typedef Documentation
◆ instance_Fn
typedef oid *() instance_Fn(oid *name, snint *len, mib_tree_entry *current, oid_ParseFn **Fn) |
Definition at line 28 of file snmp_core.h.
◆ mib_tree_entry
typedef struct _mib_tree_entry mib_tree_entry |
Definition at line 27 of file snmp_core.h.
◆ oid_ParseFn
typedef variable_list *() oid_ParseFn(variable_list *, snint *) |
Definition at line 26 of file snmp_core.h.
Enumeration Type Documentation
◆ AggrType
enum AggrType |
Enumerator | |
---|---|
atNone | |
atSum | |
atAverage | |
atMax | |
atMin |
Definition at line 29 of file snmp_core.h.
Function Documentation
◆ addr2oid()
void addr2oid | ( | Ip::Address & | addr, |
oid * | Dest | ||
) |
Definition at line 1083 of file snmp_core.cc.
References code, debugs, Ip::Address::getInAddr(), INETADDRESSTYPE_IPV4, INETADDRESSTYPE_IPV6, Ip::Address::isIPv6(), size, and snmpDebugOid().
Referenced by client_Inst().
◆ oid2addr()
void oid2addr | ( | oid * | Dest, |
Ip::Address & | addr, | ||
u_int | code | ||
) |
Definition at line 1115 of file snmp_core.cc.
References debugs, size, and snmpDebugOid().
Referenced by client_Inst(), and snmp_meshCtblFn().
◆ snmpAgentResponse()
Definition at line 460 of file snmp_core.cc.
References snmp_pdu::command, debugs, snmp_pdu::errindex, snmp_pdu::errstat, variable_list::name, variable_list::name_length, variable_list::next_variable, snmp_pdu::reqid, SNMP_ERR_NOERROR, SNMP_ERR_NOSUCHNAME, snmp_pdu_create(), SNMP_PDU_GET, SNMP_PDU_GETNEXT, SNMP_PDU_RESPONSE, snmp_var_free(), snmp_var_new(), snmpTreeGet(), snmpTreeNext(), snmp_pdu::variables, and xfree.
Referenced by Snmp::SendResponse(), and snmpConstructReponse().
◆ snmpAggrType()
Definition at line 573 of file snmp_core.cc.
References _mib_tree_entry::aggrType, atNone, debugs, mib_tree_head, MYNAME, _mib_tree_entry::name, and snmpTreeEntry().
Referenced by Snmp::Pdu::aggregate(), and Snmp::Pdu::fixAggregate().
◆ snmpClosePorts()
void snmpClosePorts | ( | void | ) |
Definition at line 323 of file snmp_core.cc.
References Comm::Connection::close(), DBG_IMPORTANT, debugs, Comm::IsConnOpen(), Comm::Connection::local, snmpIncomingConn, and snmpOutgoingConn.
Referenced by serverConnectionsClose(), and SquidShutdown().
◆ snmpDebugOid()
Definition at line 1056 of file snmp_core.cc.
References MemBuf::append(), MemBuf::content(), MemBuf::init(), MemBuf::isNull(), and MAX_IPSTRLEN.
Referenced by addr2oid(), oid2addr(), snmp_meshCtblFn(), snmp_netDnsFn(), snmp_netFqdnFn(), snmp_netIpFn(), snmp_sysFn(), snmpAddNode(), snmpTreeGet(), and snmpTreeNext().
◆ snmpInit()
void snmpInit | ( | void | ) |
Definition at line 71 of file snmp_core.cc.
References assert, atAverage, atMax, atMin, atNone, atSum, client_Inst(), CONF_ADMIN, CONF_LOG_FAC, CONF_ST_MMAXSZ, CONF_ST_SWHIWM, CONF_ST_SWLOWM, CONF_ST_SWMAXSZ, CONF_STORAGE, CONF_UNIQNAME, CONF_VERSION, CONF_VERSION_ID, debugs, DNS_REP, DNS_REQ, DNS_SERVERS, FQDN_ENT, FQDN_GHBN, FQDN_HITS, FQDN_MISS, FQDN_NEGHIT, FQDN_PENDHIT, FQDN_REQ, IP_ENT, IP_GHBN, IP_HITS, IP_LOC, IP_MISS, IP_NEGHIT, IP_PENDHIT, IP_REQ, MESH_CTBL, MESH_CTBL_ADDR, MESH_CTBL_ADDR_TYPE, MESH_CTBL_HTBYTES, MESH_CTBL_HTHITBYTES, MESH_CTBL_HTHITS, MESH_CTBL_HTREQ, MESH_CTBL_ICPBYTES, MESH_CTBL_ICPHITBYTES, MESH_CTBL_ICPHITS, MESH_CTBL_ICPREQ, MESH_PTBL, MESH_PTBL_ADDR, MESH_PTBL_ADDR_TYPE, MESH_PTBL_FETCHES, MESH_PTBL_HTTP, MESH_PTBL_ICP, MESH_PTBL_IGN, MESH_PTBL_INDEX, MESH_PTBL_KEEPAL_R, MESH_PTBL_KEEPAL_S, MESH_PTBL_NAME, MESH_PTBL_PACKED, MESH_PTBL_RTT, MESH_PTBL_SENT, MESH_PTBL_STATE, MESH_PTBL_TYPE, mib_tree_head, mib_tree_last, NET_DNS_CACHE, NET_FQDN_CACHE, NET_IP_CACHE, peer_Inst(), PERF_MEDIAN_BHR, PERF_MEDIAN_DNS, PERF_MEDIAN_HTTP_ALL, PERF_MEDIAN_HTTP_HIT, PERF_MEDIAN_HTTP_MISS, PERF_MEDIAN_HTTP_NH, PERF_MEDIAN_HTTP_NM, PERF_MEDIAN_ICP_QUERY, PERF_MEDIAN_ICP_REPLY, PERF_MEDIAN_RHR, PERF_MEDIAN_TIME, PERF_PROTO, PERF_PROTOSTAT_AGGR, PERF_PROTOSTAT_AGGR_CLIENTS, PERF_PROTOSTAT_AGGR_CURSWAP, PERF_PROTOSTAT_AGGR_ERRORS, PERF_PROTOSTAT_AGGR_HTTP_ERRORS, PERF_PROTOSTAT_AGGR_HTTP_HITS, PERF_PROTOSTAT_AGGR_HTTP_KBYTES_IN, PERF_PROTOSTAT_AGGR_HTTP_KBYTES_OUT, PERF_PROTOSTAT_AGGR_HTTP_REQ, PERF_PROTOSTAT_AGGR_ICP_R, PERF_PROTOSTAT_AGGR_ICP_RKB, PERF_PROTOSTAT_AGGR_ICP_S, PERF_PROTOSTAT_AGGR_ICP_SKB, PERF_PROTOSTAT_AGGR_KBYTES_IN, PERF_PROTOSTAT_AGGR_KBYTES_OUT, PERF_PROTOSTAT_AGGR_REQ, PERF_PROTOSTAT_MEDIAN, PERF_SYS, PERF_SYS_CPUTIME, PERF_SYS_CPUUSAGE, PERF_SYS_CURLRUEXP, PERF_SYS_CURMAX_FD, PERF_SYS_CURRESERVED_FD, PERF_SYS_CURUNLREQ, PERF_SYS_CURUNUSED_FD, PERF_SYS_CURUSED_FD, PERF_SYS_MAXRESSZ, PERF_SYS_MEMUSAGE, PERF_SYS_NUMOBJCNT, PERF_SYS_NUMR, PERF_SYS_PF, snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_netDnsFn(), snmp_netFqdnFn(), snmp_netIpFn(), snmp_prfProtoFn(), snmp_prfSysFn(), snmp_sysFn(), snmpAddNode(), snmpAddNodeStr(), snmpCreateOid(), snmplib_debug_hook, snmpLookupNodeStr(), snmpSnmplibDebug(), static_Inst(), SYS_UPTIME, SYSSTOR, SYSVMSIZ, and time_Inst().
Referenced by mainInitialize().
◆ snmpOpenPorts()
void snmpOpenPorts | ( | void | ) |
Definition at line 259 of file snmp_core.cc.
References SquidConfig::Addrs, asyncCallbackFun, Config, DBG_CRITICAL, DBG_IMPORTANT, debugs, Ip::EnableIpv6, fatal(), Ipc::fdnInSnmpSocket, Ipc::fdnOutSnmpSocket, IPV6_SPECIAL_SPLITSTACK, Ip::Address::isAnyAddr(), Ip::Address::isNoAddr(), Comm::Connection::local, Ip::Address::port(), SquidConfig::Port, Ip::Address::setIPv4(), SquidConfig::snmp, SquidConfig::snmp_incoming, SquidConfig::snmp_outgoing, snmpIncomingConn, snmpOutgoingConn, snmpPortOpened(), and Ipc::StartListening().
Referenced by serverConnectionsOpen().
Variable Documentation
◆ snmpHandleUdp
|
extern |
◆ snmpOutgoingConn
|
extern |
Definition at line 39 of file snmp_core.cc.
Referenced by snmpClosePorts(), snmpOpenPorts(), and snmpPortOpened().