Compare commits

..

No commits in common. '983440fc29df161be57fd19434f9c53ce97690d4' and 'bba77edecd025ec1191538228d6987d5b9773218' have entirely different histories.

@ -1 +1 @@
0.25.3
0.25.2

@ -178,7 +178,7 @@ static int daemon_sysentry_deinit(s_sysentry *sysent)
return 0;
}
static int daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
static bool daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
{
bool good_phone = FALSE;
bool good_host = FALSE;
@ -208,11 +208,6 @@ static int daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
if( tcpip_isgood_host(ovrd->sIpaddr) )
good_host = TRUE;
}
else if ( node && *node->host )
{
if( tcpip_isgood_host(node->host) )
good_host = TRUE;
}
/*
* Check work time
@ -236,16 +231,6 @@ static int daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
good_time = TRUE;
}
// Must be more complicated, i.e. call to IP even if modem is not good time
if ( good_host )
{
good_time = TRUE;
}
DEB((D_DAEMON, "daemon: node_cancall_line good_phone: %d, good_time:%d, good_host:%d",
good_phone, good_time, good_host));
if( good_time )
{
if( good_host )
@ -338,23 +323,9 @@ static bool daemon_node_cancall(s_sysentry *syst, bool ign_wtime, bool tcpip)
return FALSE;
}
/* Make check for tcpip out */
if ( tcpip )
{
rc = daemon_node_cancall_line(&syst->node, NULL);
DEB((D_DAEMON, "daemon tcpip: node_cancall rc=%d", rc));
if ( rc == 2 )
{
syst->tcpip = TRUE;
return TRUE;
}
}
/* Make checks for all lines */
if( syst->overrides )
{
DEB((D_DAEMON, "daemon: node_cancall OVR-IN"));
if( syst->lineptr && syst->lineptr->hidden )
{
line = syst->line + 1;
@ -392,18 +363,11 @@ static bool daemon_node_cancall(s_sysentry *syst, bool ign_wtime, bool tcpip)
}
line++;
}
}
else /* Node without overriden parameters */
{
syst->line = line = 0;
rc = daemon_node_cancall_line(&syst->node, NULL);
DEB((D_DAEMON, "daemon: node_cancall rc=%d", rc));
if ( rc )
{
syst->tcpip = (rc == 2) ? TRUE : FALSE;
return TRUE;
}
return daemon_node_cancall_line(&syst->node, NULL);
}
return FALSE;
@ -723,8 +687,6 @@ int daemon_rescan_sysqueue(s_sysqueue *q, s_daemon_queue dqs[])
#ifdef DEBUG
log_sysqueue(q);
DEB((D_DAEMON, "daemon rescan_sysqueue daemon queue: MODEM: %d, %d; TCPIP: %d, %d",
dqs[MODEM_QUEUE].circle, dqs[MODEM_QUEUE].current, dqs[TCPIP_QUEUE].circle, dqs[TCPIP_QUEUE].current));
#endif
return 0;
@ -1048,16 +1010,16 @@ int daemon_run(const char *confname, const char *incname, bool quit)
timer_set(&timer_alive, DAEMON_ALIVE_TIMER);
}
if( max_tcpip > 0 )
if( max_modem > 0 )
{
DEB((D_INFO,"daemon: daemon_tcpip_queue"));
daemon_queue_do(&daemon_queues[TCPIP_QUEUE]);
DEB((D_INFO,"daemon: daemon_modem_queue"));
daemon_queue_do(&daemon_queues[MODEM_QUEUE]);
}
if( max_modem > 0 )
if( max_tcpip > 0 )
{
DEB((D_INFO,"daemon: daemon_modem_queue"));
daemon_queue_do(&daemon_queues[MODEM_QUEUE]);
daemon_queue_do(&daemon_queues[TCPIP_QUEUE]);
}
(void)sleep(DAEMON_IDLE_SLEEP);

@ -54,13 +54,8 @@ static int daemon_call_branch(s_sysentry *syst, const char *lockdir, s_modemport
s_bforce_opts opts;
// TODO: add hiddenline round-robin
memset(&opts, '\0', sizeof(s_bforce_opts));
opts.hiddline = 0;
if ( syst->tcpip )
opts.runmode = MODE_CALL_IP;
else
opts.runmode = MODE_CALL_DEFAULT;
opts.runmode = MODE_CALL_DEFAULT;
opts.ipproto = NULL;
opts.phone = NULL;
opts.force = 0;

@ -294,7 +294,7 @@ int nodelist_parsestring(s_node *node, char *str)
//TODO: Add more INA flags to array
nodelist_flagvalue(node->flags, "INA", node->host);
DEB((D_NODELIST, "nodelist: Parsed inet values IBN: %d, IFC: %d, ITN: %d, INA: %s", node->do_binkp, node->do_ifcico, node->do_telnet, node->host));
DEB((D_NODELIST, "nodelist: Parsed inet values IBN: %d, IFC: %d, ITN: %d, INA: %d", node->do_binkp, node->do_ifcico, node->do_telnet, node->host));
return 0;
}

@ -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,13 +568,12 @@ 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)
@ -582,7 +581,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
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 )
{
@ -594,14 +593,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
}
else if( opts->runmode == MODE_CALL_IP )
{
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 )
if( strcasecmp(opts->ipproto, "binkp") == 0 )
{
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;
}
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
{
DEB((D_EVENT, "Unknown runmode %d", opts->runmode));
log("Unknown runmode");
log("Unknown protocol");
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);
DEB((D_EVENT, s));
//snprintf(s, 299, "initial: may use %d must use %d", call_mayuse, call_mustuse);
//log(s);
if( (call_mayuse & CALL_MODEM) )
if( call_mayuse & CALL_MODEM )
{
// 1. use phone from opts
// 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);
log(s);
DEB((D_EVENT, s));
// snprintf(s, 299, "after phone check: may use %d must use %d", call_mayuse, call_mustuse);
// log(s);
/*
* 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));
}
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) {
@ -773,7 +765,6 @@ 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";

Loading…
Cancel
Save