X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/05fa444f7cd2661c0903fb4b3424fd692fa1215a..fdee6fdb88e79929c952fea956fa57e5780804cf:/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..328cea88 100644 --- a/projects/stargazer/plugins/other/smux/utils.cpp +++ b/projects/stargazer/plugins/other/smux/utils.cpp @@ -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;