|
|
|
@ -543,7 +543,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
char s[300];
|
|
|
|
|
snprintf(s, 299, "bforce calling system %d:%d/%d.%d", addr.zone, addr.net, addr.node, addr.point );
|
|
|
|
|
log(s);
|
|
|
|
|
|
|
|
|
|
DEB((D_EVENT, s));
|
|
|
|
|
// find suitable way of connection and try to make session
|
|
|
|
|
|
|
|
|
|
int rc = 0;
|
|
|
|
@ -568,12 +568,13 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state.listed = state.node.listed;
|
|
|
|
|
DEB((D_EVENT, "Calling init, listed=%d", state.listed));
|
|
|
|
|
state.node.addr.domain[0] = '\0'; /* Discard domain for node address */
|
|
|
|
|
|
|
|
|
|
// 1. If call method specified in cmdline, do use it
|
|
|
|
|
// 2. If not, use nodelist data and overrides and call all available methods
|
|
|
|
|
// If override contains Phone or IP flags, ignore nodelist connect methods (but save INA if not overrided)
|
|
|
|
|
|
|
|
|
|
DEB((D_EVENT, "Calling init, runmode=%d", opts->runmode));
|
|
|
|
|
// 1st - get all allowed call ways
|
|
|
|
|
// 2nd - gather information reqired to call and remove unavailable ways (no info, node does not support)
|
|
|
|
|
|
|
|
|
@ -581,7 +582,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
|
|
|
|
|
if( opts->runmode == MODE_CALL_DEFAULT )
|
|
|
|
|
{
|
|
|
|
|
call_mayuse = CALL_MODEM | CALL_TCPIP_ANY;
|
|
|
|
|
call_mustuse = CALL_MODEM | CALL_TCPIP_ANY;
|
|
|
|
|
}
|
|
|
|
|
else if( opts->runmode == MODE_CALL_STDIO )
|
|
|
|
|
{
|
|
|
|
@ -593,7 +594,14 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
}
|
|
|
|
|
else if( opts->runmode == MODE_CALL_IP )
|
|
|
|
|
{
|
|
|
|
|
if( strcasecmp(opts->ipproto, "binkp") == 0 )
|
|
|
|
|
DEB((D_EVENT, "Calling init, MODE_CALL_IP"));
|
|
|
|
|
if( !(opts->ipproto) ) // determine from nodelist/override
|
|
|
|
|
{
|
|
|
|
|
DEB((D_EVENT, "ipproto not set"));
|
|
|
|
|
call_mayuse = CALL_TCPIP_ANY;
|
|
|
|
|
call_mustuse = 0;
|
|
|
|
|
}
|
|
|
|
|
else if( strcasecmp(opts->ipproto, "binkp") == 0 )
|
|
|
|
|
{
|
|
|
|
|
call_mustuse = CALL_TCPIP_BINKP;
|
|
|
|
|
}
|
|
|
|
@ -605,31 +613,29 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
{
|
|
|
|
|
call_mustuse = CALL_TCPIP_TELNET;
|
|
|
|
|
}
|
|
|
|
|
else if( opts->ipproto == NULL ) // determine from nodelist/override
|
|
|
|
|
{
|
|
|
|
|
call_mayuse = CALL_TCPIP_ANY;
|
|
|
|
|
call_mustuse = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DEB((D_EVENT, "Unknown protocol %s", opts->ipproto));
|
|
|
|
|
log("Unknown protocol");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
log("Unknown protocol");
|
|
|
|
|
DEB((D_EVENT, "Unknown runmode %d", opts->runmode));
|
|
|
|
|
log("Unknown runmode");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
call_mayuse |= call_mustuse; // it simplifies logics: all required is allowed
|
|
|
|
|
|
|
|
|
|
//char s[300];
|
|
|
|
|
//snprintf(s, 299, "initial: may use %d must use %d", call_mayuse, call_mustuse);
|
|
|
|
|
//log(s);
|
|
|
|
|
snprintf(s, 299, "initial: may use %d must use %d", call_mayuse, call_mustuse);
|
|
|
|
|
log(s);
|
|
|
|
|
DEB((D_EVENT, s));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( call_mayuse & CALL_MODEM )
|
|
|
|
|
if( (call_mayuse & CALL_MODEM) )
|
|
|
|
|
{
|
|
|
|
|
// 1. use phone from opts
|
|
|
|
|
// 2. use overrides
|
|
|
|
@ -693,9 +699,9 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// snprintf(s, 299, "after phone check: may use %d must use %d", call_mayuse, call_mustuse);
|
|
|
|
|
// log(s);
|
|
|
|
|
|
|
|
|
|
snprintf(s, 299, "after phone check: may use %d must use %d", call_mayuse, call_mustuse);
|
|
|
|
|
log(s);
|
|
|
|
|
DEB((D_EVENT, s));
|
|
|
|
|
/*
|
|
|
|
|
* Apply overrides to the node information
|
|
|
|
|
*/
|
|
|
|
@ -746,6 +752,8 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
state.override.sIpaddr, sizeof(state.node.host));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DEB((D_EVENT, "Calling init, IPHOST", state.node.host));
|
|
|
|
|
|
|
|
|
|
if( call_mayuse & CALL_TCPIP_ANY && !tcpip_isgood_host(state.node.host) ) {
|
|
|
|
|
char *fidodnszone = conf_string(cf_fidodnszone);
|
|
|
|
|
if (fidodnszone) {
|
|
|
|
@ -765,6 +773,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|
|
|
|
{
|
|
|
|
|
call_mayuse &= ~CALL_TCPIP_ANY;
|
|
|
|
|
log("bad host, exclude IP");
|
|
|
|
|
DEB((D_EVENT, "bad host %s, exclude IP", state.node.host));
|
|
|
|
|
if( call_mustuse & CALL_TCPIP_ANY )
|
|
|
|
|
{
|
|
|
|
|
errmsg = "don't know host name";
|
|
|
|
|