Eddy DK Programmer Guide
126
cgiFormInteger
("N_TELNET
", &value, cfg.system.telnet_server);
if (value == 1)
{
listPutf(list, "
n_telnet_di
", "");
listPutf(list, "
n_telnet_en
", "selected");
}
else
{
listPutf(list,
"n_telnet_di
", "selected");
listPutf(list, "
n_telnet_en
", "");
}
cgiFormInteger("
N_WEB
", &value, cfg.system.web_server);
if (value == 1)
{
listPutf(list, "
n_web_di
", "");
listPutf(list,
"n_web_en
", "selected");
}
else
{
listPutf(list, "
n_web_di
", "selected");
listPutf(list, "
n_web_en
", "");
}
The following shows processing part of setagent.c to save user-modified configuration value.
[Source abstract]
value2 = cgiFormStringNoNewlines("
N_IP
", buff, 16);
if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.ip);
value2 = cgiFormStringNoNewlines("
N_MASK
", buff, 16);
if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.mask);
value2 = cgiFormStringNoNewlines("
N_GW
", buff, 16);
if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.gateway);
value2 = cgiFormStringNoNewlines("
N_DNS
", buff, 16);
if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.dns);
cgiFormInteger("
N_TELNET
", &value, cfg.system.telnet_server);
cfg.system.telnet_server = value;
cgiFormInteger("
N_WEB
", &value, cfg.system.web_server);
cfg.system.web_server = value;