Added support for the do_inet semafore

This commit is contained in:
Michiel Broek 2002-02-02 15:15:34 +00:00
parent 03016abff7
commit 1a1586d651
7 changed files with 59 additions and 13 deletions

View File

@ -4457,6 +4457,12 @@ v0.33.19 26-Oct-2001
outbound status, nodelist flags etc. Experimental. outbound status, nodelist flags etc. Experimental.
Added code to do outbound calling, experimental. Calling Added code to do outbound calling, experimental. Calling
systems in parallel is now possible. systems in parallel is now possible.
Creates the semafore do_inet if there is an internet node to
call even if there's no internet connection. Removes this
semafore if there are no internet nodes to call. This can be
used by ppp scripts to see if there is work and when there is
no more work to do. Not important for permament connected
systems.
mbmon: mbmon:
Changed the lastcaller screen to display the External Door Changed the lastcaller screen to display the External Door
@ -4464,6 +4470,7 @@ v0.33.19 26-Oct-2001
When lastcaller info is scrolling, the lines are first proper When lastcaller info is scrolling, the lines are first proper
erased. erased.
Fixes for Sparc systems. Fixes for Sparc systems.
Added support for display do_inet semafore in menu 2.
mbmsg: mbmsg:
Corrected header in logfile for pack function. Corrected header in logfile for pack function.

View File

@ -1,4 +1,5 @@
<HTML> <HTML>
<!-- $Id$ -->
<HEAD> <HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO 8859-1"> <META http-equiv="Content-Type" content="text/html; charset=ISO 8859-1">
<META http-equiv="Content-Style-Type" content="text/css"> <META http-equiv="Content-Style-Type" content="text/css">
@ -11,7 +12,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 27-jul-2001</h5> <h5>Last update 02-Feb-2002</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<H1>Semafore files with MBSE BBS.</H1> <H1>Semafore files with MBSE BBS.</H1>
@ -19,7 +20,7 @@
The directory $MBSE_ROOT/sema is the hardcoded semafore directory where all The directory $MBSE_ROOT/sema is the hardcoded semafore directory where all
semafore's must be created, tested and removed. When the system is booting, semafore's must be created, tested and removed. When the system is booting,
the init script will erase all semafore's just before the BBS is started. the init script will erase all semafore's just before the BBS is started.
This description is valid from MBSE BBS v0.33.18 and newer. This description is valid from MBSE BBS v0.33.19 and newer.
<PRE> <PRE>
zmh Purpose: to mark the state of Zone Mail Hour. zmh Purpose: to mark the state of Zone Mail Hour.
@ -52,11 +53,16 @@ scanout Purpose: Signal that the outbound must be rescanned.
Checked by mbtask to check the outbound. Checked by mbtask to check the outbound.
Removed by mbtask as soon as it is detected. Removed by mbtask as soon as it is detected.
do_inet Purpose: Signal that there are node(s) to be called via the
internet. Usefull for dialup systems to check whether a
connection to the internet is needed.
Created and removed by mbtask.
mbtask.last Purpose: A timestamp created and touched by "mbtask" every mbtask.last Purpose: A timestamp created and touched by "mbtask" every
minute so you can check it is running. minute so you can check it is running.
</PRE> </PRE>
<A HREF="index.htm"><IMG SRC="../images/b_arrow.gif" ALT="Back" Border="0" width="33" height="35"> Go Back</A> <A HREF="index.htm"><IMG SRC="../images/b_arrow.gif" ALT="Back" Border="0">Go Back</A>
</BLOCKQUOTE> </BLOCKQUOTE>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -1,4 +1,5 @@
<HTML> <HTML>
<!-- $Id$ -->
<HEAD> <HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO 8859-1"> <META http-equiv="Content-Type" content="text/html; charset=ISO 8859-1">
<META http-equiv="Content-Style-Type" content="text/css"> <META http-equiv="Content-Style-Type" content="text/css">
@ -11,7 +12,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 29-Dec-2001</h5> <h5>Last update 02-Feb-2002</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<H1>mbtask - MBSE BBS Taskmanager</H1> <H1>mbtask - MBSE BBS Taskmanager</H1>
@ -259,9 +260,9 @@ Command: GVER:0; Give server version.
Reply: 100:1,Version ....; Version reply. Reply: 100:1,Version ....; Version reply.
Command: GSTA:0; Get complete mbsed status record. (13 fields) Command: GSTA:0; Get complete mbsed status record. (13 fields)
Reply: 100:19,start,laststart,daily,startups,clients,tot_clients,tot_peak,syntax_errs, Reply: 100:20,start,laststart,daily,startups,clients,tot_clients,tot_peak,syntax_errs,
com_errs,today_clients,today_peak,today_syntax,today_comerr,bbsopen, com_errs,today_clients,today_peak,today_syntax,today_comerr,bbsopen,
is_zmh,processing,system_load,sequence; is_zmh,do_inet,processing,system_load,sequence;
Command: GMON:1,n; Get registration info line, 1=First, 0=Next line. Command: GMON:1,n; Get registration info line, 1=First, 0=Next line.
Reply: 100:7,pid,tty,user,program,city,isdoing,starttime; Reply: 100:7,pid,tty,user,program,city,isdoing,starttime;

