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