namespace
{
PLUGIN_CREATOR<AUTH_IA> iac;
-
-void InitEncrypt(BLOWFISH_CTX * ctx, const std::string & password);
}
extern "C" PLUGIN * GetPlugin();
///////////////////////////
pv.param = "Port";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
{
errorStr = "Parameter \'Port\' not found.";
printfd(__FILE__, "Parameter 'Port' not found\n");
///////////////////////////
pv.param = "UserDelay";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
{
errorStr = "Parameter \'UserDelay\' not found.";
printfd(__FILE__, "Parameter 'UserDelay' not found\n");
///////////////////////////
pv.param = "UserTimeout";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
{
errorStr = "Parameter \'UserTimeout\' not found.";
printfd(__FILE__, "Parameter 'UserTimeout' not found\n");
///////////////////////////
pv.param = "LogProtocolErrors";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
logProtocolErrors = false;
else if (ParseYesNo(pvi->value[0], &logProtocolErrors))
{
int n = 0;
pv.param = "FreeMb";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end() || pvi->value.empty())
{
errorStr = "Parameter \'FreeMb\' not found.";
printfd(__FILE__, "Parameter 'FreeMb' not found\n");
#ifdef IA_PHASE_DEBUG
IA_PHASE::IA_PHASE()
: phase(1),
- phaseTime(),
flog(NULL)
{
gettimeofday(&phaseTime, NULL);
}
#else
IA_PHASE::IA_PHASE()
- : phase(1),
- phaseTime()
+ : phase(1)
{
gettimeofday(&phaseTime, NULL);
}
return ret;
}
//-----------------------------------------------------------------------------
+int AUTH_IA::Reload(const MODULE_SETTINGS & ms)
+{
+AUTH_IA_SETTINGS newIaSettings;
+if (newIaSettings.ParseSettings(ms))
+ {
+ printfd(__FILE__, "AUTH_IA::Reload() - Failed to reload InetAccess.\n");
+ logger("AUTH_IA: Cannot reload InetAccess. Errors found.");
+ return -1;
+ }
+
+printfd(__FILE__, "AUTH_IA::Reload() - Reloaded InetAccess successfully.\n");
+logger("AUTH_IA: Reloaded InetAccess successfully.");
+iaSettings = newIaSettings;
+return 0;
+}
+//-----------------------------------------------------------------------------
int AUTH_IA::PrepareNet()
{
struct sockaddr_in listenAddr;
return res;
}
-namespace
-{
-//-----------------------------------------------------------------------------
-inline
-void InitEncrypt(BLOWFISH_CTX * ctx, const std::string & password)
-{
-unsigned char keyL[PASSWD_LEN];
-memset(keyL, 0, PASSWD_LEN);
-strncpy((char *)keyL, password.c_str(), PASSWD_LEN);
-Blowfish_Init(ctx, keyL, PASSWD_LEN);
-}
-//-----------------------------------------------------------------------------
-}