From: Maxim Mamontov Date: Thu, 9 Feb 2012 11:31:06 +0000 (+0200) Subject: Merge branch 'master' into full-month-stats X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/86fd475d6f97b818d7cb45e91625a1cb7ac9c8e6?hp=a39afcce76c3a02331385af96a474207d057fb09 Merge branch 'master' into full-month-stats --- diff --git a/ChangeLog b/ChangeLog index 971c2f2e..cca2afcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,10 @@ General: * Большая часть кода приведена в соответствие с рекомендациями Скотта Мейерса. * Вычищена куча кода. Но это еще не конец. + * Исправлена ошибка установки в случае наличия предыдущей установки. + * Добавлена поддержка FreeBSD9. + * Структура базы для Firebird больше не создается при make install-data, + нужно создавать вручную. Compilation: * При проверке условий сборки теперь используются переменные CC и CXX @@ -29,6 +33,7 @@ Compilation: и gcc, и clang и ekopath). * Существенно переработана система сборки. Теперь она не сорит заголовочными файлами и библотеками там где не нужно. + * Убрана зависимость от bash. Libraries: * Использование динамических внутренних библиотек признано @@ -37,6 +42,7 @@ Libraries: * Добавлена специализация x2str для беззнаковых типов. * Библиотеки crypto.lib и scriptexecuter.lib теперь содержат 100% кода на языке C! + * Исправлена работа библиотеки ia.lib на платформах с Big Endian. Plugins: * В плагин для PostgreSQL добавлен параметр retries указывающий количество @@ -59,6 +65,7 @@ Plugins: - количество абонентов с положительным кредитом; - количество абонентов с положительным предоплаченным трафиком; - количество абонентов меняющих тарифный план в следующем месяце; + - количество абонентов с ненулевым трафиком за сессию; - общее количество тарифов; - количество абонентов потарифно; - общее количество админов; @@ -79,6 +86,9 @@ Plugins: корректной остановки плагина. Привет мейнтейнерам Debian которые до сих пор не обновили xmlrpc-c! Зато минус одно падение с SIGSEGV и General Protection Fault при останове! + * Плагин remote_script больше не сообщает об ошибке и позволяет системе + запуститься если файл привязки подсетей пуст. + * Пересмотрен порядок загрузки плагинов. stargazer: * Исправлена ошибка приводящая к неправильному сообщению о причине @@ -95,7 +105,3 @@ stargazer: USERS что позволило избавиться от дедлока в определенных условиях. * Устранена возможность выгрузки активного плагина. Минус одно потенциальное падение с SIGSEGV и General Protection Fault! - -rscriptd: - * В примере конфигурационного файла для rscriptd путь /etc/rscriptd - заменен на /etc/stargazer. diff --git a/projects/stargazer/plugins/authorization/ao/ao.h b/projects/stargazer/plugins/authorization/ao/ao.h index fe267c4e..205ebf5a 100644 --- a/projects/stargazer/plugins/authorization/ao/ao.h +++ b/projects/stargazer/plugins/authorization/ao/ao.h @@ -94,8 +94,8 @@ public: int ParseSettings() { return 0; } const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const; - uint16_t GetStartPosition() const { return 70; } - uint16_t GetStopPosition() const { return 70; } + uint16_t GetStartPosition() const { return 30; } + uint16_t GetStopPosition() const { return 30; } void AddUser(USER_PTR u); void DelUser(USER_PTR u); diff --git a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h index 1158955f..d0f6b5ac 100644 --- a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h +++ b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h @@ -252,8 +252,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const { return "InetAccess authorization plugin v.1.4"; } - uint16_t GetStartPosition() const { return 50; } - uint16_t GetStopPosition() const { return 50; } + uint16_t GetStartPosition() const { return 30; } + uint16_t GetStopPosition() const { return 30; } int SendMessage(const STG_MSG & msg, uint32_t ip) const; diff --git a/projects/stargazer/plugins/authorization/stress/stress.cpp b/projects/stargazer/plugins/authorization/stress/stress.cpp index 7273ed48..39e74b0d 100644 --- a/projects/stargazer/plugins/authorization/stress/stress.cpp +++ b/projects/stargazer/plugins/authorization/stress/stress.cpp @@ -205,12 +205,12 @@ return isRunning; //----------------------------------------------------------------------------- uint16_t AUTH_STRESS::GetStartPosition() const { -return 70; +return 30; } //----------------------------------------------------------------------------- uint16_t AUTH_STRESS::GetStopPosition() const { -return 70; +return 30; } //----------------------------------------------------------------------------- void AUTH_STRESS::SetUserNotifiers(USER_PTR u) diff --git a/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp b/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp index 595c45fc..85fd602b 100644 --- a/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp +++ b/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp @@ -434,12 +434,12 @@ return NULL; //----------------------------------------------------------------------------- uint16_t DEBUG_CAP::GetStartPosition() const { -return 0; +return 40; } //----------------------------------------------------------------------------- uint16_t DEBUG_CAP::GetStopPosition() const { -return 0; +return 40; } //----------------------------------------------------------------------------- RAW_PACKET MakeTCPPacket(const char * src, diff --git a/projects/stargazer/plugins/capture/cap_nf/cap_nf.h b/projects/stargazer/plugins/capture/cap_nf/cap_nf.h index e6961643..43d6e098 100644 --- a/projects/stargazer/plugins/capture/cap_nf/cap_nf.h +++ b/projects/stargazer/plugins/capture/cap_nf/cap_nf.h @@ -39,8 +39,8 @@ $Author: faust $ #include "stg/module_settings.h" #define VERSION "CAP_NF v. 0.4" -#define START_POS 10 -#define STOP_POS 10 +#define START_POS 40 +#define STOP_POS 40 class USERS; class USER; diff --git a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h index 65ee87d3..62a78a43 100644 --- a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h +++ b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h @@ -59,8 +59,8 @@ public: int ParseSettings(); const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const; - uint16_t GetStartPosition() const { return 10; } - uint16_t GetStopPosition() const { return 10; } + uint16_t GetStartPosition() const { return 40; } + uint16_t GetStopPosition() const { return 40; } private: DIVERT_CAP(const DIVERT_CAP & rvalue); diff --git a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h b/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h index 8f7e1f2f..ad9ff9f1 100644 --- a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h +++ b/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h @@ -107,8 +107,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const; - uint16_t GetStartPosition() const { return 10; } - uint16_t GetStopPosition() const { return 10; } + uint16_t GetStartPosition() const { return 40; } + uint16_t GetStopPosition() const { return 40; } private: BPF_CAP(const BPF_CAP & rvalue); diff --git a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h b/projects/stargazer/plugins/capture/ether_linux/ether_cap.h index 64560ca4..44c4ae7e 100644 --- a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h +++ b/projects/stargazer/plugins/capture/ether_linux/ether_cap.h @@ -59,8 +59,8 @@ public: int ParseSettings() { return 0; } const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const; - uint16_t GetStartPosition() const { return 10; } - uint16_t GetStopPosition() const { return 10; } + uint16_t GetStartPosition() const { return 40; } + uint16_t GetStopPosition() const { return 40; } private: ETHER_CAP(const ETHER_CAP & rvalue); diff --git a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h b/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h index 308234b4..7c78da89 100644 --- a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h +++ b/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h @@ -54,8 +54,8 @@ public: int ParseSettings() { return 0; } const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const; - uint16_t GetStartPosition() const { return 10; } - uint16_t GetStopPosition() const { return 10; } + uint16_t GetStartPosition() const { return 40; } + uint16_t GetStopPosition() const { return 40; } private: IPQ_CAP(const IPQ_CAP & rvalue); diff --git a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp index 3607a806..0016babe 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp @@ -1,3 +1,5 @@ +#include // xmlrpc-c devs have missed something :) + #include "stg/common.h" #include "admins_methods.h" #include "rpcconfig.h" diff --git a/projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp index b971c638..c4684c1b 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp @@ -1,5 +1,7 @@ #include +#include // xmlrpc-c devs have missed something :) + #include "stg/version.h" #include "stg/common.h" #include "info_methods.h" diff --git a/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp index 14319aa1..e4d05636 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp @@ -1,3 +1,5 @@ +#include // xmlrpc-c devs have missed something :) + #include "stg/message.h" #include "stg/common.h" #include "utils.h" diff --git a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp index d4419b40..56a188f1 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include // xmlrpc-c devs have missed something :) #include "stg/common.h" #include "stg/admin.h" diff --git a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h index 87ef9470..8525f889 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h @@ -76,8 +76,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const { return RPC_CONFIG_VERSION; } - uint16_t GetStartPosition() const { return 220; } - uint16_t GetStopPosition() const { return 220; } + uint16_t GetStartPosition() const { return 20; } + uint16_t GetStopPosition() const { return 20; } bool GetAdminInfo(const std::string & cookie, ADMIN_INFO * info); diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp b/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp index 91f60062..fad12886 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp @@ -1,3 +1,5 @@ +#include // xmlrpc-c devs have missed something :) + #include "tariff_helper.h" void TARIFF_HELPER::GetTariffInfo(xmlrpc_c::value * info) const diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp index 1643fbef..77d73b02 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp @@ -1,3 +1,5 @@ +#include // xmlrpc-c devs have missed something :) + #include "tariffs_methods.h" #include "rpcconfig.h" #include "tariff_helper.h" diff --git a/projects/stargazer/plugins/configuration/sgconfig-ng/stgconfig.h b/projects/stargazer/plugins/configuration/sgconfig-ng/stgconfig.h index fd3a9e62..7678c8b0 100644 --- a/projects/stargazer/plugins/configuration/sgconfig-ng/stgconfig.h +++ b/projects/stargazer/plugins/configuration/sgconfig-ng/stgconfig.h @@ -40,8 +40,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const { return PLUGIN_VERSION; } - uint16_t GetStartPosition() const { return 220; } - uint16_t GetStopPosition() const { return 220; } + uint16_t GetStartPosition() const { return 20; } + uint16_t GetStopPosition() const { return 20; } private: USERS * users; diff --git a/projects/stargazer/plugins/configuration/sgconfig/stgconfig.h b/projects/stargazer/plugins/configuration/sgconfig/stgconfig.h index 9db9fd93..cdce9668 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/stgconfig.h +++ b/projects/stargazer/plugins/configuration/sgconfig/stgconfig.h @@ -45,8 +45,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const; - uint16_t GetStartPosition() const { return 220; } - uint16_t GetStopPosition() const { return 220; } + uint16_t GetStartPosition() const { return 20; } + uint16_t GetStopPosition() const { return 20; } private: STG_CONFIG(const STG_CONFIG & rvalue); diff --git a/projects/stargazer/plugins/configuration/sgconfig2/stgconfig.cpp b/projects/stargazer/plugins/configuration/sgconfig2/stgconfig.cpp index c5864cc4..f08286ca 100644 --- a/projects/stargazer/plugins/configuration/sgconfig2/stgconfig.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig2/stgconfig.cpp @@ -155,12 +155,12 @@ return NULL; uint16_t STG_CONFIG::GetStartPosition() const { -return 220; +return 20; } uint16_t STG_CONFIG::GetStopPosition() const { -return 220; +return 20; } bool PrepareNetwork() diff --git a/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp b/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp index 1b9237ca..e23df01d 100644 --- a/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp +++ b/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp @@ -180,12 +180,12 @@ return NULL; //----------------------------------------------------------------------------- uint16_t XR_CONFIG::GetStartPosition() const { -return 221; +return 20; } //----------------------------------------------------------------------------- uint16_t XR_CONFIG::GetStopPosition() const { -return 221; +return 20; } //----------------------------------------------------------------------------- int XR_CONFIG::SetUserCash(const string & admLogin, const string & usrLogin, double cash) const diff --git a/projects/stargazer/plugins/other/ping/ping.h b/projects/stargazer/plugins/other/ping/ping.h index 63b86a6e..6c31eb95 100644 --- a/projects/stargazer/plugins/other/ping/ping.h +++ b/projects/stargazer/plugins/other/ping/ping.h @@ -116,8 +116,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const { return "Pinger v.1.01"; } - uint16_t GetStartPosition() const { return 100; } - uint16_t GetStopPosition() const { return 100; } + uint16_t GetStartPosition() const { return 10; } + uint16_t GetStopPosition() const { return 10; } void AddUser(USER_PTR u); void DelUser(USER_PTR u); diff --git a/projects/stargazer/plugins/other/radius/radius.h b/projects/stargazer/plugins/other/radius/radius.h index 731753a0..92cfcab2 100644 --- a/projects/stargazer/plugins/other/radius/radius.h +++ b/projects/stargazer/plugins/other/radius/radius.h @@ -102,8 +102,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const { return "RADIUS data access plugin v 0.6"; } - uint16_t GetStartPosition() const { return 20; } - uint16_t GetStopPosition() const { return 20; } + uint16_t GetStartPosition() const { return 30; } + uint16_t GetStopPosition() const { return 30; } int SendMessage(const STG_MSG &, uint32_t) const { return 0; } diff --git a/projects/stargazer/plugins/other/rscript/rscript.h b/projects/stargazer/plugins/other/rscript/rscript.h index 461fcacd..794c4c2b 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.h +++ b/projects/stargazer/plugins/other/rscript/rscript.h @@ -170,8 +170,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const { return "Remote script v 0.3"; } - uint16_t GetStartPosition() const { return 20; } - uint16_t GetStopPosition() const { return 20; } + uint16_t GetStartPosition() const { return 10; } + uint16_t GetStopPosition() const { return 10; } void DelUser(USER_PTR u) { UnSetUserNotifier(u); } void AddUser(USER_PTR u) { SetUserNotifier(u); } diff --git a/projects/stargazer/plugins/other/smux/smux.h b/projects/stargazer/plugins/other/smux/smux.h index 9d0e516d..24f7de32 100644 --- a/projects/stargazer/plugins/other/smux/smux.h +++ b/projects/stargazer/plugins/other/smux/smux.h @@ -122,8 +122,8 @@ public: const std::string & GetStrError() const { return errorStr; } const std::string GetVersion() const { return "Stg SMUX Plugin 1.1"; } - uint16_t GetStartPosition() const { return 100; } - uint16_t GetStopPosition() const { return 100; } + uint16_t GetStartPosition() const { return 10; } + uint16_t GetStopPosition() const { return 10; } bool UpdateTables(); diff --git a/projects/stargazer/plugins/other/userstat/userstat.h b/projects/stargazer/plugins/other/userstat/userstat.h index 1c5776f8..18b128c1 100644 --- a/projects/stargazer/plugins/other/userstat/userstat.h +++ b/projects/stargazer/plugins/other/userstat/userstat.h @@ -56,8 +56,8 @@ public: virtual bool IsRunning() { return isRunning; } virtual const string & GetStrError() const { return errorStr; } virtual const string GetVersion() const { return version; } - virtual uint16_t GetStartPosition() const { return 0; } - virtual uint16_t GetStopPosition() const { return 0; } + virtual uint16_t GetStartPosition() const { return 10; } + virtual uint16_t GetStopPosition() const { return 10; } private: struct IsDone : public unary_function