9 #include <net-snmp/net-snmp-config.h>
10 #include <net-snmp/definitions.h>
11 #include <net-snmp/types.h>
12 #include <net-snmp/utilities.h>
13 #include <net-snmp/config_api.h>
14 #include <net-snmp/agent/net-snmp-agent-includes.h>
15 #undef INET6 /* SRSLY? */
16 #endif /* HAVE_NET_SNMP */
24 SNMPAgent(const std::string& name, const std::string& daemonSocket);
32 d_thread = std::thread(&SNMPAgent::worker, this);
34 #endif /* HAVE_NET_SNMP */
38 static int setCounter64Value(netsnmp_request_info* request,
40 #endif /* HAVE_NET_SNMP */
43 /* OID for snmpTrapOID.0 */
44 static const std::array<oid, 11> snmpTrapOID;
46 static bool sendTrap(pdns::channel::Sender<netsnmp_variable_list, void(*)(netsnmp_variable_list*)>& sender,
47 netsnmp_variable_list* varList);
49 pdns::channel::Sender<netsnmp_variable_list, void(*)(netsnmp_variable_list*)> d_sender;
50 pdns::channel::Receiver<netsnmp_variable_list, void(*)(netsnmp_variable_list*)> d_receiver;
51 #endif /* HAVE_NET_SNMP */
54 static void handleTrapsCB(int fd, FDMultiplexer::funcparam_t& var);
55 static void handleSNMPQueryCB(int fd, FDMultiplexer::funcparam_t& var);
56 void handleTrapsEvent();
57 void handleSNMPQueryEvent(int fd);