Rebuild for configurable nodelists handling
This commit is contained in:
parent
fbe81bfa68
commit
3dfe32df94
18
ChangeLog
18
ChangeLog
@ -1,10 +1,20 @@
|
|||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
|
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
||||||
|
|
||||||
|
Nodelist processing is under construction, it may be possible that you system
|
||||||
|
won't call if you use this version or if it does not accept calls, cannot
|
||||||
|
route mail or breaks your system.
|
||||||
|
|
||||||
|
DO NOT USE THIS VERSION ON PRODUCTION SYSTEMS, ONLY FOR TESTING.
|
||||||
|
|
||||||
v0.37.00 26-Dec-2002.
|
v0.37.00 26-Dec-2002.
|
||||||
|
|
||||||
general:
|
general:
|
||||||
A new developer joined the team, David Gonzalez.
|
A new developer joined the team, David Gonzalez.
|
||||||
|
The settings to suppres some IP protocols (global and nodes)
|
||||||
|
are removed, this behaviour can be set using nodelist flags
|
||||||
|
configuration.
|
||||||
|
|
||||||
libs:
|
libs:
|
||||||
The nodelist lookup functions are now in a separate library.
|
The nodelist lookup functions are now in a separate library.
|
||||||
@ -17,10 +27,18 @@ v0.37.00 26-Dec-2002.
|
|||||||
With binkp and EMSI sessions double received remote aka's are
|
With binkp and EMSI sessions double received remote aka's are
|
||||||
filtered.
|
filtered.
|
||||||
|
|
||||||
|
mbout:
|
||||||
|
When a poll was removed, the outbound was not rescanned.
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
Prepared for more example translations.
|
Prepared for more example translations.
|
||||||
|
Added German template files made by Joachim Kuwan.
|
||||||
|
|
||||||
|
|
||||||
|
mbsetup:
|
||||||
|
Removed global flags No-IBN, IFC and ITN from the setup.
|
||||||
|
Removed nodes flags No-IBN, IFC and ITN from the setup.
|
||||||
|
|
||||||
|
|
||||||
v0.36.00 26-Dec-2002 - stable release
|
v0.36.00 26-Dec-2002 - stable release
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ SRCS = endian.c
|
|||||||
HDRS = endian.h
|
HDRS = endian.h
|
||||||
OBJS = endian.o
|
OBJS = endian.o
|
||||||
OTHER = Makefile header.txt footer.txt menus-le.tar menus-be.tar \
|
OTHER = Makefile header.txt footer.txt menus-le.tar menus-be.tar \
|
||||||
txtfiles-en.tar templates-en.tar templates-es.tar
|
txtfiles-en.tar templates-en.tar templates-es.tar templates-de.tar
|
||||||
|
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
|
|
||||||
@ -36,11 +36,15 @@ install: all
|
|||||||
fi
|
fi
|
||||||
@if [ ! -f ${PREFIX}/english/txtfiles/main.ans ]; then \
|
@if [ ! -f ${PREFIX}/english/txtfiles/main.ans ]; then \
|
||||||
tar xfC txtfiles-en.tar ${PREFIX}/english/txtfiles ; \
|
tar xfC txtfiles-en.tar ${PREFIX}/english/txtfiles ; \
|
||||||
echo "Installed default english txtfiles" ; \
|
echo "Installed default English txtfiles" ; \
|
||||||
fi
|
fi
|
||||||
@if [ ! -f ${PREFIX}/english/macro/html.tic ]; then \
|
@if [ ! -f ${PREFIX}/english/macro/html.tic ]; then \
|
||||||
tar xfC templates-en.tar ${PREFIX}/english/macro ; \
|
tar xfC templates-en.tar ${PREFIX}/english/macro ; \
|
||||||
echo "Installed default english macro files" ; \
|
echo "Installed default English macro files" ; \
|
||||||
|
fi
|
||||||
|
@if [ ! -f ${PREFIX}/german/macro/html.tic ]; then \
|
||||||
|
tar xfC templates-de.tar ${PREFIX}/german/macro ; \
|
||||||
|
echo "Installed default German macro files" ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -179,6 +179,6 @@ smtp.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h mbine
|
|||||||
diesel.o: ../config.h libs.h memwatch.h diesel.h
|
diesel.o: ../config.h libs.h memwatch.h diesel.h
|
||||||
mbdiesel.o: ../config.h libs.h memwatch.h structs.h users.h records.h common.h clcomm.h diesel.h
|
mbdiesel.o: ../config.h libs.h memwatch.h structs.h users.h records.h common.h clcomm.h diesel.h
|
||||||
memwatch.o: ../config.h libs.h memwatch.h
|
memwatch.o: ../config.h libs.h memwatch.h
|
||||||
nodelist.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h nodelist.h
|
nodelist.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h mberrors.h nodelist.h
|
||||||
ftscprod.o: ../config.h libs.h memwatch.h structs.h common.h
|
ftscprod.o: ../config.h libs.h memwatch.h structs.h common.h
|
||||||
# End of generated dependencies
|
# End of generated dependencies
|
||||||
|
802
lib/nodelist.c
802
lib/nodelist.c
@ -36,12 +36,28 @@
|
|||||||
#include "records.h"
|
#include "records.h"
|
||||||
#include "clcomm.h"
|
#include "clcomm.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "mberrors.h"
|
||||||
#include "nodelist.h"
|
#include "nodelist.h"
|
||||||
|
|
||||||
|
|
||||||
#define NULLDOMAIN "nulldomain"
|
#define NULLDOMAIN "nulldomain"
|
||||||
|
|
||||||
|
|
||||||
|
static char *k, *v;
|
||||||
|
static char *nlpath = NULL;
|
||||||
|
static int nlinitdone = FALSE;
|
||||||
|
static int linecnt = 0;
|
||||||
|
static unsigned long mypots = 0, myisdn = 0, mytcpip =0;
|
||||||
|
|
||||||
|
|
||||||
|
static int getkwd(char**);
|
||||||
|
static int getmdm(char**);
|
||||||
|
static int getarr(char**);
|
||||||
|
static int getdom(char**);
|
||||||
|
static int getsrv(char**);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct _pkey pkey[] = {
|
struct _pkey pkey[] = {
|
||||||
{(char *)"Down", NL_NODE, NL_DOWN},
|
{(char *)"Down", NL_NODE, NL_DOWN},
|
||||||
{(char *)"Hold", NL_NODE, NL_HOLD},
|
{(char *)"Hold", NL_NODE, NL_HOLD},
|
||||||
@ -54,105 +70,476 @@ struct _pkey pkey[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
struct _okey okey[] = {
|
* Table to parse the ~/etc/nodelist.conf file
|
||||||
{(char *)"CM", OL_CM},
|
*/
|
||||||
{(char *)"MO", OL_MO},
|
static struct _keytab {
|
||||||
{(char *)"LO", OL_LO},
|
char *key;
|
||||||
{(char *)"MN", OL_MN},
|
int (*prc)(char **);
|
||||||
{NULL, 0}
|
char** dest;
|
||||||
};
|
} keytab[] = {
|
||||||
|
{(char *)"online", getkwd, (char **)&nl_online},
|
||||||
struct _fkey fkey[] = {
|
{(char *)"request", getkwd, (char **)&nl_request},
|
||||||
{(char *)"V22", NL_V22},
|
{(char *)"reqbits", getkwd, (char **)&nl_reqbits},
|
||||||
{(char *)"V29", NL_V29},
|
{(char *)"pots", getmdm, (char **)&nl_pots},
|
||||||
{(char *)"V32", NL_V32},
|
{(char *)"isdn", getmdm, (char **)&nl_isdn},
|
||||||
{(char *)"V32B",NL_V32B | NL_V32},
|
{(char *)"tcpip", getmdm, (char **)&nl_tcpip},
|
||||||
{(char *)"V34", NL_V34},
|
{(char *)"search", getarr, (char **)&nl_search},
|
||||||
{(char *)"V42", NL_V42 | NL_MNP},
|
{(char *)"dialer", getarr, (char **)&nl_dialer},
|
||||||
{(char *)"V42B",NL_V42B | NL_V42 | NL_MNP},
|
{(char *)"domsuffix", getdom, (char **)&nl_domsuffix},
|
||||||
{(char *)"MNP", NL_MNP},
|
{(char *)"service", getsrv, (char **)&nl_service},
|
||||||
{(char *)"H96", NL_H96},
|
{NULL, NULL, NULL}
|
||||||
{(char *)"HST", NL_HST | NL_MNP},
|
|
||||||
{(char *)"H14", NL_H14 | NL_HST | NL_MNP},
|
|
||||||
{(char *)"H16", NL_H16 | NL_H14 | NL_HST | NL_MNP | NL_V42 | NL_V42B},
|
|
||||||
{(char *)"MAX", NL_MAX},
|
|
||||||
{(char *)"PEP", NL_PEP},
|
|
||||||
{(char *)"CSP", NL_CSP},
|
|
||||||
{(char *)"V32T",NL_V32T | NL_V32B | NL_V32},
|
|
||||||
{(char *)"VFC", NL_VFC},
|
|
||||||
{(char *)"ZYX", NL_ZYX | NL_V32B | NL_V32 | NL_V42B | NL_V42 | NL_MNP},
|
|
||||||
{(char *)"X2C", NL_X2C | NL_X2S | NL_V34},
|
|
||||||
{(char *)"X2S", NL_X2S | NL_V34},
|
|
||||||
{(char *)"V90C",NL_V90C | NL_V90S | NL_V34},
|
|
||||||
{(char *)"V90S",NL_V90S | NL_V34},
|
|
||||||
{(char *)"Z19", NL_Z19 | NL_V32B | NL_V32 | NL_V42B | NL_V42 | NL_MNP | NL_ZYX},
|
|
||||||
{NULL, 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _xkey xkey [] = {
|
|
||||||
{(char *)"XA", RQ_XA},
|
|
||||||
{(char *)"XB", RQ_XB},
|
|
||||||
{(char *)"XC", RQ_XC},
|
|
||||||
{(char *)"XP", RQ_XP},
|
|
||||||
{(char *)"XR", RQ_XR},
|
|
||||||
{(char *)"XW", RQ_XW},
|
|
||||||
{(char *)"XX", RQ_XX},
|
|
||||||
{NULL, 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _dkey dkey [] = {
|
|
||||||
{(char *)"V110L", ND_V110L},
|
|
||||||
{(char *)"V110H", ND_V110H},
|
|
||||||
{(char *)"V120L", ND_V120L},
|
|
||||||
{(char *)"V120H", ND_V120H},
|
|
||||||
{(char *)"X75", ND_X75},
|
|
||||||
{NULL, 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _ikey ikey [] = {
|
|
||||||
{(char *)"IBN", IP_IBN},
|
|
||||||
{(char *)"IFC", IP_IFC},
|
|
||||||
{(char *)"ITN", IP_ITN},
|
|
||||||
{(char *)"IVM", IP_IVM},
|
|
||||||
{(char *)"IP", IP_IP},
|
|
||||||
{(char *)"IFT", IP_IFT},
|
|
||||||
{NULL, 0}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a keyword, string, unsigned long
|
||||||
|
*/
|
||||||
|
static int getkwd(char **dest)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
unsigned long tmp;
|
||||||
|
nodelist_flag **tmpm;
|
||||||
|
|
||||||
|
for (p = v; *p && !isspace(*p); p++);
|
||||||
|
if (*p)
|
||||||
|
*p++ = '\0';
|
||||||
|
while (*p && isspace(*p))
|
||||||
|
p++;
|
||||||
|
if (*p == '\0') {
|
||||||
|
WriteError("%s(%s): less then two tokens", nlpath, linecnt);
|
||||||
|
return MBERR_INIT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (tmpm = (nodelist_flag**)dest; *tmpm; tmpm=&((*tmpm)->next));
|
||||||
|
(*tmpm) = (nodelist_flag *) xmalloc(sizeof(nodelist_flag));
|
||||||
|
(*tmpm)->next = NULL;
|
||||||
|
(*tmpm)->name = xstrcpy(v);
|
||||||
|
tmp = strtoul(p, NULL, 0);
|
||||||
|
(*tmpm)->value = tmp;
|
||||||
|
// Syslog('s', "getkwd: %s(%d): \"%s\" \"%s\" \"%08x\"", nlpath, linecnt, MBSE_SS(k), (*tmpm)->name, (*tmpm)->value);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a keyword, string, unsigned long, unsigned long
|
||||||
|
*/
|
||||||
|
static int getmdm(char **dest)
|
||||||
|
{
|
||||||
|
char *p, *q;
|
||||||
|
unsigned long tmp1, tmp2;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
|
for (p = v; *p && !isspace(*p); p++);
|
||||||
|
if (*p)
|
||||||
|
*p++ = '\0';
|
||||||
|
while (*p && isspace(*p))
|
||||||
|
p++;
|
||||||
|
if (*p == '\0') {
|
||||||
|
WriteError("%s(%s): less then two tokens", nlpath, linecnt);
|
||||||
|
return MBERR_INIT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (q = p; *q && !isspace(*q); q++);
|
||||||
|
if (*q)
|
||||||
|
*q++ = '\0';
|
||||||
|
while (*q && isspace(*q))
|
||||||
|
q++;
|
||||||
|
if (*q == '\0') {
|
||||||
|
WriteError("%s(%s): less then three tokens", nlpath, linecnt);
|
||||||
|
return MBERR_INIT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (tmpm = (nodelist_modem**)dest; *tmpm; tmpm=&((*tmpm)->next));
|
||||||
|
(*tmpm) = (nodelist_modem *) xmalloc(sizeof(nodelist_modem));
|
||||||
|
(*tmpm)->next = NULL;
|
||||||
|
(*tmpm)->name = xstrcpy(v);
|
||||||
|
tmp1 = strtoul(p, NULL, 0);
|
||||||
|
tmp2 = strtoul(q, NULL, 0);
|
||||||
|
(*tmpm)->mask = tmp1;
|
||||||
|
(*tmpm)->value = tmp2;
|
||||||
|
// Syslog('s', "getmdm: %s(%d): \"%s\" \"%s\" \"%08x\" \"%08x\"", nlpath, linecnt, MBSE_SS(k),
|
||||||
|
// (*tmpm)->name, (*tmpm)->mask, (*tmpm)->value);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a keyword, string array
|
||||||
|
*/
|
||||||
|
static int getarr(char **dest)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
nodelist_array **tmpm;
|
||||||
|
|
||||||
|
for (p = v; *p && !isspace(*p); p++);
|
||||||
|
if (*p)
|
||||||
|
*p++ = '\0';
|
||||||
|
|
||||||
|
for (tmpm = (nodelist_array**)dest; *tmpm; tmpm=&((*tmpm)->next));
|
||||||
|
(*tmpm) = (nodelist_array *) xmalloc(sizeof(nodelist_array));
|
||||||
|
(*tmpm)->next = NULL;
|
||||||
|
(*tmpm)->name = xstrcpy(v);
|
||||||
|
// Syslog('s', "getarr: %s(%d): \"%s\" \"%s\"", nlpath, linecnt, MBSE_SS(k), (*tmpm)->name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a keyword, unsigned short, string
|
||||||
|
*/
|
||||||
|
static int getdom(char **dest)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
unsigned short tmp;
|
||||||
|
nodelist_domsuf **tmpm;
|
||||||
|
|
||||||
|
for (p = v; *p && !isspace(*p); p++);
|
||||||
|
if (*p)
|
||||||
|
*p++ = '\0';
|
||||||
|
while (*p && isspace(*p))
|
||||||
|
p++;
|
||||||
|
if (*p == '\0') {
|
||||||
|
WriteError("%s(%s): less then two tokens", nlpath, linecnt);
|
||||||
|
return MBERR_INIT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (tmpm = (nodelist_domsuf**)dest; *tmpm; tmpm=&((*tmpm)->next));
|
||||||
|
(*tmpm) = (nodelist_domsuf *) xmalloc(sizeof(nodelist_domsuf));
|
||||||
|
(*tmpm)->next = NULL;
|
||||||
|
tmp = strtod(v, NULL);
|
||||||
|
(*tmpm)->zone = tmp;
|
||||||
|
(*tmpm)->name = xstrcpy(p);
|
||||||
|
// Syslog('s', "getdom: %s(%d): \"%s\" \"%d\" \"%s\"", nlpath, linecnt, MBSE_SS(k), (*tmpm)->zone, (*tmpm)->name);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a keyword, string, string, unsigned long
|
||||||
|
*/
|
||||||
|
static int getsrv(char **dest)
|
||||||
|
{
|
||||||
|
char *p, *q;
|
||||||
|
unsigned long tmp;
|
||||||
|
nodelist_service **tmpm;
|
||||||
|
|
||||||
|
for (p = v; *p && !isspace(*p); p++);
|
||||||
|
if (*p)
|
||||||
|
*p++ = '\0';
|
||||||
|
while (*p && isspace(*p))
|
||||||
|
p++;
|
||||||
|
if (*p == '\0') {
|
||||||
|
WriteError("%s(%s): less then two tokens", nlpath, linecnt);
|
||||||
|
return MBERR_INIT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (q = p; *q && !isspace(*q); q++);
|
||||||
|
if (*q)
|
||||||
|
*q++ = '\0';
|
||||||
|
while (*q && isspace(*q))
|
||||||
|
q++;
|
||||||
|
if (*q == '\0') {
|
||||||
|
WriteError("%s(%s): less then three tokens", nlpath, linecnt);
|
||||||
|
return MBERR_INIT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (tmpm = (nodelist_service**)dest; *tmpm; tmpm=&((*tmpm)->next));
|
||||||
|
(*tmpm) = (nodelist_service *) xmalloc(sizeof(nodelist_service));
|
||||||
|
(*tmpm)->next = NULL;
|
||||||
|
(*tmpm)->flag = xstrcpy(v);
|
||||||
|
(*tmpm)->service = xstrcpy(p);
|
||||||
|
tmp = strtoul(q, NULL, 0);
|
||||||
|
(*tmpm)->port = tmp;
|
||||||
|
// Syslog('s', "getsrv: %s(%d): \"%s\" \"%s\" \"%s\" \"%d\"", nlpath, linecnt, MBSE_SS(k),
|
||||||
|
// (*tmpm)->flag, (*tmpm)->service, (*tmpm)->port);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void tidy_nl_flag(nodelist_flag **);
|
||||||
|
void tidy_nl_flag(nodelist_flag **fap)
|
||||||
|
{
|
||||||
|
nodelist_flag *tmp, *old;
|
||||||
|
|
||||||
|
for (tmp = *fap; tmp; tmp = old) {
|
||||||
|
old = tmp->next;
|
||||||
|
if (tmp->name)
|
||||||
|
free(tmp->name);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
*fap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void tidy_nl_modem(nodelist_modem **);
|
||||||
|
void tidy_nl_modem(nodelist_modem **fap)
|
||||||
|
{
|
||||||
|
nodelist_modem *tmp, *old;
|
||||||
|
|
||||||
|
for (tmp = *fap; tmp; tmp = old) {
|
||||||
|
old = tmp->next;
|
||||||
|
if (tmp->name)
|
||||||
|
free(tmp->name);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
*fap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void tidy_nl_array(nodelist_array **);
|
||||||
|
void tidy_nl_array(nodelist_array **fap)
|
||||||
|
{
|
||||||
|
nodelist_array *tmp, *old;
|
||||||
|
|
||||||
|
for (tmp = *fap; tmp; tmp = old) {
|
||||||
|
old = tmp->next;
|
||||||
|
if (tmp->name)
|
||||||
|
free(tmp->name);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
*fap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void tidy_nl_domsuf(nodelist_domsuf **);
|
||||||
|
void tidy_nl_domsuf(nodelist_domsuf **fap)
|
||||||
|
{
|
||||||
|
nodelist_domsuf *tmp, *old;
|
||||||
|
|
||||||
|
for (tmp = *fap; tmp; tmp = old) {
|
||||||
|
old = tmp->next;
|
||||||
|
if (tmp->name)
|
||||||
|
free(tmp->name);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
*fap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void tidy_nl_service(nodelist_service **);
|
||||||
|
void tidy_nl_service(nodelist_service **fap)
|
||||||
|
{
|
||||||
|
nodelist_service *tmp, *old;
|
||||||
|
|
||||||
|
for (tmp = *fap; tmp; tmp = old) {
|
||||||
|
old = tmp->next;
|
||||||
|
if (tmp->flag)
|
||||||
|
free(tmp->flag);
|
||||||
|
if (tmp->service)
|
||||||
|
free(tmp->service);
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
|
*fap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* De-init nodelists, free all allocated memory
|
||||||
|
*/
|
||||||
|
void deinitnl(void)
|
||||||
|
{
|
||||||
|
if (!nlinitdone)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Syslog('s', "De-init nodelists");
|
||||||
|
|
||||||
|
tidy_nl_flag(&nl_online);
|
||||||
|
tidy_nl_flag(&nl_request);
|
||||||
|
tidy_nl_flag(&nl_reqbits);
|
||||||
|
tidy_nl_modem(&nl_pots);
|
||||||
|
tidy_nl_modem(&nl_isdn);
|
||||||
|
tidy_nl_modem(&nl_tcpip);
|
||||||
|
tidy_nl_array(&nl_search);
|
||||||
|
tidy_nl_array(&nl_dialer);
|
||||||
|
tidy_nl_domsuf(&nl_domsuffix);
|
||||||
|
tidy_nl_service(&nl_service);
|
||||||
|
|
||||||
|
Syslog('s', "De-init done");
|
||||||
|
nlinitdone = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Init nodelists.
|
||||||
|
*/
|
||||||
int initnl(void)
|
int initnl(void)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int i, rc = 0, Found;
|
||||||
FILE *dbf, *fp;
|
FILE *dbf, *fp;
|
||||||
char *filexnm, *path;
|
char *filexnm, buf[256], *p, *q;
|
||||||
struct _nlfil fdx;
|
struct _nlfil fdx;
|
||||||
|
struct taskrec TCFG;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
|
if (nlinitdone == TRUE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
nl_online = NULL;
|
||||||
|
nl_pots = NULL;
|
||||||
|
nl_request = NULL;
|
||||||
|
nl_reqbits = NULL;
|
||||||
|
nl_isdn = NULL;
|
||||||
|
nl_tcpip = NULL;
|
||||||
|
nl_search = NULL;
|
||||||
|
nl_domsuffix = NULL;
|
||||||
|
nl_dialer = NULL;
|
||||||
|
nl_service = NULL;
|
||||||
|
|
||||||
filexnm = xstrcpy(CFG.nodelists);
|
filexnm = xstrcpy(CFG.nodelists);
|
||||||
filexnm = xstrcat(filexnm,(char *)"/node.files");
|
filexnm = xstrcat(filexnm,(char *)"/node.files");
|
||||||
|
nlpath = calloc(PATH_MAX, sizeof(char));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if all installed nodelists are present.
|
||||||
|
*/
|
||||||
if ((dbf = fopen(filexnm, "r")) == NULL) {
|
if ((dbf = fopen(filexnm, "r")) == NULL) {
|
||||||
WriteError("$Can't open %s", filexnm);
|
WriteError("$Can't open %s", filexnm);
|
||||||
rc = 101;
|
rc = MBERR_INIT_ERROR;
|
||||||
} else {
|
} else {
|
||||||
path = calloc(128, sizeof(char));
|
|
||||||
|
|
||||||
while (fread(&fdx, sizeof(fdx), 1, dbf) == 1) {
|
while (fread(&fdx, sizeof(fdx), 1, dbf) == 1) {
|
||||||
sprintf(path, "%s/%s", CFG.nodelists, fdx.filename);
|
sprintf(nlpath, "%s/%s", CFG.nodelists, fdx.filename);
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
if ((fp = fopen(nlpath, "r")) == NULL) {
|
||||||
WriteError("$Can't open %s", path);
|
WriteError("$Can't open %s", nlpath);
|
||||||
rc = 101;
|
rc = MBERR_INIT_ERROR;
|
||||||
} else {
|
} else {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(dbf);
|
fclose(dbf);
|
||||||
free(path);
|
}
|
||||||
|
free(filexnm);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read and parse ~/etc/nodelist.conf
|
||||||
|
*/
|
||||||
|
sprintf(nlpath, "%s/etc/nodelist.conf", getenv("MBSE_ROOT"));
|
||||||
|
if ((dbf = fopen(nlpath, "r")) == NULL) {
|
||||||
|
WriteError("$Can't open %s", nlpath);
|
||||||
|
rc = MBERR_INIT_ERROR;
|
||||||
|
} else {
|
||||||
|
while (fgets(buf, sizeof(buf) -1, dbf)) {
|
||||||
|
linecnt++;
|
||||||
|
if (*(p = buf + strlen(buf) -1) != '\n') {
|
||||||
|
WriteError("%s(%d): \"%s\" - line too long", nlpath, linecnt, buf);
|
||||||
|
rc = MBERR_INIT_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*p-- = '\0';
|
||||||
|
while ((p >= buf) && isspace(*p))
|
||||||
|
*p-- = '\0';
|
||||||
|
k = buf;
|
||||||
|
while (*k && isspace(*k))
|
||||||
|
k++;
|
||||||
|
p = k;
|
||||||
|
while (*p && !isspace(*p))
|
||||||
|
p++;
|
||||||
|
*p++='\0';
|
||||||
|
v = p;
|
||||||
|
while (*v && isspace(*v))
|
||||||
|
v++;
|
||||||
|
|
||||||
|
if ((*k == '\0') || (*k == '#')) {
|
||||||
|
// Syslog('n', "\"%s\" \"%s\" - ignore", MBSE_SS(k), MBSE_SS(v));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(filexnm);
|
// Syslog('n', "\"%s\" \"%s\" - parsed", MBSE_SS(k), MBSE_SS(v));
|
||||||
|
|
||||||
|
for (i = 0; keytab[i].key; i++)
|
||||||
|
if (strcasecmp(k,keytab[i].key) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (keytab[i].key == NULL) {
|
||||||
|
WriteError("%s(%d): %s %s - unknown keyword", nlpath, linecnt, MBSE_SS(k), MBSE_SS(v));
|
||||||
|
rc = MBERR_INIT_ERROR;
|
||||||
|
break;
|
||||||
|
} else if ((keytab[i].prc(keytab[i].dest))) {
|
||||||
|
rc = MBERR_INIT_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(dbf);
|
||||||
|
}
|
||||||
|
|
||||||
|
Found = FALSE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Howmany TCP sessions are allowd
|
||||||
|
*/
|
||||||
|
sprintf(nlpath, "%s/etc/task.data", getenv("MBSE_ROOT"));
|
||||||
|
if ((fp = fopen(nlpath, "r"))) {
|
||||||
|
fread(&TCFG, sizeof(TCFG), 1, fp);
|
||||||
|
fclose(fp);
|
||||||
|
} else {
|
||||||
|
TCFG.max_tcp = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read all our TCP/IP capabilities and set the global flag.
|
||||||
|
*/
|
||||||
|
if (TCFG.max_tcp) {
|
||||||
|
sprintf(buf, "%s", CFG.Flags);
|
||||||
|
q = buf;
|
||||||
|
for (p = q; p; p = q) {
|
||||||
|
if ((q = strchr(p, ',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
|
if (strncasecmp((*tmpm)->name, p, strlen((*tmpm)->name)) == 0)
|
||||||
|
mytcpip |= (*tmpm)->value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read the ports configuration for all pots and isdn lines.
|
||||||
|
* All lines are ORed so we have a global and total lines
|
||||||
|
* capability.
|
||||||
|
*/
|
||||||
|
sprintf(nlpath, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
||||||
|
if ((fp = fopen(nlpath, "r"))) {
|
||||||
|
fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, fp);
|
||||||
|
|
||||||
|
while (fread(&ttyinfo, ttyinfohdr.recsize, 1, fp) == 1) {
|
||||||
|
if (((ttyinfo.type == POTS) || (ttyinfo.type == ISDN)) && (ttyinfo.available) && (ttyinfo.callout)) {
|
||||||
|
|
||||||
|
sprintf(buf, "%s", ttyinfo.flags);
|
||||||
|
q = buf;
|
||||||
|
for (p = q; p; p = q) {
|
||||||
|
if ((q = strchr(p, ',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
|
if (strcasecmp((*tmpm)->name, p) == 0)
|
||||||
|
mypots |= (*tmpm)->value;
|
||||||
|
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
|
if (strcasecmp((*tmpm)->name, p) == 0)
|
||||||
|
myisdn |= (*tmpm)->value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(nlpath);
|
||||||
|
Syslog('s', "mypots %08x myisdn %08x mytcpip %08x", mypots, myisdn, mytcpip);
|
||||||
|
Syslog('s', "Nodelists initialize complete, rc=%d", rc);
|
||||||
|
nlinitdone = TRUE;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,15 +564,20 @@ node *getnlent(faddr *addr)
|
|||||||
{
|
{
|
||||||
FILE *fp, *np;
|
FILE *fp, *np;
|
||||||
static node nodebuf;
|
static node nodebuf;
|
||||||
static char buf[2048], ebuf[2048], *p, *q;
|
static char buf[2048], ebuf[2048], *p, *q, tbuf[256];
|
||||||
struct _ixentry xaddr;
|
struct _ixentry xaddr;
|
||||||
int i, j, Found = FALSE, ixflag, stdflag, ndrecord = FALSE;
|
int i, Found = FALSE, ixflag, stdflag, ndrecord = FALSE;
|
||||||
char *mydomain, *path;
|
char *mydomain, *path;
|
||||||
struct _nlfil fdx;
|
struct _nlfil fdx;
|
||||||
struct _nlidx ndx;
|
struct _nlidx ndx;
|
||||||
long lowest, highest, current;
|
long lowest, highest, current;
|
||||||
struct _nodeshdr ndhdr;
|
struct _nodeshdr ndhdr;
|
||||||
static struct _nodes nd;
|
static struct _nodes nd;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
nodelist_flag **tmpf;
|
||||||
|
nodelist_service **tmps;
|
||||||
|
nodelist_array **tmpa;
|
||||||
|
unsigned long tport = 0;
|
||||||
|
|
||||||
Syslog('s', "getnlent: %s", ascfnode(addr,0xff));
|
Syslog('s', "getnlent: %s", ascfnode(addr,0xff));
|
||||||
|
|
||||||
@ -217,6 +609,7 @@ node *getnlent(faddr *addr)
|
|||||||
nodebuf.uflags[0] = NULL;
|
nodebuf.uflags[0] = NULL;
|
||||||
nodebuf.t1 = '\0';
|
nodebuf.t1 = '\0';
|
||||||
nodebuf.t2 = '\0';
|
nodebuf.t2 = '\0';
|
||||||
|
nodebuf.url = NULL;
|
||||||
|
|
||||||
if (addr == NULL)
|
if (addr == NULL)
|
||||||
goto retdummy;
|
goto retdummy;
|
||||||
@ -312,6 +705,7 @@ node *getnlent(faddr *addr)
|
|||||||
fclose(fp);
|
fclose(fp);
|
||||||
goto retdummy;
|
goto retdummy;
|
||||||
}
|
}
|
||||||
|
Syslog('s', "getnlent: %s", buf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load noderecord if this node has one, if there is one then
|
* Load noderecord if this node has one, if there is one then
|
||||||
@ -450,21 +844,21 @@ node *getnlent(faddr *addr)
|
|||||||
/*
|
/*
|
||||||
* Process authorized flags and user flags both as authorized.
|
* Process authorized flags and user flags both as authorized.
|
||||||
*/
|
*/
|
||||||
for (j = 0; fkey[j].key; j++)
|
for (tmpf = &nl_online; *tmpf; tmpf=&((*tmpf)->next))
|
||||||
if (strcasecmp(p, fkey[j].key) == 0)
|
if (strcasecmp(p, (*tmpf)->name) == 0)
|
||||||
nodebuf.mflags |= fkey[j].flag;
|
nodebuf.oflags |= (*tmpf)->value;
|
||||||
for (j = 0; okey[j].key; j++)
|
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if (strcasecmp(p, okey[j].key) == 0)
|
if (strcasecmp(p, (*tmpm)->name) == 0)
|
||||||
nodebuf.oflags |= okey[j].flag;
|
nodebuf.mflags |= (*tmpm)->value;
|
||||||
for (j = 0; dkey[j].key; j++)
|
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if (strcasecmp(p, dkey[j].key) == 0)
|
if (strcasecmp(p, (*tmpm)->name) == 0)
|
||||||
nodebuf.dflags |= dkey[j].flag;
|
nodebuf.dflags |= (*tmpm)->value;
|
||||||
for (j = 0; ikey[j].key; j++)
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if (strncasecmp(p, ikey[j].key, strlen(ikey[j].key)) == 0)
|
if (strncasecmp(p, (*tmpm)->name, strlen((*tmpm)->name)) == 0)
|
||||||
nodebuf.iflags |= ikey[j].flag;
|
nodebuf.iflags |= (*tmpm)->value;
|
||||||
for (j = 0; xkey[j].key; j++)
|
for (tmpf = &nl_request; *tmpf; tmpf=&((*tmpf)->next))
|
||||||
if (strcasecmp(p, xkey[j].key) == 0)
|
if (strcasecmp(p, (*tmpf)->name) == 0)
|
||||||
nodebuf.xflags |= xkey[j].flag;
|
nodebuf.xflags = (*tmpf)->value;
|
||||||
if ((p[0] == 'T') && (strlen(p) == 3)) {
|
if ((p[0] == 'T') && (strlen(p) == 3)) {
|
||||||
/*
|
/*
|
||||||
* System open hours flag
|
* System open hours flag
|
||||||
@ -503,6 +897,87 @@ node *getnlent(faddr *addr)
|
|||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Build the connection URL
|
||||||
|
*
|
||||||
|
* If the node has some IP flags and we allow TCP, then search the best protocol.
|
||||||
|
*/
|
||||||
|
if (nodebuf.iflags & mytcpip) {
|
||||||
|
Syslog('s', "node iflags %08x, mytcpip %08x", nodebuf.iflags, mytcpip);
|
||||||
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
|
if ((*tmpm)->mask & nodebuf.iflags) {
|
||||||
|
Syslog('s', "Setting %s", (*tmpm)->name);
|
||||||
|
for (tmps = &nl_service; *tmps; tmps=&((*tmps)->next)) {
|
||||||
|
if (strcmp((*tmps)->flag, (*tmpm)->name) == 0) {
|
||||||
|
sprintf(tbuf, "%s", (*tmps)->service);
|
||||||
|
tport = (*tmps)->port;
|
||||||
|
Syslog('s', "Setting %s %d", (*tmps)->service, (*tmps)->port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The last setting is the best
|
||||||
|
*/
|
||||||
|
nodebuf.url = xstrcpy(tbuf);
|
||||||
|
nodebuf.url = xstrcat(nodebuf.url, (char *)"://");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Next, try to find out the FQDN for this node, we have a search
|
||||||
|
* preference list in the nodelist.conf file.
|
||||||
|
*/
|
||||||
|
memset(&tbuf, 0, sizeof(tbuf));
|
||||||
|
if (ndrecord && strlen(nd.Nl_hostname)) {
|
||||||
|
Syslog('s', "Using override %s for FQDN", nd.Nl_hostname);
|
||||||
|
sprintf(tbuf, nodebuf.name);
|
||||||
|
nodebuf.url = xstrcat(nodebuf.url, tbuf);
|
||||||
|
} else {
|
||||||
|
for (tmpa = &nl_search; *tmpa; tmpa=&((*tmpa)->next)) {
|
||||||
|
Syslog('s', "Search FQDN method %s", (*tmpa)->name);
|
||||||
|
if (strcasecmp((*tmpa)->name, "field3") == 0) {
|
||||||
|
sprintf(tbuf, nodebuf.name);
|
||||||
|
if (strchr(tbuf, '.')) {
|
||||||
|
/*
|
||||||
|
* Okay, there are dots, this can be a FQDN or IP address.
|
||||||
|
*/
|
||||||
|
Syslog('s', "Using field3 \"%s\"", tbuf);
|
||||||
|
nodebuf.url = xstrcat(nodebuf.url, tbuf);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (strcasecmp((*tmpa)->name, "field6") == 0) {
|
||||||
|
if (nodebuf.phone && strncmp(nodebuf.phone, "000-", 4) == 0) {
|
||||||
|
Syslog('s', "Found 000- prefix");
|
||||||
|
sprintf(tbuf, "%s", nodebuf.phone+4);
|
||||||
|
for (i = 0; i < strlen(tbuf); i++)
|
||||||
|
if (tbuf[i] == '-')
|
||||||
|
tbuf[i] = '.';
|
||||||
|
Syslog('s', "Using field6 \"%s\"", tbuf);
|
||||||
|
nodebuf.url = xstrcat(nodebuf.url, tbuf);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strchr(tbuf, ':') == NULL) {
|
||||||
|
/*
|
||||||
|
* No optional port number, add one from the default
|
||||||
|
* for this protocol.
|
||||||
|
*/
|
||||||
|
sprintf(tbuf, ":%lu", tport);
|
||||||
|
Syslog('s', "Adding default port %s", tbuf);
|
||||||
|
nodebuf.url = xstrcat(nodebuf.url, tbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (nodebuf.dflags & myisdn) {
|
||||||
|
nodebuf.url = xstrcpy((char *)"isdn://");
|
||||||
|
nodebuf.url = xstrcat(nodebuf.url, nodebuf.phone);
|
||||||
|
} else if (nodebuf.mflags & mypots) {
|
||||||
|
nodebuf.url = xstrcpy((char *)"pots://");
|
||||||
|
nodebuf.url = xstrcat(nodebuf.url, nodebuf.phone);
|
||||||
|
}
|
||||||
|
|
||||||
nodebuf.addr.name = nodebuf.sysop;
|
nodebuf.addr.name = nodebuf.sysop;
|
||||||
nodebuf.addr.domain = xstrcpy(fdx.domain);
|
nodebuf.addr.domain = xstrcpy(fdx.domain);
|
||||||
nodebuf.upnet = ndx.upnet;
|
nodebuf.upnet = ndx.upnet;
|
||||||
@ -513,6 +988,7 @@ node *getnlent(faddr *addr)
|
|||||||
|
|
||||||
Syslog('s', "getnlent: system %s, %s", nodebuf.name, nodebuf.location);
|
Syslog('s', "getnlent: system %s, %s", nodebuf.name, nodebuf.location);
|
||||||
Syslog('s', "getnlent: sysop %s, %s", nodebuf.sysop, nodebuf.phone);
|
Syslog('s', "getnlent: sysop %s, %s", nodebuf.sysop, nodebuf.phone);
|
||||||
|
Syslog('s', "getnlent: URL %s", printable(nodebuf.url, 0));
|
||||||
moflags(nodebuf.mflags);
|
moflags(nodebuf.mflags);
|
||||||
diflags(nodebuf.dflags);
|
diflags(nodebuf.dflags);
|
||||||
ipflags(nodebuf.iflags);
|
ipflags(nodebuf.iflags);
|
||||||
@ -534,6 +1010,7 @@ retdummy:
|
|||||||
nodebuf.sysop = (char *)"Sysop";
|
nodebuf.sysop = (char *)"Sysop";
|
||||||
nodebuf.phone = NULL;
|
nodebuf.phone = NULL;
|
||||||
nodebuf.speed = 2400;
|
nodebuf.speed = 2400;
|
||||||
|
nodebuf.url = NULL;
|
||||||
free(mydomain);
|
free(mydomain);
|
||||||
|
|
||||||
return &nodebuf;
|
return &nodebuf;
|
||||||
@ -544,16 +1021,15 @@ retdummy:
|
|||||||
void olflags(unsigned long flags)
|
void olflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
nodelist_flag **tmpm;
|
||||||
|
|
||||||
t = xstrcpy((char *)"Mailer flags :");
|
t = xstrcpy((char *)"Mailer flags :");
|
||||||
if (flags & OL_CM)
|
for (tmpm = &nl_online; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
t = xstrcat(t, (char *)" CM");
|
if ((*tmpm)->value & flags) {
|
||||||
if (flags & OL_MO)
|
t = xstrcat(t, (char *)" ");
|
||||||
t = xstrcat(t, (char *)" MO");
|
t = xstrcat(t, (*tmpm)->name);
|
||||||
if (flags & OL_LO)
|
}
|
||||||
t = xstrcat(t, (char *)" LO");
|
}
|
||||||
if (flags & OL_MN)
|
|
||||||
t = xstrcat(t, (char *)" MN");
|
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
@ -563,16 +1039,22 @@ void olflags(unsigned long flags)
|
|||||||
void rqflags(unsigned long flags)
|
void rqflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
nodelist_flag **tmpm;
|
||||||
|
|
||||||
t = xstrcpy((char *)"Request flags:");
|
t = xstrcpy((char *)"Request flags:");
|
||||||
if (flags & RQ_RQ_BR)
|
for (tmpm = &nl_reqbits; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
t = xstrcat(t, (char *)" RQ_BR");
|
if ((*tmpm)->value & flags) {
|
||||||
if (flags & RQ_RQ_BU)
|
t = xstrcat(t, (char *)" ");
|
||||||
t = xstrcat(t, (char *)" RQ_BU");
|
t = xstrcat(t, (*tmpm)->name);
|
||||||
if (flags & RQ_RQ_WR)
|
}
|
||||||
t = xstrcat(t, (char *)" RQ_WR");
|
}
|
||||||
if (flags & RQ_RQ_WU)
|
for (tmpm = &nl_request; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
t = xstrcat(t, (char *)" RQ_WU");
|
if ((*tmpm)->value == flags) {
|
||||||
|
t = xstrcat(t, (char *)" (");
|
||||||
|
t = xstrcat(t, (*tmpm)->name);
|
||||||
|
t = xstrcat(t, (char *)")");
|
||||||
|
}
|
||||||
|
}
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
@ -582,54 +1064,17 @@ void rqflags(unsigned long flags)
|
|||||||
void moflags(unsigned long flags)
|
void moflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
if (!flags)
|
if (!flags)
|
||||||
return;
|
return;
|
||||||
t = xstrcpy((char *)"Modem flags :");
|
t = xstrcpy((char *)"Modem flags :");
|
||||||
if (flags & NL_V22)
|
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
t = xstrcat(t, (char *)" V22");
|
if ((*tmpm)->mask & flags) {
|
||||||
if (flags & NL_V29)
|
t = xstrcat(t, (char *)" ");
|
||||||
t = xstrcat(t, (char *)" V29");
|
t = xstrcat(t, (*tmpm)->name);
|
||||||
if (flags & NL_V32)
|
}
|
||||||
t = xstrcat(t, (char *)" V32");
|
}
|
||||||
if (flags & NL_V32B)
|
|
||||||
t = xstrcat(t, (char *)" V32B");
|
|
||||||
if (flags & NL_V34)
|
|
||||||
t = xstrcat(t, (char *)" V34");
|
|
||||||
if (flags & NL_V42)
|
|
||||||
t = xstrcat(t, (char *)" V42");
|
|
||||||
if (flags & NL_V42B)
|
|
||||||
t = xstrcat(t, (char *)" V42B");
|
|
||||||
if (flags & NL_MNP)
|
|
||||||
t = xstrcat(t, (char *)" MNP");
|
|
||||||
if (flags & NL_H96)
|
|
||||||
t = xstrcat(t, (char *)" H96");
|
|
||||||
if (flags & NL_HST)
|
|
||||||
t = xstrcat(t, (char *)" HST");
|
|
||||||
if (flags & NL_H14)
|
|
||||||
t = xstrcat(t, (char *)" H14");
|
|
||||||
if (flags & NL_H16)
|
|
||||||
t = xstrcat(t, (char *)" H16");
|
|
||||||
if (flags & NL_MAX)
|
|
||||||
t = xstrcat(t, (char *)" MAX");
|
|
||||||
if (flags & NL_PEP)
|
|
||||||
t = xstrcat(t, (char *)" PEP");
|
|
||||||
if (flags & NL_CSP)
|
|
||||||
t = xstrcat(t, (char *)" CSP");
|
|
||||||
if (flags & NL_V32T)
|
|
||||||
t = xstrcat(t, (char *)" V32T");
|
|
||||||
if (flags & NL_VFC)
|
|
||||||
t = xstrcat(t, (char *)" VFC");
|
|
||||||
if (flags & NL_ZYX)
|
|
||||||
t = xstrcat(t, (char *)" ZYX");
|
|
||||||
if (flags & NL_X2C)
|
|
||||||
t = xstrcat(t, (char *)" X2C");
|
|
||||||
if (flags & NL_X2S)
|
|
||||||
t = xstrcat(t, (char *)" X2S");
|
|
||||||
if (flags & NL_V90C)
|
|
||||||
t = xstrcat(t, (char *)" V90C");
|
|
||||||
if (flags & NL_V90S)
|
|
||||||
t = xstrcat(t, (char *)" V90S");
|
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
@ -639,21 +1084,17 @@ void moflags(unsigned long flags)
|
|||||||
void diflags(unsigned long flags)
|
void diflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
if (!flags)
|
if (!flags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
t = xstrcpy((char *)"ISDN flags :");
|
t = xstrcpy((char *)"ISDN flags :");
|
||||||
if (flags & ND_V110L)
|
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
t = xstrcat(t, (char *)" V110L");
|
if ((*tmpm)->mask & flags) {
|
||||||
if (flags & ND_V110H)
|
t = xstrcat(t, (char *)" ");
|
||||||
t = xstrcat(t, (char *)" V110H");
|
t = xstrcat(t, (*tmpm)->name);
|
||||||
if (flags & ND_V120L)
|
}
|
||||||
t = xstrcat(t, (char *)" V120L");
|
}
|
||||||
if (flags & ND_V120H)
|
|
||||||
t = xstrcat(t, (char *)" V120H");
|
|
||||||
if (flags & ND_X75)
|
|
||||||
t = xstrcat(t, (char *)" X75");
|
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
@ -663,26 +1104,35 @@ void diflags(unsigned long flags)
|
|||||||
void ipflags(unsigned long flags)
|
void ipflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
if (!flags)
|
if (!flags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
t = xstrcpy((char *)"TCP/IP flags :");
|
t = xstrcpy((char *)"TCP/IP flags :");
|
||||||
if (flags & IP_IBN)
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
t = xstrcat(t, (char *)" IBN");
|
if ((*tmpm)->mask & flags) {
|
||||||
if (flags & IP_IFC)
|
t = xstrcat(t, (char *)" ");
|
||||||
t = xstrcat(t, (char *)" IFC");
|
t = xstrcat(t, (*tmpm)->name);
|
||||||
if (flags & IP_ITN)
|
}
|
||||||
t = xstrcat(t, (char *)" ITN");
|
}
|
||||||
if (flags & IP_IVM)
|
|
||||||
t = xstrcat(t, (char *)" IVM");
|
|
||||||
if (flags & IP_IP)
|
|
||||||
t = xstrcat(t, (char *)" IP");
|
|
||||||
if (flags & IP_IFT)
|
|
||||||
t = xstrcat(t, (char *)" IFT");
|
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
unsigned long getCMmask(void)
|
||||||
|
{
|
||||||
|
nodelist_flag **tmpm;
|
||||||
|
|
||||||
|
for (tmpm = &nl_online; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
|
if (strcmp("CM", (*tmpm)->name) == 0) {
|
||||||
|
return (*tmpm)->value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteError("CM mask not found in %s/etc/nodelist.conf", getenv("MBSE_ROOT"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,26 +41,6 @@
|
|||||||
# WARNING: This file will replace hardcoded behaviour of several parts of
|
# WARNING: This file will replace hardcoded behaviour of several parts of
|
||||||
# the MBSE BBS package, tampering with this file is at your own risk.
|
# the MBSE BBS package, tampering with this file is at your own risk.
|
||||||
|
|
||||||
# The following are the valid keywords in field 1 of the nodelist.
|
|
||||||
# They also represent the order of the nodes.
|
|
||||||
keyword Zone 1
|
|
||||||
keyword Region 2
|
|
||||||
keyword Host 3
|
|
||||||
keyword Hub 4
|
|
||||||
keyword "" 5
|
|
||||||
keyword Point 6
|
|
||||||
|
|
||||||
|
|
||||||
# The next flags are ORed to get a call possible value. A value of zero
|
|
||||||
# means that the node is reachable analogue with a FTS-0001 session.
|
|
||||||
# The rest is treated special.
|
|
||||||
#
|
|
||||||
callflag Down 0x01 # Node is Down
|
|
||||||
callflag Hold 0x02 # Node is Hold
|
|
||||||
callflag Pvt 0x04 # Pvt nodelist entry, no analogue call possible
|
|
||||||
callflag Dummy 0x08 # Dummy, no nodelist entry
|
|
||||||
callflag ISDN 0x10 # ISDN only node
|
|
||||||
callflag TCPIP 0x20 # ION (Internet Only Node)
|
|
||||||
|
|
||||||
|
|
||||||
# Online special flags.
|
# Online special flags.
|
||||||
@ -71,36 +51,6 @@ online LO 0x00000004
|
|||||||
online MN 0x00000008
|
online MN 0x00000008
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Modem flags, order is important to check the fastest possible connection
|
|
||||||
# method. This also masks implied modes.
|
|
||||||
#
|
|
||||||
# flag entry implied mask
|
|
||||||
modem MNP 0x00000001 0x00000001
|
|
||||||
modem V42 0x00000002 0x00000003 # implies MNP
|
|
||||||
modem V42B 0x00000004 0x00000007 # implies MNP and V42
|
|
||||||
modem V22 0x00000008 0x00000008
|
|
||||||
modem V29 0x00000010 0x00000010
|
|
||||||
modem V32 0x00000020 0x00000020
|
|
||||||
modem H96 0x00000040 0x00000040
|
|
||||||
modem HST 0x00000080 0x00000081 # implies MNP
|
|
||||||
modem MAX 0x00000100 0x00000100
|
|
||||||
modem PEP 0x00000200 0x00000200
|
|
||||||
modem CSP 0x00000400 0x00000400
|
|
||||||
modem V32B 0x00000800 0x00000820 # implies V32
|
|
||||||
modem H14 0x00001000 0x00001081 # implies HST and MNP
|
|
||||||
modem V32T 0x00002000 0x00002820 # implies V32B and V32
|
|
||||||
modem H16 0x00004000 0x00005087 # implies H14, HST, MNP, V42, V42B
|
|
||||||
modem ZYX 0x00008000 0x00008827 # implies V32B, V32, V42B, V42, MNP
|
|
||||||
modem Z19 0x00010000 0x00018827 # implies V32B, V32, V42B, V42, MNP, ZYX
|
|
||||||
modem VFC 0x00020000 0x00020000
|
|
||||||
modem V34 0x00040000 0x00040000
|
|
||||||
modem X2C 0x00080000 0x001B0000 # implies X2S, V34
|
|
||||||
modem X2S 0x00100000 0x00140000 # implies V34
|
|
||||||
modem V90C 0x00200000 0x00640000 # implies V90S, V34
|
|
||||||
modem V90S 0x00400000 0x00440000 # implies V34
|
|
||||||
|
|
||||||
|
|
||||||
# Request flags, masks:
|
# Request flags, masks:
|
||||||
# 0x00000001 Bark request
|
# 0x00000001 Bark request
|
||||||
# 0x00000002 Bark update
|
# 0x00000002 Bark update
|
||||||
@ -113,7 +63,59 @@ request XC 0x0000000D # Bark request, Wazoo request, Wazoo update
|
|||||||
request XP 0x00000003 # Bark request, Bark update
|
request XP 0x00000003 # Bark request, Bark update
|
||||||
request XR 0x00000005 # Bark request, Wazoo request
|
request XR 0x00000005 # Bark request, Wazoo request
|
||||||
request XW 0x00000004 # Wazoo request
|
request XW 0x00000004 # Wazoo request
|
||||||
request XX 0x0000000B # Wazoo request, Wazoo update
|
request XX 0x0000000C # Wazoo request, Wazoo update
|
||||||
|
|
||||||
|
# Request flags bits
|
||||||
|
#
|
||||||
|
reqbits RQ_BR 0x00000001 # Bark request
|
||||||
|
reqbits RQ_BU 0x00000002 # Bark update
|
||||||
|
reqbits RQ_WR 0x00000004 # Wazoo request
|
||||||
|
reqbits RQ_WU 0x00000008 # Wazoo update
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Network services, the valid IP flags translated to the internet service
|
||||||
|
# names and their default ports.
|
||||||
|
#
|
||||||
|
service IBN binkp 24554
|
||||||
|
service IFC fido 60179
|
||||||
|
service ITN telnet 23
|
||||||
|
|
||||||
|
|
||||||
|
# Switched network service names, they are used to build the
|
||||||
|
# URLs for modem and ISDN lines.
|
||||||
|
#
|
||||||
|
dialer pots
|
||||||
|
dialer isdn
|
||||||
|
|
||||||
|
|
||||||
|
# Modem flags, order is important to check the fastest possible connection
|
||||||
|
# method. This also masks implied modes.
|
||||||
|
#
|
||||||
|
# flag entry implied mask
|
||||||
|
pots MNP 0x00000001 0x00000001
|
||||||
|
pots V42 0x00000002 0x00000003 # implies MNP
|
||||||
|
pots V42B 0x00000004 0x00000007 # implies MNP and V42
|
||||||
|
pots V22 0x00000008 0x00000008
|
||||||
|
pots V29 0x00000010 0x00000010
|
||||||
|
pots V32 0x00000020 0x00000020
|
||||||
|
pots H96 0x00000040 0x00000040
|
||||||
|
pots HST 0x00000080 0x00000081 # implies MNP
|
||||||
|
pots MAX 0x00000100 0x00000100
|
||||||
|
pots PEP 0x00000200 0x00000200
|
||||||
|
pots CSP 0x00000400 0x00000400
|
||||||
|
pots V32B 0x00000800 0x00000820 # implies V32
|
||||||
|
pots H14 0x00001000 0x00001081 # implies HST and MNP
|
||||||
|
pots V32T 0x00002000 0x00002820 # implies V32B and V32
|
||||||
|
pots H16 0x00004000 0x00005087 # implies H14, HST, MNP, V42, V42B
|
||||||
|
pots ZYX 0x00008000 0x00008827 # implies V32B, V32, V42B, V42, MNP
|
||||||
|
pots Z19 0x00010000 0x00018827 # implies V32B, V32, V42B, V42, MNP, ZYX
|
||||||
|
pots VFC 0x00020000 0x00020000
|
||||||
|
pots V34 0x00040000 0x00040000
|
||||||
|
pots X2C 0x00080000 0x001B0000 # implies X2S, V34
|
||||||
|
pots X2S 0x00100000 0x00140000 # implies V34
|
||||||
|
pots V90C 0x00200000 0x00640000 # implies V90S, V34
|
||||||
|
pots V90S 0x00400000 0x00440000 # implies V34
|
||||||
|
|
||||||
|
|
||||||
# ISDN flags in order of best speed.
|
# ISDN flags in order of best speed.
|
||||||
@ -127,30 +129,31 @@ isdn X75 0x00000010 0x00000010
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Note that the IP flags do not represent the order of preference.
|
# Supported IP protocols by the mailer in order of preference.
|
||||||
# That need to be changed.
|
# The names must match the service names.
|
||||||
#
|
#
|
||||||
tcpip IBN 0x00000001 0x00000001
|
tcpip ITN 0x00000001 0x00000001
|
||||||
tcpip IFC 0x00000002 0x00000002
|
tcpip IFC 0x00000002 0x00000002
|
||||||
tcpip ITN 0x00000004 0x00000004
|
tcpip IBN 0x00000004 0x00000004
|
||||||
tcpip IVM 0x00000008 0x00000008
|
|
||||||
tcpip IP 0x00000010 0x00000010
|
|
||||||
tcpip IFT 0x00000020 0x00000020
|
|
||||||
|
|
||||||
|
|
||||||
# The following gives the order to search for the
|
# The following gives the order to search for the
|
||||||
# FQDN or IP address of the node. Valid values are:
|
# FQDN or IP address of the node. Valid values are:
|
||||||
# system - Search in the system name field
|
# field3 - Search in the system name field, may have :port suffix.
|
||||||
# phone - Search the phone field for 000- prefix
|
# 192.168.1.40:1234 or ntbox.mbse.ym:5678 are valid.
|
||||||
|
# field6 - Search the phone field for 000- prefix, may be a IP
|
||||||
|
# or a FQDN with or without a :port suffix.
|
||||||
|
# 000-192-168-1-40:1234 or 000-ntbox.mbse.ym:5678 are valid.
|
||||||
|
# ina - Search INA:fqdn (NOT YET AVAILABLE)
|
||||||
# firstflag - First IP flag (NOT YET AVAILABLE)
|
# firstflag - First IP flag (NOT YET AVAILABLE)
|
||||||
# eslf - Extended St. Louis Format fields (NOT YET AVAILABLE)
|
# eslf - Extended St. Louis Format fields (NOT YET AVAILABLE)
|
||||||
# defdomain - Asume default domain (NOT YET AVAILABLE)
|
# defdomain - Asume default domain (NOT YET AVAILABLE)
|
||||||
#
|
#
|
||||||
# In all cases, the nodes setup overrides everything.
|
# In all cases, the nodes setup overrides everything.
|
||||||
# Order is important
|
# Order is important, defdomain must be the last if used.
|
||||||
#
|
#
|
||||||
search system
|
search field3
|
||||||
search phone
|
search field6
|
||||||
|
|
||||||
# The default searchdomain, will be prefixed with f1.n2 (NOT YET AVAILABLE)
|
# The default searchdomain, will be prefixed with f1.n2 (NOT YET AVAILABLE)
|
||||||
#
|
#
|
||||||
|
155
lib/nodelist.h
155
lib/nodelist.h
@ -5,95 +5,11 @@
|
|||||||
|
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
|
|
||||||
|
|
||||||
#define MAXNAME 35
|
#define MAXNAME 35
|
||||||
#define MAXUFLAGS 16
|
#define MAXUFLAGS 16
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Analogue Modem flag values, order is important, first the
|
|
||||||
* compresion capabilities, then the linespeeds. This is late
|
|
||||||
* tested by portsel to find the fastest common connection
|
|
||||||
* speed for a given line if you have multiple dialout modems.
|
|
||||||
*/
|
|
||||||
#define NL_MNP 0x00000001L
|
|
||||||
#define NL_V42 0x00000002L
|
|
||||||
#define NL_V42B 0x00000004L
|
|
||||||
#define NL_V22 0x00000008L
|
|
||||||
#define NL_V29 0x00000010L
|
|
||||||
#define NL_V32 0x00000020L
|
|
||||||
#define NL_H96 0x00000040L
|
|
||||||
#define NL_HST 0x00000080L
|
|
||||||
#define NL_MAX 0x00000100L
|
|
||||||
#define NL_PEP 0x00000200L
|
|
||||||
#define NL_CSP 0x00000400L
|
|
||||||
#define NL_V32B 0x00000800L
|
|
||||||
#define NL_H14 0x00001000L
|
|
||||||
#define NL_V32T 0x00002000L
|
|
||||||
#define NL_H16 0x00004000L
|
|
||||||
#define NL_ZYX 0x00008000L
|
|
||||||
#define NL_Z19 0x00010000L
|
|
||||||
#define NL_VFC 0x00020000L
|
|
||||||
#define NL_V34 0x00040000L
|
|
||||||
#define NL_X2C 0x00080000L
|
|
||||||
#define NL_X2S 0x00100000L
|
|
||||||
#define NL_V90C 0x00200000L
|
|
||||||
#define NL_V90S 0x00400000L
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ISDN Flags
|
|
||||||
*/
|
|
||||||
#define ND_V110L 0x00000001L
|
|
||||||
#define ND_V110H 0x00000002L
|
|
||||||
#define ND_V120L 0x00000004L
|
|
||||||
#define ND_V120H 0x00000008L
|
|
||||||
#define ND_X75 0x00000010L
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* TCP/IP flags
|
|
||||||
*/
|
|
||||||
#define IP_IBN 0x00000001L
|
|
||||||
#define IP_IFC 0x00000002L
|
|
||||||
#define IP_ITN 0x00000004L
|
|
||||||
#define IP_IVM 0x00000008L
|
|
||||||
#define IP_IP 0x00000010L
|
|
||||||
#define IP_IFT 0x00000020L
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Online special flags
|
|
||||||
*/
|
|
||||||
#define OL_CM 0x00000001L
|
|
||||||
#define OL_MO 0x00000002L
|
|
||||||
#define OL_LO 0x00000004L
|
|
||||||
#define OL_MN 0x00000008L
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Request flags
|
|
||||||
*/
|
|
||||||
#define RQ_RQMODE 0x0000000fL
|
|
||||||
#define RQ_RQ_BR 0x00000001L
|
|
||||||
#define RQ_RQ_BU 0x00000002L
|
|
||||||
#define RQ_RQ_WR 0x00000004L
|
|
||||||
#define RQ_RQ_WU 0x00000008L
|
|
||||||
#define RQ_XA (RQ_RQ_BR | RQ_RQ_BU | RQ_RQ_WR | RQ_RQ_WU)
|
|
||||||
#define RQ_XB (RQ_RQ_BR | RQ_RQ_BU | RQ_RQ_WR )
|
|
||||||
#define RQ_XC (RQ_RQ_BR | RQ_RQ_WR | RQ_RQ_WU)
|
|
||||||
#define RQ_XP (RQ_RQ_BR | RQ_RQ_BU )
|
|
||||||
#define RQ_XR (RQ_RQ_BR | RQ_RQ_WR )
|
|
||||||
#define RQ_XW ( RQ_RQ_WR )
|
|
||||||
#define RQ_XX ( RQ_RQ_WR | RQ_RQ_WU)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Nodelist entry
|
* Nodelist entry
|
||||||
*/
|
*/
|
||||||
@ -117,43 +33,48 @@ typedef struct _node {
|
|||||||
char *uflags[MAXUFLAGS]; /* User flags */
|
char *uflags[MAXUFLAGS]; /* User flags */
|
||||||
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 */
|
||||||
} node;
|
} node;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern struct _fkey {
|
/*
|
||||||
char *key;
|
* Memory array structures read from nodelist.conf
|
||||||
unsigned long flag;
|
*/
|
||||||
} fkey[];
|
typedef struct _nodelist_flag {
|
||||||
|
struct _nodelist_flag *next;
|
||||||
|
char *name;
|
||||||
|
unsigned long value;
|
||||||
|
} nodelist_flag;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _nodelist_modem {
|
||||||
extern struct _dkey {
|
struct _nodelist_modem *next;
|
||||||
char *key;
|
char *name;
|
||||||
unsigned long flag;
|
unsigned long mask;
|
||||||
} dkey[];
|
unsigned long value;
|
||||||
|
} nodelist_modem;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _nodelist_array {
|
||||||
extern struct _ikey {
|
struct _nodelist_array *next;
|
||||||
char *key;
|
char *name;
|
||||||
unsigned long flag;
|
} nodelist_array;
|
||||||
} ikey[];
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _nodelist_domsuf {
|
||||||
extern struct _okey {
|
struct _nodelist_domsuf *next;
|
||||||
char *key;
|
unsigned short zone;
|
||||||
unsigned long flag;
|
char *name;
|
||||||
} okey[];
|
} nodelist_domsuf;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _nodelist_service {
|
||||||
extern struct _xkey {
|
struct _nodelist_service *next;
|
||||||
char *key;
|
char *flag;
|
||||||
unsigned long flag;
|
char *service;
|
||||||
} xkey[];
|
unsigned long port;
|
||||||
|
} nodelist_service;
|
||||||
|
|
||||||
|
|
||||||
extern struct _nodelist {
|
extern struct _nodelist {
|
||||||
@ -162,7 +83,6 @@ extern struct _nodelist {
|
|||||||
} *nodevector;
|
} *nodevector;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct _ixentry {
|
struct _ixentry {
|
||||||
unsigned short zone;
|
unsigned short zone;
|
||||||
unsigned short net;
|
unsigned short net;
|
||||||
@ -171,7 +91,6 @@ struct _ixentry {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern struct _pkey {
|
extern struct _pkey {
|
||||||
char *key;
|
char *key;
|
||||||
unsigned char type;
|
unsigned char type;
|
||||||
@ -180,16 +99,30 @@ extern struct _pkey {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nodelist_flag *nl_online;
|
||||||
|
nodelist_flag *nl_request;
|
||||||
|
nodelist_flag *nl_reqbits;
|
||||||
|
nodelist_modem *nl_pots;
|
||||||
|
nodelist_modem *nl_isdn;
|
||||||
|
nodelist_modem *nl_tcpip;
|
||||||
|
nodelist_array *nl_search;
|
||||||
|
nodelist_array *nl_dialer;
|
||||||
|
nodelist_domsuf *nl_domsuffix;
|
||||||
|
nodelist_service *nl_service;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From nodelist.c
|
* From nodelist.c
|
||||||
*/
|
*/
|
||||||
int initnl(void);
|
int initnl(void);
|
||||||
|
void deinitnl(void);
|
||||||
node *getnlent(faddr *);
|
node *getnlent(faddr *);
|
||||||
void olflags(unsigned long);
|
void olflags(unsigned long);
|
||||||
void rqflags(unsigned long);
|
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
|
||||||
|
@ -729,9 +729,9 @@ struct sysconfig {
|
|||||||
|
|
||||||
unsigned xNoJanus : 1;
|
unsigned xNoJanus : 1;
|
||||||
unsigned NoHydra : 1; /* Don't do Hydra */
|
unsigned NoHydra : 1; /* Don't do Hydra */
|
||||||
unsigned NoIBN : 1; /* No TCP-IP binkp */
|
unsigned xNoIBN : 1;
|
||||||
unsigned NoITN : 1; /* No TCP-IP telnet */
|
unsigned xNoITN : 1;
|
||||||
unsigned NoIFC : 1; /* No TCP-IP ifcico */
|
unsigned xNoIFC : 1;
|
||||||
|
|
||||||
char Phone[21]; /* Default phonenumber */
|
char Phone[21]; /* Default phonenumber */
|
||||||
unsigned long Speed; /* Default linespeed */
|
unsigned long Speed; /* Default linespeed */
|
||||||
@ -1221,13 +1221,13 @@ struct _nodes {
|
|||||||
unsigned xNoJanus : 1; /* Don't use Janus */
|
unsigned xNoJanus : 1; /* Don't use Janus */
|
||||||
unsigned NoHydra : 1; /* Don't use Hydra */
|
unsigned NoHydra : 1; /* Don't use Hydra */
|
||||||
|
|
||||||
unsigned NoIBN : 1; /* Don't use TCP-IP binkp */
|
unsigned xNoIBN : 1;
|
||||||
unsigned PackNetmail : 1; /* Pack netmail */
|
unsigned PackNetmail : 1; /* Pack netmail */
|
||||||
unsigned ARCmailCompat : 1; /* ARCmail Compatibility */
|
unsigned ARCmailCompat : 1; /* ARCmail Compatibility */
|
||||||
unsigned ARCmailAlpha : 1; /* Allow a..z ARCmail name */
|
unsigned ARCmailAlpha : 1; /* Allow a..z ARCmail name */
|
||||||
unsigned FNC : 1; /* Node needs 8.3 filenames */
|
unsigned FNC : 1; /* Node needs 8.3 filenames */
|
||||||
unsigned NoITN : 1; /* Don't use TCP-IP telnet */
|
unsigned xNoITN : 1;
|
||||||
unsigned NoIFC : 1; /* Don't use TCP-IP ifcico */
|
unsigned xNoIFC : 1;
|
||||||
|
|
||||||
char xExtra[94];
|
char xExtra[94];
|
||||||
time_t StartDate; /* Node start date */
|
time_t StartDate; /* Node start date */
|
||||||
|
@ -104,8 +104,10 @@ int portopen(faddr *addr)
|
|||||||
|
|
||||||
int call(faddr *addr)
|
int call(faddr *addr)
|
||||||
{
|
{
|
||||||
int i, rc = 1;
|
int i, rc = 1, proto = FALSE;
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
|
unsigned long cmmask, ipmask;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't call points, call their boss instead.
|
* Don't call points, call their boss instead.
|
||||||
@ -134,6 +136,7 @@ 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
|
||||||
@ -152,19 +155,12 @@ int call(faddr *addr)
|
|||||||
* First see if this node can be reached over the internet and
|
* First see if this node can be reached over the internet and
|
||||||
* that internet calls are allowed.
|
* that internet calls are allowed.
|
||||||
*/
|
*/
|
||||||
if (nlent->iflags && ((localoptions & (NOIBN & NOITN & NOIFC)) == 0)) {
|
if (nlent->iflags) {
|
||||||
if (!inetaddr) {
|
if (!inetaddr) {
|
||||||
Syslog('d', "Trying to find IP address...");
|
Syslog('d', "Trying to find IP address...");
|
||||||
/*
|
/*
|
||||||
* There is no fdn or IP address at the commandline.
|
* There is no fdn or IP address at the commandline.
|
||||||
* First check nodesetup for an override in the phone field.
|
* First check nodesetup for an override in the phone field.
|
||||||
*/
|
|
||||||
// if (strlen(nodes.phone[0])) {
|
|
||||||
// inetaddr = xstrcpy(nodes.phone[0]);
|
|
||||||
// } else if (strlen(nodes.phone[1])) {
|
|
||||||
// inetaddr = xstrcpy(nodes.phone[1]);
|
|
||||||
// } else {
|
|
||||||
/*
|
|
||||||
* Try to find the fdn in several places in the nodelist fields.
|
* Try to find the fdn in several places in the nodelist fields.
|
||||||
*/
|
*/
|
||||||
if ((nlent->phone != NULL) && (strncmp(nlent->phone, (char *)"000-", 4) == 0)) {
|
if ((nlent->phone != NULL) && (strncmp(nlent->phone, (char *)"000-", 4) == 0)) {
|
||||||
@ -184,7 +180,6 @@ int call(faddr *addr)
|
|||||||
inetaddr = xstrcpy(nlent->location);
|
inetaddr = xstrcpy(nlent->location);
|
||||||
Syslog('d', "Got hostname from nodelist location");
|
Syslog('d', "Got hostname from nodelist location");
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -200,16 +195,36 @@ int call(faddr *addr)
|
|||||||
* from the nodelist. If it fails, fallback to dial.
|
* from the nodelist. If it fails, fallback to dial.
|
||||||
* Priority IBN, IFC, ITN.
|
* Priority IBN, IFC, ITN.
|
||||||
*/
|
*/
|
||||||
if ((nlent->iflags & IP_IBN) && ((localoptions & NOIBN) == 0)) {
|
ipmask = 0;
|
||||||
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
|
if (strcmp("IBN", (*tmpm)->name) == 0)
|
||||||
|
ipmask = (*tmpm)->mask;
|
||||||
|
if (nlent->iflags & ipmask) {
|
||||||
tcp_mode = TCPMODE_IBN;
|
tcp_mode = TCPMODE_IBN;
|
||||||
Syslog('d', "TCP/IP mode set to IBN");
|
Syslog('d', "TCP/IP mode set to IBN");
|
||||||
} else if ((nlent->iflags & IP_IFC) && ((localoptions & NOIFC) == 0)) {
|
proto = TRUE;
|
||||||
|
}
|
||||||
|
if (!proto) {
|
||||||
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
|
if (strcmp("IFC", (*tmpm)->name) == 0)
|
||||||
|
ipmask = (*tmpm)->mask;
|
||||||
|
if (nlent->iflags & ipmask) {
|
||||||
tcp_mode = TCPMODE_IFC;
|
tcp_mode = TCPMODE_IFC;
|
||||||
Syslog('d', "TCP/IP mode set to IFC");
|
Syslog('d', "TCP/IP mode set to IFC");
|
||||||
} else if ((nlent->iflags & IP_ITN) && ((localoptions & NOITN) == 0)) {
|
proto = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!proto) {
|
||||||
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
|
if (strcmp("ITN", (*tmpm)->name) == 0)
|
||||||
|
ipmask = (*tmpm)->mask;
|
||||||
|
if (nlent->iflags & ipmask) {
|
||||||
tcp_mode = TCPMODE_ITN;
|
tcp_mode = TCPMODE_ITN;
|
||||||
Syslog('d', "TCP/IP mode seto to ITN");
|
Syslog('d', "TCP/IP mode seto to ITN");
|
||||||
} else {
|
proto = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!proto) {
|
||||||
Syslog('+', "No common TCP/IP protocols for node %s", nlent->name);
|
Syslog('+', "No common TCP/IP protocols for node %s", nlent->name);
|
||||||
free(inetaddr);
|
free(inetaddr);
|
||||||
inetaddr = NULL;
|
inetaddr = NULL;
|
||||||
@ -224,8 +239,8 @@ int call(faddr *addr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((nlent->oflags & OL_CM) == 0) && (!IsZMH())) {
|
if (((nlent->oflags & cmmask) == 0) && (!IsZMH())) {
|
||||||
Syslog('?', "Warning: calling MO system outside ZMH");
|
Syslog('?', "Warning: calling non-CM system outside ZMH");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inbound)
|
if (inbound)
|
||||||
|
@ -93,7 +93,7 @@ int rx_emsi(char *data)
|
|||||||
emsi_local_protos &= ~PROT_JAN;
|
emsi_local_protos &= ~PROT_JAN;
|
||||||
if (localoptions & NOHYDRA)
|
if (localoptions & NOHYDRA)
|
||||||
emsi_local_protos &= ~PROT_HYD;
|
emsi_local_protos &= ~PROT_HYD;
|
||||||
if ((localoptions & NOITN) || (localoptions & NOIFC) || ((session_flags & SESSION_TCP) == 0)) {
|
if ((session_flags & SESSION_TCP) == 0) {
|
||||||
emsi_local_protos &= ~PROT_TCP;
|
emsi_local_protos &= ~PROT_TCP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ int tx_emsi(char *data)
|
|||||||
emsi_local_protos &= ~PROT_JAN;
|
emsi_local_protos &= ~PROT_JAN;
|
||||||
if (localoptions & NOHYDRA)
|
if (localoptions & NOHYDRA)
|
||||||
emsi_local_protos &= ~PROT_HYD;
|
emsi_local_protos &= ~PROT_HYD;
|
||||||
if ((localoptions & NOIFC) || (localoptions & NOITN) || ((session_flags & SESSION_TCP) == 0)) {
|
if ((session_flags & SESSION_TCP) == 0) {
|
||||||
emsi_local_protos &= ~PROT_TCP;
|
emsi_local_protos &= ~PROT_TCP;
|
||||||
}
|
}
|
||||||
emsi_remote_protos=0;
|
emsi_remote_protos=0;
|
||||||
|
@ -77,6 +77,8 @@ void ProgName()
|
|||||||
void die(int);
|
void die(int);
|
||||||
void die(int onsig)
|
void die(int onsig)
|
||||||
{
|
{
|
||||||
|
deinitnl();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First check if a child is running, if so, kill it.
|
* First check if a child is running, if so, kill it.
|
||||||
*/
|
*/
|
||||||
@ -176,6 +178,7 @@ int main(int argc, char *argv[])
|
|||||||
faddr *addr = NULL;
|
faddr *addr = NULL;
|
||||||
node *nlent;
|
node *nlent;
|
||||||
FILE *fl;
|
FILE *fl;
|
||||||
|
unsigned long cmmask;
|
||||||
|
|
||||||
#ifdef MEMWATCH
|
#ifdef MEMWATCH
|
||||||
mwInit();
|
mwInit();
|
||||||
@ -312,13 +315,14 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
nlent = getnlent(addr);
|
nlent = getnlent(addr);
|
||||||
|
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 & OL_CM) == 0) && (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] == '-')
|
||||||
|
@ -44,6 +44,8 @@ int nlinfo(faddr *addr)
|
|||||||
node *nlent;
|
node *nlent;
|
||||||
int i, t;
|
int i, t;
|
||||||
char flagbuf[256];
|
char flagbuf[256];
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
nodelist_flag **tmpf;
|
||||||
|
|
||||||
if (addr == NULL)
|
if (addr == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -67,29 +69,22 @@ int nlinfo(faddr *addr)
|
|||||||
/*
|
/*
|
||||||
* Get all normal nodelist flags
|
* Get all normal nodelist flags
|
||||||
*/
|
*/
|
||||||
for (i = 0; fkey[i].flag != 0; i++)
|
for (tmpf = &nl_online; *tmpf; tmpf = &((*tmpf)->next))
|
||||||
if ((nlent->mflags & fkey[i].flag) == fkey[i].flag)
|
if ((nlent->oflags & (*tmpf)->value) == (*tmpf)->value)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", fkey[i].key);
|
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpf)->name);
|
||||||
for (i = 0; dkey[i].flag != 0; i++)
|
for (tmpf = &nl_request; *tmpf; tmpf = &((*tmpf)->next))
|
||||||
if ((nlent->dflags & dkey[i].flag) == dkey[i].flag)
|
if (nlent->xflags == (*tmpf)->value)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", dkey[i].key);
|
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpf)->name);
|
||||||
for (i = 0; ikey[i].flag != 0; i++)
|
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if ((nlent->iflags & ikey[i].flag) == ikey[i].flag)
|
if ((nlent->mflags & (*tmpm)->mask) == (*tmpm)->mask)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", ikey[i].key);
|
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
|
||||||
for (i = 0; okey[i].flag != 0; i++)
|
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if ((nlent->oflags & okey[i].flag) == okey[i].flag)
|
if ((nlent->dflags & (*tmpm)->mask) == (*tmpm)->mask)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", okey[i].key);
|
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
|
||||||
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
switch (nlent->xflags) {
|
if ((nlent->iflags & (*tmpm)->mask) == (*tmpm)->mask)
|
||||||
case RQ_XA: sprintf(flagbuf + strlen(flagbuf), "XA"); break;
|
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
|
||||||
case RQ_XB: sprintf(flagbuf + strlen(flagbuf), "XB"); break;
|
flagbuf[strlen(flagbuf)-1] = '\0';
|
||||||
case RQ_XC: sprintf(flagbuf + strlen(flagbuf), "XC"); break;
|
|
||||||
case RQ_XP: sprintf(flagbuf + strlen(flagbuf), "XP"); break;
|
|
||||||
case RQ_XR: sprintf(flagbuf + strlen(flagbuf), "XR"); break;
|
|
||||||
case RQ_XW: sprintf(flagbuf + strlen(flagbuf), "XW"); break;
|
|
||||||
case RQ_XX: sprintf(flagbuf + strlen(flagbuf), "XX"); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Flags : %s\n", flagbuf);
|
printf("Flags : %s\n", flagbuf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -136,6 +131,7 @@ int nlinfo(faddr *addr)
|
|||||||
}
|
}
|
||||||
printf("Uplink : %u/%u\n", nlent->upnet, nlent->upnode);
|
printf("Uplink : %u/%u\n", nlent->upnet, nlent->upnode);
|
||||||
printf("Region : %u\n", nlent->region);
|
printf("Region : %u\n", nlent->region);
|
||||||
|
printf("URL : %s\n", printable(nlent->url, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nlent->addr.domain)
|
if (nlent->addr.domain)
|
||||||
|
@ -366,6 +366,7 @@ int poll(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;
|
||||||
@ -383,6 +384,7 @@ int poll(faddr *addr, int stop)
|
|||||||
if (!do_quiet)
|
if (!do_quiet)
|
||||||
printf("Removed poll for %s\n", ascfnode(addr, 0x1f));
|
printf("Removed poll for %s\n", ascfnode(addr, 0x1f));
|
||||||
}
|
}
|
||||||
|
CreateSema((char *)"scanout");
|
||||||
} else {
|
} else {
|
||||||
Syslog('+', "No poll found for %s", ascfnode(addr, 0x1f));
|
Syslog('+', "No poll found for %s", ascfnode(addr, 0x1f));
|
||||||
}
|
}
|
||||||
@ -412,7 +414,9 @@ int poll(faddr *addr, int stop)
|
|||||||
rc = MBERR_CANNOT_MAKE_POLL;
|
rc = MBERR_CANNOT_MAKE_POLL;
|
||||||
} else {
|
} else {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (((nlent->oflags & OL_CM) == 0) && (!IsZMH())) {
|
cmmask = getCMmask();
|
||||||
|
Syslog('s', "oflags %08x cmmask %08x", nlent->oflags, cmmask);
|
||||||
|
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));
|
||||||
|
@ -55,9 +55,6 @@ static struct _ktab {
|
|||||||
{(char *)"Zmodem", NOZMODEM},
|
{(char *)"Zmodem", NOZMODEM},
|
||||||
{(char *)"ZedZap", NOZEDZAP},
|
{(char *)"ZedZap", NOZEDZAP},
|
||||||
{(char *)"Hydra", NOHYDRA},
|
{(char *)"Hydra", NOHYDRA},
|
||||||
{(char *)"IBN", NOIBN},
|
|
||||||
{(char *)"ITN", NOITN},
|
|
||||||
{(char *)"IFC", NOIFC},
|
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -98,12 +95,6 @@ void rdoptions(int Loaded)
|
|||||||
localoptions |= NOZEDZAP;
|
localoptions |= NOZEDZAP;
|
||||||
if (CFG.NoHydra)
|
if (CFG.NoHydra)
|
||||||
localoptions |= NOHYDRA;
|
localoptions |= NOHYDRA;
|
||||||
if (CFG.NoIBN)
|
|
||||||
localoptions |= NOIBN;
|
|
||||||
if (CFG.NoITN)
|
|
||||||
localoptions |= NOITN;
|
|
||||||
if (CFG.NoIFC)
|
|
||||||
localoptions |= NOIFC;
|
|
||||||
|
|
||||||
if (nodes.Aka[0].zone == 0) {
|
if (nodes.Aka[0].zone == 0) {
|
||||||
if (Loaded)
|
if (Loaded)
|
||||||
@ -128,13 +119,6 @@ void rdoptions(int Loaded)
|
|||||||
localoptions |= NOZEDZAP;
|
localoptions |= NOZEDZAP;
|
||||||
if (nodes.NoHydra)
|
if (nodes.NoHydra)
|
||||||
localoptions |= NOHYDRA;
|
localoptions |= NOHYDRA;
|
||||||
if (nodes.NoIBN)
|
|
||||||
localoptions |= NOIBN;
|
|
||||||
if (nodes.NoITN)
|
|
||||||
localoptions |= NOITN;
|
|
||||||
if (nodes.NoIFC)
|
|
||||||
localoptions |= NOIFC;
|
|
||||||
|
|
||||||
logoptions();
|
logoptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,9 +60,6 @@ extern int localoptions;
|
|||||||
#define NOZEDZAP 0x0080
|
#define NOZEDZAP 0x0080
|
||||||
#define NOJANUS 0x0100
|
#define NOJANUS 0x0100
|
||||||
#define NOHYDRA 0x0200
|
#define NOHYDRA 0x0200
|
||||||
#define NOIBN 0x0400
|
|
||||||
#define NOITN 0x0800
|
|
||||||
#define NOIFC 0x1000
|
|
||||||
|
|
||||||
|
|
||||||
struct _history history; /* History record for sessions */
|
struct _history history; /* History record for sessions */
|
||||||
|
@ -191,15 +191,17 @@ 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;
|
||||||
|
|
||||||
|
cmmask = getCMmask();
|
||||||
point = Dest->point;
|
point = Dest->point;
|
||||||
Dest->point = 0;
|
Dest->point = 0;
|
||||||
|
|
||||||
if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) {
|
if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) {
|
||||||
if (Nlent->oflags & OL_CM) {
|
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);
|
||||||
|
@ -1351,9 +1351,6 @@ void s_mailer(void)
|
|||||||
mvprintw(12,31, "12. No Zmodem");
|
mvprintw(12,31, "12. No Zmodem");
|
||||||
mvprintw(13,31, "13. No Zedzap");
|
mvprintw(13,31, "13. No Zedzap");
|
||||||
mvprintw(14,31, "14. No Hydra");
|
mvprintw(14,31, "14. No Hydra");
|
||||||
mvprintw(15,31, "15. No IBN binkp");
|
|
||||||
mvprintw(16,31, "16. No IFC ifcico");
|
|
||||||
mvprintw(17,31, "17. No ITN telnet");
|
|
||||||
|
|
||||||
mvprintw(12,59, "18. Phonetrans 1-10");
|
mvprintw(12,59, "18. Phonetrans 1-10");
|
||||||
mvprintw(13,59, "19. Phonetrans 11-20");
|
mvprintw(13,59, "19. Phonetrans 11-20");
|
||||||
@ -1418,9 +1415,6 @@ void e_mailer(void)
|
|||||||
show_bool(12,52, CFG.NoZmodem);
|
show_bool(12,52, CFG.NoZmodem);
|
||||||
show_bool(13,52, CFG.NoZedzap);
|
show_bool(13,52, CFG.NoZedzap);
|
||||||
show_bool(14,52, CFG.NoHydra);
|
show_bool(14,52, CFG.NoHydra);
|
||||||
show_bool(15,52, CFG.NoIBN);
|
|
||||||
show_bool(16,52, CFG.NoIFC);
|
|
||||||
show_bool(17,52, CFG.NoITN);
|
|
||||||
|
|
||||||
show_int( 16,75, CFG.Req_Files);
|
show_int( 16,75, CFG.Req_Files);
|
||||||
show_int( 17,75, CFG.Req_MBytes);
|
show_int( 17,75, CFG.Req_MBytes);
|
||||||
@ -1442,9 +1436,6 @@ void e_mailer(void)
|
|||||||
case 12:E_BOOL(12,52, CFG.NoZmodem, "If set then the ^Zmodem^ protocol is disabled")
|
case 12:E_BOOL(12,52, CFG.NoZmodem, "If set then the ^Zmodem^ protocol is disabled")
|
||||||
case 13:E_BOOL(13,52, CFG.NoZedzap, "If set then the ^Zedzap^ protocol is disabled")
|
case 13:E_BOOL(13,52, CFG.NoZedzap, "If set then the ^Zedzap^ protocol is disabled")
|
||||||
case 14:E_BOOL(14,52, CFG.NoHydra, "If set then the ^Hydra^ protocol is disabled")
|
case 14:E_BOOL(14,52, CFG.NoHydra, "If set then the ^Hydra^ protocol is disabled")
|
||||||
case 15:E_BOOL(15,52, CFG.NoIBN, "If set then the ^TCP/IP IBN binkp^ protocol is disabled")
|
|
||||||
case 16:E_BOOL(16,52, CFG.NoIFC, "If set then the ^TCP/IP IFC ifcico^ protocol is disabled")
|
|
||||||
case 17:E_BOOL(17,52, CFG.NoITN, "If set then the ^TCP/IP ITN telnet^ protocol is disabled")
|
|
||||||
|
|
||||||
case 18:e_trans(0);
|
case 18:e_trans(0);
|
||||||
break;
|
break;
|
||||||
@ -2106,9 +2097,6 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
|||||||
fprintf(fp, " No Zmodem %s\n", getboolean(CFG.NoZmodem));
|
fprintf(fp, " No Zmodem %s\n", getboolean(CFG.NoZmodem));
|
||||||
fprintf(fp, " No Zedzap %s\n", getboolean(CFG.NoZedzap));
|
fprintf(fp, " No Zedzap %s\n", getboolean(CFG.NoZedzap));
|
||||||
fprintf(fp, " No Hydra %s\n", getboolean(CFG.NoHydra));
|
fprintf(fp, " No Hydra %s\n", getboolean(CFG.NoHydra));
|
||||||
fprintf(fp, " No TCP/IP IBN %s\n", getboolean(CFG.NoIBN));
|
|
||||||
fprintf(fp, " No TCP/IP IFC %s\n", getboolean(CFG.NoIFC));
|
|
||||||
fprintf(fp, " No TCP/IP ITN %s\n", getboolean(CFG.NoITN));
|
|
||||||
fprintf(fp, " Max request files %d\n", CFG.Req_Files);
|
fprintf(fp, " Max request files %d\n", CFG.Req_Files);
|
||||||
fprintf(fp, " Max request MBytes %d\n", CFG.Req_MBytes);
|
fprintf(fp, " Max request MBytes %d\n", CFG.Req_MBytes);
|
||||||
|
|
||||||
|
@ -802,9 +802,6 @@ void SessionScreen(void)
|
|||||||
mvprintw(14,41, "14. No Zmodem");
|
mvprintw(14,41, "14. No Zmodem");
|
||||||
mvprintw(15,41, "15. No Zedzap");
|
mvprintw(15,41, "15. No Zedzap");
|
||||||
mvprintw(16,41, "16. No Hydra");
|
mvprintw(16,41, "16. No Hydra");
|
||||||
mvprintw(17,41, "17. No TCP/IP IBN");
|
|
||||||
mvprintw(18,41, "18. No TCP/IP IFC");
|
|
||||||
mvprintw(19,41, "19. No TCP/IP ITN");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -833,11 +830,8 @@ void SessionEdit(void)
|
|||||||
show_bool(14,61, nodes.NoZmodem);
|
show_bool(14,61, nodes.NoZmodem);
|
||||||
show_bool(15,61, nodes.NoZedzap);
|
show_bool(15,61, nodes.NoZedzap);
|
||||||
show_bool(16,61, nodes.NoHydra);
|
show_bool(16,61, nodes.NoHydra);
|
||||||
show_bool(17,61, nodes.NoIBN);
|
|
||||||
show_bool(18,61, nodes.NoIFC);
|
|
||||||
show_bool(19,61, nodes.NoITN);
|
|
||||||
|
|
||||||
switch(select_menu(19)) {
|
switch(select_menu(16)) {
|
||||||
case 0: return;
|
case 0: return;
|
||||||
case 1: E_STR( 7,26,15, nodes.Spasswd, "The ^Session password^ for this node")
|
case 1: E_STR( 7,26,15, nodes.Spasswd, "The ^Session password^ for this node")
|
||||||
case 2: E_STR( 8,26,40, nodes.dial, "If needed, give a special modem ^dial command^ for this node")
|
case 2: E_STR( 8,26,40, nodes.dial, "If needed, give a special modem ^dial command^ for this node")
|
||||||
@ -858,9 +852,6 @@ void SessionEdit(void)
|
|||||||
case 14:E_BOOL(14,61, nodes.NoZmodem, "Disable ^Zmodem^ protocol with this node")
|
case 14:E_BOOL(14,61, nodes.NoZmodem, "Disable ^Zmodem^ protocol with this node")
|
||||||
case 15:E_BOOL(15,61, nodes.NoZedzap, "Disable ^Zedzap^ protocol with this node")
|
case 15:E_BOOL(15,61, nodes.NoZedzap, "Disable ^Zedzap^ protocol with this node")
|
||||||
case 16:E_BOOL(16,61, nodes.NoHydra, "Disable ^Hydra^ protocol with this node")
|
case 16:E_BOOL(16,61, nodes.NoHydra, "Disable ^Hydra^ protocol with this node")
|
||||||
case 17:E_BOOL(17,61, nodes.NoIBN, "Disable ^TCP/IP IBN binkp^ protocol with this node")
|
|
||||||
case 18:E_BOOL(18,61, nodes.NoIFC, "Disable ^TCP/IP IFC ifcico^ protocol with this node")
|
|
||||||
case 19:E_BOOL(19,61, nodes.NoITN, "Disable ^TCP/IP ITN telnet^ protocol with this node")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1483,9 +1474,6 @@ int node_doc(FILE *fp, FILE *toc, int page)
|
|||||||
fprintf(fp, " No Zmodem %s\n", getboolean(nodes.NoZmodem));
|
fprintf(fp, " No Zmodem %s\n", getboolean(nodes.NoZmodem));
|
||||||
fprintf(fp, " No Zedzap %s", getboolean(nodes.NoZedzap));
|
fprintf(fp, " No Zedzap %s", getboolean(nodes.NoZedzap));
|
||||||
fprintf(fp, " No Hydra %s", getboolean(nodes.NoHydra));
|
fprintf(fp, " No Hydra %s", getboolean(nodes.NoHydra));
|
||||||
fprintf(fp, " No TCP/IP IBN %s\n", getboolean(nodes.NoIBN));
|
|
||||||
fprintf(fp, " No TCP/IP IFC %s", getboolean(nodes.NoIFC));
|
|
||||||
fprintf(fp, " No TCP/IP ITN %s", getboolean(nodes.NoITN));
|
|
||||||
fprintf(fp, " Mail forward %s\n", getboolean(nodes.MailFwd));
|
fprintf(fp, " Mail forward %s\n", getboolean(nodes.MailFwd));
|
||||||
fprintf(fp, " Check mailpwd %s", getboolean(nodes.MailPwdCheck));
|
fprintf(fp, " Check mailpwd %s", getboolean(nodes.MailPwdCheck));
|
||||||
fprintf(fp, " ARCmail comp. %s", getboolean(nodes.ARCmailCompat));
|
fprintf(fp, " ARCmail comp. %s", getboolean(nodes.ARCmailCompat));
|
||||||
|
@ -591,6 +591,13 @@ int checktasks(int onsig)
|
|||||||
if (task[i].tasktype == CM_POTS || task[i].tasktype == CM_ISDN || task[i].tasktype == CM_INET)
|
if (task[i].tasktype == CM_POTS || task[i].tasktype == CM_ISDN || task[i].tasktype == CM_INET)
|
||||||
rescan = TRUE;
|
rescan = TRUE;
|
||||||
ptimer = PAUSETIME;
|
ptimer = PAUSETIME;
|
||||||
|
/*
|
||||||
|
* If a nodelist compiler is ready, reload the nodelists configuration
|
||||||
|
*/
|
||||||
|
if (task[i].tasktype == MBINDEX) {
|
||||||
|
deinitnl();
|
||||||
|
initnl();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first && task[i].rc) {
|
if (first && task[i].rc) {
|
||||||
@ -699,6 +706,7 @@ void die(int onsig)
|
|||||||
else
|
else
|
||||||
Syslog('+', "Good, no more tasks running");
|
Syslog('+', "Good, no more tasks running");
|
||||||
|
|
||||||
|
deinitnl();
|
||||||
ulocktask();
|
ulocktask();
|
||||||
if (sock != -1)
|
if (sock != -1)
|
||||||
close(sock);
|
close(sock);
|
||||||
@ -1034,6 +1042,8 @@ void scheduler(void)
|
|||||||
Syslog('+', "Ports configuration changed, reloading");
|
Syslog('+', "Ports configuration changed, reloading");
|
||||||
load_ports();
|
load_ports();
|
||||||
check_ports();
|
check_ports();
|
||||||
|
deinitnl();
|
||||||
|
initnl();
|
||||||
sem_set((char *)"scanout", TRUE);
|
sem_set((char *)"scanout", TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1305,8 +1315,8 @@ int main(int argc, char **argv)
|
|||||||
memset(®info, 0, sizeof(reginfo));
|
memset(®info, 0, sizeof(reginfo));
|
||||||
memset(&calllist, 0, sizeof(calllist));
|
memset(&calllist, 0, sizeof(calllist));
|
||||||
sprintf(spath, "%s/tmp/mbtask", getenv("MBSE_ROOT"));
|
sprintf(spath, "%s/tmp/mbtask", getenv("MBSE_ROOT"));
|
||||||
|
|
||||||
sprintf(ttyfn, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
sprintf(ttyfn, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
||||||
|
initnl();
|
||||||
load_ports();
|
load_ports();
|
||||||
check_ports();
|
check_ports();
|
||||||
|
|
||||||
|
@ -202,7 +202,18 @@ int outstat()
|
|||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
|
unsigned long cmmask, ibnmask = 0, ifcmask = 0, itnmask = 0;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
|
cmmask = getCMmask();
|
||||||
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) {
|
||||||
|
if (strcmp((*tmpm)->name, "IBN") == 0)
|
||||||
|
ibnmask = (*tmpm)->mask;
|
||||||
|
if (strcmp((*tmpm)->name, "IFC") == 0)
|
||||||
|
ifcmask = (*tmpm)->mask;
|
||||||
|
if (strcmp((*tmpm)->name, "ITN") == 0)
|
||||||
|
itnmask = (*tmpm)->mask;
|
||||||
|
}
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
tm = gmtime(&now); /* UTC time */
|
tm = gmtime(&now); /* UTC time */
|
||||||
uhour = tm->tm_hour;
|
uhour = tm->tm_hour;
|
||||||
@ -406,9 +417,9 @@ 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.
|
* check if we can send immediatly.
|
||||||
*/
|
*/
|
||||||
if (TCFG.max_tcp && (tmp->olflags & OL_CM) &&
|
if (TCFG.max_tcp && (tmp->olflags & cmmask) &&
|
||||||
(((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 & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) {
|
||||||
tmp->flavors |= F_CALL;
|
tmp->flavors |= F_CALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +428,7 @@ 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.
|
||||||
*/
|
*/
|
||||||
if ((tmp->olflags & OL_CM) || T_window || iszmh) {
|
if ((tmp->olflags & cmmask) || T_window || iszmh) {
|
||||||
tmp->flavors |= F_CALL;
|
tmp->flavors |= F_CALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -427,7 +438,7 @@ 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.
|
||||||
*/
|
*/
|
||||||
if ((tmp->olflags & OL_CM) || T_window || iszmh) {
|
if ((tmp->olflags & cmmask) || T_window || iszmh) {
|
||||||
tmp->flavors |= F_CALL;
|
tmp->flavors |= F_CALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -480,8 +491,7 @@ int outstat()
|
|||||||
if ((tmp->flavors) & F_CALL) {
|
if ((tmp->flavors) & F_CALL) {
|
||||||
tmp->callmode = CM_NONE;
|
tmp->callmode = CM_NONE;
|
||||||
|
|
||||||
if (TCFG.max_tcp && !(nodes.NoIBN && nodes.NoIFC && nodes.NoITN) &&
|
if (TCFG.max_tcp && ((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) {
|
||||||
((tmp->ipflags & IP_IBN) || (tmp->ipflags & IP_IFC) || (tmp->ipflags & IP_ITN))) {
|
|
||||||
inet_calls++;
|
inet_calls++;
|
||||||
tmp->callmode = CM_INET;
|
tmp->callmode = CM_INET;
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,9 @@ void load_ports()
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
pp_list new;
|
pp_list new;
|
||||||
int j, stdflag;
|
int stdflag;
|
||||||
char *p, *q;
|
char *p, *q;
|
||||||
|
nodelist_modem **tmpm;
|
||||||
|
|
||||||
tidy_portlist(&pl);
|
tidy_portlist(&pl);
|
||||||
if ((fp = fopen(ttyfn, "r")) == NULL) {
|
if ((fp = fopen(ttyfn, "r")) == NULL) {
|
||||||
@ -142,12 +143,12 @@ void load_ports()
|
|||||||
if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) {
|
if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) {
|
||||||
stdflag = FALSE;
|
stdflag = FALSE;
|
||||||
} else {
|
} else {
|
||||||
for (j = 0; fkey[j].key; j++)
|
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if (strcasecmp(p, fkey[j].key) == 0)
|
if (strcasecmp(p, (*tmpm)->name) == 0)
|
||||||
new.mflags |= fkey[j].flag;
|
new.mflags |= (*tmpm)->value;
|
||||||
for (j = 0; dkey[j].key; j++)
|
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if (strcasecmp(p, dkey[j].key) == 0)
|
if (strcasecmp(p, (*tmpm)->name) == 0)
|
||||||
new.dflags |= dkey[j].flag;
|
new.dflags |= (*tmpm)->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user