Rebuild for configurable nodelists handling

This commit is contained in:
Michiel Broek 2002-12-30 22:13:33 +00:00
parent fbe81bfa68
commit 3dfe32df94
20 changed files with 1143 additions and 736 deletions

View File

@ -1,10 +1,20 @@
$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.
general:
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:
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
filtered.
mbout:
When a poll was removed, the outbound was not rescanned.
examples:
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

View File

@ -7,7 +7,7 @@ SRCS = endian.c
HDRS = endian.h
OBJS = endian.o
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
@if [ ! -f ${PREFIX}/english/txtfiles/main.ans ]; then \
tar xfC txtfiles-en.tar ${PREFIX}/english/txtfiles ; \
echo "Installed default english txtfiles" ; \
echo "Installed default English txtfiles" ; \
fi
@if [ ! -f ${PREFIX}/english/macro/html.tic ]; then \
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
clean:

View File

@ -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
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
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
# End of generated dependencies

File diff suppressed because it is too large Load Diff

View File

@ -41,26 +41,6 @@
# 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 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.
@ -71,49 +51,71 @@ online LO 0x00000004
online MN 0x00000008
# Request flags, masks:
# 0x00000001 Bark request
# 0x00000002 Bark update
# 0x00000004 Wazoo request
# 0x00000008 Wazoo update
#
request XA 0x0000000F # Bark request, Bark update, Wazoo request, Wazoo update
request XB 0x00000007 # Bark request, Bark update, Wazoo request
request XC 0x0000000D # Bark request, Wazoo request, Wazoo update
request XP 0x00000003 # Bark request, Bark update
request XR 0x00000005 # Bark request, Wazoo request
request XW 0x00000004 # Wazoo request
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
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:
# 0x00000001 Bark request
# 0x00000002 Bark update
# 0x00000004 Wazoo request
# 0x00000008 Wazoo update
#
request XA 0x0000000F # Bark request, Bark update, Wazoo request, Wazoo update
request XB 0x00000007 # Bark request, Bark update, Wazoo request
request XC 0x0000000D # Bark request, Wazoo request, Wazoo update
request XP 0x00000003 # Bark request, Bark update
request XR 0x00000005 # Bark request, Wazoo request
request XW 0x00000004 # Wazoo request
request XX 0x0000000B # Wazoo request, Wazoo update
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.
@ -127,30 +129,31 @@ isdn X75 0x00000010 0x00000010
# Note that the IP flags do not represent the order of preference.
# That need to be changed.
# Supported IP protocols by the mailer in order of preference.
# The names must match the service names.
#
tcpip IBN 0x00000001 0x00000001
tcpip ITN 0x00000001 0x00000001
tcpip IFC 0x00000002 0x00000002
tcpip ITN 0x00000004 0x00000004
tcpip IVM 0x00000008 0x00000008
tcpip IP 0x00000010 0x00000010
tcpip IFT 0x00000020 0x00000020
tcpip IBN 0x00000004 0x00000004
# The following gives the order to search for the
# FQDN or IP address of the node. Valid values are:
# system - Search in the system name field
# phone - Search the phone field for 000- prefix
# field3 - Search in the system name field, may have :port suffix.
# 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)
# eslf - Extended St. Louis Format fields (NOT YET AVAILABLE)
# defdomain - Asume default domain (NOT YET AVAILABLE)
#
# In all cases, the nodes setup overrides everything.
# Order is important
# Order is important, defdomain must be the last if used.
#
search system
search phone
search field3
search field6
# The default searchdomain, will be prefixed with f1.n2 (NOT YET AVAILABLE)
#

View File

