X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/5223bc7c163c9cd52e9ae4d8ad93a96e40e86632..52b4afb2c72468a55fb49aeed3f7dda1277319df:/projects/stargazer/plugins/other/snmp/snmp.cpp diff --git a/projects/stargazer/plugins/other/snmp/snmp.cpp b/projects/stargazer/plugins/other/snmp/snmp.cpp deleted file mode 100644 index 4d26a8b9..00000000 --- a/projects/stargazer/plugins/other/snmp/snmp.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "asn1/OpenPDU.h" - -#include "snmp.h" -#include "stg/common.h" - -class SNMP_AGENT_CREATOR -{ -private: - SNMP_AGENT * snmpAgent; - -public: - SNMP_AGENT_CREATOR() - : snmpAgent(new SNMP_AGENT()) - { - }; - ~SNMP_AGENT_CREATOR() - { - delete snmpAgent; - }; - - SNMP_AGENT * GetPlugin() - { - return snmpAgent; - }; -}; - -SNMP_AGENT_CREATOR pc; - -int output(const void * buffer, size_t size, void * data) -{ -int * fd = static_cast(data); -return write(*fd, buffer, size); -} - -int SendOpenPDU(int fd, OpenPDU & msg) -{ -asn_enc_rval_t error; - -error = der_encode(&asn_DEF_OpenPDU, &msg, output, &fd); - -if (error.encoded == -1) - { - printfd(__FILE__, "Could not encode OpenPDU (at %s)\n", - error.failed_type ? error.failed_type->name : "unknown"); - return -1; - } -else - { - printfd(__FILE__, "OpenPDU encoded successfully"); - } -return 0; -} - -SNMP_AGENT::SNMP_AGENT() - : PLUGIN(), - running(false), - stopped(true) -{ -pthread_mutex_init(&mutex, NULL); -} - -SNMP_AGENT::~SNMP_AGENT() -{ -pthread_mutex_destroy(&mutex); -} - -int SNMP_AGENT::ParseSettings() -{ -return 0; -} - -int SNMP_AGENT::Start() -{ -return 0; -} - -int SNMP_AGENT::Stop() -{ -return 0; -} - -void * SNMP_AGENT::Runner(void * d) -{ -SNMP_AGENT * snmpAgent = static_cast(d); - -snmpAgent->Run(); - -return NULL; -} - -void SNMP_AGENT::Run() -{ -}