diff --git a/ChangeLog b/ChangeLog index 91e3fc20..82603287 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4635,6 +4635,8 @@ v0.33.20 10-Feb-2002 mbtask: Removed some debug logging. + Creates the semafore is_inet when the internet connections is + available, and removes it when it is down. mbcico: Fixed binkp driver to accept incoming unprotected sessions. diff --git a/html/misc/semafore.html b/html/misc/semafore.html index 68bad5c8..d12febc9 100644 --- a/html/misc/semafore.html +++ b/html/misc/semafore.html @@ -12,7 +12,7 @@
-
Last update 02-Feb-2002
+
Last update 21-Feb-2002

 

Semafore files with MBSE BBS.

@@ -58,6 +58,11 @@ do_inet Purpose: Signal that there are node(s) to be called via the connection to the internet is needed. Created and removed by mbtask. +is_inet Purpose: Signal that the internet is available. Usefull for + dialup systems to check when the internet connection is up + or down after starting or stopping ppp. + Created and removed by mbtask. + mbtask.last Purpose: A timestamp created and touched by "mbtask" every minute so you can check it is running. diff --git a/lib/dbnode.c b/lib/dbnode.c index 3e7ad031..9451435e 100644 --- a/lib/dbnode.c +++ b/lib/dbnode.c @@ -72,7 +72,7 @@ int TestNode(fidoaddr aka) int i, nodeok = FALSE; for (i = 0; i < 20; i++) { - if (((aka.zone == 0) || (aka.zone = nodes.Aka[i].zone)) && + if (((aka.zone == 0) || (aka.zone == nodes.Aka[i].zone)) && (aka.net == nodes.Aka[i].net) && (aka.node == nodes.Aka[i].node) && (aka.point == nodes.Aka[i].point)) diff --git a/mbtask/mbtask.c b/mbtask/mbtask.c index 1d956b01..503c56e8 100644 --- a/mbtask/mbtask.c +++ b/mbtask/mbtask.c @@ -1492,12 +1492,14 @@ void scheduler(void) tasklog('!', "Internet connection is down"); internet = FALSE; sem_set((char *)"scanout", TRUE); + RemoveSema((char *)"is_inet"); } } else { if (!internet) { tasklog('!', "Internet connection is up"); internet = TRUE; sem_set((char *)"scanout", TRUE); + CreateSema((char *)"is_inet"); } icmp_errs = 0; } diff --git a/mbtask/outstat.c b/mbtask/outstat.c index 369dd1dc..ff422a1c 100644 --- a/mbtask/outstat.c +++ b/mbtask/outstat.c @@ -54,6 +54,45 @@ extern int s_do_inet; /* Internet wanted */ +/* + * Load noderecord if the node is in our setup. + */ +int load_node(fidoaddr); +int load_node(fidoaddr n) +{ + char *temp; + FILE *fp; + int i; + + temp = calloc(PATH_MAX, sizeof(char)); + sprintf(temp, "%s/etc/nodes.data", getenv("MBSE_ROOT")); + if ((fp = fopen(temp, "r")) == NULL) { + free(temp); + memset(&nodes, 0, sizeof(nodes)); + return FALSE; + } + + fread(&nodeshdr, sizeof(nodeshdr), 1, fp); + while (fread(&nodes, nodeshdr.recsize, 1, fp) == 1) { + fseek(fp, nodeshdr.filegrp + nodeshdr.mailgrp, SEEK_CUR); + for (i = 0; i < 20; i++) { + if ((n.zone == nodes.Aka[i].zone) || (n.net == nodes.Aka[i].net) || + (n.node == nodes.Aka[i].node) || (n.point == nodes.Aka[i].point)) { + fclose(fp); + free(temp); + return TRUE; + } + } + } + + fclose(fp); + memset(&nodes, 0, sizeof(nodes)); + free(temp); + return FALSE; +} + + + void set_next(int, int); void set_next(int hour, int min) { @@ -164,6 +203,10 @@ int outstat() first = FALSE; } + if (load_node(tmp->addr)) + tasklog('o', "Loaded node %s, NoCall=%s, NoTCP=%s", ascfnode(tmp->addr, 0x0f), + nodes.NoCall?"True":"False", nodes.NoTCP?"True":"False"); + /* * Zone Mail Hours, only use Fidonet Hours. * Other nets use your default ZMH. @@ -237,7 +280,7 @@ int outstat() T_window = TRUE; } } -// tasklog('o', "T_window=%s, iszmh=%s", T_window?"true":"false", iszmh?"true":"false"); + tasklog('o', "T_window=%s, iszmh=%s", T_window?"true":"false", iszmh?"true":"false"); strcpy(flstr,"...... ... .."); /* * If the node has internet and we have internet available, check if we can send @@ -312,6 +355,12 @@ int outstat() if (tmp->t2) flstr[12] = tmp->t2; + /* + * If forbidden to call from setup, clear callflag. + */ + if (nodes.NoCall) + tmp->flavors &= ~F_CALL; + /* * If we must call this node, figure out how to call this node. */ @@ -322,7 +371,7 @@ int outstat() tmp->callmode = CM_NONE; - if (internet && TCFG.max_tcp && + if (internet && TCFG.max_tcp && !nodes.NoTCP && ((tmp->ipflags & IP_IBN) || (tmp->ipflags & IP_IFC) || (tmp->ipflags & IP_ITN))) { inet_calls++; tmp->callmode = CM_INET; diff --git a/mbtask/outstat.h b/mbtask/outstat.h index fb782006..fd5e619a 100644 --- a/mbtask/outstat.h +++ b/mbtask/outstat.h @@ -5,6 +5,9 @@ typedef enum {CM_NONE, CM_INET, CM_ISDN, CM_POTS, MBFIDO, MBINDEX, MBFILE, MBINIT} CMODE; +struct _nodeshdr nodeshdr; /* Header record */ +struct _nodes nodes; /* Nodes datarecord */ + /* * Linked list of nodes with mail in the outbound.