X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/05fa444f7cd2661c0903fb4b3424fd692fa1215a..e36233b7cc31f1afc35b5e66c6c68724e9c67753:/projects/stargazer/plugins/other/smux/utils.cpp diff --git a/projects/stargazer/plugins/other/smux/utils.cpp b/projects/stargazer/plugins/other/smux/utils.cpp index 4bfc0c10..3a3628f5 100644 --- a/projects/stargazer/plugins/other/smux/utils.cpp +++ b/projects/stargazer/plugins/other/smux/utils.cpp @@ -6,11 +6,11 @@ #include "stg/common.h" -#include "asn1/OpenPDU.h" -#include "asn1/ClosePDU.h" -#include "asn1/RReqPDU.h" -#include "asn1/ber_decoder.h" -#include "asn1/der_encoder.h" +#include "stg/OpenPDU.h" +#include "stg/ClosePDU.h" +#include "stg/RReqPDU.h" +#include "stg/ber_decoder.h" +#include "stg/der_encoder.h" #include "pen.h" #include "utils.h" @@ -74,6 +74,27 @@ OBJECT_IDENTIFIER_set_arcs(oi, arcs, sizeof(arcs[0]), arcPos); return true; } +std::string OI2String(OBJECT_IDENTIFIER_t * oi) +{ +std::string res; + +int arcs[1024]; +int count = OBJECT_IDENTIFIER_get_arcs(oi, arcs, sizeof(arcs[0]), 1024); + +if (count > 1024) + return ""; + +for (int i = 0; i < count; ++i) + { + res += "."; + std::string arc; + strprintf(&arc, "%d", arcs[i]); + res += arc; + } + +return res; +} + bool SendOpenPDU(int fd) { const char * description = "Stg SMUX Plugin"; @@ -191,27 +212,6 @@ if(error.code != RC_OK) return pdus; } -std::string OI2String(OBJECT_IDENTIFIER_t * oi) -{ -std::string res; - -int arcs[1024]; -int count = OBJECT_IDENTIFIER_get_arcs(oi, arcs, sizeof(arcs[0]), 1024); - -if (count > 1024) - return ""; - -for (int i = 0; i < count; ++i) - { - res += "."; - std::string arc; - strprintf(&arc, "%d", arcs[i]); - res += arc; - } - -return res; -} - int SendGetResponsePDU(int fd, GetResponse_PDU_t * getResponse) { asn_enc_rval_t error;