Added experimental support for the ICM flag (FSP-1033)

This commit is contained in:
Michiel Broek 2004-06-18 19:54:13 +00:00
parent 2fc80ab754
commit 1d93090e5a
11 changed files with 60 additions and 75 deletions

View File

@ -1,5 +1,13 @@
$Id$ $Id$
WARNING!!!!!
This is a testversion for the ICM flag (FSP-1033). This flag
is not yet accepted. It is also possible that certain nodes
are not called anymore!! Please report if so, but only Fidonet
nodes, or if from other nets, show me the nodelist entry too.
v0.61.0 06-Jun-2004. v0.61.0 06-Jun-2004.
@ -33,6 +41,8 @@ v0.61.0 06-Jun-2004.
mbsetup: mbsetup:
In mail and files group edit screens, to make an area active In mail and files group edit screens, to make an area active
existing connections check is skipped. existing connections check is skipped.
If a node record is deleted, the outbox and directory paths
are removed as well if they are empty.
v0.60.0 09-Feb-2004 - 04-Jun-2004 v0.60.0 09-Feb-2004 - 04-Jun-2004

View File

@ -1091,13 +1091,20 @@ node *getnlent(faddr *addr)
if (addr->domain == NULL) if (addr->domain == NULL)
addr->domain = xstrcpy(nodebuf.addr.domain); addr->domain = xstrcpy(nodebuf.addr.domain);
nodebuf.can_pots = (nodebuf.mflags || nodebuf.dflags) ? TRUE : FALSE;
nodebuf.can_ip = (nodebuf.iflags) ? TRUE : FALSE;
nodebuf.is_cm = (nodebuf.oflags & 0x00000001) ? TRUE : FALSE;
nodebuf.is_icm = (nodebuf.oflags & 0x00000002) ? TRUE : FALSE;
Syslog('n', "getnlent: system %s, %s", nodebuf.name, nodebuf.location); Syslog('n', "getnlent: system %s, %s", nodebuf.name, nodebuf.location);
Syslog('n', "getnlent: sysop %s, %s", nodebuf.sysop, nodebuf.phone); Syslog('n', "getnlent: sysop %s, %s", nodebuf.sysop, nodebuf.phone);
Syslog('n', "getnlent: URL %s", printable(nodebuf.url, 0)); Syslog('n', "getnlent: URL %s", printable(nodebuf.url, 0));
Syslog('n', "getnlent: online POTS %s CM %s, IP %s ICM %s", nodebuf.can_pots ?"Yes":"No",
nodebuf.is_cm ?"Yes":"No", nodebuf.can_ip ?"Yes":"No", nodebuf.is_icm ?"Yes":"No");
// moflags(nodebuf.mflags); // moflags(nodebuf.mflags);
// diflags(nodebuf.dflags); // diflags(nodebuf.dflags);
// ipflags(nodebuf.iflags); // ipflags(nodebuf.iflags);
olflags(nodebuf.oflags); // olflags(nodebuf.oflags);
// rqflags(nodebuf.xflags); // rqflags(nodebuf.xflags);
free(mydomain); free(mydomain);
@ -1225,25 +1232,3 @@ void ipflags(unsigned long flags)
} }
unsigned long getCMmask(void)
{
nodelist_flag **tmpm;
static unsigned long mask = 0L;
for (tmpm = &nl_online; *tmpm; tmpm=&((*tmpm)->next)) {
if (strcmp("CM", (*tmpm)->name) == 0) {
mask |= (*tmpm)->value;
}
if (strcmp("ICM", (*tmpm)->name) == 0) {
mask |= (*tmpm)->value;
}
}
if (mask)
return mask;
WriteError("CM and ICM mask not found in %s/etc/nodelist.conf", getenv("MBSE_ROOT"));
return 0;
}

View File

@ -44,13 +44,13 @@
# Online special flags. # Online special flags. CM and ICM must be the first two!
# #
online CM 0x00000001 online CM 0x00000001
online MO 0x00000002 online ICM 0x00000002
online LO 0x00000004 online MO 0x00000004
online MN 0x00000008 online LO 0x00000008
online ICM 0x00000010 online MN 0x00000010
# Request flags, masks: # Request flags, masks:

View File