View File

@ -240,9 +240,10 @@ void system_stat(void)
mvprintw( 9, 6, "Total server starts"); mvprintw( 9, 6, "Total server starts");
mvprintw( 9,62, "Internet"); mvprintw( 9,62, "Internet");
mvprintw(10, 6, "Connected clients"); mvprintw(10, 6, "Connected clients");
mvprintw(10,62, "Running"); mvprintw(10,62, "Need inet");
mvprintw(11,62, "Load avg"); mvprintw(11,62, "Running");
mvprintw(12,30, "Total Today"); mvprintw(12,30, "Total Today");
mvprintw(12,62, "Load avg");
hor_lin(13,30,8); hor_lin(13,30,8);
hor_lin(13,45,8); hor_lin(13,45,8);
mvprintw(14, 6, "Client connects"); mvprintw(14, 6, "Client connects");
@ -280,7 +281,8 @@ void system_stat(void)
mvprintw(8,72, "%s", atoi(strtok(NULL, ",")) == 1?"Yes":"No "); mvprintw(8,72, "%s", atoi(strtok(NULL, ",")) == 1?"Yes":"No ");
mvprintw(9,72, "%s", atoi(strtok(NULL, ",")) == 1?"Yes":"No "); mvprintw(9,72, "%s", atoi(strtok(NULL, ",")) == 1?"Yes":"No ");
mvprintw(10,72,"%s", atoi(strtok(NULL, ",")) == 1?"Yes":"No "); mvprintw(10,72,"%s", atoi(strtok(NULL, ",")) == 1?"Yes":"No ");
mvprintw(11,72, "%s ", strtok(NULL, ",")); mvprintw(11,72,"%s", atoi(strtok(NULL, ",")) == 1?"Yes":"No ");
mvprintw(12,72, "%s ", strtok(NULL, ","));
mvprintw(19,30, (char *)"%s", strtok(NULL, ";")); mvprintw(19,30, (char *)"%s", strtok(NULL, ";"));
} }

View File

