X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3a45cd9275dc9279e133deb0932402ae5f4d0b5f..9ed663cdb641ed18d1b121017ea640df3daddfdc:/projects/stargazer/plugins/other/smux/smux.cpp?ds=inline diff --git a/projects/stargazer/plugins/other/smux/smux.cpp b/projects/stargazer/plugins/other/smux/smux.cpp index 0cf56ff8..f6c1fade 100644 --- a/projects/stargazer/plugins/other/smux/smux.cpp +++ b/projects/stargazer/plugins/other/smux/smux.cpp @@ -11,27 +11,16 @@ #include #include "stg/common.h" +#include "stg/plugin_creator.h" #include "smux.h" #include "utils.h" -class SMUX_CREATOR -{ -private: - SMUX * smux; - -public: - SMUX_CREATOR() : smux(new SMUX()) {} - ~SMUX_CREATOR() { delete smux; } - - SMUX * GetPlugin() { return smux; } -}; - -SMUX_CREATOR sac; +PLUGIN_CREATOR smc; PLUGIN * GetPlugin() { -return sac.GetPlugin(); +return smc.GetPlugin(); } SMUX_SETTINGS::SMUX_SETTINGS() @@ -44,7 +33,7 @@ int SMUX_SETTINGS::ParseSettings(const MODULE_SETTINGS & s) PARAM_VALUE pv; std::vector::const_iterator pvi; int p; -/////////////////////////// + pv.param = "Port"; pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv); if (pvi == s.moduleParams.end()) @@ -127,19 +116,19 @@ if (PrepareNet()) return -1; // Users -sensors[".1.3.6.1.4.1.38313.1.1.1"] = new TotalUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.2"] = new ConnectedUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.3"] = new AuthorizedUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.4"] = new AlwaysOnlineUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.5"] = new NoCashUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.7"] = new DisabledDetailStatsUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.8"] = new DisabledUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.9"] = new PassiveUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.10"] = new CreditUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.11"] = new FreeMbUsersSensor(*users); -sensors[".1.3.6.1.4.1.38313.1.1.12"] = new TariffChangeUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.1")] = new TotalUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.2")] = new ConnectedUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.3")] = new AuthorizedUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.4")] = new AlwaysOnlineUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.5")] = new NoCashUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.7")] = new DisabledDetailStatsUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.8")] = new DisabledUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.9")] = new PassiveUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.10")] = new CreditUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.11")] = new FreeMbUsersSensor(*users); +sensors[OID(".1.3.6.1.4.1.38313.1.1.12")] = new TariffChangeUsersSensor(*users); // Tariffs -sensors[".1.3.6.1.4.1.38313.1.2.1"] = new TotalTariffsSensor(*tariffs); +sensors[OID(".1.3.6.1.4.1.38313.1.2.1")] = new TotalTariffsSensor(*tariffs); if (!running) {