1 #include "asn1/OpenPDU.h"
4 #include "stg/common.h"
6 class SNMP_AGENT_CREATOR
9 SNMP_AGENT * snmpAgent;
13 : snmpAgent(new SNMP_AGENT())
21 SNMP_AGENT * GetPlugin()
27 SNMP_AGENT_CREATOR pc;
29 int output(const void * buffer, size_t size, void * data)
31 int * fd = static_cast<int *>(data);
32 return write(*fd, buffer, size);
35 int SendOpenPDU(int fd, OpenPDU & msg)
39 error = der_encode(&asn_DEF_OpenPDU, &msg, output, &fd);
41 if (error.encoded == -1)
43 printfd(__FILE__, "Could not encode OpenPDU (at %s)\n",
44 error.failed_type ? error.failed_type->name : "unknown");
49 printfd(__FILE__, "OpenPDU encoded successfully");
54 SNMP_AGENT::SNMP_AGENT()
59 pthread_mutex_init(&mutex, NULL);
62 SNMP_AGENT::~SNMP_AGENT()
64 pthread_mutex_destroy(&mutex);
67 int SNMP_AGENT::ParseSettings()
72 int SNMP_AGENT::Start()
77 int SNMP_AGENT::Stop()
82 void * SNMP_AGENT::Runner(void * d)
84 SNMP_AGENT * snmpAgent = static_cast<SNMP_AGENT *>(d);
91 void SNMP_AGENT::Run()