Added support for FIDO DNS zone

master
Sergey Dorofeev 13 years ago
parent 6eac20718a
commit 096f382eaa

@ -180,6 +180,7 @@ s_conf_entry bforce_config[BFORCE_NUMBER_OF_KEYWORDS+1] = {
CONF_KEY(netspool_host, CT_STRING), CONF_KEY(netspool_host, CT_STRING),
CONF_KEY(netspool_port, CT_STRING), CONF_KEY(netspool_port, CT_STRING),
#endif #endif
CONF_KEY(fidodnszone, CT_STRING),
CONF_END() CONF_END()
}; };

@ -758,6 +758,21 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
state.override.sIpaddr, sizeof(state.node.host)); state.override.sIpaddr, sizeof(state.node.host));
} }
if( call_mayuse & CALL_TCPIP_ANY && !tcpip_isgood_host(state.node.host) ) {
char *fidodnszone = conf_string(cf_fidodnszone);
if (fidodnszone) {
if (addr.point) {
snprintf(state.node.host, BNI_MAXHOST, "p%d.f%d.n%d.z%d.%s",
addr.point, addr.node, addr.net, addr.zone, fidodnszone);
}
else {
snprintf(state.node.host, BNI_MAXHOST, "f%d.n%d.z%d.%s",
addr.node, addr.net, addr.zone, fidodnszone);
}
log("use fido DNS zone: %s", state.node.host);
}
}
if( call_mayuse & CALL_TCPIP_ANY && !tcpip_isgood_host(state.node.host) ) if( call_mayuse & CALL_TCPIP_ANY && !tcpip_isgood_host(state.node.host) )
{ {
call_mayuse &= ~CALL_TCPIP_ANY; call_mayuse &= ~CALL_TCPIP_ANY;

@ -275,6 +275,7 @@ typedef enum {
cf_netspool_host, cf_netspool_host,
cf_netspool_port, cf_netspool_port,
#endif #endif
cf_fidodnszone,
BFORCE_NUMBER_OF_KEYWORDS BFORCE_NUMBER_OF_KEYWORDS
} bforce_config_keyword; } bforce_config_keyword;

Loading…
Cancel
Save