@ -100,6 +100,7 @@ extern int s_index; /* Compile nl semafore */
extern int s_newnews; /* New news semafore */ extern int s_newnews; /* New news semafore */
extern int s_reqindex; /* Create req index sem */ extern int s_reqindex; /* Create req index sem */
extern int s_msglink; /* Messages link sem */ extern int s_msglink; /* Messages link sem */
extern int s_do_inet; /* Internet wanted */
int pingstate = P_INIT; /* Ping state */ int pingstate = P_INIT; /* Ping state */
int pingnr = 1; /* Ping #, 1 or 2 */ int pingnr = 1; /* Ping #, 1 or 2 */
int pingresult[2]; /* Ping results */ int pingresult[2]; /* Ping results */
@ -533,6 +534,17 @@ int check_calllist(void)
sem_set((char *)"scanout", FALSE); sem_set((char *)"scanout", FALSE);
} }
/*
* Check if we need to remove the do_inet semafore
*/
if (!inet_calls && s_do_inet) {
tasklog('c', "Removing do_inet semafore");
s_do_inet = FALSE;
if (IsSema((char *)"do_inet")) {
RemoveSema((char *)"do_inet");
}
}
call_work = 0; call_work = 0;
for (i = 0; i < MAXTASKS; i++) { for (i = 0; i < MAXTASKS; i++) {
if (calllist[i].addr.zone) { if (calllist[i].addr.zone) {

View File

@ -50,6 +50,7 @@ int isdn_calls; /* ISDN calls to make */
int pots_calls; /* POTS calls to make */ int pots_calls; /* POTS calls to make */
pp_list *pl = NULL; /* Portlist */ pp_list *pl = NULL; /* Portlist */
_alist_l *alist = NULL; /* Nodes to call list */ _alist_l *alist = NULL; /* Nodes to call list */
extern int s_do_inet; /* Internet wanted */
@ -242,10 +243,22 @@ int outstat()
* If the node has internet and we have internet available, check if we can send * If the node has internet and we have internet available, check if we can send
* immediatly. * immediatly.
*/ */
if (internet && TCFG.max_tcp && if (TCFG.max_tcp &&
(((tmp->flavors) & F_IMM) || ((tmp->flavors) & F_CRASH) || ((tmp->flavors) & F_NORMAL)) && (((tmp->flavors) & F_IMM) || ((tmp->flavors) & F_CRASH) || ((tmp->flavors) & F_NORMAL)) &&
((tmp->ipflags & IP_IBN) || (tmp->ipflags & IP_IFC) || (tmp->ipflags & IP_ITN))) { ((tmp->ipflags & IP_IBN) || (tmp->ipflags & IP_IFC) || (tmp->ipflags & IP_ITN))) {
/*
* If connection available, set callflag
*/
if (internet)
tmp->flavors |= F_CALL; tmp->flavors |= F_CALL;
/*
* Always set semafore do_inet
*/
if (!s_do_inet) {
CreateSema((char *)"do_inet");
s_do_inet = TRUE;
tasklog('c', "Created semafore do_inet");
}
} }
if ((tmp->flavors) & F_IMM ) { if ((tmp->flavors) & F_IMM ) {
flstr[0]='I'; flstr[0]='I';

View File

@ -48,6 +48,7 @@ int s_index = FALSE;
int s_msglink = FALSE; int s_msglink = FALSE;
int s_newnews = FALSE; int s_newnews = FALSE;
int s_bbsopen = FALSE; int s_bbsopen = FALSE;
int s_do_inet = FALSE;
extern int UPSalarm; extern int UPSalarm;
extern int ptimer; extern int ptimer;
@ -287,14 +288,14 @@ char *stat_status()
static char buf[160]; static char buf[160];
buf[0] = '\0'; buf[0] = '\0';
sprintf(buf, "100:19,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%d,%d,%d,%d,%2.2f,%lu;", sprintf(buf, "100:20,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%d,%d,%d,%d,%d,%2.2f,%lu;",
status.start, status.laststart, status.daily, status.start, status.laststart, status.daily,
status.startups, status.clients, status.startups, status.clients,
status.total.tot_clt, status.total.peak_clt, status.total.tot_clt, status.total.peak_clt,
status.total.s_error, status.total.c_error, status.total.s_error, status.total.c_error,
status.today.tot_clt, status.today.peak_clt, status.today.tot_clt, status.today.peak_clt,
status.today.s_error, status.today.c_error, status.today.s_error, status.today.c_error,
status.open, get_zmh(), internet, Processing, Load, status.sequence); status.open, get_zmh(), internet, s_do_inet, Processing, Load, status.sequence);
return buf; return buf;
} }
@ -351,6 +352,8 @@ int sem_set(char *sem, int value)
s_msglink = value; s_msglink = value;
} else if (!strcmp(sem, "reqindex")) { } else if (!strcmp(sem, "reqindex")) {
s_reqindex = value; s_reqindex = value;
} else if (!strcmp(sem, "do_inet")) {
s_do_inet = value;
} else { } else {
return FALSE; return FALSE;
} }
@ -387,6 +390,8 @@ char *sem_status(char *data)
value = s_reqindex; value = s_reqindex;
} else if (!strcmp(sem, "upsalarm")) { } else if (!strcmp(sem, "upsalarm")) {
value = UPSalarm; value = UPSalarm;
} else if (!strcmp(sem, "do_inet")) {
value = s_do_inet;
} else { } else {
tasklog('s', "sem_status(%s) buf=%s", sem, buf); tasklog('s', "sem_status(%s) buf=%s", sem, buf);
return buf; return buf;