@ -34,6 +34,10 @@ typedef struct _node {
int t1; /* T flag, first char */ int t1; /* T flag, first char */
int t2; /* T flag, second char */ int t2; /* T flag, second char */
char *url; /* URL for connection */ char *url; /* URL for connection */
unsigned is_cm : 1; /* Node is CM */
unsigned is_icm : 1; /* Node is ICM */
unsigned can_pots : 1; /* Can do POTS or ISDN */
unsigned can_ip : 1; /* Can do TCP/IP */
} node; } node;
@ -122,7 +126,6 @@ void rqflags(unsigned long);
void moflags(unsigned long); void moflags(unsigned long);
void diflags(unsigned long); void diflags(unsigned long);
void ipflags(unsigned long); void ipflags(unsigned long);
unsigned long getCMmask(void);
#endif #endif

View File

@ -102,7 +102,6 @@ int call(faddr *addr)
{ {
int rc = 1; int rc = 1;
char *p, temp[81]; char *p, temp[81];
unsigned long cmmask;
/* /*
* First check if node is locked, if not lock it immediatly * First check if node is locked, if not lock it immediatly
@ -136,7 +135,6 @@ int call(faddr *addr)
*/ */
noderecord(addr); noderecord(addr);
rdoptions(TRUE); rdoptions(TRUE);
cmmask = getCMmask();
/* /*
* Fill default history info in case we get a FTS0001 session * Fill default history info in case we get a FTS0001 session
@ -205,7 +203,8 @@ int call(faddr *addr)
} }
} }
if (((nlent->oflags & cmmask) == 0) && (!IsZMH())) { if (((nlent->can_pots && nlent->is_cm) == FALSE) && ((nlent->can_ip && nlent->is_icm) == FALSE) && (!IsZMH())) {
// if (((nlent->oflags & cmmask) == 0) && (!IsZMH())) {
Syslog('?', "Warning: calling non-CM system outside ZMH"); Syslog('?', "Warning: calling non-CM system outside ZMH");
} }

View File

@ -171,7 +171,6 @@ int main(int argc, char *argv[])
faddr *addr = NULL; faddr *addr = NULL;
node *nlent; node *nlent;
FILE *fl; FILE *fl;
unsigned long cmmask;
most_debug = TRUE; most_debug = TRUE;
@ -316,14 +315,14 @@ int main(int argc, char *argv[])
free(nlent->url); free(nlent->url);
nlent->url = NULL; nlent->url = NULL;
cmmask = getCMmask();
if (nlent->pflag == NL_DUMMY) if (nlent->pflag == NL_DUMMY)
Fatal((char *)"Node is not in nodelist", MBERR_NODE_NOT_IN_LIST); Fatal((char *)"Node is not in nodelist", MBERR_NODE_NOT_IN_LIST);
if (nlent->pflag == NL_DOWN) if (nlent->pflag == NL_DOWN)
Fatal((char *)"Node has status Down", MBERR_NODE_MAY_NOT_CALL); Fatal((char *)"Node has status Down", MBERR_NODE_MAY_NOT_CALL);
if (nlent->pflag == NL_HOLD) if (nlent->pflag == NL_HOLD)
Fatal((char *)"Node has status Hold", MBERR_NODE_MAY_NOT_CALL); Fatal((char *)"Node has status Hold", MBERR_NODE_MAY_NOT_CALL);
if (((nlent->oflags & cmmask) == 0) && (flavor == 'c')) if (((nlent->can_pots && nlent->is_cm) == FALSE) && ((nlent->can_ip && nlent->is_icm) == FALSE) && (flavor == 'c'))
// if (((nlent->oflags & cmmask) == 0) && (flavor == 'c'))
Fatal((char *)"Node is not CM, must use Immediate, Normal or Hold flavor", MBERR_NODE_MAY_NOT_CALL); Fatal((char *)"Node is not CM, must use Immediate, Normal or Hold flavor", MBERR_NODE_MAY_NOT_CALL);
if (argv[4][0] == '-') if (argv[4][0] == '-')

View File

@ -457,7 +457,6 @@ int pollnode(faddr *addr, int stop)
{ {
char *pol; char *pol;
int rc = 0; int rc = 0;
unsigned long cmmask;
FILE *fp; FILE *fp;
callstat *cst; callstat *cst;
node *nlent; node *nlent;
@ -511,9 +510,8 @@ int pollnode(faddr *addr, int stop)
rc = MBERR_CANNOT_MAKE_POLL; rc = MBERR_CANNOT_MAKE_POLL;
} else { } else {
fclose(fp); fclose(fp);
cmmask = getCMmask(); if (((nlent->can_pots && nlent->is_cm) == FALSE) && ((nlent->can_ip && nlent->is_icm) == FALSE) && (!IsZMH())) {
Syslog('s', "oflags %08x (i)cmmask %08x", nlent->oflags, cmmask); // if (((nlent->oflags & cmmask) == 0) && (!IsZMH())) {
if (((nlent->oflags & cmmask) == 0) && (!IsZMH())) {
Syslog('+', "Created poll for %s, non-CM node outside ZMH", ascfnode(addr, 0x1f)); Syslog('+', "Created poll for %s, non-CM node outside ZMH", ascfnode(addr, 0x1f));
if (!do_quiet) if (!do_quiet)
printf("Created poll for %s, non-CM node outside ZMH\n", ascfnode(addr, 0x1f)); printf("Created poll for %s, non-CM node outside ZMH\n", ascfnode(addr, 0x1f));

View File

@ -187,7 +187,6 @@ int Crash_Option(faddr *Dest)
node *Nlent; node *Nlent;
int rc = 0; int rc = 0;
unsigned short point; unsigned short point;
unsigned long cmmask;
if (exitinfo.Security.level < CFG.iCrashLevel) if (exitinfo.Security.level < CFG.iCrashLevel)
return 0; return 0;
@ -196,8 +195,7 @@ int Crash_Option(faddr *Dest)
Dest->point = 0; Dest->point = 0;
if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) { if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) {
cmmask = getCMmask(); if ((Nlent->can_pots && Nlent->is_cm) || (Nlent->can_ip && Nlent->is_icm)) {
if (Nlent->oflags & cmmask) {
/* Crash [y/N]: */ /* Crash [y/N]: */
pout(CYAN, BLACK, (char *)Language(461)); pout(CYAN, BLACK, (char *)Language(461));
colour(CFG.MsgInputColourF, CFG.MsgInputColourB); colour(CFG.MsgInputColourF, CFG.MsgInputColourB);

View File

@ -229,6 +229,14 @@ void CloseNoderec(int Force)
while (fread(&nodes, nodeshdr.recsize, 1, fi) == 1) { while (fread(&nodes, nodeshdr.recsize, 1, fi) == 1) {
if (!nodes.Deleted) if (!nodes.Deleted)
fill_stlist(&nod, nodes.Sysop, ftell(fi) - nodeshdr.recsize); fill_stlist(&nod, nodes.Sysop, ftell(fi) - nodeshdr.recsize);
else {
/*
* Remove obsolete paths
*/
unlink(nodes.Dir_out_path);
unlink(nodes.Dir_in_path);
unlink(nodes.OutBox);
}
fseek(fi, nodeshdr.filegrp + nodeshdr.mailgrp, SEEK_CUR); fseek(fi, nodeshdr.filegrp + nodeshdr.mailgrp, SEEK_CUR);
} }
sort_stlist(&nod); sort_stlist(&nod);

View File

@ -265,11 +265,9 @@ int outstat()
DIR *dp = NULL; DIR *dp = NULL;
struct dirent *de; struct dirent *de;
struct stat sb; struct stat sb;
unsigned long cmmask, ibnmask = 0, ifcmask = 0, itnmask = 0; unsigned long ibnmask = 0, ifcmask = 0, itnmask = 0;
nodelist_modem **tmpm; nodelist_modem **tmpm;
nodelist_flag **tmpf;
cmmask = getCMmask();
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) { for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) {
if (strcmp((*tmpm)->name, "IBN") == 0) if (strcmp((*tmpm)->name, "IBN") == 0)
ibnmask = (*tmpm)->mask; ibnmask = (*tmpm)->mask;
@ -534,7 +532,7 @@ int outstat()
* If the node has internet and we have internet configured, * If the node has internet and we have internet configured,
* check if we can send immediatly. Works for CM and ICM. * check if we can send immediatly. Works for CM and ICM.
*/ */
if (TCFG.max_tcp && (tmp->olflags & cmmask) && if (TCFG.max_tcp && ((tmp->can_ip && tmp->is_icm) || (!tmp->can_pots && tmp->can_ip && tmp->is_cm)) &&
(((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 & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) { ((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) {
tmp->flavors |= F_CALL; tmp->flavors |= F_CALL;
@ -548,25 +546,13 @@ int outstat()
/* /*
* Immediate mail, send if node is CM or is in a Txx window or is in ZMH. * Immediate mail, send if node is CM or is in a Txx window or is in ZMH.
*/ */
cmmask = 0L; if (tmp->is_cm || T_window || iszmh) {
for (tmpf = &nl_online; *tmpf; tmpf=&((*tmpf)->next)) {
if (strcmp("CM", (*tmpf)->name) == 0) {
cmmask = (*tmpf)->value;
}
}
if ((tmp->olflags & cmmask) || T_window || iszmh) {
tmp->flavors |= F_CALL; tmp->flavors |= F_CALL;
} }
/* /*
* Now check again for the ICM flag. * Now check again for the ICM flag.
*/ */
cmmask = 0L; if (tmp->is_icm && TCFG.max_tcp &&
for (tmpf = &nl_online; *tmpf; tmpf=&((*tmpf)->next)) {
if (strcmp("ICM", (*tmpf)->name) == 0) {
cmmask = (*tmpf)->value;
}
}
if ((tmp->olflags & cmmask) && TCFG.max_tcp &&
((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) { ((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) {
tmp->flavors |= F_CALL; tmp->flavors |= F_CALL;
} }
@ -577,30 +563,17 @@ int outstat()
/* /*
* Crash mail, send if node is CM or is in a Txx window or is in ZMH. * Crash mail, send if node is CM or is in a Txx window or is in ZMH.
*/ */
cmmask = 0L; if (tmp->is_cm || T_window || iszmh) {
for (tmpf = &nl_online; *tmpf; tmpf=&((*tmpf)->next)) {
if (strcmp("CM", (*tmpf)->name) == 0) {
cmmask = (*tmpf)->value;
}
}
if ((tmp->olflags & cmmask) || T_window || iszmh) {
tmp->flavors |= F_CALL; tmp->flavors |= F_CALL;
} }
/* /*
* Now check again for the ICM flag. * Now check again for the ICM flag.
*/ */
cmmask = 0L; if (tmp->is_icm && TCFG.max_tcp &&
for (tmpf = &nl_online; *tmpf; tmpf=&((*tmpf)->next)) {
if (strcmp("ICM", (*tmpf)->name) == 0) {
cmmask = (*tmpf)->value;
}
}
if ((tmp->olflags & cmmask) && TCFG.max_tcp &&
((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) { ((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) {
tmp->flavors |= F_CALL; tmp->flavors |= F_CALL;
} }
} }
cmmask = getCMmask();
if ((tmp->flavors) & F_NORMAL) if ((tmp->flavors) & F_NORMAL)
flstr[2]='N'; flstr[2]='N';
@ -792,6 +765,10 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
(*tmp)->ipflags = nlent->iflags; (*tmp)->ipflags = nlent->iflags;
(*tmp)->t1 = nlent->t1; (*tmp)->t1 = nlent->t1;
(*tmp)->t2 = nlent->t2; (*tmp)->t2 = nlent->t2;
(*tmp)->can_pots = nlent->can_pots;
(*tmp)->can_ip = nlent->can_ip;
(*tmp)->is_cm = nlent->is_cm;
(*tmp)->is_icm = nlent->is_icm;
} else { } else {
(*tmp)->olflags = 0L; (*tmp)->olflags = 0L;
(*tmp)->moflags = 0L; (*tmp)->moflags = 0L;
@ -799,6 +776,10 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
(*tmp)->ipflags = 0L; (*tmp)->ipflags = 0L;
(*tmp)->t1 = '\0'; (*tmp)->t1 = '\0';
(*tmp)->t2 = '\0'; (*tmp)->t2 = '\0';
(*tmp)->can_pots = FALSE;
(*tmp)->can_ip = FALSE;
(*tmp)->is_cm = FALSE;
(*tmp)->is_icm = FALSE;
} }
(*tmp)->time = time(NULL); (*tmp)->time = time(NULL);
(*tmp)->size = 0L; (*tmp)->size = 0L;

View File

@ -28,6 +28,10 @@ typedef struct _alist
int t1; /* First Txx flag */ int t1; /* First Txx flag */
int t2; /* Second Txx flag */ int t2; /* Second Txx flag */
int callmode; /* Call method */ int callmode; /* Call method */
unsigned can_pots : 1;
unsigned can_ip : 1;
unsigned is_cm : 1;
unsigned is_icm : 1;
} _alist_l; } _alist_l;