Added support for the do_inet semafore
This commit is contained in:
parent
03016abff7
commit
1a1586d651
@ -4457,6 +4457,12 @@ v0.33.19 26-Oct-2001
|
||||
outbound status, nodelist flags etc. Experimental.
|
||||
Added code to do outbound calling, experimental. Calling
|
||||
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:
|
||||
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
|
||||
erased.
|
||||
Fixes for Sparc systems.
|
||||
Added support for display do_inet semafore in menu 2.
|
||||
|
||||
mbmsg:
|
||||
Corrected header in logfile for pack function.
|
||||
|
@ -1,4 +1,5 @@
|
||||
<HTML>
|
||||
<!-- $Id$ -->
|
||||
<HEAD>
|
||||
<META http-equiv="Content-Type" content="text/html; charset=ISO 8859-1">
|
||||
<META http-equiv="Content-Style-Type" content="text/css">
|
||||
@ -11,7 +12,7 @@
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<BLOCKQUOTE>
|
||||
<h5>Last update 27-jul-2001</h5>
|
||||
<h5>Last update 02-Feb-2002</h5>
|
||||
<P> <P>
|
||||
|
||||
<H1>Semafore files with MBSE BBS.</H1>
|
||||
@ -19,7 +20,7 @@
|
||||
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,
|
||||
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>
|
||||
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.
|
||||
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
|
||||
minute so you can check it is running.
|
||||
</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>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<HTML>
|
||||
<!-- $Id$ -->
|
||||
<HEAD>
|
||||
<META http-equiv="Content-Type" content="text/html; charset=ISO 8859-1">
|
||||
<META http-equiv="Content-Style-Type" content="text/css">
|
||||
@ -11,7 +12,7 @@
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<BLOCKQUOTE>
|
||||
<h5>Last update 29-Dec-2001</h5>
|
||||
<h5>Last update 02-Feb-2002</h5>
|
||||
<P> <P>
|
||||
|
||||
<H1>mbtask - MBSE BBS Taskmanager</H1>
|
||||
@ -259,9 +260,9 @@ Command: GVER:0; Give server version.
|
||||
Reply: 100:1,Version ....; Version reply.
|
||||
|
||||
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,
|
||||
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.
|
||||
Reply: 100:7,pid,tty,user,program,city,isdoing,starttime;
|
||||
|
@ -240,9 +240,10 @@ void system_stat(void)
|
||||
mvprintw( 9, 6, "Total server starts");
|
||||
mvprintw( 9,62, "Internet");
|
||||
mvprintw(10, 6, "Connected clients");
|
||||
mvprintw(10,62, "Running");
|
||||
mvprintw(11,62, "Load avg");
|
||||
mvprintw(10,62, "Need inet");
|
||||
mvprintw(11,62, "Running");
|
||||
mvprintw(12,30, "Total Today");
|
||||
mvprintw(12,62, "Load avg");
|
||||
hor_lin(13,30,8);
|
||||
hor_lin(13,45,8);
|
||||
mvprintw(14, 6, "Client connects");
|
||||
@ -280,7 +281,8 @@ void system_stat(void)
|
||||
mvprintw(8,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(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, ";"));
|
||||
}
|
||||
|
||||
|
@ -100,6 +100,7 @@ extern int s_index; /* Compile nl semafore */
|
||||
extern int s_newnews; /* New news semafore */
|
||||
extern int s_reqindex; /* Create req index sem */
|
||||
extern int s_msglink; /* Messages link sem */
|
||||
extern int s_do_inet; /* Internet wanted */
|
||||
int pingstate = P_INIT; /* Ping state */
|
||||
int pingnr = 1; /* Ping #, 1 or 2 */
|
||||
int pingresult[2]; /* Ping results */
|
||||
@ -533,6 +534,17 @@ int check_calllist(void)
|
||||
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;
|
||||
for (i = 0; i < MAXTASKS; i++) {
|
||||
if (calllist[i].addr.zone) {
|
||||
|
@ -50,6 +50,7 @@ int isdn_calls; /* ISDN calls to make */
|
||||
int pots_calls; /* POTS calls to make */
|
||||
pp_list *pl = NULL; /* Portlist */
|
||||
_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
|
||||
* immediatly.
|
||||
*/
|
||||
if (internet && TCFG.max_tcp &&
|
||||
if (TCFG.max_tcp &&
|
||||
(((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->flavors |= F_CALL;
|
||||
/*
|
||||
* If connection available, set callflag
|
||||
*/
|
||||
if (internet)
|
||||
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 ) {
|
||||
flstr[0]='I';
|
||||
|
@ -48,6 +48,7 @@ int s_index = FALSE;
|
||||
int s_msglink = FALSE;
|
||||
int s_newnews = FALSE;
|
||||
int s_bbsopen = FALSE;
|
||||
int s_do_inet = FALSE;
|
||||
extern int UPSalarm;
|
||||
extern int ptimer;
|
||||
|
||||
@ -287,14 +288,14 @@ char *stat_status()
|
||||
static char buf[160];
|
||||
|
||||
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.startups, status.clients,
|
||||
status.total.tot_clt, status.total.peak_clt,
|
||||
status.total.s_error, status.total.c_error,
|
||||
status.today.tot_clt, status.today.peak_clt,
|
||||
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;
|
||||
}
|
||||
|
||||
@ -351,6 +352,8 @@ int sem_set(char *sem, int value)
|
||||
s_msglink = value;
|
||||
} else if (!strcmp(sem, "reqindex")) {
|
||||
s_reqindex = value;
|
||||
} else if (!strcmp(sem, "do_inet")) {
|
||||
s_do_inet = value;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
@ -387,6 +390,8 @@ char *sem_status(char *data)
|
||||
value = s_reqindex;
|
||||
} else if (!strcmp(sem, "upsalarm")) {
|
||||
value = UPSalarm;
|
||||
} else if (!strcmp(sem, "do_inet")) {
|
||||
value = s_do_inet;
|
||||
} else {
|
||||
tasklog('s', "sem_status(%s) buf=%s", sem, buf);
|
||||
return buf;
|
||||
|
Reference in New Issue
Block a user