*CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
*OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
log_file = NULL;
- OperSpyWhois = nofork = HideBans = HideSplits = false;
- AllowHalfop = true;
+ forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false;
+ writelog = AllowHalfop = true;
dns_timeout = DieDelay = 5;
MaxTargets = 20;
NetBufferSize = 10240;
return true;
}
-bool ValidateNetworkName(const char* tag, const char* value, void* data)
-{
- char* x = (char*)data;
-
- log(DEFAULT,"<server:network> '%s'",x);
-
- return true;
-}
-
-bool ValidateServerDesc(const char* tag, const char* value, void* data)
-{
- char* x = (char*)data;
-
- log(DEFAULT,"<server:description> '%s'",x);
-
- return true;
-}
-
bool ValidateNetBufferSize(const char* tag, const char* value, void* data)
{
if ((!Config->NetBufferSize) || (Config->NetBufferSize > 65535) || (Config->NetBufferSize < 1024))
{"options", "softlimit", &this->SoftLimit, DT_INTEGER, ValidateSoftLimit},
{"options", "somaxconn", &this->MaxConn, DT_INTEGER, ValidateMaxConn},
{"server", "name", &this->ServerName, DT_CHARPTR, ValidateServerName},
- {"server", "description", &this->ServerDesc, DT_CHARPTR, ValidateServerDesc},
- {"server", "network", &this->Network, DT_CHARPTR, ValidateNetworkName},
+ {"server", "description", &this->ServerDesc, DT_CHARPTR, NoValidation},
+ {"server", "network", &this->Network, DT_CHARPTR, NoValidation},
{"admin", "name", &this->AdminName, DT_CHARPTR, NoValidation},
{"admin", "email", &this->AdminEmail, DT_CHARPTR, NoValidation},
{"admin", "nick", &this->AdminNick, DT_CHARPTR, NoValidation},
{
/* Leaving quotes, we have the value */
results.push_back(KeyVal(current_key, current_value));
- std::cout << "<" << tagname << ":" << current_key << "> " << current_value << std::endl;
+
+ // std::cout << "<" << tagname << ":" << current_key << "> " << current_value << std::endl;
+
in_quote = false;
got_key = false;
}
}
}
+ else if(pos == 0)
+ {
+ log(DEBUG, "No <%s> tags in config file.", tag.c_str());
+ }
else
{
- log(DEBUG, "ConfValue got an out-of-range index %d", pos);
+ log(DEBUG, "ConfValue got an out-of-range index %d, there are only %d occurences of %s", pos, target.count(tag), tag.c_str());
}
return false;
int ServerConfig::ConfValueEnum(ConfigDataHash &target, const char* tag)
{
- return ConfValueEnum(target, std::string(tag));
+ return target.count(tag);
}
int ServerConfig::ConfValueEnum(ConfigDataHash &target, const std::string &tag)
int ServerConfig::ConfVarEnum(ConfigDataHash &target, const char* tag, int index)
{
- return 1;
+ return ConfVarEnum(target, std::string(tag), index);
}
int ServerConfig::ConfVarEnum(ConfigDataHash &target, const std::string &tag, int index)
return iter->second.size();
}
+ else if(pos == 0)
+ {
+ log(DEBUG, "No <%s> tags in config file.", tag.c_str());
+ }
else
{
- log(DEBUG, "ConfVarEnum got an out-of-range index %d", pos);
+ log(DEBUG, "ConfVarEnum got an out-of-range index %d, there are only %d occurences of %s", pos, target.count(tag), tag.c_str());
}
return 0;
* a maximum of one second before it times out, using the DNS
* server specified in the configuration file.
*/
-bool BindSocket(int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr)
+bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr)
{
memset(&server,0,sizeof(server));
- struct in_addr addy;
+ insp_inaddr addy;
bool resolved = false;
char resolved_addr[128];
int BindPorts(bool bail)
{
char configToken[MAXBUF], Addr[MAXBUF], Type[MAXBUF];
- sockaddr_in client,server;
+ insp_sockaddr client, server;
int clientportcount = 0;
int BoundPortCount = 0;