Changeset 205
- Timestamp:
- 11/04/09 06:52:49 (2 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 28 edited
-
AutoBuild.h (modified) (1 diff)
-
NSClient++-2005.sln (modified) (2 diffs)
-
include/NSCHelper.h (modified) (1 diff)
-
include/config.h (modified) (2 diffs)
-
include/settings/Settings.h (modified) (1 diff)
-
include/settings/macros.h (added)
-
include/settings/settings_old.hpp (modified) (5 diffs)
-
include/strEx.h (modified) (1 diff)
-
modules/CheckDisk/CheckDisk-2005.vcproj (modified) (13 diffs)
-
modules/CheckEventLog/CheckEventLog-2005.vcproj (modified) (13 diffs)
-
modules/CheckEventLog/CheckEventLog.cpp (modified) (3 diffs)
-
modules/CheckEventLog/CheckEventLog.h (modified) (1 diff)
-
modules/CheckExternalScripts/CheckExternalScripts.cpp (modified) (3 diffs)
-
modules/CheckExternalScripts/stdafx.h (modified) (1 diff)
-
modules/CheckHelpers/CheckHelpers-2005.vcproj (modified) (13 diffs)
-
modules/CheckSystem/CheckSystem-2005.vcproj (modified) (31 diffs)
-
modules/CheckSystem/PDHCollector.cpp (modified) (2 diffs)
-
modules/FileLogger/FileLogger.cpp (modified) (1 diff)
-
modules/NRPEClient/NRPEClient-2005.vcproj (modified) (1 diff)
-
modules/NRPEClient/NRPEClient.cpp (modified) (5 diffs)
-
modules/NRPEClient/stdafx.h (modified) (2 diffs)
-
modules/NRPEListener/NRPEListener.cpp (modified) (2 diffs)
-
release-build.bat (modified) (2 diffs)
-
service (modified) (1 prop)
-
service/Jamfile (modified) (1 diff)
-
service/NSCPlugin.cpp (modified) (2 diffs)
-
service/NSClient++-2005.vcproj (modified) (22 diffs)
-
service/NSClient++.cpp (modified) (14 diffs)
-
service/NSClient++.h (modified) (3 diffs)
-
service/core_api.cpp (added)
-
service/core_api.h (added)
-
service/settings_logger_impl.hpp (added)
-
service/settings_manager_impl.cpp (added)
-
service/settings_manager_impl.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/AutoBuild.h
r202 r205 3 3 // change the FALSE to TRUE for autoincrement of build number 4 4 #define INCREMENT_VERSION TRUE 5 #define FILEVER 0,4,0, 216 #define PRODUCTVER 0,4,0, 217 #define STRFILEVER _T("0.4.0. 21")8 #define STRPRODUCTVER _T("0.4.0. 21")5 #define FILEVER 0,4,0,33 6 #define PRODUCTVER 0,4,0,33 7 #define STRFILEVER _T("0.4.0.33") 8 #define STRPRODUCTVER _T("0.4.0.33") 9 9 #define STRPRODUCTDATE _T("2009-11-01") 10 10 #endif // AUTOBUILD_H -
trunk/NSClient++-2005.sln
r204 r205 465 465 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|Mixed Platforms.Build.0 = Debug|x64 466 466 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|Win32.ActiveCfg = Debug|Win32 467 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|Win32.Build.0 = Debug|Win32468 467 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|x64.ActiveCfg = Debug|x64 469 468 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|x64.Build.0 = Debug|x64 … … 485 484 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Mixed Platforms.Build.0 = Debug|x64 486 485 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Win32.ActiveCfg = Debug|Win32 487 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Win32.Build.0 = Debug|Win32488 486 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|x64.ActiveCfg = Debug|x64 489 487 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|x64.Build.0 = Debug|x64 -
trunk/include/NSCHelper.h
r202 r205 418 418 419 419 #define SETTINGS_MAKE_NAME(key) \ 420 std::wstring(setting s::key ## _PATH + _T(".") + settings::key)420 std::wstring(setting_keys::key ## _PATH + _T(".") + setting_keys::key) 421 421 422 422 #define SETTINGS_GET_STRING(key) \ 423 NSCModuleHelper::getSettingsString(setting s::key ## _PATH, settings::key, settings::key ## _DEFAULT)423 NSCModuleHelper::getSettingsString(setting_keys::key ## _PATH, setting_keys::key, setting_keys::key ## _DEFAULT) 424 424 #define SETTINGS_GET_INT(key) \ 425 NSCModuleHelper::getSettingsInt(setting s::key ## _PATH, settings::key, settings::key ## _DEFAULT)425 NSCModuleHelper::getSettingsInt(setting_keys::key ## _PATH, setting_keys::key, setting_keys::key ## _DEFAULT) 426 426 #define SETTINGS_GET_BOOL(key) \ 427 NSCModuleHelper::getSettingsInt(setting s::key ## _PATH, settings::key, settings::key ## _DEFAULT)427 NSCModuleHelper::getSettingsInt(setting_keys::key ## _PATH, setting_keys::key, setting_keys::key ## _DEFAULT) 428 428 429 429 #define SETTINGS_GET_STRING_FALLBACK(key, fallback) \ 430 NSCModuleHelper::getSettingsString(setting s::key ## _PATH, settings::key, NSCModuleHelper::getSettingsString(settings::fallback ## _PATH, settings::fallback, settings::fallback ## _DEFAULT))430 NSCModuleHelper::getSettingsString(setting_keys::key ## _PATH, setting_keys::key, NSCModuleHelper::getSettingsString(setting_keys::fallback ## _PATH, setting_keys::fallback, setting_keys::fallback ## _DEFAULT)) 431 431 #define SETTINGS_GET_INT_FALLBACK(key, fallback) \ 432 NSCModuleHelper::getSettingsInt(setting s::key ## _PATH, settings::key, NSCModuleHelper::getSettingsInt(settings::fallback ## _PATH, settings::fallback, settings::fallback ## _DEFAULT))432 NSCModuleHelper::getSettingsInt(setting_keys::key ## _PATH, setting_keys::key, NSCModuleHelper::getSettingsInt(setting_keys::fallback ## _PATH, setting_keys::fallback, setting_keys::fallback ## _DEFAULT)) 433 433 #define SETTINGS_GET_BOOL_FALLBACK(key, fallback) \ 434 NSCModuleHelper::getSettingsInt(setting s::key ## _PATH, settings::key, NSCModuleHelper::getSettingsInt(settings::fallback ## _PATH, settings::fallback, settings::fallback ## _DEFAULT))434 NSCModuleHelper::getSettingsInt(setting_keys::key ## _PATH, setting_keys::key, NSCModuleHelper::getSettingsInt(setting_keys::fallback ## _PATH, setting_keys::fallback, setting_keys::fallback ## _DEFAULT)) 435 435 436 436 #define SETTINGS_REG_KEY_S(key) \ 437 NSCModuleHelper::settings_register_key(setting s::key ## _PATH, settings::key, NSCAPI::key_string, settings::key ## _TITLE, settings::key ## _DESC, settings::key ## _DEFAULT, settings::key ## _ADVANCED);437 NSCModuleHelper::settings_register_key(setting_keys::key ## _PATH, setting_keys::key, NSCAPI::key_string, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, setting_keys::key ## _DEFAULT, setting_keys::key ## _ADVANCED); 438 438 #define SETTINGS_REG_KEY_I(key) \ 439 NSCModuleHelper::settings_register_key(setting s::key ## _PATH, settings::key, NSCAPI::key_integer, settings::key ## _TITLE, settings::key ## _DESC, strEx::itos(settings::key ## _DEFAULT), settings::key ## _ADVANCED);439 NSCModuleHelper::settings_register_key(setting_keys::key ## _PATH, setting_keys::key, NSCAPI::key_integer, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, strEx::itos(setting_keys::key ## _DEFAULT), setting_keys::key ## _ADVANCED); 440 440 #define SETTINGS_REG_KEY_B(key) \ 441 NSCModuleHelper::settings_register_key(setting s::key ## _PATH, settings::key, NSCAPI::key_integer, settings::key ## _TITLE, settings::key ## _DESC, settings::key ## _DEFAULT==1?_T("1"):_T("0"), settings::key ## _ADVANCED);441 NSCModuleHelper::settings_register_key(setting_keys::key ## _PATH, setting_keys::key, NSCAPI::key_integer, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, setting_keys::key ## _DEFAULT==1?_T("1"):_T("0"), setting_keys::key ## _ADVANCED); 442 442 #define SETTINGS_REG_PATH(key) \ 443 NSCModuleHelper::settings_register_path(setting s::key ## _PATH, settings::key ## _TITLE, settings::key ## _DESC, settings::key ## _ADVANCED);443 NSCModuleHelper::settings_register_path(setting_keys::key ## _PATH, setting_keys::key ## _TITLE, setting_keys::key ## _DESC, setting_keys::key ## _ADVANCED); -
trunk/include/config.h
r202 r205 24 24 #include <tchar.h> 25 25 #include <string> 26 #include <settings/macros.h> 26 27 // Application Name 27 28 #define SZAPPNAME _T("NSClient++") … … 71 72 #define CHECK_ALL _T("CheckAll") 72 73 #define CHECK_ALL_OTHERS _T("CheckAllOthers") 73 74 #define DEFINE_SETTING_S(name, path, key, value) \75 const std::wstring name ## _PATH = _T(path); \76 const std::wstring name = _T(key); \77 const std::wstring name ## _DEFAULT = _T(value);78 #define NSCLIENT_SETTINGS_SYSTRAY_EXE _T("systray_exe")79 #define NSCLIENT_SETTINGS_SYSTRAY_EXE_DEFAULT _T("nstray.exe")80 81 #define DEFINE_PATH(name, path) \82 const std::wstring name ## _PATH = _T(path);83 84 #define DEFINE_SETTING_I(name, path, key, value) \85 const std::wstring name ## _PATH = _T(path); \86 const std::wstring name = _T(key); \87 const long long name ## _DEFAULT = value;88 89 #define DEFINE_SETTING_B(name, path, key, value) \90 const std::wstring name ## _PATH = _T(path); \91 const std::wstring name = _T(key); \92 const bool name ## _DEFAULT = value;93 94 #define DESCRIBE_SETTING(name, title, description) \95 const std::wstring name ## _TITLE = _T(title); \96 const std::wstring name ## _DESC = _T(description); \97 const bool name ## _ADVANCED = false;98 99 #define DESCRIBE_SETTING_ADVANCED(name, title, description) \100 const std::wstring name ## _TITLE = _T(title); \101 const std::wstring name ## _DESC = _T(description); \102 const bool name ## _ADVANCED = true;103 104 #define SETTINGS_KEY(key) \105 settings::key ## _PATH, settings::key, settings::key ## _DEFAULT106 107 #define SETTINGS_REG_KEY_S_GEN(key, type) \108 settings::key ## _PATH, settings::key, type, settings::key ## _TITLE, settings::key ## _DESC, settings::key ## _DEFAULT, settings::key ## _ADVANCED109 #define SETTINGS_REG_KEY_I_GEN(key, type) \110 settings::key ## _PATH, settings::key, type, settings::key ## _TITLE, settings::key ## _DESC, strEx::itos(settings::key ## _DEFAULT), settings::key ## _ADVANCED111 #define SETTINGS_REG_KEY_B_GEN(key, type) \112 settings::key ## _PATH, settings::key, type, settings::key ## _TITLE, settings::key ## _DESC, settings::key ## _DEFAULT==1?_T("1"):_T("0"), settings::key ## _ADVANCED113 #define SETTINGS_REG_PATH_GEN(key) \114 settings::key ## _PATH, settings::key ## _TITLE, settings::key ## _DESC, settings::key ## _ADVANCED115 116 117 #define GENERIC_KEY_ALLOWED_HOSTS "allowed hosts"118 #define GENERIC_KEY_BIND_TO "bind to"119 #define GENERIC_KEY_SOCK_READ_TIMEOUT "socket read timeout"120 #define GENERIC_KEY_SOCK_LISTENQUE "socket queue size"121 #define GENERIC_KEY_SOCK_CACHE_ALLOWED "allowed hosts caching"122 #define GENERIC_KEY_PWD_MASTER_KEY "master key"123 #define GENERIC_KEY_PWD "password"124 #define GENERIC_KEY_OBFUSCATED_PWD "obfuscated password"125 #define GENERIC_KEY_USE_SSL "use ssl"126 127 namespace settings {128 129 #define DEFAULT_PROTOCOL_SECTION "/protocols/default"130 #define NSCLIENT_SECTION "/protocols/NSClient"131 #define NRPE_SECTION_PROTOCOL "/protocols/NRPE"132 #define DEFAULT_SECTION "/settings"133 #define NRPE_SECTION "/settings/NRPE"134 #define NRPE_CLIENT_HANDLER_SECTION "/settings/NRPE/client/handlers"135 #define NRPE_SECTION_HANDLERS "/settings/NRPE/Handlers"136 #define MAIN_MODULES_SECTION _T("/modules")137 #define EVENT_LOG_SECTION "/settings/eventlog"138 #define EXTSCRIPT_SECTION "/settings/external scripts"139 #define EXTSCRIPT_SCRIPT_SECTION "/settings/external scripts/scripts"140 #define EXTSCRIPT_ALIAS_SECTION "/settings/external scripts/alias"141 #define CHECK_SYSTEM_SECTION "/settings/system"142 #define CHECK_SYSTEM_COUNTERS_SECTION "/settings/system/PDH counters"143 #define CHECK_SYSTEM_SERVICES_SECTION "/settings/system/services"144 #define NSCA_SECTION "/settings/NSCA"145 #define NSCA_SERVER_SECTION "/settings/NSCA/server"146 #define NSCA_CMD_SECTION "/settings/NSCA/server/commands"147 #define TASK_SCHED_SECTION "/settings/Task Scheduler"148 #define LUA_SECTION "/settings/Lua/script"149 #define LOG_SECTION "/settings/log"150 151 // NSClient Setting headlines152 namespace nsclient {153 DEFINE_PATH(SECTION, NSCLIENT_SECTION);154 DESCRIBE_SETTING(SECTION, "NSCLIENT SECTION", "Section for NSClient (NSClientListsner.dll) (check_nt) protocol options.");155 156 DEFINE_SETTING_S(ALLOWED_HOSTS, NSCLIENT_SECTION, GENERIC_KEY_ALLOWED_HOSTS, "");157 DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. If you leave this blank the global version will be used instead.");158 159 DEFINE_SETTING_I(PORT, NSCLIENT_SECTION, "port", 12489);160 DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to.");161 162 DEFINE_SETTING_S(BINDADDR, NSCLIENT_SECTION, GENERIC_KEY_BIND_TO, "");163 DESCRIBE_SETTING(BINDADDR, "BIND TO ADDRESS", "Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. Leaving this blank will bind to all avalible IP adresses.");164 165 DEFINE_SETTING_I(READ_TIMEOUT, NSCLIENT_SECTION, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);166 DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.");167 168 DEFINE_SETTING_I(LISTENQUE, NSCLIENT_SECTION, GENERIC_KEY_SOCK_LISTENQUE, 0);169 DESCRIBE_SETTING_ADVANCED(LISTENQUE, "LISTEN QUEUE", "Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts.");170 171 DEFINE_SETTING_S(VERSION, NSCLIENT_SECTION, "version", "auto");172 DESCRIBE_SETTING(VERSION, "VERSION", "The version number to return for the CLIENTVERSION check (useful to \"simulate\" an old/different version of the client, auto will be generated from the compiled version string inside NSClient++");173 174 DEFINE_SETTING_B(CACHE_ALLOWED, NSCLIENT_SECTION, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);175 DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");176 177 DEFINE_SETTING_S(MASTER_KEY, NSCLIENT_SECTION, GENERIC_KEY_PWD_MASTER_KEY, "This is a secret key that you should change");178 DESCRIBE_SETTING(MASTER_KEY, "MASTER KEY", "The secret \"key\" used when (de)obfuscating passwords.");179 180 DEFINE_SETTING_S(PWD, NSCLIENT_SECTION, GENERIC_KEY_PWD, "");181 DESCRIBE_SETTING(PWD, "PASSWORD", "This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.");182 183 DEFINE_SETTING_S(OBFUSCATED_PWD, NSCLIENT_SECTION, GENERIC_KEY_OBFUSCATED_PWD, "");184 DESCRIBE_SETTING(OBFUSCATED_PWD, "OBFUSCATED PASSWORD", "This is the same as the password option but here you can store the password in an obfuscated manner. *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the password. Its just a bit harder to do it at first glance.");185 186 DEFINE_SETTING_S(SYSTRAY_EXE, NSCLIENT_SECTION, "systray_exe", "nstray.exe");187 DESCRIBE_SETTING(SYSTRAY_EXE, "TODO", "TODO");188 }189 190 // NSClient Setting headlines191 namespace nrpe {192 DEFINE_PATH(SECTION, NRPE_SECTION_PROTOCOL);193 DESCRIBE_SETTING(SECTION, "NRPE SECTION", "Section for NRPE (NRPEListener.dll) (check_nrpe) protocol options.");194 195 196 DEFINE_PATH(CH_SECTION, NRPE_CLIENT_HANDLER_SECTION);197 DESCRIBE_SETTING(CH_SECTION, "CLIENT HANDLER SECTION", "...");198 199 DEFINE_SETTING_S(ALLOWED_HOSTS, NRPE_SECTION_PROTOCOL, GENERIC_KEY_ALLOWED_HOSTS, "");200 DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. If you leave this blank the global version will be used instead.");201 202 DEFINE_SETTING_I(PORT, NRPE_SECTION_PROTOCOL, "port", 5666);203 DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to.");204 205 DEFINE_SETTING_S(BINDADDR, NRPE_SECTION_PROTOCOL, GENERIC_KEY_BIND_TO, "");206 DESCRIBE_SETTING(BINDADDR, "BIND TO ADDRESS", "Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. Leaving this blank will bind to all avalible IP adresses.");207 208 DEFINE_SETTING_I(READ_TIMEOUT, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);209 DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.");210 211 DEFINE_SETTING_I(LISTENQUE, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_LISTENQUE, 0);212 DESCRIBE_SETTING_ADVANCED(LISTENQUE, "LISTEN QUEUE", "Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts.");213 214 DEFINE_SETTING_B(CACHE_ALLOWED, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);215 DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");216 217 DEFINE_SETTING_B(KEYUSE_SSL, NRPE_SECTION_PROTOCOL, GENERIC_KEY_USE_SSL, true);218 DESCRIBE_SETTING(KEYUSE_SSL, "USE SSL SOCKET", "This option controls if SSL should be used on the socket.");219 220 DEFINE_SETTING_I(PAYLOAD_LENGTH, NRPE_SECTION_PROTOCOL, "payload length", 1024);221 DESCRIBE_SETTING_ADVANCED(PAYLOAD_LENGTH, "PAYLOAD LENGTH", "Length of payload to/from the NRPE agent. This is a hard specific value so you have to \"configure\" (read recompile) your NRPE agent to use the same value for it to work.");222 223 DEFINE_SETTING_B(ALLOW_PERFDATA, NRPE_SECTION, "performance data", true);224 DESCRIBE_SETTING_ADVANCED(ALLOW_PERFDATA, "PERFORMANCE DATA", "Send performance data back to nagios (set this to 0 to remove all performance data).");225 226 DEFINE_SETTING_S(SCRIPT_PATH, NRPE_SECTION, "script path", "");227 DESCRIBE_SETTING_ADVANCED(SCRIPT_PATH, "SCRIPT DIRECTORY", "Load all scripts in a directory and use them as commands. Probably dangerous but usefull if you have loads of scripts :)");228 229 DEFINE_SETTING_I(CMD_TIMEOUT, NRPE_SECTION, "command timeout", 60);230 DESCRIBE_SETTING(CMD_TIMEOUT, "COMMAND TIMEOUT", "This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off.");231 232 DEFINE_SETTING_B(ALLOW_ARGS, NRPE_SECTION, "allow arguments", false);233 DESCRIBE_SETTING(ALLOW_ARGS, "COMMAND ARGUMENT PROCESSING", "This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.");234 235 DEFINE_SETTING_B(ALLOW_NASTY, NRPE_SECTION, "allow nasy characters", false);236 DESCRIBE_SETTING(ALLOW_NASTY, "COMMAND ALLOW NASTY META CHARS", "This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'\"\\[]{}) characters in arguments.");237 238 DEFINE_PATH(SECTION_HANDLERS, NRPE_SECTION_HANDLERS);239 DESCRIBE_SETTING(SECTION_HANDLERS, "NRPE COMMAND DEFINITIONS -- DEPRECATED", "Command definitions that this daemon will run (it will also run all internal commands such as those from ther ExternalScriptModule).");240 241 }242 243 namespace settings_def {244 DEFINE_SETTING_B(COMPATIBLITY, DEFAULT_SECTION, "compatiblity 0.3", true);245 DESCRIBE_SETTING(COMPATIBLITY, "COMPATIBLE SETTINGS SYSTEM", "Allow reading old settings files from 0.3.x versions.");246 247 DEFINE_SETTING_I(PAYLOAD_LEN, DEFAULT_SECTION, "payload length", 4096);248 DESCRIBE_SETTING(PAYLOAD_LEN, "PAYLOAD LENGTH", "...");249 250 DEFINE_SETTING_B(SHARED_SESSION, DEFAULT_SECTION, "shared session", true);251 DESCRIBE_SETTING(SHARED_SESSION, "SHARED SESSION", "TODO");252 253 }254 255 namespace shared_session {256 DEFINE_SETTING_S(SYSTRAY_EXE, DEFAULT_SECTION, "tray", "");257 DESCRIBE_SETTING(SYSTRAY_EXE, "SYSTEM TRAY EXE", "TODO");258 259 }260 261 namespace protocol_def {262 DEFINE_SETTING_S(ALLOWED_HOSTS, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_ALLOWED_HOSTS, "");263 DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons. If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password). The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access");264 265 DEFINE_SETTING_B(CACHE_ALLOWED, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_SOCK_CACHE_ALLOWED, false);266 DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false.");267 268 DEFINE_SETTING_S(MASTER_KEY, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_PWD_MASTER_KEY, "This is a secret key that you should change");269 DESCRIBE_SETTING(MASTER_KEY, "MASTER KEY", "The secret \"key\" used when (de)obfuscating passwords.");270 271 DEFINE_SETTING_S(PWD, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_PWD, "");272 DESCRIBE_SETTING(PWD, "PASSWORD", "This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.");273 274 DEFINE_SETTING_S(OBFUSCATED_PWD, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_OBFUSCATED_PWD, "");275 DESCRIBE_SETTING(OBFUSCATED_PWD, "OBFUSCATED PASSWORD", "This is the same as the password option but here you can store the password in an obfuscated manner. *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the password. Its just a bit harder to do it at first glance.");276 }277 namespace event_log {278 DEFINE_PATH(SECTION, EVENT_LOG_SECTION);279 DESCRIBE_SETTING(SECTION, "EVENT LOG SECTION", "Section for the EventLog Checker (CHeckEventLog.dll).");280 281 DEFINE_SETTING_B(DEBUG_KEY, EVENT_LOG_SECTION, "debug", false);282 DESCRIBE_SETTING_ADVANCED(DEBUG_KEY, "DEBUG", "Log all \"hits\" and \"misses\" on the eventlog filter chain, useful for debugging eventlog checks but very very very noisy so you don't want to accidentally set this on a real machine.");283 284 DEFINE_SETTING_B(LOOKUP_NAMES, EVENT_LOG_SECTION, "lookup_names", false);285 DESCRIBE_SETTING_ADVANCED(LOOKUP_NAMES, "TODO", "TODO");286 287 DEFINE_SETTING_S(SYNTAX, EVENT_LOG_SECTION, "syntax", "");288 DESCRIBE_SETTING(SYNTAX, "SYNTAX", "Set this to use a specific syntax string for all commands (that don't specify one).");289 290 DEFINE_SETTING_I(BUFFER_SIZE, EVENT_LOG_SECTION, "buffer_size", 4096);291 DESCRIBE_SETTING(BUFFER_SIZE, "BUFFER SIZE", "The size of the bugfer to use when getting messages this affects the speed and maximum size of messages you can recieve.");292 }293 294 namespace external_scripts {295 DEFINE_PATH(SECTION, EXTSCRIPT_SECTION);296 DESCRIBE_SETTING(SECTION, "EXTERNAL SCRIPT SECTION", "Section for external scripts (CheckExternalScripts.dll).");297 298 DEFINE_SETTING_I(TIMEOUT, EXTSCRIPT_SECTION, "timeout", 60);299 DESCRIBE_SETTING(TIMEOUT, "COMMAND TIMEOUT", "The maximum time in seconds that a command can execute. (if more then this execution will be aborted). NOTICE this only affects external commands not internal ones.");300 301 DEFINE_SETTING_B(ALLOW_ARGS, EXTSCRIPT_SECTION, "allow arguments", false);302 DESCRIBE_SETTING(ALLOW_ARGS, "COMMAND ARGUMENT PROCESSING", "This option determines whether or not the we will allow clients to specify arguments to commands that are executed.");303 304 DEFINE_SETTING_B(ALLOW_NASTY, EXTSCRIPT_SECTION, "allow nasy characters", false);305 DESCRIBE_SETTING(ALLOW_NASTY, "COMMAND ALLOW NASTY META CHARS", "This option determines whether or not the we will allow clients to specify nasty (as in |`&><'\"\\[]{}) characters in arguments.");306 307 DEFINE_SETTING_S(SCRIPT_PATH, EXTSCRIPT_SECTION, "script path", "");308 DESCRIBE_SETTING_ADVANCED(SCRIPT_PATH, "SCRIPT DIRECTORY", "Load all scripts in a directory and use them as commands. Probably dangerous but usefull if you have loads of scripts :)");309 310 DEFINE_PATH(SCRIPT_SECTION, EXTSCRIPT_SCRIPT_SECTION);311 DESCRIBE_SETTING(SCRIPT_SECTION, "EXTERNAL SCRIPT SCRIPTS SECTION", "A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments> for instance:");312 313 DEFINE_PATH(ALIAS_SECTION, EXTSCRIPT_ALIAS_SECTION);314 DESCRIBE_SETTING(ALIAS_SECTION, "EXTERNAL SCRIPT ALIAS SECTION", "Works like the \"inject\" concept of NRPE scripts module. But in short a list of aliases available. An alias is an internal command that has been \"wrapped\" (to add arguments). Be careful so you don't create loops (ie check_loop=check_a, check_a=check_loop)");315 }316 317 namespace check_system {318 319 DEFINE_PATH(SECTION, CHECK_SYSTEM_SECTION);320 DESCRIBE_SETTING(SECTION, "SYSTEM", "Section for system checks and system settings.");321 322 DEFINE_SETTING_S(PROC_ENUM, CHECK_SYSTEM_SECTION, "process enumeration method", "auto");323 DESCRIBE_SETTING_ADVANCED(PROC_ENUM, "COMMAND TIMEOUT", "Set the PROCESS enumeration method (auto, TOOLHELP or PSAPI)");324 const std::wstring PROC_ENUM_PSAPI = _T("PSAPI");325 const std::wstring PROC_ENUM_TH = _T("TOOLHELP");326 327 DEFINE_SETTING_S(CPU_METHOD, CHECK_SYSTEM_SECTION, "method", "PDH_AUTO");328 DESCRIBE_SETTING_ADVANCED(CPU_METHOD, "CPU METHOD", "Set this to false to disable auto detect (counters.defs) PDH language and OS version.");329 const std::wstring CPU_METHOD_PDH_MANUAL = _T("PDH_MANUAL");330 const std::wstring CPU_METHOD_PDH_AUTO = _T("PDH_AUTO");331 const std::wstring CPU_METHOD_PDH_NO_INDEX = _T("PDH_NO_INDEX");332 333 DEFINE_SETTING_S(BUFFER_SIZE, CHECK_SYSTEM_SECTION, "buffer size", "1h");334 DESCRIBE_SETTING(BUFFER_SIZE, "BUFFER SIZE", " The time to store CPU load data.");335 336 DEFINE_SETTING_I(INTERVALL, CHECK_SYSTEM_SECTION, "interval", 10);337 DESCRIBE_SETTING_ADVANCED(INTERVALL, "CHECK INTERVAL", "Time between checks in 1/10 of seconds.");338 339 DEFINE_SETTING_S(FORCE_LANGUAGE, CHECK_SYSTEM_SECTION, "locale", "auto");340 DESCRIBE_SETTING_ADVANCED(FORCE_LANGUAGE, "FORCE LOCALE", "Set this to a locale ID if you want to force auto-detection of counters from that locale.");341 342 DEFINE_PATH(COUNTERS_SECTION, CHECK_SYSTEM_COUNTERS_SECTION);343 DESCRIBE_SETTING_ADVANCED(COUNTERS_SECTION, "PDH COUNTERS", "Section to define PDH counters to use");344 345 DEFINE_SETTING_S(PDH_MEM_CMT_LIM, CHECK_SYSTEM_COUNTERS_SECTION, "memory commit limit", "\\Memory\\Commit Limit");346 DESCRIBE_SETTING_ADVANCED(PDH_MEM_CMT_LIM, "PDH COUNTER", "Counter to use to check upper memory limit.");347 348 DEFINE_SETTING_S(PDH_MEM_CMT_BYT, CHECK_SYSTEM_COUNTERS_SECTION, "memory commit byte", "\\Memory\\Committed Bytes");349 DESCRIBE_SETTING_ADVANCED(PDH_MEM_CMT_BYT, "PDH COUNTER", "Counter to use to check current memory usage.");350 351 DEFINE_SETTING_S(PDH_SYSUP, CHECK_SYSTEM_COUNTERS_SECTION, "system uptime", "\\System\\System Up Time");352 DESCRIBE_SETTING_ADVANCED(PDH_SYSUP, "PDH COUNTER", "Counter to use to check the uptime of the system.");353 354 DEFINE_SETTING_S(PDH_CPU, CHECK_SYSTEM_COUNTERS_SECTION, "processor time", "\\Processor(_total)\\% Processor Time");355 DESCRIBE_SETTING_ADVANCED(PDH_CPU, "PDH COUNTER", "Counter to use for CPU load.");356 357 DEFINE_PATH(SERVICES_SECTION, CHECK_SYSTEM_SERVICES_SECTION);358 DESCRIBE_SETTING_ADVANCED(SERVICES_SECTION, "SERVICE CHECKS", "Section to define service checks to use");359 360 DEFINE_SETTING_S(SVC_BOOT_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_BOOT_START", "ignored");361 DESCRIBE_SETTING_ADVANCED(SVC_BOOT_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");362 363 DEFINE_SETTING_S(SVC_SYSTEM_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_SYSTEM_START", "ignored");364 DESCRIBE_SETTING_ADVANCED(SVC_SYSTEM_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");365 366 DEFINE_SETTING_S(SVC_AUTO_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_AUTO_START", "started");367 DESCRIBE_SETTING_ADVANCED(SVC_AUTO_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");368 369 DEFINE_SETTING_S(SVC_DEMAND_START, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_DEMAND_START", "ignored");370 DESCRIBE_SETTING_ADVANCED(SVC_DEMAND_START, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");371 372 DEFINE_SETTING_S(SVC_DISABLED, CHECK_SYSTEM_SERVICES_SECTION, "SERVICE_DISABLED", "stopped");373 DESCRIBE_SETTING_ADVANCED(SVC_DISABLED, "SERVICE_BOOT_START SERVICE CHECK", "Set how to handle services set to SERVICE_BOOT_START state when checking all services");374 375 376 }377 378 namespace nsca {379 DEFINE_PATH(SECTION, NSCA_SECTION);380 DESCRIBE_SETTING(SECTION, "NSCA SECTION", "Section for NSCA passive check module.");381 382 DEFINE_SETTING_I(INTERVAL, NSCA_SECTION, "interval", 60);383 DESCRIBE_SETTING(INTERVAL, "COMMAND TIMEOUT", "Time in seconds between each report back to the server (cant as of yet be set individually so this is for all \"checks\")");384 385 DEFINE_SETTING_S(HOSTNAME, NSCA_SECTION, "hostname", "");386 DESCRIBE_SETTING_ADVANCED(HOSTNAME, "LOCAL HOSTNAME", "The host name of this host if set to blank (default) the windows name of the computer will be used.");387 388 DEFINE_PATH(SERVER_SECTION, NSCA_SERVER_SECTION);389 DESCRIBE_SETTING(SERVER_SECTION, "NSCA SERVER SECTION", "Configure the NSCA server to report to");390 391 DEFINE_SETTING_S(SERVER_HOST, NSCA_SERVER_SECTION, "host", "unknown-host");392 DESCRIBE_SETTING(SERVER_HOST, "NSCA SERVER", "The NSCA/Nagios(?) server to report results to.");393 394 DEFINE_SETTING_I(SERVER_PORT, NSCA_SERVER_SECTION, "port", 5667);395 DESCRIBE_SETTING(SERVER_PORT, "NSCA PORT", "The NSCA server port");396 397 DEFINE_SETTING_I(ENCRYPTION, NSCA_SERVER_SECTION, "encryption method", 1);398 DESCRIBE_SETTING(ENCRYPTION, "NSCA ENCRYPTION", "Number corresponding to the various encryption algorithms (see the wiki). Has to be the same as the server or it wont work at all.");399 400 DEFINE_SETTING_S(PASSWORD, NSCA_SERVER_SECTION, "password", "");401 DESCRIBE_SETTING(PASSWORD, "NSCA PASSWORD", "The password to use. Again has to be the same as the server or it wont work at all.");402 403 DEFINE_SETTING_I(THREADS, NSCA_SECTION, "debug threads", 1);404 DESCRIBE_SETTING_ADVANCED(THREADS, "DEBUG OPTION (THREADS)", "Number of threads to run, no reason to change this really (unless you want to stress test something)");405 406 DEFINE_SETTING_B(CACHE_HOST, NSCA_SECTION, "cache hostname", false);407 DESCRIBE_SETTING_ADVANCED(CACHE_HOST, "CACHE HOSTNAME", "???");408 409 DEFINE_PATH(CMD_SECTION, NSCA_CMD_SECTION);410 DESCRIBE_SETTING(CMD_SECTION, "NSCA COMMAND SECTION", "Commands to check and report to the NSCA server");411 412 DEFINE_SETTING_S(REPORT_MODE, NSCA_SERVER_SECTION, "report", "all");413 DESCRIBE_SETTING(REPORT_MODE, "REPORT MODE", "What to report to the server (any of the following: all, critical, warning, unknown, ok)");414 415 DEFINE_SETTING_S(TIME_DELTA_DEFAULT, NSCA_SECTION, "delay", "0");416 DESCRIBE_SETTING(TIME_DELTA_DEFAULT, "TODO", "TODO");417 418 DEFINE_SETTING_I(PAYLOAD_LENGTH, NSCA_SECTION, "payload length", 512);419 DESCRIBE_SETTING_ADVANCED(PAYLOAD_LENGTH, "PAYLOAD LENGTH", "Length of payload to/from the NSCA agent. This is a hard specific value so you have to \"configure\" (read recompile) your NSCA server to use the same value for it to work.");420 421 DEFINE_SETTING_I(READ_TIMEOUT, NSCA_SERVER_SECTION, GENERIC_KEY_SOCK_READ_TIMEOUT, 30);422 DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.");423 424 }425 426 namespace task_scheduler {427 DEFINE_PATH(SECTION, TASK_SCHED_SECTION);428 DESCRIBE_SETTING_ADVANCED(SECTION, "TASK SCHEDULER", "???");429 430 DEFINE_SETTING_S(SYNTAX, TASK_SCHED_SECTION, "syntax", "%title% last run: %most-recent-run-time% (%exit-code%)");431 DESCRIBE_SETTING_ADVANCED(SYNTAX, "SYNTAX", "Set this to use a specific syntax string for all commands (that don't specify one)");432 }433 434 namespace lua {435 DEFINE_PATH(SECTION, LUA_SECTION);436 DESCRIBE_SETTING_ADVANCED(SECTION, "LUA SECTION", "A list of LUA script to load at startup. In difference to \"external checks\" all LUA scripts are loaded at startup. Names have no meaning since the script (on boot) submit which commands are available and tie that to various functions.");437 }438 439 namespace log {440 DEFINE_PATH(SECTION, LOG_SECTION);441 DESCRIBE_SETTING_ADVANCED(SECTION, "LOG SECTION", "Configure loggning properties.");442 443 DEFINE_SETTING_S(FILENAME, LOG_SECTION, "file", "nsclient.log");444 DESCRIBE_SETTING_ADVANCED(FILENAME, "SYNTAX", "The file to write log data to. If no directory is used this is relative to the NSClient++ binary.");445 446 DEFINE_SETTING_S(ROOT, LOG_SECTION, "root", "auto");447 DESCRIBE_SETTING_ADVANCED(ROOT, "TODO", "TODO");448 449 DEFINE_SETTING_S(DATEMASK, LOG_SECTION, "date format", "%Y-%m-%d %H:%M:%S");450 DESCRIBE_SETTING_ADVANCED(DATEMASK, "DATEMASK", "The date format used when logging to a file.");451 452 DEFINE_SETTING_B(DEBUG_LOG, LOG_SECTION, "debug", false);453 DESCRIBE_SETTING_ADVANCED(DEBUG_LOG, "DEBUG LOGGING", "Enable debug logging can help track down errors and find problems but will impact overall perfoamnce negativly.");454 }455 }456 74 457 75 // Check System Settings -
trunk/include/settings/Settings.h
r202 r205 24 24 #include <string> 25 25 #include <map> 26 #include <Mutex.h> 26 27 #define BUFF_LEN 4096 27 28 -
trunk/include/settings/settings_old.hpp
r202 r205 16 16 OLDSettings(Settings::SettingsCore *core, std::wstring context) :Settings::SettingsInterfaceImpl(core, context) { 17 17 add_mapping(MAIN_MODULES_SECTION, MAIN_MODULES_SECTION_OLD); 18 add_mapping(setting s::settings_def::PAYLOAD_LEN_PATH, settings::settings_def::PAYLOAD_LEN, MAIN_SECTION_TITLE, MAIN_STRING_LENGTH);18 add_mapping(setting_keys::settings_def::PAYLOAD_LEN_PATH, setting_keys::settings_def::PAYLOAD_LEN, MAIN_SECTION_TITLE, MAIN_STRING_LENGTH); 19 19 20 20 #define SETTINGS_MAP_KEY_A(name, section, key) \ 21 add_mapping(setting s::name ## _PATH, settings::name, section, key);21 add_mapping(setting_keys::name ## _PATH, setting_keys::name, section, key); 22 22 #define SETTINGS_MAP_SECTION_A(name, section) \ 23 add_mapping(setting s::name ## _PATH, section);23 add_mapping(setting_keys::name ## _PATH, section); 24 24 25 25 … … 43 43 #define LOG_FILENAME _T("file") 44 44 #define LOG_DATEMASK _T("date_mask") 45 NSC_DEBUG_MSG(_T("Using compatibility mode in: LOGGING module"));46 45 47 46 SETTINGS_MAP_KEY_A(log::FILENAME, LOG_SECTION_TITLE, LOG_FILENAME); … … 141 140 if (it == sections_.end()) 142 141 return path_new; 142 get_core()->get_logger()->debug(__FILEW__, __LINE__, _T("Mapping: ") + path_new + _T(" to ") + (*it).second); 143 143 return (*it).second; 144 144 } … … 392 392 /// @author mickem 393 393 virtual void get_real_keys(std::wstring path, string_list &list) { 394 std::wstring mapped_path = map_path(path); 395 int_read_section(mapped_path, list); 394 396 /* 395 std::wstring mapped_path = get_core()->reverse_map_path(path);396 int_read_section(path, list);397 397 Settings::SettingsCore::mapped_key_list_type mapped_keys = get_core()->find_maped_keys(path); 398 398 for (Settings::SettingsCore::mapped_key_list_type::const_iterator cit = mapped_keys.begin(); cit != mapped_keys.end(); ++cit) { … … 414 414 } 415 415 void int_read_section(std::wstring section, string_list &list, unsigned int bufferLength = BUFF_LEN) { 416 get_core()->get_logger()->debug(__FILEW__, __LINE__, _T("Reading (OLD) section: ") + section); 416 417 // @TODO this is not correct! 417 std::wstring mapped = map_path(section);418 418 TCHAR* buffer = new TCHAR[bufferLength+1]; 419 419 if (buffer == NULL) 420 420 throw SettingsException(_T("getSections:: Failed to allocate memory for buffer!")); 421 unsigned int count = GetPrivateProfileSection( mapped.c_str(), buffer, bufferLength, get_file_name().c_str());421 unsigned int count = GetPrivateProfileSection(section.c_str(), buffer, bufferLength, get_file_name().c_str()); 422 422 if (count == bufferLength-2) { 423 423 delete [] buffer; -
trunk/include/strEx.h
r201 r205 634 634 #endif 635 635 } 636 637 638 #include <string> 639 #include <locale> 640 641 #include <boost/lexical_cast.hpp> 642 643 namespace boost 644 { 645 template<> 646 inline std::wstring lexical_cast<std::wstring, std::string>(const std::string& arg) 647 { 648 std::wstring result; 649 std::locale loc; 650 for(unsigned int i= 0; i < arg.size(); ++i) 651 { 652 result += std::use_facet<std::ctype<wchar_t> >(loc).widen(arg[i]); 653 } 654 return result; 655 } 656 657 template<> 658 inline std::string lexical_cast<std::string, std::wstring>(const std::wstring& arg) 659 { 660 std::string result; 661 std::locale loc; 662 for(unsigned int i= 0; i < arg.size(); ++i) 663 { 664 result += std::use_facet<std::ctype<wchar_t> >(loc).narrow(arg[i]); 665 } 666 return result; 667 } 668 } 669 -
trunk/modules/CheckDisk/CheckDisk-2005.vcproj
r201 r205 345 345 </Configuration> 346 346 <Configuration 347 Name="Distribution|Win32"348 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"349 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"350 ConfigurationType="2"351 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"352 CharacterSet="1"353 >354 <Tool355 Name="VCPreBuildEventTool"356 />357 <Tool358 Name="VCCustomBuildTool"359 />360 <Tool361 Name="VCXMLDataGeneratorTool"362 />363 <Tool364 Name="VCWebServiceProxyGeneratorTool"365 />366 <Tool367 Name="VCMIDLTool"368 />369 <Tool370 Name="VCCLCompilerTool"371 AdditionalIncludeDirectories="../include;../../include"372 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;USE_BOOST"373 RuntimeLibrary="0"374 UsePrecompiledHeader="2"375 WarningLevel="3"376 Detect64BitPortabilityProblems="false"377 DebugInformationFormat="3"378 />379 <Tool380 Name="VCManagedResourceCompilerTool"381 />382 <Tool383 Name="VCResourceCompilerTool"384 />385 <Tool386 Name="VCPreLinkEventTool"387 />388 <Tool389 Name="VCLinkerTool"390 OutputFile="$(OutDir)\$(ProjectName).dll"391 LinkIncremental="1"392 ModuleDefinitionFile="CheckDisk.def"393 GenerateDebugInformation="false"394 SubSystem="2"395 OptimizeReferences="2"396 EnableCOMDATFolding="2"397 ImportLibrary="$(OutDir)/CheckDisk.lib"398 TargetMachine="1"399 />400 <Tool401 Name="VCALinkTool"402 />403 <Tool404 Name="VCManifestTool"405 />406 <Tool407 Name="VCXDCMakeTool"408 />409 <Tool410 Name="VCBscMakeTool"411 />412 <Tool413 Name="VCFxCopTool"414 />415 <Tool416 Name="VCAppVerifierTool"417 />418 <Tool419 Name="VCWebDeploymentTool"420 />421 <Tool422 Name="VCPostBuildEventTool"423 />424 </Configuration>425 <Configuration426 347 Name="Distribution|x64" 427 348 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" … … 630 551 EnableCOMDATFolding="2" 631 552 TargetMachine="17" 632 />633 <Tool634 Name="VCALinkTool"635 />636 <Tool637 Name="VCManifestTool"638 />639 <Tool640 Name="VCXDCMakeTool"641 />642 <Tool643 Name="VCBscMakeTool"644 />645 <Tool646 Name="VCFxCopTool"647 />648 <Tool649 Name="VCAppVerifierTool"650 />651 <Tool652 Name="VCWebDeploymentTool"653 />654 <Tool655 Name="VCPostBuildEventTool"656 />657 </Configuration>658 <Configuration659 Name="Debug-MemCheck|Win32"660 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"661 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"662 ConfigurationType="2"663 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"664 CharacterSet="1"665 >666 <Tool667 Name="VCPreBuildEventTool"668 />669 <Tool670 Name="VCCustomBuildTool"671 />672 <Tool673 Name="VCXMLDataGeneratorTool"674 />675 <Tool676 Name="VCWebServiceProxyGeneratorTool"677 />678 <Tool679 Name="VCMIDLTool"680 />681 <Tool682 Name="VCCLCompilerTool"683 Optimization="0"684 AdditionalIncludeDirectories="../include;../../include"685 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;MEMCHECK"686 MinimalRebuild="true"687 BasicRuntimeChecks="3"688 RuntimeLibrary="3"689 UsePrecompiledHeader="2"690 WarningLevel="3"691 Detect64BitPortabilityProblems="false"692 DebugInformationFormat="4"693 />694 <Tool695 Name="VCManagedResourceCompilerTool"696 />697 <Tool698 Name="VCResourceCompilerTool"699 />700 <Tool701 Name="VCPreLinkEventTool"702 />703 <Tool704 Name="VCLinkerTool"705 OutputFile="$(OutDir)\$(ProjectName).dll"706 LinkIncremental="2"707 ModuleDefinitionFile="CheckDisk.def"708 GenerateDebugInformation="true"709 ProgramDatabaseFile="$(OutDir)/CheckDisk.pdb"710 SubSystem="2"711 ImportLibrary="$(OutDir)/CheckDisk.lib"712 TargetMachine="1"713 553 /> 714 554 <Tool … … 793 633 ImportLibrary="$(OutDir)/CheckDisk.lib" 794 634 TargetMachine="17" 795 />796 <Tool797 Name="VCALinkTool"798 />799 <Tool800 Name="VCManifestTool"801 />802 <Tool803 Name="VCXDCMakeTool"804 />805 <Tool806 Name="VCBscMakeTool"807 />808 <Tool809 Name="VCFxCopTool"810 />811 <Tool812 Name="VCAppVerifierTool"813 />814 <Tool815 Name="VCWebDeploymentTool"816 />817 <Tool818 Name="VCPostBuildEventTool"819 />820 </Configuration>821 <Configuration822 Name="OP5|Win32"823 OutputDirectory="$(SolutionDir)$(ConfigurationName)"824 IntermediateDirectory="$(ConfigurationName)"825 ConfigurationType="2"826 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"827 CharacterSet="1"828 >829 <Tool830 Name="VCPreBuildEventTool"831 />832 <Tool833 Name="VCCustomBuildTool"834 />835 <Tool836 Name="VCXMLDataGeneratorTool"837 />838 <Tool839 Name="VCWebServiceProxyGeneratorTool"840 />841 <Tool842 Name="VCMIDLTool"843 />844 <Tool845 Name="VCCLCompilerTool"846 AdditionalIncludeDirectories="../include;../../include"847 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;USE_BOOST"848 UsePrecompiledHeader="2"849 WarningLevel="3"850 DebugInformationFormat="3"851 />852 <Tool853 Name="VCManagedResourceCompilerTool"854 />855 <Tool856 Name="VCResourceCompilerTool"857 />858 <Tool859 Name="VCPreLinkEventTool"860 />861 <Tool862 Name="VCLinkerTool"863 OutputFile="$(OutDir)\$(ProjectName).dll"864 LinkIncremental="1"865 ModuleDefinitionFile="CheckDisk.def"866 GenerateDebugInformation="false"867 SubSystem="2"868 OptimizeReferences="2"869 EnableCOMDATFolding="2"870 TargetMachine="1"871 635 /> 872 636 <Tool … … 1419 1183 </FileConfiguration> 1420 1184 <FileConfiguration 1421 Name="Distribution|Win32"1422 >1423 <Tool1424 Name="VCCLCompilerTool"1425 UsePrecompiledHeader="0"1426 PrecompiledHeaderThrough=""1427 />1428 </FileConfiguration>1429 <FileConfiguration1430 1185 Name="Distribution|x64" 1431 1186 > … … 1455 1210 </FileConfiguration> 1456 1211 <FileConfiguration 1457 Name="Debug-MemCheck|Win32"1458 >1459 <Tool1460 Name="VCCLCompilerTool"1461 UsePrecompiledHeader="0"1462 PrecompiledHeaderThrough=""1463 />1464 </FileConfiguration>1465 <FileConfiguration1466 1212 Name="Debug-MemCheck|x64" 1467 >1468 <Tool1469 Name="VCCLCompilerTool"1470 UsePrecompiledHeader="0"1471 PrecompiledHeaderThrough=""1472 />1473 </FileConfiguration>1474 <FileConfiguration1475 Name="OP5|Win32"1476 1213 > 1477 1214 <Tool … … 1580 1317 </FileConfiguration> 1581 1318 <FileConfiguration 1582 Name="Distribution|Win32"1583 >1584 <Tool1585 Name="VCCLCompilerTool"1586 UsePrecompiledHeader="0"1587 PrecompiledHeaderThrough=""1588 />1589 </FileConfiguration>1590 <FileConfiguration1591 1319 Name="Distribution|x64" 1592 1320 > … … 1616 1344 </FileConfiguration> 1617 1345 <FileConfiguration 1618 Name="Debug-MemCheck|Win32"1619 >1620 <Tool1621 Name="VCCLCompilerTool"1622 UsePrecompiledHeader="0"1623 PrecompiledHeaderThrough=""1624 />1625 </FileConfiguration>1626 <FileConfiguration1627 1346 Name="Debug-MemCheck|x64" 1628 >1629 <Tool1630 Name="VCCLCompilerTool"1631 UsePrecompiledHeader="0"1632 PrecompiledHeaderThrough=""1633 />1634 </FileConfiguration>1635 <FileConfiguration1636 Name="OP5|Win32"1637 1347 > 1638 1348 <Tool … … 1733 1443 </FileConfiguration> 1734 1444 <FileConfiguration 1735 Name="Distribution| Win32"1445 Name="Distribution|x64" 1736 1446 > 1737 1447 <Tool … … 1741 1451 </FileConfiguration> 1742 1452 <FileConfiguration 1743 Name=" Distribution|x64"1453 Name="Nightly|Win32" 1744 1454 > 1745 1455 <Tool … … 1749 1459 </FileConfiguration> 1750 1460 <FileConfiguration 1751 Name="Nightly| Win32"1461 Name="Nightly|x64" 1752 1462 > 1753 1463 <Tool … … 1757 1467 </FileConfiguration> 1758 1468 <FileConfiguration 1759 Name="Nightly|x64"1760 >1761 <Tool1762 Name="VCCLCompilerTool"1763 UsePrecompiledHeader="1"1764 />1765 </FileConfiguration>1766 <FileConfiguration1767 Name="Debug-MemCheck|Win32"1768 >1769 <Tool1770 Name="VCCLCompilerTool"1771 UsePrecompiledHeader="1"1772 />1773 </FileConfiguration>1774 <FileConfiguration1775 1469 Name="Debug-MemCheck|x64" 1776 >1777 <Tool1778 Name="VCCLCompilerTool"1779 UsePrecompiledHeader="1"1780 />1781 </FileConfiguration>1782 <FileConfiguration1783 Name="OP5|Win32"1784 1470 > 1785 1471 <Tool … … 1877 1563 </FileConfiguration> 1878 1564 <FileConfiguration 1879 Name="Distribution|Win32"1880 >1881 <Tool1882 Name="VCCLCompilerTool"1883 UsePrecompiledHeader="0"1884 PrecompiledHeaderThrough=""1885 />1886 </FileConfiguration>1887 <FileConfiguration1888 1565 Name="Distribution|x64" 1889 1566 > … … 1913 1590 </FileConfiguration> 1914 1591 <FileConfiguration 1915 Name="Debug-MemCheck|Win32"1916 >1917 <Tool1918 Name="VCCLCompilerTool"1919 UsePrecompiledHeader="0"1920 PrecompiledHeaderThrough=""1921 />1922 </FileConfiguration>1923 <FileConfiguration1924 1592 Name="Debug-MemCheck|x64" 1925 >1926 <Tool1927 Name="VCCLCompilerTool"1928 UsePrecompiledHeader="0"1929 PrecompiledHeaderThrough=""1930 />1931 </FileConfiguration>1932 <FileConfiguration1933 Name="OP5|Win32"1934 1593 > 1935 1594 <Tool -
trunk/modules/CheckEventLog/CheckEventLog-2005.vcproj
r201 r205 349 349 </Configuration> 350 350 <Configuration 351 Name="Distribution|Win32"352 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"353 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"354 ConfigurationType="2"355 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"356 CharacterSet="1"357 >358 <Tool359 Name="VCPreBuildEventTool"360 ExcludedFromBuild="true"361 />362 <Tool363 Name="VCCustomBuildTool"364 />365 <Tool366 Name="VCXMLDataGeneratorTool"367 />368 <Tool369 Name="VCWebServiceProxyGeneratorTool"370 />371 <Tool372 Name="VCMIDLTool"373 />374 <Tool375 Name="VCCLCompilerTool"376 AdditionalIncludeDirectories="../include;../../include"377 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;USE_BOOST"378 RuntimeLibrary="0"379 UsePrecompiledHeader="2"380 WarningLevel="3"381 Detect64BitPortabilityProblems="false"382 DebugInformationFormat="3"383 />384 <Tool385 Name="VCManagedResourceCompilerTool"386 />387 <Tool388 Name="VCResourceCompilerTool"389 />390 <Tool391 Name="VCPreLinkEventTool"392 />393 <Tool394 Name="VCLinkerTool"395 OutputFile="$(OutDir)\$(ProjectName).dll"396 LinkIncremental="1"397 ModuleDefinitionFile="CheckEventLog.def"398 GenerateDebugInformation="false"399 SubSystem="2"400 OptimizeReferences="2"401 EnableCOMDATFolding="2"402 ImportLibrary="$(OutDir)/CheckEventLog.lib"403 TargetMachine="1"404 />405 <Tool406 Name="VCALinkTool"407 />408 <Tool409 Name="VCManifestTool"410 />411 <Tool412 Name="VCXDCMakeTool"413 />414 <Tool415 Name="VCBscMakeTool"416 />417 <Tool418 Name="VCFxCopTool"419 />420 <Tool421 Name="VCAppVerifierTool"422 />423 <Tool424 Name="VCWebDeploymentTool"425 />426 <Tool427 Name="VCPostBuildEventTool"428 />429 </Configuration>430 <Configuration431 351 Name="Distribution|x64" 432 352 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" … … 636 556 EnableCOMDATFolding="2" 637 557 TargetMachine="17" 638 />639 <Tool640 Name="VCALinkTool"641 />642 <Tool643 Name="VCManifestTool"644 />645 <Tool646 Name="VCXDCMakeTool"647 />648 <Tool649 Name="VCBscMakeTool"650 />651 <Tool652 Name="VCFxCopTool"653 />654 <Tool655 Name="VCAppVerifierTool"656 />657 <Tool658 Name="VCWebDeploymentTool"659 />660 <Tool661 Name="VCPostBuildEventTool"662 />663 </Configuration>664 <Configuration665 Name="Debug-MemCheck|Win32"666 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"667 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"668 ConfigurationType="2"669 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"670 CharacterSet="1"671 >672 <Tool673 Name="VCPreBuildEventTool"674 ExcludedFromBuild="true"675 />676 <Tool677 Name="VCCustomBuildTool"678 />679 <Tool680 Name="VCXMLDataGeneratorTool"681 />682 <Tool683 Name="VCWebServiceProxyGeneratorTool"684 />685 <Tool686 Name="VCMIDLTool"687 />688 <Tool689 Name="VCCLCompilerTool"690 Optimization="0"691 AdditionalIncludeDirectories="../include;../../include"692 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;MEMCHECK"693 MinimalRebuild="true"694 BasicRuntimeChecks="3"695 RuntimeLibrary="3"696 UsePrecompiledHeader="2"697 WarningLevel="3"698 Detect64BitPortabilityProblems="false"699 DebugInformationFormat="4"700 />701 <Tool702 Name="VCManagedResourceCompilerTool"703 />704 <Tool705 Name="VCResourceCompilerTool"706 />707 <Tool708 Name="VCPreLinkEventTool"709 />710 <Tool711 Name="VCLinkerTool"712 OutputFile="$(OutDir)\$(ProjectName).dll"713 LinkIncremental="2"714 ModuleDefinitionFile="CheckEventLog.def"715 GenerateDebugInformation="true"716 ProgramDatabaseFile="$(OutDir)/CheckEventLog.pdb"717 SubSystem="2"718 ImportLibrary="$(OutDir)/CheckEventLog.lib"719 TargetMachine="1"720 558 /> 721 559 <Tool … … 801 639 ImportLibrary="$(OutDir)/CheckEventLog.lib" 802 640 TargetMachine="17" 803 />804 <Tool805 Name="VCALinkTool"806 />807 <Tool808 Name="VCManifestTool"809 />810 <Tool811 Name="VCXDCMakeTool"812 />813 <Tool814 Name="VCBscMakeTool"815 />816 <Tool817 Name="VCFxCopTool"818 />819 <Tool820 Name="VCAppVerifierTool"821 />822 <Tool823 Name="VCWebDeploymentTool"824 />825 <Tool826 Name="VCPostBuildEventTool"827 />828 </Configuration>829 <Configuration830 Name="OP5|Win32"831 OutputDirectory="$(SolutionDir)$(ConfigurationName)"832 IntermediateDirectory="$(ConfigurationName)"833 ConfigurationType="2"834 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"835 CharacterSet="1"836 >837 <Tool838 Name="VCPreBuildEventTool"839 ExcludedFromBuild="true"840 />841 <Tool842 Name="VCCustomBuildTool"843 />844 <Tool845 Name="VCXMLDataGeneratorTool"846 />847 <Tool848 Name="VCWebServiceProxyGeneratorTool"849 />850 <Tool851 Name="VCMIDLTool"852 />853 <Tool854 Name="VCCLCompilerTool"855 AdditionalIncludeDirectories="../include;../../include"856 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;USE_BOOST"857 UsePrecompiledHeader="2"858 WarningLevel="3"859 DebugInformationFormat="3"860 />861 <Tool862 Name="VCManagedResourceCompilerTool"863 />864 <Tool865 Name="VCResourceCompilerTool"866 />867 <Tool868 Name="VCPreLinkEventTool"869 />870 <Tool871 Name="VCLinkerTool"872 OutputFile="$(OutDir)\$(ProjectName).dll"873 LinkIncremental="1"874 ModuleDefinitionFile="CheckEventLog.def"875 SubSystem="2"876 OptimizeReferences="2"877 EnableCOMDATFolding="2"878 TargetMachine="1"879 641 /> 880 642 <Tool … … 1433 1195 </FileConfiguration> 1434 1196 <FileConfiguration 1435 Name="Distribution|Win32"1436 >1437 <Tool1438 Name="VCCLCompilerTool"1439 UsePrecompiledHeader="0"1440 PrecompiledHeaderThrough=""1441 />1442 </FileConfiguration>1443 <FileConfiguration1444 1197 Name="Distribution|x64" 1445 1198 > … … 1469 1222 </FileConfiguration> 1470 1223 <FileConfiguration 1471 Name="Debug-MemCheck|Win32"1472 >1473 <Tool1474 Name="VCCLCompilerTool"1475 UsePrecompiledHeader="0"1476 PrecompiledHeaderThrough=""1477 />1478 </FileConfiguration>1479 <FileConfiguration1480 1224 Name="Debug-MemCheck|x64" 1481 >1482 <Tool1483 Name="VCCLCompilerTool"1484 UsePrecompiledHeader="0"1485 PrecompiledHeaderThrough=""1486 />1487 </FileConfiguration>1488 <FileConfiguration1489 Name="OP5|Win32"1490 1225 > 1491 1226 <Tool … … 1594 1329 </FileConfiguration> 1595 1330 <FileConfiguration 1596 Name="Distribution|Win32"1597 >1598 <Tool1599 Name="VCCLCompilerTool"1600 UsePrecompiledHeader="0"1601 PrecompiledHeaderThrough=""1602 />1603 </FileConfiguration>1604 <FileConfiguration1605 1331 Name="Distribution|x64" 1606 1332 > … … 1630 1356 </FileConfiguration> 1631 1357 <FileConfiguration 1632 Name="Debug-MemCheck|Win32"1633 >1634 <Tool1635 Name="VCCLCompilerTool"1636 UsePrecompiledHeader="0"1637 PrecompiledHeaderThrough=""1638 />1639 </FileConfiguration>1640 <FileConfiguration1641 1358 Name="Debug-MemCheck|x64" 1642 >1643 <Tool1644 Name="VCCLCompilerTool"1645 UsePrecompiledHeader="0"1646 PrecompiledHeaderThrough=""1647 />1648 </FileConfiguration>1649 <FileConfiguration1650 Name="OP5|Win32"1651 1359 > 1652 1360 <Tool … … 1747 1455 </FileConfiguration> 1748 1456 <FileConfiguration 1749 Name="Distribution| Win32"1457 Name="Distribution|x64" 1750 1458 > 1751 1459 <Tool … … 1755 1463 </FileConfiguration> 1756 1464 <FileConfiguration 1757 Name=" Distribution|x64"1465 Name="Nightly|Win32" 1758 1466 > 1759 1467 <Tool … … 1763 1471 </FileConfiguration> 1764 1472 <FileConfiguration 1765 Name="Nightly| Win32"1473 Name="Nightly|x64" 1766 1474 > 1767 1475 <Tool … … 1771 1479 </FileConfiguration> 1772 1480 <FileConfiguration 1773 Name="Nightly|x64"1774 >1775 <Tool1776 Name="VCCLCompilerTool"1777 UsePrecompiledHeader="1"1778 />1779 </FileConfiguration>1780 <FileConfiguration1781 Name="Debug-MemCheck|Win32"1782 >1783 <Tool1784 Name="VCCLCompilerTool"1785 UsePrecompiledHeader="1"1786 />1787 </FileConfiguration>1788 <FileConfiguration1789 1481 Name="Debug-MemCheck|x64" 1790 >1791 <Tool1792 Name="VCCLCompilerTool"1793 UsePrecompiledHeader="1"1794 />1795 </FileConfiguration>1796 <FileConfiguration1797 Name="OP5|Win32"1798 1482 > 1799 1483 <Tool … … 1891 1575 </FileConfiguration> 1892 1576 <FileConfiguration 1893 Name="Distribution|Win32"1894 >1895 <Tool1896 Name="VCCLCompilerTool"1897 UsePrecompiledHeader="0"1898 PrecompiledHeaderThrough=""1899 />1900 </FileConfiguration>1901 <FileConfiguration1902 1577 Name="Distribution|x64" 1903 1578 > … … 1927 1602 </FileConfiguration> 1928 1603 <FileConfiguration 1929 Name="Debug-MemCheck|Win32"1930 >1931 <Tool1932 Name="VCCLCompilerTool"1933 UsePrecompiledHeader="0"1934 PrecompiledHeaderThrough=""1935 />1936 </FileConfiguration>1937 <FileConfiguration1938 1604 Name="Debug-MemCheck|x64" 1939 >1940 <Tool1941 Name="VCCLCompilerTool"1942 UsePrecompiledHeader="0"1943 PrecompiledHeaderThrough=""1944 />1945 </FileConfiguration>1946 <FileConfiguration1947 Name="OP5|Win32"1948 1605 > 1949 1606 <Tool -
trunk/modules/CheckEventLog/CheckEventLog.cpp
r202 r205 30 30 #include <map> 31 31 #include <vector> 32 #include <config.h> 32 33 33 34 CheckEventLog gCheckEventLog; … … 633 634 if (err == ERROR_INSUFFICIENT_BUFFER) { 634 635 if (!buffer_error_reported) { 635 NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small change the value of ") + setting s::event_log::BUFFER_SIZE + _T("=") + strEx::itos(dwNeeded+1) + _T(" under [EventLog] in nsc.ini : ") + error::lookup::last_error(err));636 NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small change the value of ") + setting_keys::event_log::BUFFER_SIZE + _T("=") + strEx::itos(dwNeeded+1) + _T(" under [EventLog] in nsc.ini : ") + error::lookup::last_error(err)); 636 637 buffer_error_reported = true; 637 638 } … … 741 742 DWORD err = GetLastError(); 742 743 if (err == ERROR_INSUFFICIENT_BUFFER) { 743 NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small (set the value of ") + setting s::event_log::BUFFER_SIZE_TITLE + _T("): ") + error::lookup::last_error(err));744 message = std::wstring(_T("EvenlogBuffer is too small (set the value of ")) + setting s::event_log::BUFFER_SIZE_TITLE + _T("): ") + error::lookup::last_error(err);744 NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small (set the value of ") + setting_keys::event_log::BUFFER_SIZE_TITLE + _T("): ") + error::lookup::last_error(err)); 745 message = std::wstring(_T("EvenlogBuffer is too small (set the value of ")) + setting_keys::event_log::BUFFER_SIZE_TITLE + _T("): ") + error::lookup::last_error(err); 745 746 return NSCAPI::returnUNKNOWN; 746 747 } else if (err != ERROR_HANDLE_EOF) { -
trunk/modules/CheckEventLog/CheckEventLog.h
r201 r205 21 21 NSC_WRAPPERS_MAIN(); 22 22 23 #include < config.h>23 #include <settings/macros.h> 24 24 #include <strEx.h> 25 25 #include <utils.h> -
trunk/modules/CheckExternalScripts/CheckExternalScripts.cpp
r202 r205 23 23 #include <strEx.h> 24 24 #include <time.h> 25 #include < config.h>25 #include <settings/macros.h> 26 26 #include <msvc_wrappers.h> 27 27 #include <file_helpers.hpp> 28 #include <config.h> 28 29 29 30 CheckExternalScripts gCheckExternalScripts; … … 80 81 allowNasty_ = SETTINGS_GET_BOOL(nrpe::ALLOW_NASTY); 81 82 std::list<std::wstring>::const_iterator it; 82 std::list<std::wstring> commands = NSCModuleHelper::getSettingsSection(setting s::external_scripts::SCRIPT_SECTION_PATH);83 std::list<std::wstring> commands = NSCModuleHelper::getSettingsSection(setting_keys::external_scripts::SCRIPT_SECTION_PATH); 83 84 for (it = commands.begin(); it != commands.end(); ++it) { 84 85 if ((*it).empty()) 85 86 continue; 86 std::wstring s = NSCModuleHelper::getSettingsString(setting s::external_scripts::SCRIPT_SECTION_PATH, (*it), _T(""));87 std::wstring s = NSCModuleHelper::getSettingsString(setting_keys::external_scripts::SCRIPT_SECTION_PATH, (*it), _T("")); 87 88 if (s.empty()) { 88 89 NSC_LOG_ERROR_STD(_T("Invalid command definition: ") + (*it)); … … 93 94 } 94 95 95 commands = NSCModuleHelper::getSettingsSection(setting s::external_scripts::ALIAS_SECTION_PATH);96 commands = NSCModuleHelper::getSettingsSection(setting_keys::external_scripts::ALIAS_SECTION_PATH); 96 97 for (it = commands.begin(); it != commands.end(); ++it) { 97 98 if ((*it).empty()) 98 99 continue; 99 std::wstring s = NSCModuleHelper::getSettingsString(setting s::external_scripts::ALIAS_SECTION_PATH, (*it), _T(""));100 std::wstring s = NSCModuleHelper::getSettingsString(setting_keys::external_scripts::ALIAS_SECTION_PATH, (*it), _T("")); 100 101 if (s.empty()) { 101 102 NSC_LOG_ERROR_STD(_T("Invalid command definition: ") + (*it)); -
trunk/modules/CheckExternalScripts/stdafx.h
r101 r205 28 28 #include <functional> 29 29 30 #include <config.h>31 30 #include <utils.h> 32 31 -
trunk/modules/CheckHelpers/CheckHelpers-2005.vcproj
r201 r205 345 345 </Configuration> 346 346 <Configuration 347 Name="Distribution|Win32"348 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"349 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"350 ConfigurationType="2"351 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"352 CharacterSet="1"353 >354 <Tool355 Name="VCPreBuildEventTool"356 />357 <Tool358 Name="VCCustomBuildTool"359 />360 <Tool361 Name="VCXMLDataGeneratorTool"362 />363 <Tool364 Name="VCWebServiceProxyGeneratorTool"365 />366 <Tool367 Name="VCMIDLTool"368 />369 <Tool370 Name="VCCLCompilerTool"371 AdditionalIncludeDirectories="../include;../../include"372 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"373 RuntimeLibrary="0"374 UsePrecompiledHeader="2"375 WarningLevel="3"376 Detect64BitPortabilityProblems="false"377 DebugInformationFormat="3"378 />379 <Tool380 Name="VCManagedResourceCompilerTool"381 />382 <Tool383 Name="VCResourceCompilerTool"384 />385 <Tool386 Name="VCPreLinkEventTool"387 />388 <Tool389 Name="VCLinkerTool"390 OutputFile="$(OutDir)\$(ProjectName).dll"391 LinkIncremental="1"392 ModuleDefinitionFile="CheckHelpers.def"393 GenerateDebugInformation="false"394 SubSystem="2"395 OptimizeReferences="2"396 EnableCOMDATFolding="2"397 ImportLibrary="$(OutDir)/CheckDisk.lib"398 TargetMachine="1"399 />400 <Tool401 Name="VCALinkTool"402 />403 <Tool404 Name="VCManifestTool"405 />406 <Tool407 Name="VCXDCMakeTool"408 />409 <Tool410 Name="VCBscMakeTool"411 />412 <Tool413 Name="VCFxCopTool"414 />415 <Tool416 Name="VCAppVerifierTool"417 />418 <Tool419 Name="VCWebDeploymentTool"420 />421 <Tool422 Name="VCPostBuildEventTool"423 />424 </Configuration>425 <Configuration426 347 Name="Distribution|x64" 427 348 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" … … 630 551 EnableCOMDATFolding="2" 631 552 TargetMachine="17" 632 />633 <Tool634 Name="VCALinkTool"635 />636 <Tool637 Name="VCManifestTool"638 />639 <Tool640 Name="VCXDCMakeTool"641 />642 <Tool643 Name="VCBscMakeTool"644 />645 <Tool646 Name="VCFxCopTool"647 />648 <Tool649 Name="VCAppVerifierTool"650 />651 <Tool652 Name="VCWebDeploymentTool"653 />654 <Tool655 Name="VCPostBuildEventTool"656 />657 </Configuration>658 <Configuration659 Name="Debug-MemCheck|Win32"660 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"661 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"662 ConfigurationType="2"663 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"664 CharacterSet="1"665 >666 <Tool667 Name="VCPreBuildEventTool"668 />669 <Tool670 Name="VCCustomBuildTool"671 />672 <Tool673 Name="VCXMLDataGeneratorTool"674 />675 <Tool676 Name="VCWebServiceProxyGeneratorTool"677 />678 <Tool679 Name="VCMIDLTool"680 />681 <Tool682 Name="VCCLCompilerTool"683 Optimization="0"684 AdditionalIncludeDirectories="../include;../../include"685 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;MEMCHECK"686 MinimalRebuild="true"687 BasicRuntimeChecks="3"688 RuntimeLibrary="3"689 UsePrecompiledHeader="2"690 WarningLevel="3"691 Detect64BitPortabilityProblems="false"692 DebugInformationFormat="4"693 />694 <Tool695 Name="VCManagedResourceCompilerTool"696 />697 <Tool698 Name="VCResourceCompilerTool"699 />700 <Tool701 Name="VCPreLinkEventTool"702 />703 <Tool704 Name="VCLinkerTool"705 OutputFile="$(OutDir)\$(ProjectName).dll"706 LinkIncremental="2"707 ModuleDefinitionFile="CheckHelpers.def"708 GenerateDebugInformation="true"709 ProgramDatabaseFile="$(OutDir)/CheckDisk.pdb"710 SubSystem="2"711 ImportLibrary="$(OutDir)/CheckHelpers.lib"712 TargetMachine="1"713 553 /> 714 554 <Tool … … 793 633 ImportLibrary="$(OutDir)/CheckDisk.lib" 794 634 TargetMachine="17" 795 />796 <Tool797 Name="VCALinkTool"798 />799 <Tool800 Name="VCManifestTool"801 />802 <Tool803 Name="VCXDCMakeTool"804 />805 <Tool806 Name="VCBscMakeTool"807 />808 <Tool809 Name="VCFxCopTool"810 />811 <Tool812 Name="VCAppVerifierTool"813 />814 <Tool815 Name="VCWebDeploymentTool"816 />817 <Tool818 Name="VCPostBuildEventTool"819 />820 </Configuration>821 <Configuration822 Name="OP5|Win32"823 OutputDirectory="$(SolutionDir)$(ConfigurationName)"824 IntermediateDirectory="$(ConfigurationName)"825 ConfigurationType="2"826 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"827 CharacterSet="1"828 >829 <Tool830 Name="VCPreBuildEventTool"831 />832 <Tool833 Name="VCCustomBuildTool"834 />835 <Tool836 Name="VCXMLDataGeneratorTool"837 />838 <Tool839 Name="VCWebServiceProxyGeneratorTool"840 />841 <Tool842 Name="VCMIDLTool"843 />844 <Tool845 Name="VCCLCompilerTool"846 AdditionalIncludeDirectories="../include;../../include"847 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS"848 UsePrecompiledHeader="2"849 WarningLevel="3"850 DebugInformationFormat="3"851 />852 <Tool853 Name="VCManagedResourceCompilerTool"854 />855 <Tool856 Name="VCResourceCompilerTool"857 />858 <Tool859 Name="VCPreLinkEventTool"860 />861 <Tool862 Name="VCLinkerTool"863 OutputFile="$(OutDir)\$(ProjectName).dll"864 LinkIncremental="1"865 ModuleDefinitionFile="CheckHelpers.def"866 GenerateDebugInformation="false"867 SubSystem="2"868 OptimizeReferences="2"869 EnableCOMDATFolding="2"870 TargetMachine="1"871 635 /> 872 636 <Tool … … 1420 1184 </FileConfiguration> 1421 1185 <FileConfiguration 1422 Name="Distribution|Win32"1423 >1424 <Tool1425 Name="VCCLCompilerTool"1426 UsePrecompiledHeader="0"1427 PrecompiledHeaderThrough=""1428 />1429 </FileConfiguration>1430 <FileConfiguration1431 1186 Name="Distribution|x64" 1432 1187 > … … 1456 1211 </FileConfiguration> 1457 1212 <FileConfiguration 1458 Name="Debug-MemCheck|Win32"1459 >1460 <Tool1461 Name="VCCLCompilerTool"1462 UsePrecompiledHeader="0"1463 PrecompiledHeaderThrough=""1464 />1465 </FileConfiguration>1466 <FileConfiguration1467 1213 Name="Debug-MemCheck|x64" 1468 >1469 <Tool1470 Name="VCCLCompilerTool"1471 UsePrecompiledHeader="0"1472 PrecompiledHeaderThrough=""1473 />1474 </FileConfiguration>1475 <FileConfiguration1476 Name="OP5|Win32"1477 1214 > 1478 1215 <Tool … … 1585 1322 </FileConfiguration> 1586 1323 <FileConfiguration 1587 Name="Distribution|Win32"1588 >1589 <Tool1590 Name="VCCLCompilerTool"1591 UsePrecompiledHeader="0"1592 PrecompiledHeaderThrough=""1593 />1594 </FileConfiguration>1595 <FileConfiguration1596 1324 Name="Distribution|x64" 1597 1325 > … … 1621 1349 </FileConfiguration> 1622 1350 <FileConfiguration 1623 Name="Debug-MemCheck|Win32"1624 >1625 <Tool1626 Name="VCCLCompilerTool"1627 UsePrecompiledHeader="0"1628 PrecompiledHeaderThrough=""1629 />1630 </FileConfiguration>1631 <FileConfiguration1632 1351 Name="Debug-MemCheck|x64" 1633 >1634 <Tool1635 Name="VCCLCompilerTool"1636 UsePrecompiledHeader="0"1637 PrecompiledHeaderThrough=""1638 />1639 </FileConfiguration>1640 <FileConfiguration1641 Name="OP5|Win32"1642 1352 > 1643 1353 <Tool … … 1738 1448 </FileConfiguration> 1739 1449 <FileConfiguration 1740 Name="Distribution| Win32"1450 Name="Distribution|x64" 1741 1451 > 1742 1452 <Tool … … 1746 1456 </FileConfiguration> 1747 1457 <FileConfiguration 1748 Name=" Distribution|x64"1458 Name="Nightly|Win32" 1749 1459 > 1750 1460 <Tool … … 1754 1464 </FileConfiguration> 1755 1465 <FileConfiguration 1756 Name="Nightly| Win32"1466 Name="Nightly|x64" 1757 1467 > 1758 1468 <Tool … … 1762 1472 </FileConfiguration> 1763 1473 <FileConfiguration 1764 Name="Nightly|x64"1765 >1766 <Tool1767 Name="VCCLCompilerTool"1768 UsePrecompiledHeader="1"1769 />1770 </FileConfiguration>1771 <FileConfiguration1772 Name="Debug-MemCheck|Win32"1773 >1774 <Tool1775 Name="VCCLCompilerTool"1776 UsePrecompiledHeader="1"1777 />1778 </FileConfiguration>1779 <FileConfiguration1780 1474 Name="Debug-MemCheck|x64" 1781 >1782 <Tool1783 Name="VCCLCompilerTool"1784 UsePrecompiledHeader="1"1785 />1786 </FileConfiguration>1787 <FileConfiguration1788 Name="OP5|Win32"1789 1475 > 1790 1476 <Tool … … 1882 1568 </FileConfiguration> 1883 1569 <FileConfiguration 1884 Name="Distribution|Win32"1885 >1886 <Tool1887 Name="VCCLCompilerTool"1888 UsePrecompiledHeader="0"1889 PrecompiledHeaderThrough=""1890 />1891 </FileConfiguration>1892 <FileConfiguration1893 1570 Name="Distribution|x64" 1894 1571 > … … 1918 1595 </FileConfiguration> 1919 1596 <FileConfiguration 1920 Name="Debug-MemCheck|Win32"1921 >1922 <Tool1923 Name="VCCLCompilerTool"1924 UsePrecompiledHeader="0"1925 PrecompiledHeaderThrough=""1926 />1927 </FileConfiguration>1928 <FileConfiguration1929 1597 Name="Debug-MemCheck|x64" 1930 >1931 <Tool1932 Name="VCCLCompilerTool"1933 UsePrecompiledHeader="0"1934 PrecompiledHeaderThrough=""1935 />1936 </FileConfiguration>1937 <FileConfiguration1938 Name="OP5|Win32"1939 1598 > 1940 1599 <Tool -
trunk/modules/CheckSystem/CheckSystem-2005.vcproj
r201 r205 349 349 </Configuration> 350 350 <Configuration 351 Name="Distribution|Win32"352 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"353 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"354 ConfigurationType="2"355 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"356 CharacterSet="1"357 >358 <Tool359 Name="VCPreBuildEventTool"360 />361 <Tool362 Name="VCCustomBuildTool"363 />364 <Tool365 Name="VCXMLDataGeneratorTool"366 />367 <Tool368 Name="VCWebServiceProxyGeneratorTool"369 />370 <Tool371 Name="VCMIDLTool"372 />373 <Tool374 Name="VCCLCompilerTool"375 AdditionalIncludeDirectories="../../include"376 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;USE_BOOST"377 RuntimeLibrary="0"378 UsePrecompiledHeader="2"379 WarningLevel="3"380 Detect64BitPortabilityProblems="false"381 DebugInformationFormat="3"382 />383 <Tool384 Name="VCManagedResourceCompilerTool"385 />386 <Tool387 Name="VCResourceCompilerTool"388 />389 <Tool390 Name="VCPreLinkEventTool"391 />392 <Tool393 Name="VCLinkerTool"394 AdditionalDependencies="Pdh.lib"395 OutputFile="$(OutDir)\$(ProjectName).dll"396 LinkIncremental="1"397 ModuleDefinitionFile="CheckSystem.def"398 GenerateDebugInformation="false"399 SubSystem="2"400 OptimizeReferences="2"401 EnableCOMDATFolding="2"402 ImportLibrary="$(OutDir)/CheckSystem.lib"403 TargetMachine="1"404 />405 <Tool406 Name="VCALinkTool"407 />408 <Tool409 Name="VCManifestTool"410 />411 <Tool412 Name="VCXDCMakeTool"413 />414 <Tool415 Name="VCBscMakeTool"416 />417 <Tool418 Name="VCFxCopTool"419 />420 <Tool421 Name="VCAppVerifierTool"422 />423 <Tool424 Name="VCWebDeploymentTool"425 />426 <Tool427 Name="VCPostBuildEventTool"428 />429 </Configuration>430 <Configuration431 351 Name="Distribution|x64" 432 352 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" … … 665 585 </Configuration> 666 586 <Configuration 667 Name="Debug-MemCheck|Win32"668 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules"669 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)"670 ConfigurationType="2"671 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"672 CharacterSet="1"673 >674 <Tool675 Name="VCPreBuildEventTool"676 />677 <Tool678 Name="VCCustomBuildTool"679 />680 <Tool681 Name="VCXMLDataGeneratorTool"682 />683 <Tool684 Name="VCWebServiceProxyGeneratorTool"685 />686 <Tool687 Name="VCMIDLTool"688 />689 <Tool690 Name="VCCLCompilerTool"691 Optimization="0"692 AdditionalIncludeDirectories="../include;../../include"693 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;MEMCHECK"694 MinimalRebuild="true"695 BasicRuntimeChecks="3"696 RuntimeLibrary="3"697 UsePrecompiledHeader="2"698 WarningLevel="3"699 Detect64BitPortabilityProblems="false"700 DebugInformationFormat="4"701 />702 <Tool703 Name="VCManagedResourceCompilerTool"704 />705 <Tool706 Name="VCResourceCompilerTool"707 />708 <Tool709 Name="VCPreLinkEventTool"710 />711 <Tool712 Name="VCLinkerTool"713 AdditionalDependencies="Pdh.lib"714 OutputFile="$(OutDir)\$(ProjectName).dll"715 LinkIncremental="2"716 ModuleDefinitionFile="CheckSystem.def"717 GenerateDebugInformation="true"718 ProgramDatabaseFile="$(OutDir)/CheckSystem.pdb"719 SubSystem="2"720 ImportLibrary="$(OutDir)/CheckSystem.lib"721 TargetMachine="1"722 />723 <Tool724 Name="VCALinkTool"725 />726 <Tool727 Name="VCManifestTool"728 />729 <Tool730 Name="VCXDCMakeTool"731 />732 <Tool733 Name="VCBscMakeTool"734 />735 <Tool736 Name="VCFxCopTool"737 />738 <Tool739 Name="VCAppVerifierTool"740 />741 <Tool742 Name="VCWebDeploymentTool"743 />744 <Tool745 Name="VCPostBuildEventTool"746 />747 </Configuration>748 <Configuration749 587 Name="Debug-MemCheck|x64" 750 588 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" … … 803 641 ImportLibrary="$(OutDir)/CheckSystem.lib" 804 642 TargetMachine="17" 805 />806 <Tool807 Name="VCALinkTool"808 />809 <Tool810 Name="VCManifestTool"811 />812 <Tool813 Name="VCXDCMakeTool"814 />815 <Tool816 Name="VCBscMakeTool"817 />818 <Tool819 Name="VCFxCopTool"820 />821 <Tool822 Name="VCAppVerifierTool"823 />824 <Tool825 Name="VCWebDeploymentTool"826 />827 <Tool828 Name="VCPostBuildEventTool"829 />830 </Configuration>831 <Configuration832 Name="OP5|Win32"833 OutputDirectory="$(SolutionDir)$(ConfigurationName)"834 IntermediateDirectory="$(ConfigurationName)"835 ConfigurationType="2"836 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"837 CharacterSet="1"838 >839 <Tool840 Name="VCPreBuildEventTool"841 />842 <Tool843 Name="VCCustomBuildTool"844 />845 <Tool846 Name="VCXMLDataGeneratorTool"847 />848 <Tool849 Name="VCWebServiceProxyGeneratorTool"850 />851 <Tool852 Name="VCMIDLTool"853 />854 <Tool855 Name="VCCLCompilerTool"856 AdditionalIncludeDirectories="../../include"857 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;USE_BOOST"858 UsePrecompiledHeader="2"859 WarningLevel="3"860 DebugInformationFormat="3"861 />862 <Tool863 Name="VCManagedResourceCompilerTool"864 />865 <Tool866 Name="VCResourceCompilerTool"867 />868 <Tool869 Name="VCPreLinkEventTool"870 />871 <Tool872 Name="VCLinkerTool"873 AdditionalDependencies="Pdh.lib"874 OutputFile="$(OutDir)\$(ProjectName).dll"875 LinkIncremental="1"876 ModuleDefinitionFile="CheckSystem.def"877 GenerateDebugInformation="false"878 SubSystem="2"879 OptimizeReferences="2"880 EnableCOMDATFolding="2"881 TargetMachine="1"882 643 /> 883 644 <Tool … … 1437 1198 </FileConfiguration> 1438 1199 <FileConfiguration 1439 Name="Distribution|Win32"1440 >1441 <Tool1442 Name="VCCLCompilerTool"1443 UsePrecompiledHeader="0"1444 PrecompiledHeaderThrough=""1445 />1446 </FileConfiguration>1447 <FileConfiguration1448 1200 Name="Distribution|x64" 1449 1201 > … … 1473 1225 </FileConfiguration> 1474 1226 <FileConfiguration 1475 Name="Debug-MemCheck|Win32"1476 >1477 <Tool1478 Name="VCCLCompilerTool"1479 UsePrecompiledHeader="0"1480 PrecompiledHeaderThrough=""1481 />1482 </FileConfiguration>1483 <FileConfiguration1484 1227 Name="Debug-MemCheck|x64" 1485 1228 > … … 1491 1234 </FileConfiguration> 1492 1235 <FileConfiguration 1493 Name="OP5|Win32"1494 >1495 <Tool1496 Name="VCCLCompilerTool"1497 UsePrecompiledHeader="0"1498 PrecompiledHeaderThrough=""1499 />1500 </FileConfiguration>1501 <FileConfiguration1502 1236 Name="OP5|x64" 1503 1237 > … … 1602 1336 </FileConfiguration> 1603 1337 <FileConfiguration 1604 Name="Distribution|Win32"1605 >1606 <Tool1607 Name="VCCLCompilerTool"1608 UsePrecompiledHeader="0"1609 PrecompiledHeaderThrough=""1610 />1611 </FileConfiguration>1612 <FileConfiguration1613 1338 Name="Distribution|x64" 1614 1339 > … … 1638 1363 </FileConfiguration> 1639 1364 <FileConfiguration 1640 Name="Debug-MemCheck|Win32"1641 >1642 <Tool1643 Name="VCCLCompilerTool"1644 UsePrecompiledHeader="0"1645 PrecompiledHeaderThrough=""1646 />1647 </FileConfiguration>1648 <FileConfiguration1649 1365 Name="Debug-MemCheck|x64" 1650 1366 > … … 1656 1372 </FileConfiguration> 1657 1373 <FileConfiguration 1658 Name="OP5|Win32"1659 >1660 <Tool1661 Name="VCCLCompilerTool"1662 UsePrecompiledHeader="0"1663 PrecompiledHeaderThrough=""1664 />1665 </FileConfiguration>1666 <FileConfiguration1667 1374 Name="OP5|x64" 1668 1375 > … … 1759 1466 </FileConfiguration> 1760 1467 <FileConfiguration 1761 Name="Distribution|Win32"1762 >1763 <Tool1764 Name="VCCLCompilerTool"1765 UsePrecompiledHeader="0"1766 PrecompiledHeaderThrough=""1767 />1768 </FileConfiguration>1769 <FileConfiguration1770 1468 Name="Distribution|x64" 1771 1469 > … … 1795 1493 </FileConfiguration> 1796 1494 <FileConfiguration 1797 Name="Debug-MemCheck|Win32"1798 >1799 <Tool1800 Name="VCCLCompilerTool"1801 UsePrecompiledHeader="0"1802 PrecompiledHeaderThrough=""1803 />1804 </FileConfiguration>1805 <FileConfiguration1806 1495 Name="Debug-MemCheck|x64" 1807 1496 > … … 1813 1502 </FileConfiguration> 1814 1503 <FileConfiguration 1815 Name="OP5|Win32"1816 >1817 <Tool1818 Name="VCCLCompilerTool"1819 UsePrecompiledHeader="0"1820 PrecompiledHeaderThrough=""1821 />1822 </FileConfiguration>1823 <FileConfiguration1824 1504 Name="OP5|x64" 1825 1505 > … … 1916 1596 </FileConfiguration> 1917 1597 <FileConfiguration 1918 Name="Distribution|Win32"1919 >1920 <Tool1921 Name="VCCLCompilerTool"1922 UsePrecompiledHeader="0"1923 PrecompiledHeaderThrough=""1924 />1925 </FileConfiguration>1926 <FileConfiguration1927 1598 Name="Distribution|x64" 1928 1599 > … … 1952 1623 </FileConfiguration> 1953 1624 <FileConfiguration 1954 Name="Debug-MemCheck|Win32"1955 >1956 <Tool1957 Name="VCCLCompilerTool"1958 UsePrecompiledHeader="0"1959 PrecompiledHeaderThrough=""1960 />1961 </FileConfiguration>1962 <FileConfiguration1963 1625 Name="Debug-MemCheck|x64" 1964 1626 > … … 1970 1632 </FileConfiguration> 1971 1633 <FileConfiguration 1972 Name="OP5|Win32"1973 >1974 <Tool1975 Name="VCCLCompilerTool"1976 UsePrecompiledHeader="0"1977 PrecompiledHeaderThrough=""1978 />1979 </FileConfiguration>1980 <FileConfiguration1981 1634 Name="OP5|x64" 1982 1635 > … … 2073 1726 </FileConfiguration> 2074 1727 <FileConfiguration 2075 Name="Distribution|Win32"2076 >2077 <Tool2078 Name="VCCLCompilerTool"2079 UsePrecompiledHeader="0"2080 />2081 </FileConfiguration>2082 <FileConfiguration2083 1728 Name="Distribution|x64" 2084 1729 > … … 2105 1750 </FileConfiguration> 2106 1751 <FileConfiguration 2107 Name="Debug-MemCheck|Win32"2108 >2109 <Tool2110 Name="VCCLCompilerTool"2111 UsePrecompiledHeader="0"2112 />2113 </FileConfiguration>2114 <FileConfiguration2115 1752 Name="Debug-MemCheck|x64" 2116 1753 > … … 2121 1758 </FileConfiguration> 2122 1759 <FileConfiguration 2123 Name="OP5|Win32"2124 >2125 <Tool2126 Name="VCCLCompilerTool"2127 UsePrecompiledHeader="0"2128 />2129 </FileConfiguration>2130 <FileConfiguration2131 1760 Name="OP5|x64" 2132 1761 > … … 2173 1802 </FileConfiguration> 2174 1803 <FileConfiguration 2175 Name="Distribution| Win32"1804 Name="Distribution|x64" 2176 1805 > 2177 1806 <Tool … … 2181 1810 </FileConfiguration> 2182 1811 <FileConfiguration 1812 Name="Nightly|Win32" 1813 > 1814 <Tool 1815 Name="VCCLCompilerTool" 1816 UsePrecompiledHeader="1" 1817 /> 1818 </FileConfiguration> 1819 <FileConfiguration 1820 Name="Nightly|x64" 1821 > 1822 <Tool 1823 Name="VCCLCompilerTool" 1824 UsePrecompiledHeader="1" 1825 /> 1826 </FileConfiguration> 1827 <FileConfiguration 1828 Name="Debug-MemCheck|x64" 1829 > 1830 <Tool 1831 Name="VCCLCompilerTool" 1832 UsePrecompiledHeader="1" 1833 /> 1834 </FileConfiguration> 1835 <FileConfiguration 1836 Name="OP5|x64" 1837 > 1838 <Tool 1839 Name="VCCLCompilerTool" 1840 UsePrecompiledHeader="1" 1841 /> 1842 </FileConfiguration> 1843 <FileConfiguration 1844 Name="Debug|Itanium" 1845 > 1846 <Tool 1847 Name="VCCLCompilerTool" 1848 UsePrecompiledHeader="1" 1849 /> 1850 </FileConfiguration> 1851 <FileConfiguration 1852 Name="Release|Itanium" 1853 > 1854 <Tool 1855 Name="VCCLCompilerTool" 1856 UsePrecompiledHeader="1" 1857 /> 1858 </FileConfiguration> 1859 <FileConfiguration 1860 Name="Distribution|Itanium" 1861 > 1862 <Tool 1863 Name="VCCLCompilerTool" 1864 UsePrecompiledHeader="1" 1865 /> 1866 </FileConfiguration> 1867 <FileConfiguration 1868 Name="Nightly|Itanium" 1869 > 1870 <Tool 1871 Name="VCCLCompilerTool" 1872 UsePrecompiledHeader="1" 1873 /> 1874 </FileConfiguration> 1875 <FileConfiguration 1876 Name="Debug-MemCheck|Itanium" 1877 > 1878 <Tool 1879 Name="VCCLCompilerTool" 1880 UsePrecompiledHeader="1" 1881 /> 1882 </FileConfiguration> 1883 </File> 1884 <File 1885 RelativePath="..\..\include\sysinfo.cpp" 1886 > 1887 <FileConfiguration 1888 Name="Debug|Win32" 1889 > 1890 <Tool 1891 Name="VCCLCompilerTool" 1892 UsePrecompiledHeader="0" 1893 /> 1894 </FileConfiguration> 1895 <FileConfiguration 1896 Name="Debug|x64" 1897 > 1898 <Tool 1899 Name="VCCLCompilerTool" 1900 UsePrecompiledHeader="0" 1901 /> 1902 </FileConfiguration> 1903 <FileConfiguration 1904 Name="Release|Win32" 1905 > 1906 <Tool 1907 Name="VCCLCompilerTool" 1908 UsePrecompiledHeader="0" 1909 /> 1910 </FileConfiguration> 1911 <FileConfiguration 1912 Name="Release|x64" 1913 > 1914 <Tool 1915 Name="VCCLCompilerTool" 1916 UsePrecompiledHeader="0" 1917 /> 1918 </FileConfiguration> 1919 <FileConfiguration 2183 1920 Name="Distribution|x64" 2184 1921 > 2185 1922 <Tool 2186 1923 Name="VCCLCompilerTool" 2187 UsePrecompiledHeader=" 1"1924 UsePrecompiledHeader="0" 2188 1925 /> 2189 1926 </FileConfiguration> … … 2193 1930 <Tool 2194 1931 Name="VCCLCompilerTool" 2195 UsePrecompiledHeader=" 1"1932 UsePrecompiledHeader="0" 2196 1933 /> 2197 1934 </FileConfiguration> … … 2201 1938 <Tool 2202 1939 Name="VCCLCompilerTool" 2203 UsePrecompiledHeader="1" 2204 /> 2205 </FileConfiguration> 2206 <FileConfiguration 2207 Name="Debug-MemCheck|Win32" 2208 > 2209 <Tool 2210 Name="VCCLCompilerTool" 2211 UsePrecompiledHeader="1" 1940 UsePrecompiledHeader="0" 2212 1941 /> 2213 1942 </FileConfiguration> … … 2217 1946 <Tool 2218 1947 Name="VCCLCompilerTool" 2219 UsePrecompiledHeader="1" 2220 /> 2221 </FileConfiguration> 2222 <FileConfiguration 2223 Name="OP5|Win32" 2224 > 2225 <Tool 2226 Name="VCCLCompilerTool" 2227 UsePrecompiledHeader="1" 1948 UsePrecompiledHeader="0" 2228 1949 /> 2229 1950 </FileConfiguration> … … 2233 1954 <Tool 2234 1955 Name="VCCLCompilerTool" 2235 UsePrecompiledHeader="1" 2236 /> 2237 </FileConfiguration> 2238 <FileConfiguration 2239 Name="Debug|Itanium" 2240 > 2241 <Tool 2242 Name="VCCLCompilerTool" 2243 UsePrecompiledHeader="1" 2244 /> 2245 </FileConfiguration> 2246 <FileConfiguration 2247 Name="Release|Itanium" 2248 > 2249 <Tool 2250 Name="VCCLCompilerTool" 2251 UsePrecompiledHeader="1" 2252 /> 2253 </FileConfiguration> 2254 <FileConfiguration 2255 Name="Distribution|Itanium" 2256 > 2257 <Tool 2258 Name="VCCLCompilerTool" 2259 UsePrecompiledHeader="1" 2260 /> 2261 </FileConfiguration> 2262 <FileConfiguration 2263 Name="Nightly|Itanium" 2264 > 2265 <Tool 2266 Name="VCCLCompilerTool" 2267 UsePrecompiledHeader="1" 2268 /> 2269 </FileConfiguration> 2270 <FileConfiguration 2271 Name="Debug-MemCheck|Itanium" 2272 > 2273 <Tool 2274 Name="VCCLCompilerTool" 2275 UsePrecompiledHeader="1" 2276 /> 2277 </FileConfiguration> 2278 </File> 2279 <File 2280 RelativePath="..\..\include\sysinfo.cpp" 1956 UsePrecompiledHeader="0" 1957 /> 1958 </FileConfiguration> 1959 </File> 1960 <File 1961 RelativePath="..\..\include\utils.cpp" 2281 1962 > 2282 1963 <FileConfiguration … … 2286 1967 Name="VCCLCompilerTool" 2287 1968 UsePrecompiledHeader="0" 1969 PrecompiledHeaderThrough="" 2288 1970 /> 2289 1971 </FileConfiguration> … … 2294 1976 Name="VCCLCompilerTool" 2295 1977 UsePrecompiledHeader="0" 1978 PrecompiledHeaderThrough="" 2296 1979 /> 2297 1980 </FileConfiguration> … … 2302 1985 Name="VCCLCompilerTool" 2303 1986 UsePrecompiledHeader="0" 1987 PrecompiledHeaderThrough="" 2304 1988 /> 2305 1989 </FileConfiguration> … … 2310 1994 Name="VCCLCompilerTool" 2311 1995 UsePrecompiledHeader="0" 2312 /> 2313 </FileConfiguration> 2314 <FileConfiguration 2315 Name="Distribution|Win32" 2316 > 2317 <Tool 2318 Name="VCCLCompilerTool" 2319 UsePrecompiledHeader="0" 1996 PrecompiledHeaderThrough="" 2320 1997 /> 2321 1998 </FileConfiguration> … … 2326 2003 Name="VCCLCompilerTool" 2327 2004 UsePrecompiledHeader="0" 2005 PrecompiledHeaderThrough="" 2328 2006 /> 2329 2007 </FileConfiguration> … … 2334 2012 Name="VCCLCompilerTool" 2335 2013 UsePrecompiledHeader="0" 2014 PrecompiledHeaderThrough="" 2336 2015 /> 2337 2016 </FileConfiguration> … … 2342 2021 Name="VCCLCompilerTool" 2343 2022 UsePrecompiledHeader="0" 2344 /> 2345 </FileConfiguration> 2346 <FileConfiguration 2347 Name="Debug-MemCheck|Win32" 2348 > 2349 <Tool 2350 Name="VCCLCompilerTool" 2351 UsePrecompiledHeader="0" 2023 PrecompiledHeaderThrough="" 2352 2024 /> 2353 2025 </FileConfiguration> 2354 2026 <FileConfiguration 2355 2027 Name="Debug-MemCheck|x64" 2356 >2357 <Tool2358 Name="VCCLCompilerTool"2359 UsePrecompiledHeader="0"2360 />2361 </FileConfiguration>2362 <FileConfiguration2363 Name="OP5|Win32"2364 >2365 <Tool2366 Name="VCCLCompilerTool"2367 UsePrecompiledHeader="0"2368 />2369 </FileConfiguration>2370 <FileConfiguration2371 Name="OP5|x64"2372 >2373 <Tool2374 Name="VCCLCompilerTool"2375 UsePrecompiledHeader="0"2376 />2377 </FileConfiguration>2378 </File>2379 <File2380 RelativePath="..\..\include\utils.cpp"2381 >2382 <FileConfiguration2383 Name="Debug|Win32"2384 >2385 <Tool2386 Name="VCCLCompilerTool"2387 UsePrecompiledHeader="0"2388 PrecompiledHeaderThrough=""2389 />2390 </FileConfiguration>2391 <FileConfiguration2392 Name="Debug|x64"2393 >2394 <Tool2395 Name="VCCLCompilerTool"2396 UsePrecompiledHeader="0"2397 PrecompiledHeaderThrough=""2398 />2399 </FileConfiguration>2400 <FileConfiguration2401 Name="Release|Win32"2402 >2403 <Tool2404 Name="VCCLCompilerTool"2405 UsePrecompiledHeader="0"2406 PrecompiledHeaderThrough=""2407 />2408 </FileConfiguration>2409 <FileConfiguration2410 Name="Release|x64"2411 >2412 <Tool2413 Name="VCCLCompilerTool"2414 UsePrecompiledHeader="0"2415 PrecompiledHeaderThrough=""2416 />2417 </FileConfiguration>2418 <FileConfiguration2419 Name="Distribution|Win32"2420 >2421 <Tool2422 Name="VCCLCompilerTool"2423 UsePrecompiledHeader="0"2424 PrecompiledHeaderThrough=""2425 />2426 </FileConfiguration>2427 <FileConfiguration2428 Name="Distribution|x64"2429 >2430 <Tool2431 Name="VCCLCompilerTool"2432 UsePrecompiledHeader="0"2433 PrecompiledHeaderThrough=""2434 />2435 </FileConfiguration>2436 <FileConfiguration2437 Name="Nightly|Win32"2438 >2439 <Tool2440 Name="VCCLCompilerTool"2441 UsePrecompiledHeader="0"2442 PrecompiledHeaderThrough=""2443 />2444 </FileConfiguration>2445 <FileConfiguration2446 Name="Nightly|x64"2447 >2448 <Tool2449 Name="VCCLCompilerTool"2450 UsePrecompiledHeader="0"2451 PrecompiledHeaderThrough=""2452 />2453 </FileConfiguration>2454 <FileConfiguration2455 Name="Debug-MemCheck|Win32"2456 >2457 <Tool2458 Name="VCCLCompilerTool"2459 UsePrecompiledHeader="0"2460 PrecompiledHeaderThrough=""2461 />2462 </FileConfiguration>2463 <FileConfiguration2464 Name="Debug-MemCheck|x64"2465 >2466 <Tool2467 Name="VCCLCompilerTool"2468 UsePrecompiledHeader="0"2469 PrecompiledHeaderThrough=""2470 />2471 </FileConfiguration>2472 <FileConfiguration2473 Name="OP5|Win32"2474 2028 > 2475 2029 <Tool -
trunk/modules/CheckSystem/PDHCollector.cpp
r202 r205 41 41 std::wstring method = SETTINGS_GET_STRING(check_system::CPU_METHOD); 42 42 43 if (method == setting s::check_system::CPU_METHOD_PDH_MANUAL) {43 if (method == setting_keys::check_system::CPU_METHOD_PDH_MANUAL) { 44 44 NSC_DEBUG_MSG_STD(_T("Autodetect disabled from nsc.ini via: ") + SETTINGS_MAKE_NAME(check_system::CPU_METHOD)); 45 45 return false; … … 81 81 section = _T("0x") + section.substr(section.length()-4); 82 82 } 83 if (bUseIndex&&(method==setting s::check_system::CPU_METHOD_PDH_NO_INDEX)) {83 if (bUseIndex&&(method==setting_keys::check_system::CPU_METHOD_PDH_NO_INDEX)) { 84 84 NSC_DEBUG_MSG_STD(_T("We wanted to use index but were forced not to use them due to: ") + SETTINGS_MAKE_NAME(check_system::CPU_METHOD)); 85 85 bUseIndex = false; -
trunk/modules/FileLogger/FileLogger.cpp
r202 r205 73 73 file_ = SETTINGS_GET_STRING(log::FILENAME); 74 74 if (file_.empty()) 75 file_ = setting s::log::FILENAME_DEFAULT;75 file_ = setting_keys::log::FILENAME_DEFAULT; 76 76 if (file_.find(_T("\\")) == std::wstring::npos) { 77 77 std::wstring root = getFolder(SETTINGS_GET_STRING(log::ROOT)); -
trunk/modules/NRPEClient/NRPEClient-2005.vcproj
r201 r205 49 49 Optimization="0" 50 50 AdditionalIncludeDirectories="../include;../../include" 51 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_ STLP_USE_NEWALLOC;_STLP_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;USE_SSL"51 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;USE_SSL;USE_BOOST" 52 52 MinimalRebuild="true" 53 53 BasicRuntimeChecks="3" -
trunk/modules/NRPEClient/NRPEClient.cpp
r202 r205 50 50 try { 51 51 SETTINGS_REG_PATH(nrpe::CH_SECTION); 52 commands = NSCModuleHelper::getSettingsSection(setting s::nrpe::CH_SECTION_PATH);52 commands = NSCModuleHelper::getSettingsSection(setting_keys::nrpe::CH_SECTION_PATH); 53 53 } catch (NSCModuleHelper::NSCMHExcpetion &e) { 54 54 NSC_LOG_ERROR_STD(_T("Failed to register command: ") + e.msg_); … … 58 58 for (std::list<std::wstring>::const_iterator it = commands.begin(); it != commands.end(); ++it) { 59 59 NSC_DEBUG_MSG_STD(*it); 60 std::wstring s = NSCModuleHelper::getSettingsString(setting s::nrpe::CH_SECTION_PATH, (*it), _T(""));60 std::wstring s = NSCModuleHelper::getSettingsString(setting_keys::nrpe::CH_SECTION_PATH, (*it), _T("")); 61 61 if (s.empty()) { 62 62 NSC_LOG_ERROR_STD(_T("Invalid NRPE-client entry: ") + (*it)); … … 185 185 } 186 186 #endif 187 188 using boost::asio::ip::tcp; 189 187 190 int NRPEClient::commandLineExec(const TCHAR* command, const unsigned int argLen, TCHAR** args) { 188 191 #ifndef USE_BOOST … … 260 263 NRPEPacket NRPEClient::send_nossl(std::wstring host, int port, int timeout, NRPEPacket packet) 261 264 { 265 boost::asio::io_service io_service; 266 tcp::resolver resolver(io_service); 267 tcp::resolver::query query("127.0.0.1", boost::lexical_cast<std::string>(port)); 268 269 tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); 270 tcp::resolver::iterator end; 271 272 tcp::socket socket(io_service); 273 boost::system::error_code error = boost::asio::error::host_not_found; 274 while (error && endpoint_iterator != end) 275 { 276 tcp::resolver::endpoint_type ep = *endpoint_iterator; 277 NSC_DEBUG_MSG_STD(_T("Connectiing to: ") + boost::lexical_cast<std::wstring>(ep.address().to_string()) + _T(":") + boost::lexical_cast<std::wstring>(ep.port())) 278 socket.close(); 279 socket.connect(*endpoint_iterator++, error); 280 } 281 if (error) 282 throw boost::system::system_error(error); 283 284 for (;;) 285 { 286 std::vector<char> buf(packet.getBufferLength()); 287 boost::system::error_code error; 288 289 size_t len = socket.write_some(boost::asio::buffer(packet.getBuffer(), packet.getBufferLength()), error); 290 291 len = socket.read_some(boost::asio::buffer(buf), error); 292 293 if (error == boost::asio::error::eof) 294 break; // Connection closed cleanly by peer. 295 else if (error) 296 throw boost::system::system_error(error); // Some other error. 297 packet.readFrom(&buf[0], buf.size()); 298 } 299 300 301 302 /* 262 303 simpleSocket::Socket socket(true); 263 304 socket.connect(host, port); … … 266 307 socket.readAll(buffer); 267 308 packet.readFrom(buffer.getBuffer(), buffer.getLength()); 309 */ 268 310 return packet; 269 311 } -
trunk/modules/NRPEClient/stdafx.h
r108 r205 21 21 #pragma once 22 22 23 #define _WIN32_WINNT 0x0400 24 23 25 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 24 26 // Windows Header Files: 25 27 #include <windows.h> 28 #include <winsock2.h> 26 29 27 30 #include <string> … … 34 37 #include <NSCHelper.h> 35 38 39 #include <boost/array.hpp> 40 #include <boost/asio.hpp> 41 36 42 #ifdef MEMCHECK 37 43 #include <vld.h> -
trunk/modules/NRPEListener/NRPEListener.cpp
r202 r205 102 102 NSC_DEBUG_MSG_STD(_T("Non-standard buffer length (hope you have recompiled check_nrpe changing #define MAX_PACKETBUFFER_LENGTH = ") + strEx::itos(buffer_length_)); 103 103 NSC_DEBUG_MSG_STD(_T("Loading all commands (from NRPE)")); 104 std::list<std::wstring> commands = NSCModuleHelper::getSettingsSection(setting s::nrpe::SECTION_HANDLERS_PATH);104 std::list<std::wstring> commands = NSCModuleHelper::getSettingsSection(setting_keys::nrpe::SECTION_HANDLERS_PATH); 105 105 std::list<std::wstring>::const_iterator it; 106 106 for (it = commands.begin(); it != commands.end(); ++it) { … … 113 113 command_name = (*it); 114 114 } 115 std::wstring s = NSCModuleHelper::getSettingsString(setting s::nrpe::SECTION_HANDLERS_PATH, (*it), _T(""));115 std::wstring s = NSCModuleHelper::getSettingsString(setting_keys::nrpe::SECTION_HANDLERS_PATH, (*it), _T("")); 116 116 if (command_name.empty() || s.empty()) { 117 117 NSC_LOG_ERROR_STD(_T("Invalid command definition: ") + (*it)); -
trunk/release-build.bat
r202 r205 18 18 if "%1" == "w32" set w32=1 19 19 if "%1" == "x64" set x64=1 20 if "%1" == "ia64" set ia64=1 20 21 if "%1" == "hdr" set hdr=1 21 22 if "%1" == "src" set hdr=1 … … 67 68 rem call build.bat runtime-link=static variant=release architecture=ia64 --library-path=%TARGET_LIB_IA64_DIR% 68 69 70 if not "%ia64%" == "1" goto no_build_ia64 71 call :build_one address-model=64 architecture=ia64 variant=release debug-symbols=on debug-store=database --build-type=complete "--library-path=%TARGET_LIB_IA64_DIR%" "--with-psdk-lib=%PLATTFORM_SDK_LIB_IA64%" 72 IF DEFINED _ERROR goto :error 73 :no_build_ia64 74 69 75 70 76 if not "%upload%" == "1" goto no_build_upload -
trunk/service
- Property svn:ignore
-
old new 1 1 win32 2 2 *.user 3 NSC.ini
-
- Property svn:ignore
-
trunk/service/Jamfile
r203 r205 24 24 NSClient++.cpp 25 25 NSCPlugin.cpp 26 core_api.cpp 27 settings_manager_impl.cpp 26 28 ../include/NSCHelper.cpp 27 29 ../include/arrayBuffer.cpp -
trunk/service/NSCPlugin.cpp
r202 r205 22 22 #include "NSClient++.h" 23 23 #include <error.hpp> 24 #include "core_api.h" 24 25 /** 25 26 * Default c-tor … … 124 125 hModule_ = LoadLibrary(file_.c_str()); 125 126 if (!hModule_) 126 throw NSPluginException(file_, _T("Could not load library: ") + error::lookup::last_error() );127 throw NSPluginException(file_, _T("Could not load library: ") + error::lookup::last_error() + _T(" for file: ") + file_); 127 128 loadRemoteProcs_(); 128 129 bLoaded_ = true; -
trunk/service/NSClient++-2005.vcproj
r204 r205 24 24 <Configuration 25 25 Name="Release|Win32" 26 OutputDirectory="$( PlatformName)\$(ConfigurationName)"26 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 27 27 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 28 28 ConfigurationType="1" … … 126 126 <Configuration 127 127 Name="Release|x64" 128 OutputDirectory="$( PlatformName)\$(ConfigurationName)"128 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 129 129 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 130 130 ConfigurationType="1" … … 226 226 <Configuration 227 227 Name="Debug|Win32" 228 OutputDirectory=" $(PlatformName)\$(ConfigurationName)"228 OutputDirectory="..\$(PlatformName)\$(ConfigurationName)" 229 229 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 230 230 ConfigurationType="1" 231 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"232 231 UseOfMFC="0" 233 232 ATLMinimizesCRunTimeLibraryUsage="false" … … 284 283 Name="VCLinkerTool" 285 284 AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib Userenv.lib" 286 OutputFile="$(OutDir)\ $(ProjectName).exe"285 OutputFile="$(OutDir)\NSClient++.exe" 287 286 LinkIncremental="1" 288 287 SuppressStartupBanner="true" … … 320 319 <Configuration 321 320 Name="Debug|x64" 322 OutputDirectory="$( PlatformName)\$(ConfigurationName)"321 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 323 322 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 324 323 ConfigurationType="1" … … 415 414 <Configuration 416 415 Name="Distribution|Win32" 417 IntermediateDirectory="$(ConfigurationName)" 416 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 417 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 418 418 ConfigurationType="1" 419 419 > … … 447 447 <Tool 448 448 Name="VCLinkerTool" 449 OutputFile="$(OutDir)\$(ProjectName).exe" 449 450 /> 450 451 <Tool … … 475 476 <Configuration 476 477 Name="Distribution|x64" 477 OutputDirectory="$( PlatformName)\$(ConfigurationName)"478 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 478 479 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 479 480 ConfigurationType="1" … … 578 579 <Configuration 579 580 Name="Nightly|Win32" 580 OutputDirectory="$( PlatformName)\$(ConfigurationName)"581 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 581 582 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 582 583 ConfigurationType="1" … … 673 674 <Configuration 674 675 Name="Nightly|x64" 675 OutputDirectory="$( PlatformName)\$(ConfigurationName)"676 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 676 677 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 677 678 ConfigurationType="1" … … 767 768 <Configuration 768 769 Name="Debug-MemCheck|Win32" 769 IntermediateDirectory="$(ConfigurationName)" 770 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 771 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 770 772 ConfigurationType="1" 771 773 > … … 799 801 <Tool 800 802 Name="VCLinkerTool" 803 OutputFile="$(OutDir)\$(ProjectName).exe" 801 804 /> 802 805 <Tool … … 827 830 <Configuration 828 831 Name="Debug-MemCheck|x64" 829 OutputDirectory="$( PlatformName)\$(ConfigurationName)"832 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 830 833 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 831 834 ConfigurationType="1" … … 922 925 <Configuration 923 926 Name="OP5|Win32" 924 IntermediateDirectory="$(ConfigurationName)" 927 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 928 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 925 929 ConfigurationType="1" 926 930 > … … 954 958 <Tool 955 959 Name="VCLinkerTool" 960 OutputFile="$(OutDir)\$(ProjectName).exe" 956 961 /> 957 962 <Tool … … 982 987 <Configuration 983 988 Name="OP5|x64" 984 OutputDirectory="$( PlatformName)\$(ConfigurationName)"985 IntermediateDirectory="$( PlatformName)\$(ConfigurationName)"989 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 990 IntermediateDirectory="$(SolutionDir)\tmp\$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 986 991 ConfigurationType="1" 987 992 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" … … 1824 1829 </File> 1825 1830 <File 1831 RelativePath=".\core_api.cpp" 1832 > 1833 </File> 1834 <File 1826 1835 RelativePath="..\include\NSCHelper.cpp" 1827 1836 > … … 2078 2087 /> 2079 2088 </FileConfiguration> 2089 </File> 2090 <File 2091 RelativePath=".\settings_manager_impl.cpp" 2092 > 2080 2093 </File> 2081 2094 <File … … 2378 2391 </File> 2379 2392 <File 2393 RelativePath=".\core_api.h" 2394 > 2395 </File> 2396 <File 2380 2397 RelativePath=".\include\error.hpp" 2381 2398 > … … 2434 2451 </File> 2435 2452 <File 2436 RelativePath=".\include\settings\Settings.h" 2437 > 2438 </File> 2439 <File 2440 RelativePath=".\include\settings\settings_ini.hpp" 2441 > 2442 </File> 2443 <File 2444 RelativePath=".\include\settings\settings_old.hpp" 2445 > 2446 </File> 2447 <File 2448 RelativePath=".\include\settings\settings_registry.hpp" 2453 RelativePath=".\setting_keys.h" 2454 > 2455 </File> 2456 <File 2457 RelativePath="..\include\settings\Settings.h" 2458 > 2459 </File> 2460 <File 2461 RelativePath="..\include\settings\settings_ini.hpp" 2462 > 2463 </File> 2464 <File 2465 RelativePath=".\settings_logger_impl.hpp" 2466 > 2467 </File> 2468 <File 2469 RelativePath=".\settings_manager_impl.h" 2470 > 2471 </File> 2472 <File 2473 RelativePath="..\include\settings\settings_old.hpp" 2474 > 2475 </File> 2476 <File 2477 RelativePath="..\include\settings\settings_registry.hpp" 2449 2478 > 2450 2479 </File> … … 2477 2506 > 2478 2507 </File> 2508 <Filter 2509 Name="NewFilter1" 2510 Filter="settings" 2511 > 2512 </Filter> 2479 2513 </Filter> 2480 2514 <Filter … … 2503 2537 <FileConfiguration 2504 2538 Name="Debug|Win32" 2539 ExcludedFromBuild="true" 2505 2540 > 2506 2541 <Tool -
trunk/service/NSClient++.cpp
r202 r205 19 19 #include <charEx.h> 20 20 #include <Socket.h> 21 #include <b64/b64.h>22 21 #include <config.h> 23 22 #include <msvc_wrappers.h> … … 28 27 #include <crtdbg.h> 29 28 //#endif 30 #include <settings/settings_ini.hpp>31 #include <settings/settings_registry.hpp>32 #include <settings/settings_old.hpp>33 29 #include <Userenv.h> 34 30 #include <remote_processes.hpp> 35 31 #include <Lmcons.h> 32 #include "core_api.h" 33 #include "settings_manager_impl.h" 34 #include <settings/macros.h> 36 35 37 36 NSClient mainClient(SZSERVICENAME); // Global core instance. 38 37 bool g_bConsoleLog = false; 39 38 39 #define SETTINGS_GET_BOOL_CORE(key) \ 40 settings_manager::get_settings()->get_bool(setting_keys::key ## _PATH, setting_keys::key, setting_keys::key ## _DEFAULT) 41 42 #define SETTINGS_GET_STRING_CORE(key) \ 43 settings_manager::get_settings()->get_string(setting_keys::key ## _PATH, setting_keys::key, setting_keys::key ## _DEFAULT) 44 /* 45 #define SETTINGS_SET_STRING_CORE(key, value) \ 46 Settings::get_settings()->set_string(setting_keys::key ## _PATH, setting_keys::key, value); 47 */ 40 48 /** 41 49 * START OF Tray starter MERGE HELPER … … 71 79 72 80 static bool start(DWORD dwSessionId) { 73 std::wstring program = mainClient.getBasePath() + _T("\\") + SETTINGS_GET_STRING(nsclient::SYSTRAY_EXE); 81 std::wstring program = mainClient.getBasePath() + _T("\\") + 82 SETTINGS_GET_STRING_CORE(settings_def::SYSTRAY_EXE); 74 83 std::wstring cmdln = _T("\"") + program + _T("\" -channel __") + strEx::itos(dwSessionId) + _T("__"); 75 84 return tray_starter::startTrayHelper(dwSessionId, program, cmdln); … … 186 195 } 187 196 188 class NSC_logger : public Settings::LoggerInterface {189 public:190 //////////////////////////////////////////////////////////////////////////191 /// Log an ERROR message.192 ///193 /// @param file the file where the event happened194 /// @param line the line where the event happened195 /// @param message the message to log196 ///197 /// @author mickem198 void err(std::wstring file, int line, std::wstring message) {199 NSAPIMessage(NSCAPI::error, file.c_str(), line, message.c_str());200 }201 //////////////////////////////////////////////////////////////////////////202 /// Log an WARNING message.203 ///204 /// @param file the file where the event happened205 /// @param line the line where the event happened206 /// @param message the message to log207 ///208 /// @author mickem209 void warn(std::wstring file, int line, std::wstring message) {210 NSAPIMessage(NSCAPI::warning, file.c_str(), line, message.c_str());211 }212 //////////////////////////////////////////////////////////////////////////213 /// Log an INFO message.214 ///215 /// @param file the file where the event happened216 /// @param line the line where the event happened217 /// @param message the message to log218 ///219 /// @author mickem220 void info(std::wstring file, int line, std::wstring message) {221 NSAPIMessage(NSCAPI::log, file.c_str(), line, message.c_str());222 }223 //////////////////////////////////////////////////////////////////////////224 /// Log an DEBUG message.225 ///226 /// @param file the file where the event happened227 /// @param line the line where the event happened228 /// @param message the message to log229 ///230 /// @author mickem231 void debug(std::wstring file, int line, std::wstring message) {232 NSAPIMessage(NSCAPI::debug, file.c_str(), line, message.c_str());233 }234 };235 236 #define SETTINGS_GET_BOOL(key) \237 settings_manager::get_settings()->get_bool(settings::key ## _PATH, settings::key, settings::key ## _DEFAULT)238 239 namespace settings_manager {240 class NSCSettingsImpl : public Settings::SettingsHandlerImpl {241 private:242 std::wstring boot_;243 bool old_;244 public:245 NSCSettingsImpl() : old_(false) {}246 //////////////////////////////////////////////////////////////////////////247 /// Get a string form the boot file.248 ///249 /// @param section section to read a value from.250 /// @param key the key to read.251 /// @param def a default value.252 /// @return the value of the key or the default value.253 ///254 /// @author mickem255 std::wstring get_boot_string(std::wstring section, std::wstring key, std::wstring def) {256 TCHAR* buffer = new TCHAR[1024];257 GetPrivateProfileString(section.c_str(), key.c_str(), def.c_str(), buffer, 1023, boot_.c_str());258 std::wstring ret = buffer;259 delete [] buffer;260 return ret;261 }262 //////////////////////////////////////////////////////////////////////////263 /// Boot the settings subsystem from the given file (boot.ini).264 ///265 /// @param file the file to use when booting.266 ///267 /// @author mickem268 void boot(std::wstring file = _T("boot.ini")) {269 boot_ = get_base() + _T("\\") + file;270 std::wstring subsystem = get_boot_string(_T("settings"), _T("type"), _T("old"));271 get_logger()->debug(__FILEW__, __LINE__, _T("Trying to boot: ") + subsystem);272 settings_type type = string_to_type(subsystem);273 std::wstring context = get_boot_string(_T("settings"), _T("context"), subsystem);274 Settings::SettingsInterface *impl = create_instance(type, context);275 if (impl == NULL)276 throw Settings::SettingsException(_T("Could not create settings instance: ") + subsystem);277 add_type_impl(type, create_instance(type, context));278 set_type(type);279 if (old_)280 get()->set_bool(settings::settings_def::COMPATIBLITY_PATH, settings::settings_def::COMPATIBLITY, true);281 }282 //////////////////////////////////////////////////////////////////////////283 /// Create an instance of a given type.284 /// Used internally to create instances of various settings types.285 ///286 /// @param type the type to create287 /// @param context the context to use288 /// @return a new instance of given type.289 ///290 /// @author mickem291 Settings::SettingsInterface* create_instance(settings_type type, std::wstring context) {292 get_logger()->debug(__FILEW__, __LINE__, _T("Trying to create: ") + SettingsCore::type_to_string(type) + _T(": ") + context);293 if (type == SettingsCore::old_ini_file) {294 old_ = true;295 return new Settings::OLDSettings(this, context);296 }297 if (type == SettingsCore::ini_file)298 return new Settings::INISettings(this, context);299 if (type == SettingsCore::registry)300 return new Settings::REGSettings(this, context);301 throw SettingsException(_T("Undefined settings type: ") + SettingsCore::type_to_string(type));302 }303 304 };305 306 typedef Singleton<NSCSettingsImpl> SettingsHandler;307 308 // Alias to make handling "compatible" with old syntax309 Settings::SettingsInterface* get_settings() {310 return SettingsHandler::getInstance()->get();311 }312 Settings::SettingsCore* get_core() {313 return SettingsHandler::getInstance();314 }315 void destroy_settings() {316 SettingsHandler::destroyInstance();317 }318 319 320 bool init_settings() {321 try {322 get_core()->set_logger(new NSC_logger());323 get_core()->set_base(mainClient.getBasePath());324 get_core()->boot(_T("boot.ini"));325 get_core()->register_key(SETTINGS_REG_KEY_I_GEN(settings_def::PAYLOAD_LEN, Settings::SettingsCore::key_integer));326 get_core()->register_key(SETTINGS_REG_KEY_S_GEN(protocol_def::ALLOWED_HOSTS, Settings::SettingsCore::key_string));327 get_core()->register_key(SETTINGS_REG_KEY_B_GEN(protocol_def::CACHE_ALLOWED, Settings::SettingsCore::key_bool));328 get_core()->register_key(SETTINGS_REG_KEY_S_GEN(protocol_def::MASTER_KEY, Settings::SettingsCore::key_string));329 get_core()->register_key(SETTINGS_REG_KEY_S_GEN(protocol_def::PWD, Settings::SettingsCore::key_string));330 get_core()->register_key(SETTINGS_REG_KEY_S_GEN(protocol_def::OBFUSCATED_PWD, Settings::SettingsCore::key_string));331 332 } catch (SettingsException e) {333 LOG_CRITICAL_STD(_T("Failed to initialize settings: ") + e.getError());334 return false;335 } catch (...) {336 LOG_CRITICAL(_T("FATAL ERROR IN SETTINGS SUBSYTEM"));337 return false;338 }339 return true;340 }341 342 }343 344 #define SETTINGS_GET_STRING(key) \345 Settings::get_settings()->get_string(key ## _PATH, key, key ## _DEFAULT)346 #define SETTINGS_SET_STRING(key, value) \347 Settings::get_settings()->set_string(key ## _PATH, key, value);348 197 349 198 /** … … 442 291 g_bConsoleLog = true; 443 292 std::wstring password; 444 if (!settings_manager::init_settings( )) {293 if (!settings_manager::init_settings(mainClient.getBasePath())) { 445 294 std::wcout << _T("Could not find settings") << std::endl;; 446 295 return 1; … … 888 737 bool NSClientT::initCore(bool boot) { 889 738 LOG_MESSAGE(_T("Attempting to start NSCLient++ - " SZVERSION)); 890 if (!settings_manager::init_settings( )) {739 if (!settings_manager::init_settings(getBasePath())) { 891 740 return false; 892 741 } … … 895 744 settings_manager::get_settings()->set_int(_T("log"), _T("debug"), 1); 896 745 settings_manager::get_settings()->set_int(_T("Settings"), _T("shared_Session"), 1); 897 enable_shared_session_ = SETTINGS_GET_BOOL (settings_def::SHARED_SESSION);746 enable_shared_session_ = SETTINGS_GET_BOOL_CORE(settings_def::SHARED_SESSION); 898 747 } catch (SettingsException e) { 899 748 LOG_ERROR_STD(_T("Could not find settings: ") + e.getMessage()); … … 963 812 Settings::string_list list = settings_manager::get_settings()->get_keys(MAIN_MODULES_SECTION); 964 813 for (Settings::string_list::const_iterator cit = list.begin(); cit != list.end(); ++cit) { 814 LOG_DEBUG_STD(_T("Processing plugin: " + *cit)); 965 815 try { 966 816 if (settings_manager::get_settings()->get_string(MAIN_MODULES_SECTION, *cit) == _T("disabled")) { … … 1395 1245 } catch (SettingsException &e) { 1396 1246 LOG_DEBUG_STD(_T("Failed to get length: ") + e.getMessage()); 1397 return setting s::settings_def::PAYLOAD_LEN_DEFAULT;1247 return setting_keys::settings_def::PAYLOAD_LEN_DEFAULT; 1398 1248 } catch (...) { 1399 1249 LOG_ERROR(_T("Failed to get length: :(")); 1400 return setting s::settings_def::PAYLOAD_LEN_DEFAULT;1250 return setting_keys::settings_def::PAYLOAD_LEN_DEFAULT; 1401 1251 } 1402 1252 } … … 1528 1378 bool NSClientT::logDebug() { 1529 1379 if (debug_ == log_unknown) { 1380 debug_ = log_looking; 1530 1381 try { 1531 1382 if (settings_manager::get_settings()->get_int(_T("log"), _T("debug"), 0) == 1) … … 1536 1387 return true; 1537 1388 } 1538 } 1389 } else if (debug_ == log_looking) 1390 return true; 1539 1391 return (debug_ == log_debug); 1540 1392 } … … 1553 1405 */ 1554 1406 void NSClientT::reportMessage(int msgType, const TCHAR* file, const int line, std::wstring message) { 1407 strEx::replace(message, _T("\n"), _T(" ")); 1408 strEx::replace(message, _T("\r"), _T(" ")); 1555 1409 if ((msgType == NSCAPI::debug)&&(!logDebug())) { 1556 1410 return; … … 1659 1513 1660 1514 1661 NSCAPI::errorReturn NSAPIGetSettingsString(const TCHAR* section, const TCHAR* key, const TCHAR* defaultValue, TCHAR* buffer, unsigned int bufLen) {1662 try {1663 return NSCHelper::wrapReturnString(buffer, bufLen, settings_manager::get_settings()->get_string(section, key, defaultValue), NSCAPI::isSuccess);1664 } catch (...) {1665 LOG_ERROR_STD(_T("Failed to getString: ") + key);1666 return NSCAPI::hasFailed;1667 }1668 }1669 int NSAPIGetSettingsInt(const TCHAR* section, const TCHAR* key, int defaultValue) {1670 try {1671 return settings_manager::get_settings()->get_int(section, key, defaultValue);1672 } catch (SettingsException e) {1673 LOG_ERROR_STD(_T("Failed to set settings file") + e.getMessage());1674 return defaultValue;1675 }1676 }1677 NSCAPI::errorReturn NSAPIGetBasePath(TCHAR*buffer, unsigned int bufLen) {1678 return NSCHelper::wrapReturnString(buffer, bufLen, mainClient.getBasePath(), NSCAPI::isSuccess);1679 }1680 NSCAPI::errorReturn NSAPIGetApplicationName(TCHAR*buffer, unsigned int bufLen) {1681 return NSCHelper::wrapReturnString(buffer, bufLen, SZAPPNAME, NSCAPI::isSuccess);1682 }1683 NSCAPI::errorReturn NSAPIGetApplicationVersionStr(TCHAR*buffer, unsigned int bufLen) {1684 return NSCHelper::wrapReturnString(buffer, bufLen, SZVERSION, NSCAPI::isSuccess);1685 }1686 void NSAPIMessage(int msgType, const TCHAR* file, const int line, const TCHAR* message) {1687 mainClient.reportMessage(msgType, file, line, message);1688 }1689 void NSAPIStopServer(void) {1690 serviceControll::StopNoWait(SZSERVICENAME);1691 }1692 NSCAPI::nagiosReturn NSAPIInject(const TCHAR* command, const unsigned int argLen, TCHAR **argument, TCHAR *returnMessageBuffer, unsigned int returnMessageBufferLen, TCHAR *returnPerfBuffer, unsigned int returnPerfBufferLen) {1693 return mainClient.injectRAW(command, argLen, argument, returnMessageBuffer, returnMessageBufferLen, returnPerfBuffer, returnPerfBufferLen);1694 }1695 NSCAPI::errorReturn NSAPIGetSettingsSection(const TCHAR* section, TCHAR*** aBuffer, unsigned int * bufLen) {1696 try {1697 unsigned int len = 0;1698 *aBuffer = arrayBuffer::list2arrayBuffer(settings_manager::get_settings()->get_keys(section), len);1699 *bufLen = len;1700 return NSCAPI::isSuccess;1701 } catch (SettingsException e) {1702 LOG_ERROR_STD(_T("Failed to get section: ") + e.getMessage());1703 } catch (...) {1704 LOG_ERROR_STD(_T("Failed to getSection: ") + section);1705 }1706 return NSCAPI::hasFailed;1707 }1708 NSCAPI::errorReturn NSAPIReleaseSettingsSectionBuffer(TCHAR*** aBuffer, unsigned int * bufLen) {1709 arrayBuffer::destroyArrayBuffer(*aBuffer, *bufLen);1710 *bufLen = 0;1711 *aBuffer = NULL;1712 return NSCAPI::isSuccess;1713 }1714 1715 NSCAPI::boolReturn NSAPICheckLogMessages(int messageType) {1716 if (mainClient.logDebug())1717 return NSCAPI::istrue;1718 return NSCAPI::isfalse;1719 }1720 1721 1515 std::wstring Encrypt(std::wstring str, unsigned int algorithm) { 1722 1516 unsigned int len = 0; … … 1746 1540 } 1747 1541 1748 NSCAPI::errorReturn NSAPIEncrypt(unsigned int algorithm, const TCHAR* inBuffer, unsigned int inBufLen, TCHAR* outBuf, unsigned int *outBufLen) { 1749 if (algorithm != NSCAPI::xor) { 1750 LOG_ERROR(_T("Unknown algortihm requested.")); 1751 return NSCAPI::hasFailed; 1752 } 1753 std::wstring key = settings_manager::get_settings()->get_string(SETTINGS_KEY(protocol_def::MASTER_KEY)); 1754 int tcharInBufLen = 0; 1755 char *c = charEx::tchar_to_char(inBuffer, inBufLen, tcharInBufLen); 1756 std::wstring::size_type j=0; 1757 for (int i=0;i<tcharInBufLen;i++,j++) { 1758 if (j > key.size()) 1759 j = 0; 1760 c[i] ^= key[j]; 1761 } 1762 size_t cOutBufLen = b64::b64_encode(reinterpret_cast<void*>(c), tcharInBufLen, NULL, NULL); 1763 if (!outBuf) { 1764 *outBufLen = static_cast<unsigned int>(cOutBufLen*2); // TODO: Guessing wildly here but no proper way to tell without a lot of extra work 1765 return NSCAPI::isSuccess; 1766 } 1767 char *cOutBuf = new char[cOutBufLen+1]; 1768 size_t len = b64::b64_encode(reinterpret_cast<void*>(c), tcharInBufLen, cOutBuf, cOutBufLen); 1769 delete [] c; 1770 if (len == 0) { 1771 LOG_ERROR(_T("Invalid out buffer length.")); 1772 return NSCAPI::isInvalidBufferLen; 1773 } 1774 int realOutLen; 1775 TCHAR *realOut = charEx::char_to_tchar(cOutBuf, cOutBufLen, realOutLen); 1776 if (static_cast<unsigned int>(realOutLen) >= *outBufLen) { 1777 LOG_ERROR_STD(_T("Invalid out buffer length: ") + strEx::itos(realOutLen) + _T(" was needed but only ") + strEx::itos(*outBufLen) + _T(" was allocated.")); 1778 return NSCAPI::isInvalidBufferLen; 1779 } 1780 wcsncpy_s(outBuf, *outBufLen, realOut, realOutLen); 1781 delete [] realOut; 1782 outBuf[realOutLen] = 0; 1783 *outBufLen = static_cast<unsigned int>(realOutLen); 1784 return NSCAPI::isSuccess; 1785 } 1786 1787 NSCAPI::errorReturn NSAPIDecrypt(unsigned int algorithm, const TCHAR* inBuffer, unsigned int inBufLen, TCHAR* outBuf, unsigned int *outBufLen) { 1788 if (algorithm != NSCAPI::xor) { 1789 LOG_ERROR(_T("Unknown algortihm requested.")); 1790 return NSCAPI::hasFailed; 1791 } 1792 int inBufLenC = 0; 1793 char *inBufferC = charEx::tchar_to_char(inBuffer, inBufLen, inBufLenC); 1794 size_t cOutLen = b64::b64_decode(inBufferC, inBufLenC, NULL, NULL); 1795 if (!outBuf) { 1796 *outBufLen = static_cast<unsigned int>(cOutLen*2); // TODO: Guessing wildly here but no proper way to tell without a lot of extra work 1797 return NSCAPI::isSuccess; 1798 } 1799 char *cOutBuf = new char[cOutLen+1]; 1800 size_t len = b64::b64_decode(inBufferC, inBufLenC, reinterpret_cast<void*>(cOutBuf), cOutLen); 1801 delete [] inBufferC; 1802 if (len == 0) { 1803 LOG_ERROR(_T("Invalid out buffer length.")); 1804 return NSCAPI::isInvalidBufferLen; 1805 } 1806 int realOutLen; 1807 1808 std::wstring key = settings_manager::get_settings()->get_string(SETTINGS_KEY(protocol_def::MASTER_KEY)); 1809 std::wstring::size_type j=0; 1810 for (int i=0;i<cOutLen;i++,j++) { 1811 if (j > key.size()) 1812 j = 0; 1813 cOutBuf[i] ^= key[j]; 1814 } 1815 1816 TCHAR *realOut = charEx::char_to_tchar(cOutBuf, cOutLen, realOutLen); 1817 if (static_cast<unsigned int>(realOutLen) >= *outBufLen) { 1818 LOG_ERROR_STD(_T("Invalid out buffer length: ") + strEx::itos(realOutLen) + _T(" was needed but only ") + strEx::itos(*outBufLen) + _T(" was allocated.")); 1819 return NSCAPI::isInvalidBufferLen; 1820 } 1821 wcsncpy_s(outBuf, *outBufLen, realOut, realOutLen); 1822 delete [] realOut; 1823 outBuf[realOutLen] = 0; 1824 *outBufLen = static_cast<unsigned int>(realOutLen); 1825 return NSCAPI::isSuccess; 1826 } 1827 1828 NSCAPI::errorReturn NSAPISetSettingsString(const TCHAR* section, const TCHAR* key, const TCHAR* value) { 1829 try { 1830 settings_manager::get_settings()->set_string(section, key, value); 1831 } catch (...) { 1832 LOG_ERROR_STD(_T("Failed to setString: ") + key); 1833 return NSCAPI::hasFailed; 1834 } 1835 return NSCAPI::isSuccess; 1836 } 1837 NSCAPI::errorReturn NSAPISetSettingsInt(const TCHAR* section, const TCHAR* key, int value) { 1838 try { 1839 settings_manager::get_settings()->set_int(section, key, value); 1840 } catch (...) { 1841 LOG_ERROR_STD(_T("Failed to setInt: ") + key); 1842 return NSCAPI::hasFailed; 1843 } 1844 return NSCAPI::isSuccess; 1845 } 1846 NSCAPI::errorReturn NSAPIWriteSettings(int type) { 1847 try { 1848 if (type == NSCAPI::settings_registry) 1849 settings_manager::get_core()->migrate_to(Settings::SettingsCore::registry); 1850 else if (type == NSCAPI::settings_inifile) 1851 settings_manager::get_core()->migrate_to(Settings::SettingsCore::ini_file); 1852 else 1853 settings_manager::get_settings()->save(); 1854 } catch (SettingsException e) { 1855 LOG_ERROR_STD(_T("Failed to write settings: ") + e.getMessage()); 1856 return NSCAPI::hasFailed; 1857 } catch (...) { 1858 LOG_ERROR_STD(_T("Failed to write settings")); 1859 return NSCAPI::hasFailed; 1860 } 1861 return NSCAPI::isSuccess; 1862 } 1863 NSCAPI::errorReturn NSAPIReadSettings(int type) { 1864 try { 1865 if (type == NSCAPI::settings_registry) 1866 settings_manager::get_core()->migrate_from(Settings::SettingsCore::registry); 1867 else if (type == NSCAPI::settings_inifile) 1868 settings_manager::get_core()->migrate_from(Settings::SettingsCore::ini_file); 1869 else 1870 settings_manager::get_settings()->reload(); 1871 } catch (SettingsException e) { 1872 LOG_ERROR_STD(_T("Failed to read settings: ") + e.getMessage()); 1873 return NSCAPI::hasFailed; 1874 } catch (...) { 1875 LOG_ERROR_STD(_T("Failed to read settings")); 1876 return NSCAPI::hasFailed; 1877 } 1878 return NSCAPI::isSuccess; 1879 } 1880 NSCAPI::errorReturn NSAPIRehash(int flag) { 1881 return NSCAPI::hasFailed; 1882 } 1883 NSCAPI::errorReturn NSAPIDescribeCommand(const TCHAR* command, TCHAR* buffer, unsigned int bufLen) { 1884 return NSCHelper::wrapReturnString(buffer, bufLen, mainClient.describeCommand(command), NSCAPI::isSuccess); 1885 } 1886 NSCAPI::errorReturn NSAPIGetAllCommandNames(arrayBuffer::arrayBuffer* aBuffer, unsigned int *bufLen) { 1887 unsigned int len = 0; 1888 *aBuffer = arrayBuffer::list2arrayBuffer(mainClient.getAllCommandNames(), len); 1889 *bufLen = len; 1890 return NSCAPI::isSuccess; 1891 } 1892 NSCAPI::errorReturn NSAPIReleaseAllCommandNamessBuffer(TCHAR*** aBuffer, unsigned int * bufLen) { 1893 arrayBuffer::destroyArrayBuffer(*aBuffer, *bufLen); 1894 *bufLen = 0; 1895 *aBuffer = NULL; 1896 return NSCAPI::isSuccess; 1897 } 1898 NSCAPI::errorReturn NSAPIRegisterCommand(const TCHAR* cmd,const TCHAR* desc) { 1899 mainClient.registerCommand(cmd, desc); 1900 return NSCAPI::isSuccess; 1901 } 1902 NSCAPI::errorReturn NSAPISettingsRegKey(const TCHAR* path, const TCHAR* key, int type, const TCHAR* title, const TCHAR* description, const TCHAR* defVal, int advanced) { 1903 try { 1904 if (type == NSCAPI::key_string) 1905 settings_manager::get_core()->register_key(path, key, Settings::SettingsCore::key_string, title, description, defVal, advanced); 1906 if (type == NSCAPI::key_bool) 1907 settings_manager::get_core()->register_key(path, key, Settings::SettingsCore::key_bool, title, description, defVal, advanced); 1908 if (type == NSCAPI::key_integer) 1909 settings_manager::get_core()->register_key(path, key, Settings::SettingsCore::key_integer, title, description, defVal, advanced); 1910 return NSCAPI::hasFailed; 1911 } catch (SettingsException e) { 1912 LOG_ERROR_STD(_T("Failed register key: ") + e.getMessage()); 1913 return NSCAPI::hasFailed; 1914 } catch (...) { 1915 LOG_ERROR_STD(_T("Failed register key")); 1916 return NSCAPI::hasFailed; 1917 } 1918 return NSCAPI::isSuccess; 1919 } 1920 1921 1922 NSCAPI::errorReturn NSAPISettingsRegPath(const TCHAR* path, const TCHAR* title, const TCHAR* description, int advanced) { 1923 try { 1924 settings_manager::get_core()->register_path(path, title, description, advanced); 1925 } catch (SettingsException e) { 1926 LOG_ERROR_STD(_T("Failed register path: ") + e.getMessage()); 1927 return NSCAPI::hasFailed; 1928 } catch (...) { 1929 LOG_ERROR_STD(_T("Failed register path")); 1930 return NSCAPI::hasFailed; 1931 } 1932 return NSCAPI::isSuccess; 1933 } 1934 1935 //int wmain(int argc, TCHAR* argv[], TCHAR* envp[]) 1936 TCHAR* copyString(const std::wstring &str) { 1937 int sz = str.size(); 1938 TCHAR *tc = new TCHAR[sz+2]; 1939 wcsncpy_s(tc, sz+1, str.c_str(), sz); 1940 return tc; 1941 } 1942 NSCAPI::errorReturn NSAPIGetPluginList(int *len, NSCAPI::plugin_info *list[]) { 1943 NSClientT::plugin_info_list plugList= mainClient.get_all_plugins(); 1944 *len = plugList.size(); 1945 1946 *list = new NSCAPI::plugin_info[*len+1]; 1947 int i=0; 1948 for(NSClientT::plugin_info_list::const_iterator cit = plugList.begin(); cit != plugList.end(); ++cit,i++) { 1949 (*list)[i].dll = copyString((*cit).dll); 1950 (*list)[i].name = copyString((*cit).name); 1951 (*list)[i].version = copyString((*cit).version); 1952 (*list)[i].description = copyString((*cit).description); 1953 } 1954 return NSCAPI::isSuccess; 1955 } 1956 NSCAPI::errorReturn NSAPIReleasePluginList(int len, NSCAPI::plugin_info *list[]) { 1957 for (int i=0;i<len;i++) { 1958 delete [] (*list)[i].dll; 1959 delete [] (*list)[i].name; 1960 delete [] (*list)[i].version; 1961 delete [] (*list)[i].description; 1962 } 1963 delete [] *list; 1964 return NSCAPI::isSuccess; 1965 } 1966 1967 1968 NSCAPI::errorReturn NSAPISettingsSave(void) { 1969 try { 1970 settings_manager::get_settings()->save(); 1971 } catch (SettingsException e) { 1972 LOG_ERROR_STD(_T("Failed to save: ") + e.getMessage()); 1973 return NSCAPI::hasFailed; 1974 } catch (...) { 1975 LOG_ERROR_STD(_T("Failed to save")); 1976 return NSCAPI::hasFailed; 1977 } 1978 return NSCAPI::isSuccess; 1979 } 1980 1981 1982 1983 LPVOID NSAPILoader(TCHAR*buffer) { 1984 if (_wcsicmp(buffer, _T("NSAPIGetApplicationName")) == 0) 1985 return &NSAPIGetApplicationName; 1986 if (_wcsicmp(buffer, _T("NSAPIGetApplicationVersionStr")) == 0) 1987 return &NSAPIGetApplicationVersionStr; 1988 if (_wcsicmp(buffer, _T("NSAPIGetSettingsString")) == 0) 1989 return &NSAPIGetSettingsString; 1990 if (_wcsicmp(buffer, _T("NSAPIGetSettingsSection")) == 0) 1991 return &NSAPIGetSettingsSection; 1992 if (_wcsicmp(buffer, _T("NSAPIReleaseSettingsSectionBuffer")) == 0) 1993 return &NSAPIReleaseSettingsSectionBuffer; 1994 if (_wcsicmp(buffer, _T("NSAPIGetSettingsInt")) == 0) 1995 return &NSAPIGetSettingsInt; 1996 if (_wcsicmp(buffer, _T("NSAPIMessage")) == 0) 1997 return &NSAPIMessage; 1998 if (_wcsicmp(buffer, _T("NSAPIStopServer")) == 0) 1999 return &NSAPIStopServer; 2000 if (_wcsicmp(buffer, _T("NSAPIInject")) == 0) 2001 return &NSAPIInject; 2002 if (_wcsicmp(buffer, _T("NSAPIGetBasePath")) == 0) 2003 return &NSAPIGetBasePath; 2004 if (_wcsicmp(buffer, _T("NSAPICheckLogMessages")) == 0) 2005 return &NSAPICheckLogMessages; 2006 if (_wcsicmp(buffer, _T("NSAPIEncrypt")) == 0) 2007 return &NSAPIEncrypt; 2008 if (_wcsicmp(buffer, _T("NSAPIDecrypt")) == 0) 2009 return &NSAPIDecrypt; 2010 if (_wcsicmp(buffer, _T("NSAPISetSettingsString")) == 0) 2011 return &NSAPISetSettingsString; 2012 if (_wcsicmp(buffer, _T("NSAPISetSettingsInt")) == 0) 2013 return &NSAPISetSettingsInt; 2014 if (_wcsicmp(buffer, _T("NSAPIWriteSettings")) == 0) 2015 return &NSAPIWriteSettings; 2016 if (_wcsicmp(buffer, _T("NSAPIReadSettings")) == 0) 2017 return &NSAPIReadSettings; 2018 if (_wcsicmp(buffer, _T("NSAPIRehash")) == 0) 2019 return &NSAPIRehash; 2020 if (_wcsicmp(buffer, _T("NSAPIDescribeCommand")) == 0) 2021 return &NSAPIDescribeCommand; 2022 if (_wcsicmp(buffer, _T("NSAPIGetAllCommandNames")) == 0) 2023 return &NSAPIGetAllCommandNames; 2024 if (_wcsicmp(buffer, _T("NSAPIReleaseAllCommandNamessBuffer")) == 0) 2025 return &NSAPIReleaseAllCommandNamessBuffer; 2026 if (_wcsicmp(buffer, _T("NSAPIRegisterCommand")) == 0) 2027 return &NSAPIRegisterCommand; 2028 if (_wcsicmp(buffer, _T("NSAPISettingsRegKey")) == 0) 2029 return &NSAPISettingsRegKey; 2030 if (_wcsicmp(buffer, _T("NSAPISettingsRegPath")) == 0) 2031 return &NSAPISettingsRegPath; 2032 if (_wcsicmp(buffer, _T("NSAPIGetPluginList")) == 0) 2033 return &NSAPIGetPluginList; 2034 if (_wcsicmp(buffer, _T("NSAPIReleasePluginList")) == 0) 2035 return &NSAPIReleasePluginList; 2036 if (_wcsicmp(buffer, _T("NSAPISettingsSave")) == 0) 2037 return &NSAPISettingsSave; 2038 2039 LOG_ERROR_STD(_T("Function not found: ") + buffer); 2040 return NULL; 2041 } 2042 2043 1542 -
trunk/service/NSClient++.h
r202 r205 31 31 #include <com_helpers.hpp> 32 32 #include <nsclient_session.hpp> 33 33 34 34 35 /** … … 103 104 MutexRW m_mutexRWcmdDescriptions; 104 105 cmdMap cmdDescriptions_; 105 typedef enum log_status {log_unknown, log_ debug, log_nodebug };106 typedef enum log_status {log_unknown, log_looking, log_debug, log_nodebug }; 106 107 log_status debug_; 107 108 com_helper::initialize_com com_helper_; … … 181 182 typedef service_helper::NTService<NSClientT> NSClient; 182 183 184 extern NSClient mainClient; // Global core instance forward declaration. 185 183 186 184 187 std::wstring Encrypt(std::wstring str, unsigned int algorithm = NSCAPI::xor); 185 188 std::wstring Decrypt(std::wstring str, unsigned int algorithm = NSCAPI::xor); 186 187 //////////////////////////////////////////////////////////////////////////188 // Various NSAPI callback functions (available for plug-ins to make calls back to the core.189 // <b>NOTICE</b> No threading is allowed so technically every thread is responsible for marshaling things back.190 // Though I think this is not the case at the moment.191 //192 193 LPVOID NSAPILoader(TCHAR*buffer);194 NSCAPI::errorReturn NSAPIGetApplicationName(TCHAR*buffer, unsigned int bufLen);195 NSCAPI::errorReturn NSAPIGetBasePath(TCHAR*buffer, unsigned int bufLen);196 NSCAPI::errorReturn NSAPIGetApplicationVersionStr(TCHAR*buffer, unsigned int bufLen);197 NSCAPI::errorReturn NSAPIGetSettingsString(const TCHAR* section, const TCHAR* key, const TCHAR* defaultValue, TCHAR* buffer, unsigned int bufLen);198 int NSAPIGetSettingsInt(const TCHAR* section, const TCHAR* key, int defaultValue);199 void NSAPIMessage(int msgType, const TCHAR* file, const int line, const TCHAR* message);200 void NSAPIStopServer(void);201 NSCAPI::nagiosReturn NSAPIInject(const TCHAR* command, const unsigned int argLen, TCHAR **argument, TCHAR *returnMessageBuffer, unsigned int returnMessageBufferLen, TCHAR *returnPerfBuffer, unsigned int returnPerfBufferLen);202 NSCAPI::errorReturn NSAPIGetSettingsSection(const TCHAR*, TCHAR***, unsigned int *);203 NSCAPI::errorReturn NSAPIReleaseSettingsSectionBuffer(TCHAR*** aBuffer, unsigned int * bufLen);204 NSCAPI::boolReturn NSAPICheckLogMessages(int messageType);205 NSCAPI::errorReturn NSAPIEncrypt(unsigned int algorithm, const TCHAR* inBuffer, unsigned int inBufLen, TCHAR* outBuf, unsigned int *outBufLen);206 NSCAPI::errorReturn NSAPIDecrypt(unsigned int algorithm, const TCHAR* inBuffer, unsigned int inBufLen, TCHAR* outBuf, unsigned int *outBufLen);207 NSCAPI::errorReturn NSAPISetSettingsString(const TCHAR* section, const TCHAR* key, const TCHAR* value);208 NSCAPI::errorReturn NSAPISetSettingsInt(const TCHAR* section, const TCHAR* key, int value);209 NSCAPI::errorReturn NSAPIWriteSettings(int type);210 NSCAPI::errorReturn NSAPIReadSettings(int type);211 NSCAPI::errorReturn NSAPIRehash(int flag);212 NSCAPI::errorReturn NSAPIDescribeCommand(const TCHAR*,TCHAR*,unsigned int);213 NSCAPI::errorReturn NSAPIGetAllCommandNames(TCHAR***, unsigned int *);214 NSCAPI::errorReturn NSAPIReleaseAllCommandNamessBuffer(TCHAR***, unsigned int *);215 NSCAPI::errorReturn NSAPIRegisterCommand(const TCHAR*,const TCHAR*);216 NSCAPI::errorReturn NSAPISettingsRegKey(const TCHAR*, const TCHAR*, int, const TCHAR*, const TCHAR*, const TCHAR*, int);217 NSCAPI::errorReturn NSAPISettingsRegPath(const TCHAR*, const TCHAR*, const TCHAR*, int);218 NSCAPI::errorReturn NSAPIGetPluginList(int*, NSCAPI::plugin_info*[]);219 NSCAPI::errorReturn NSAPIReleasePluginList(int,NSCAPI::plugin_info*[]);220 NSCAPI::errorReturn NSAPISettingsSave(void);221 222 189 223 190 //////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.