@ -5,95 +5,11 @@
#include "../config.h"
#define MAXNAME 35
#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
*/
@ -117,43 +33,48 @@ typedef struct _node {
char *uflags[MAXUFLAGS]; /* User flags */
int t1; /* T flag, first char */
int t2; /* T flag, second char */
char *url; /* URL for connection */
} node;
extern struct _fkey {
char *key;
unsigned long flag;
} fkey[];
/*
* Memory array structures read from nodelist.conf
*/
typedef struct _nodelist_flag {
struct _nodelist_flag *next;
char *name;
unsigned long value;
} nodelist_flag;
extern struct _dkey {
char *key;
unsigned long flag;
} dkey[];
typedef struct _nodelist_modem {
struct _nodelist_modem *next;
char *name;
unsigned long mask;
unsigned long value;
} nodelist_modem;
extern struct _ikey {
char *key;
unsigned long flag;
} ikey[];
typedef struct _nodelist_array {
struct _nodelist_array *next;
char *name;
} nodelist_array;
extern struct _okey {
char *key;
unsigned long flag;
} okey[];
typedef struct _nodelist_domsuf {
struct _nodelist_domsuf *next;
unsigned short zone;
char *name;
} nodelist_domsuf;
extern struct _xkey {
char *key;
unsigned long flag;
} xkey[];
typedef struct _nodelist_service {
struct _nodelist_service *next;
char *flag;
char *service;
unsigned long port;
} nodelist_service;
extern struct _nodelist {
@ -162,7 +83,6 @@ extern struct _nodelist {
} *nodevector;
struct _ixentry {
unsigned short zone;
unsigned short net;
@ -171,7 +91,6 @@ struct _ixentry {
};
extern struct _pkey {
char *key;
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
*/
int initnl(void);
void deinitnl(void);
node *getnlent(faddr *);
void olflags(unsigned long);
void rqflags(unsigned long);
void moflags(unsigned long);
void diflags(unsigned long);
void ipflags(unsigned long);
unsigned long getCMmask(void);
#endif

View File

@ -729,9 +729,9 @@ struct sysconfig {
unsigned xNoJanus : 1;
unsigned NoHydra : 1; /* Don't do Hydra */
unsigned NoIBN : 1; /* No TCP-IP binkp */
unsigned NoITN : 1; /* No TCP-IP telnet */
unsigned NoIFC : 1; /* No TCP-IP ifcico */
unsigned xNoIBN : 1;
unsigned xNoITN : 1;
unsigned xNoIFC : 1;
char Phone[21]; /* Default phonenumber */
unsigned long Speed; /* Default linespeed */
@ -1221,13 +1221,13 @@ struct _nodes {
unsigned xNoJanus : 1; /* Don't use Janus */
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 ARCmailCompat : 1; /* ARCmail Compatibility */
unsigned ARCmailAlpha : 1; /* Allow a..z ARCmail name */
unsigned FNC : 1; /* Node needs 8.3 filenames */
unsigned NoITN : 1; /* Don't use TCP-IP telnet */
unsigned NoIFC : 1; /* Don't use TCP-IP ifcico */
unsigned xNoITN : 1;
unsigned xNoIFC : 1;
char xExtra[94];
time_t StartDate; /* Node start date */

View File

@ -104,8 +104,10 @@ int portopen(faddr *addr)
int call(faddr *addr)
{
int i, rc = 1;
int i, rc = 1, proto = FALSE;
struct hostent *he;
unsigned long cmmask, ipmask;
nodelist_modem **tmpm;
/*
* Don't call points, call their boss instead.
@ -134,6 +136,7 @@ int call(faddr *addr)
*/
noderecord(addr);
rdoptions(TRUE);
cmmask = getCMmask();
/*
* Fill default history info in case we get a FTS0001 session
@ -152,39 +155,31 @@ int call(faddr *addr)
* First see if this node can be reached over the internet and
* that internet calls are allowed.
*/
if (nlent->iflags && ((localoptions & (NOIBN & NOITN & NOIFC)) == 0)) {
if (nlent->iflags) {
if (!inetaddr) {
Syslog('d', "Trying to find IP address...");
/*
* There is no fdn or IP address at the commandline.
* First check nodesetup for an override in the phone field.
* Try to find the fdn in several places in the nodelist fields.
*/
// if (strlen(nodes.phone[0])) {
// inetaddr = xstrcpy(nodes.phone[0]);
// } else if (strlen(nodes.phone[1])) {
// inetaddr = xstrcpy(nodes.phone[1]);
// } else {
if ((nlent->phone != NULL) && (strncmp(nlent->phone, (char *)"000-", 4) == 0)) {
inetaddr = xstrcpy(nlent->phone+4);
for (i = 0; i < strlen(inetaddr); i++)
if (inetaddr[i] == '-')
inetaddr[i] = '.';
Syslog('d', "Got IP address from phone field");
} else if ((he = gethostbyname(nlent->name))) {
inetaddr = xstrcpy(nlent->name);
Syslog('d', "Got hostname from nodelist system name");
} else if ((he = gethostbyname(nlent->location))) {
/*
* Try to find the fdn in several places in the nodelist fields.
* A fdn at the nodelist location field is not in the specs
* but the real world differs from the specs.
*/
if ((nlent->phone != NULL) && (strncmp(nlent->phone, (char *)"000-", 4) == 0)) {
inetaddr = xstrcpy(nlent->phone+4);
for (i = 0; i < strlen(inetaddr); i++)
if (inetaddr[i] == '-')
inetaddr[i] = '.';
Syslog('d', "Got IP address from phone field");
} else if ((he = gethostbyname(nlent->name))) {
inetaddr = xstrcpy(nlent->name);
Syslog('d', "Got hostname from nodelist system name");
} else if ((he = gethostbyname(nlent->location))) {
/*
* A fdn at the nodelist location field is not in the specs
* but the real world differs from the specs.
*/
inetaddr = xstrcpy(nlent->location);
Syslog('d', "Got hostname from nodelist location");
}
// }
inetaddr = xstrcpy(nlent->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.
* 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;
Syslog('d', "TCP/IP mode set to IBN");
} else if ((nlent->iflags & IP_IFC) && ((localoptions & NOIFC) == 0)) {
tcp_mode = TCPMODE_IFC;
Syslog('d', "TCP/IP mode set to IFC");
} else if ((nlent->iflags & IP_ITN) && ((localoptions & NOITN) == 0)) {
tcp_mode = TCPMODE_ITN;
Syslog('d', "TCP/IP mode seto to ITN");
} else {
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;
Syslog('d', "TCP/IP mode set to IFC");
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;
Syslog('d', "TCP/IP mode seto to ITN");
proto = TRUE;
}
}
if (!proto) {
Syslog('+', "No common TCP/IP protocols for node %s", nlent->name);
free(inetaddr);
inetaddr = NULL;
@ -224,8 +239,8 @@ int call(faddr *addr)
}
}
if (((nlent->oflags & OL_CM) == 0) && (!IsZMH())) {
Syslog('?', "Warning: calling MO system outside ZMH");
if (((nlent->oflags & cmmask) == 0) && (!IsZMH())) {
Syslog('?', "Warning: calling non-CM system outside ZMH");
}
if (inbound)

View File

@ -93,7 +93,7 @@ int rx_emsi(char *data)
emsi_local_protos &= ~PROT_JAN;
if (localoptions & NOHYDRA)
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;
}
@ -224,7 +224,7 @@ int tx_emsi(char *data)
emsi_local_protos &= ~PROT_JAN;
if (localoptions & NOHYDRA)
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_remote_protos=0;

View File

@ -77,48 +77,50 @@ void ProgName()
void die(int);
void die(int onsig)
{
deinitnl();
/*
* First check if a child is running, if so, kill it.
*/
if (e_pid) {
if ((kill(e_pid, SIGTERM)) == 0)
Syslog('+', "SIGTERM to pid %d succeeded", e_pid);
else {
if ((kill(e_pid, SIGKILL)) == 0)
Syslog('+', "SIGKILL to pid %d succeded", e_pid);
else
WriteError("$Failed to kill pid %d", e_pid);
}
/*
* First check if a child is running, if so, kill it.
* In case the child had the tty in raw mode...
*/
if (e_pid) {
if ((kill(e_pid, SIGTERM)) == 0)
Syslog('+', "SIGTERM to pid %d succeeded", e_pid);
else {
if ((kill(e_pid, SIGKILL)) == 0)
Syslog('+', "SIGKILL to pid %d succeded", e_pid);
else
WriteError("$Failed to kill pid %d", e_pid);
}
system("stty sane");
}
/*
* In case the child had the tty in raw mode...
*/
system("stty sane");
}
signal(onsig, SIG_IGN);
signal(onsig, SIG_IGN);
if (show_log)
do_quiet = FALSE;
if (show_log)
do_quiet = FALSE;
if (!do_quiet)
colour(3, 0);
if (!do_quiet)
colour(3, 0);
if (onsig) {
if (onsig <= NSIG)
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
else
WriteError("Terminated with error %d", onsig);
}
if (onsig) {
if (onsig <= NSIG)
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
else
WriteError("Terminated with error %d", onsig);
}
t_end = time(NULL);
Syslog(' ', "MBOUT finished in %s", t_elapsed(t_start, t_end));
t_end = time(NULL);
Syslog(' ', "MBOUT finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) {
colour(7, 0);
printf("\n");
}
ExitClient(onsig);
if (!do_quiet) {
colour(7, 0);
printf("\n");
}
ExitClient(onsig);
}
@ -176,7 +178,8 @@ int main(int argc, char *argv[])
faddr *addr = NULL;
node *nlent;
FILE *fl;
unsigned long cmmask;
#ifdef MEMWATCH
mwInit();
#endif
@ -312,13 +315,14 @@ int main(int argc, char *argv[])
}
nlent = getnlent(addr);
cmmask = getCMmask();
if (nlent->pflag == NL_DUMMY)
Fatal((char *)"Node is not in nodelist", MBERR_NODE_NOT_IN_LIST);
if (nlent->pflag == NL_DOWN)
Fatal((char *)"Node has status Down", MBERR_NODE_MAY_NOT_CALL);
if (nlent->pflag == NL_HOLD)
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);
if (argv[4][0] == '-')

View File

@ -41,107 +41,103 @@
int nlinfo(faddr *addr)
{
node *nlent;
int i, t;
char flagbuf[256];
node *nlent;
int i, t;
char flagbuf[256];
nodelist_modem **tmpm;
nodelist_flag **tmpf;
if (addr == NULL)
return 0;
if (addr == NULL)
return 0;
Syslog('s', "Search nodelist info for %s", ascfnode(addr, 0x1f));
nlent = getnlent(addr);
Syslog('s', "Search nodelist info for %s", ascfnode(addr, 0x1f));
nlent = getnlent(addr);
if (nlent->pflag != NL_DUMMY) {
colour(3, 0);
printf("System : %s\n", nlent->name);
printf("Sysop : %s@%s\n", nlent->sysop, ascinode(addr, 0x3f));
printf("Location : %s\n", nlent->location);
if (nlent->phone)
printf("Phone : %s\n", nlent->phone);
else
printf("Phone : -Unpublished-\n");
printf("Speed : %d\n", nlent->speed);
if (nlent->pflag != NL_DUMMY) {
colour(3, 0);
printf("System : %s\n", nlent->name);
printf("Sysop : %s@%s\n", nlent->sysop, ascinode(addr, 0x3f));
printf("Location : %s\n", nlent->location);
if (nlent->phone)
printf("Phone : %s\n", nlent->phone);
else
printf("Phone : -Unpublished-\n");
printf("Speed : %d\n", nlent->speed);
flagbuf[0] = 0;
flagbuf[0] = 0;
/*
* Get all normal nodelist flags
*/
for (tmpf = &nl_online; *tmpf; tmpf = &((*tmpf)->next))
if ((nlent->oflags & (*tmpf)->value) == (*tmpf)->value)
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpf)->name);
for (tmpf = &nl_request; *tmpf; tmpf = &((*tmpf)->next))
if (nlent->xflags == (*tmpf)->value)
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpf)->name);
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
if ((nlent->mflags & (*tmpm)->mask) == (*tmpm)->mask)
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
if ((nlent->dflags & (*tmpm)->mask) == (*tmpm)->mask)
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
if ((nlent->iflags & (*tmpm)->mask) == (*tmpm)->mask)
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
flagbuf[strlen(flagbuf)-1] = '\0';
printf("Flags : %s\n", flagbuf);
/*
* Get all normal nodelist flags
*/
for (i = 0; fkey[i].flag != 0; i++)
if ((nlent->mflags & fkey[i].flag) == fkey[i].flag)
sprintf(flagbuf + strlen(flagbuf), "%s,", fkey[i].key);
for (i = 0; dkey[i].flag != 0; i++)
if ((nlent->dflags & dkey[i].flag) == dkey[i].flag)
sprintf(flagbuf + strlen(flagbuf), "%s,", dkey[i].key);
for (i = 0; ikey[i].flag != 0; i++)
if ((nlent->iflags & ikey[i].flag) == ikey[i].flag)
sprintf(flagbuf + strlen(flagbuf), "%s,", ikey[i].key);
for (i = 0; okey[i].flag != 0; i++)
if ((nlent->oflags & okey[i].flag) == okey[i].flag)
sprintf(flagbuf + strlen(flagbuf), "%s,", okey[i].key);
switch (nlent->xflags) {
case RQ_XA: sprintf(flagbuf + strlen(flagbuf), "XA"); break;
case RQ_XB: sprintf(flagbuf + strlen(flagbuf), "XB"); break;
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);
/*
* Show User flags
*/
flagbuf[0] = 0;
for (i = 0; nlent->uflags[i]; i++) {
sprintf(flagbuf + strlen(flagbuf), "%s,", nlent->uflags[i]);
}
if (strlen(flagbuf)) {
flagbuf[strlen(flagbuf) - 1] = 0;
printf("U-Flags : %s\n", flagbuf);
}
/*
* Show P flags
*/
printf("P Flag :");
if (nlent->pflag & 0x01)
printf(" Down");
if (nlent->pflag & 0x02)
printf(" Hold");
if (nlent->pflag & 0x04)
printf(" Pvt");
if (nlent->pflag & 0x10)
printf(" ISDN");
if (nlent->pflag & 0x20)
printf(" TCP/IP");
printf("\n");
if (nlent->t1) {
printf("System open : ");
t = toupper(nlent->t1);
printf("%02d:", t - 65);
if (isupper(nlent->t1))
printf("00 - ");
else
printf("30 - ");
t = toupper(nlent->t2);
printf("%02d:", t - 65);
if (isupper(nlent->t2))
printf("00\n");
else
printf("30\n");
}
printf("Uplink : %u/%u\n", nlent->upnet, nlent->upnode);
printf("Region : %u\n", nlent->region);
/*
* Show User flags
*/
flagbuf[0] = 0;
for (i = 0; nlent->uflags[i]; i++) {
sprintf(flagbuf + strlen(flagbuf), "%s,", nlent->uflags[i]);
}
if (strlen(flagbuf)) {
flagbuf[strlen(flagbuf) - 1] = 0;
printf("U-Flags : %s\n", flagbuf);
}
if (nlent->addr.domain)
free(nlent->addr.domain);
/*
* Show P flags
*/
printf("P Flag :");
if (nlent->pflag & 0x01)
printf(" Down");
if (nlent->pflag & 0x02)
printf(" Hold");
if (nlent->pflag & 0x04)
printf(" Pvt");
if (nlent->pflag & 0x10)
printf(" ISDN");
if (nlent->pflag & 0x20)
printf(" TCP/IP");
printf("\n");
if (nlent->t1) {
printf("System open : ");
t = toupper(nlent->t1);
printf("%02d:", t - 65);
if (isupper(nlent->t1))
printf("00 - ");
else
printf("30 - ");
t = toupper(nlent->t2);
printf("%02d:", t - 65);
if (isupper(nlent->t2))
printf("00\n");
else
printf("30\n");
}
printf("Uplink : %u/%u\n", nlent->upnet, nlent->upnode);
printf("Region : %u\n", nlent->region);
printf("URL : %s\n", printable(nlent->url, 0));
}
return 0;
if (nlent->addr.domain)
free(nlent->addr.domain);
return 0;
}

View File

@ -364,78 +364,82 @@ int IsZMH()
int poll(faddr *addr, int stop)
{
char *pol;
int rc = 0;
FILE *fp;
callstat *cst;
node *nlent;
if (addr == NULL)
return 0;
pol = polname(addr);
if (stop) {
if (access(pol, R_OK) == 0) {
rc = unlink(pol);
if (rc == 0) {
Syslog('+', "Removed poll for %s", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Removed poll for %s\n", ascfnode(addr, 0x1f));
}
} else {
Syslog('+', "No poll found for %s", ascfnode(addr, 0x1f));
}
} else {
nlent = getnlent(addr);
if (nlent->pflag == NL_DUMMY) {
Syslog('+', "Node %s not in nodelist", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Node %s not in nodelist", ascfnode(addr, 0x1f));
return MBERR_NODE_NOT_IN_LIST;
}
if (nlent->pflag == NL_DOWN) {
Syslog('+', "Node %s has status Down", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Node %s has status Down", ascfnode(addr, 0x1f));
return MBERR_NODE_MAY_NOT_CALL;
}
if (nlent->pflag == NL_HOLD) {
Syslog('+', "Node %s has status Hold", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Node %s has status Hold", ascfnode(addr, 0x1f));
return MBERR_NODE_MAY_NOT_CALL;
}
if ((fp = fopen(pol, "w+")) == NULL) {
WriteError("$Can't create poll for %s", ascfnode(addr, 0x1f));
rc = MBERR_CANNOT_MAKE_POLL;
} else {
fclose(fp);
if (((nlent->oflags & OL_CM) == 0) && (!IsZMH())) {
Syslog('+', "Created poll for %s, non-CM node outside ZMH", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Created poll for %s, non-CM node outside ZMH\n", ascfnode(addr, 0x1f));
} else {
Syslog('+', "Created poll for %s", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Created poll for %s\n", ascfnode(addr, 0x1f));
}
cst = getstatus(addr);
if ((cst->trystat == MBERR_NODE_LOCKED) ||
(cst->trystat == MBERR_NOT_ZMH) ||
(cst->trystat == MBERR_NO_CONNECTION) ||
(cst->trystat == MBERR_SESSION_ERROR) ||
(cst->trystat == MBERR_UNKNOWN_SESSION) ||
(cst->trystat == MBERR_NO_PORT_AVAILABLE) ||
(cst->trystat == MBERR_MODEM_ERROR)) {
putstatus(addr, 0, 0);
}
CreateSema((char *)"scanout");
}
}
char *pol;
int rc = 0;
unsigned long cmmask;
FILE *fp;
callstat *cst;
node *nlent;
if (addr == NULL)
return 0;
pol = polname(addr);
if (stop) {
if (access(pol, R_OK) == 0) {
rc = unlink(pol);
if (rc == 0) {
Syslog('+', "Removed poll for %s", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Removed poll for %s\n", ascfnode(addr, 0x1f));
}
CreateSema((char *)"scanout");
} else {
Syslog('+', "No poll found for %s", ascfnode(addr, 0x1f));
}
} else {
nlent = getnlent(addr);
if (nlent->pflag == NL_DUMMY) {
Syslog('+', "Node %s not in nodelist", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Node %s not in nodelist", ascfnode(addr, 0x1f));
return MBERR_NODE_NOT_IN_LIST;
}
if (nlent->pflag == NL_DOWN) {
Syslog('+', "Node %s has status Down", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Node %s has status Down", ascfnode(addr, 0x1f));
return MBERR_NODE_MAY_NOT_CALL;
}
if (nlent->pflag == NL_HOLD) {
Syslog('+', "Node %s has status Hold", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Node %s has status Hold", ascfnode(addr, 0x1f));
return MBERR_NODE_MAY_NOT_CALL;
}
if ((fp = fopen(pol, "w+")) == NULL) {
WriteError("$Can't create poll for %s", ascfnode(addr, 0x1f));
rc = MBERR_CANNOT_MAKE_POLL;
} else {
fclose(fp);
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));
if (!do_quiet)
printf("Created poll for %s, non-CM node outside ZMH\n", ascfnode(addr, 0x1f));
} else {
Syslog('+', "Created poll for %s", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Created poll for %s\n", ascfnode(addr, 0x1f));
}
cst = getstatus(addr);
if ((cst->trystat == MBERR_NODE_LOCKED) ||
(cst->trystat == MBERR_NOT_ZMH) ||
(cst->trystat == MBERR_NO_CONNECTION) ||
(cst->trystat == MBERR_SESSION_ERROR) ||
(cst->trystat == MBERR_UNKNOWN_SESSION) ||
(cst->trystat == MBERR_NO_PORT_AVAILABLE) ||
(cst->trystat == MBERR_MODEM_ERROR)) {
putstatus(addr, 0, 0);
}
CreateSema((char *)"scanout");
}
}
return 0;
}

View File

@ -55,9 +55,6 @@ static struct _ktab {
{(char *)"Zmodem", NOZMODEM},
{(char *)"ZedZap", NOZEDZAP},
{(char *)"Hydra", NOHYDRA},
{(char *)"IBN", NOIBN},
{(char *)"ITN", NOITN},
{(char *)"IFC", NOIFC},
{NULL, 0}
};
@ -98,12 +95,6 @@ void rdoptions(int Loaded)
localoptions |= NOZEDZAP;
if (CFG.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 (Loaded)
@ -128,13 +119,6 @@ void rdoptions(int Loaded)
localoptions |= NOZEDZAP;
if (nodes.NoHydra)
localoptions |= NOHYDRA;
if (nodes.NoIBN)
localoptions |= NOIBN;
if (nodes.NoITN)
localoptions |= NOITN;
if (nodes.NoIFC)
localoptions |= NOIFC;
logoptions();
}

View File

@ -60,9 +60,6 @@ extern int localoptions;
#define NOZEDZAP 0x0080
#define NOJANUS 0x0100
#define NOHYDRA 0x0200
#define NOIBN 0x0400
#define NOITN 0x0800
#define NOIFC 0x1000
struct _history history; /* History record for sessions */

View File

@ -188,45 +188,47 @@ int Alias_Option(void)
int Crash_Option(faddr *);
int Crash_Option(faddr *Dest)
{
node *Nlent;
int rc = 0;
unsigned short point;
node *Nlent;
int rc = 0;
unsigned short point;
unsigned long cmmask;
if (exitinfo.Security.level < CFG.iCrashLevel)
return 0;
if (exitinfo.Security.level < CFG.iCrashLevel)
return 0;
point = Dest->point;
Dest->point = 0;
cmmask = getCMmask();
point = Dest->point;
Dest->point = 0;
if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) {
if (Nlent->oflags & OL_CM) {
/* Crash [y/N]: */
pout(CYAN, BLACK, (char *)Language(461));
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
fflush(stdout);
alarm_on();
if (toupper(Getone()) == Keystroke(461, 0)) {
rc = 1;
printf("%c", Keystroke(461, 0));
} else
printf("%c", Keystroke(461, 1));
} else {
/* Warning: node is not CM, send Immediate [y/N]: */
pout(CYAN, BLACK, (char *)Language(462));
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
fflush(stdout);
alarm_on();
if (toupper(Getone()) == Keystroke(462, 0)) {
rc = 2;
printf("%c", Keystroke(462, 0));
} else
printf("%c", Keystroke(462, 1));
}
fflush(stdout);
if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) {
if (Nlent->oflags & cmmask) {
/* Crash [y/N]: */
pout(CYAN, BLACK, (char *)Language(461));
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
fflush(stdout);
alarm_on();
if (toupper(Getone()) == Keystroke(461, 0)) {
rc = 1;
printf("%c", Keystroke(461, 0));
} else
printf("%c", Keystroke(461, 1));
} else {
/* Warning: node is not CM, send Immediate [y/N]: */
pout(CYAN, BLACK, (char *)Language(462));
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
fflush(stdout);
alarm_on();
if (toupper(Getone()) == Keystroke(462, 0)) {
rc = 2;
printf("%c", Keystroke(462, 0));
} else
printf("%c", Keystroke(462, 1));
}
fflush(stdout);
}
Dest->point = point;
return rc;
Dest->point = point;
return rc;
}

View File

@ -1351,9 +1351,6 @@ void s_mailer(void)
mvprintw(12,31, "12. No Zmodem");
mvprintw(13,31, "13. No Zedzap");
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(13,59, "19. Phonetrans 11-20");
@ -1418,9 +1415,6 @@ void e_mailer(void)
show_bool(12,52, CFG.NoZmodem);
show_bool(13,52, CFG.NoZedzap);
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( 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 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 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);
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 Zedzap %s\n", getboolean(CFG.NoZedzap));
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 MBytes %d\n", CFG.Req_MBytes);

View File

@ -802,9 +802,6 @@ void SessionScreen(void)
mvprintw(14,41, "14. No Zmodem");
mvprintw(15,41, "15. No Zedzap");
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(15,61, nodes.NoZedzap);
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 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")
@ -858,9 +852,6 @@ void SessionEdit(void)
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 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 Zedzap %s", getboolean(nodes.NoZedzap));
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, " Check mailpwd %s", getboolean(nodes.MailPwdCheck));
fprintf(fp, " ARCmail comp. %s", getboolean(nodes.ARCmailCompat));

View File

@ -591,6 +591,13 @@ int checktasks(int onsig)
if (task[i].tasktype == CM_POTS || task[i].tasktype == CM_ISDN || task[i].tasktype == CM_INET)
rescan = TRUE;
ptimer = PAUSETIME;
/*
* If a nodelist compiler is ready, reload the nodelists configuration
*/
if (task[i].tasktype == MBINDEX) {
deinitnl();
initnl();
}
}
if (first && task[i].rc) {
@ -699,6 +706,7 @@ void die(int onsig)
else
Syslog('+', "Good, no more tasks running");
deinitnl();
ulocktask();
if (sock != -1)
close(sock);
@ -1034,6 +1042,8 @@ void scheduler(void)
Syslog('+', "Ports configuration changed, reloading");
load_ports();
check_ports();
deinitnl();
initnl();
sem_set((char *)"scanout", TRUE);
}
@ -1305,8 +1315,8 @@ int main(int argc, char **argv)
memset(&reginfo, 0, sizeof(reginfo));
memset(&calllist, 0, sizeof(calllist));
sprintf(spath, "%s/tmp/mbtask", getenv("MBSE_ROOT"));
sprintf(ttyfn, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
initnl();
load_ports();
check_ports();

View File

@ -202,7 +202,18 @@ int outstat()
struct dirent *de;
struct stat sb;
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);
tm = gmtime(&now); /* UTC time */
uhour = tm->tm_hour;
@ -406,9 +417,9 @@ int outstat()
* If the node has internet and we have internet configured,
* 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->ipflags & IP_IBN) || (tmp->ipflags & IP_IFC) || (tmp->ipflags & IP_ITN))) {
((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) {
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.
*/
if ((tmp->olflags & OL_CM) || T_window || iszmh) {
if ((tmp->olflags & cmmask) || T_window || iszmh) {
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.
*/
if ((tmp->olflags & OL_CM) || T_window || iszmh) {
if ((tmp->olflags & cmmask) || T_window || iszmh) {
tmp->flavors |= F_CALL;
}
}
@ -480,8 +491,7 @@ int outstat()
if ((tmp->flavors) & F_CALL) {
tmp->callmode = CM_NONE;
if (TCFG.max_tcp && !(nodes.NoIBN && nodes.NoIFC && nodes.NoITN) &&
((tmp->ipflags & IP_IBN) || (tmp->ipflags & IP_IFC) || (tmp->ipflags & IP_ITN))) {
if (TCFG.max_tcp && ((tmp->ipflags & ibnmask) || (tmp->ipflags & ifcmask) || (tmp->ipflags & itnmask))) {
inet_calls++;
tmp->callmode = CM_INET;
}

View File

@ -109,11 +109,12 @@ void fill_portlist(pp_list **fdp, pp_list *new)
*/
void load_ports()
{
FILE *fp;
pp_list new;
int j, stdflag;
char *p, *q;
FILE *fp;
pp_list new;
int stdflag;
char *p, *q;
nodelist_modem **tmpm;
tidy_portlist(&pl);
if ((fp = fopen(ttyfn, "r")) == NULL) {
Syslog('?', "$Can't open %s", ttyfn);
@ -142,12 +143,12 @@ void load_ports()
if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) {
stdflag = FALSE;
} else {
for (j = 0; fkey[j].key; j++)
if (strcasecmp(p, fkey[j].key) == 0)
new.mflags |= fkey[j].flag;
for (j = 0; dkey[j].key; j++)
if (strcasecmp(p, dkey[j].key) == 0)
new.dflags |= dkey[j].flag;
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
if (strcasecmp(p, (*tmpm)->name) == 0)
new.mflags |= (*tmpm)->value;
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
if (strcasecmp(p, (*tmpm)->name) == 0)
new.dflags |= (*tmpm)->value;
}
}