Nothing to see here, move along...

This commit is contained in:
2016-09-17 15:02:58 +03:00
parent 1c2473505d
commit 95a6f1fe97
8 changed files with 54 additions and 15 deletions

View File

@@ -16,7 +16,8 @@ struct conf_table conf = {
{
"", /* db.type */
"", /* db.hostname */
"" /* db.port */
"", /* db.port */
"" /* db.pass */
},
{
"127.0.0.1", /* rmps.agent_ip */
@@ -41,11 +42,22 @@ struct conf_table conf = {
}
};
const char* conf_db_pass(void)
{
return conf.db.pass;
}
const char* conf_db_hostname(void)
{
return conf.db.hostname;
}
void confexport(void)
{
printf( "db.type=%s\n"
"db.hostname=%s\n"
"db.port=%s\n"
"db.pass=%s\n"
"rmps.agent_ip=%s\n"
"rmps.agent_port=%s\n"
"rmps.client_ip=%s\n"
@@ -65,6 +77,7 @@ void confexport(void)
conf.db.type,
conf.db.hostname,
conf.db.port,
conf.db.pass,
conf.rmps.agent_ip,
conf.rmps.agent_port,
conf.rmps.client_ip,
@@ -259,7 +272,9 @@ static int test_conf_syntax(void)
}
ok = 0;
failed = 1;
} else if (!strcmp(buf, "rmps.agent_ip")) {
} else if (!strcmp(buf, "db.pass"))
strcpy(conf.db.pass, tmp + 1);
else if (!strcmp(buf, "rmps.agent_ip")) {
/* TODO */
} else if (!strcmp(buf, "rmps.agent_port")) {
if ((i = strlen(tmp + 1)) < 6) {