Added nodelist override settings
This commit is contained in:
parent
4982b8bd2b
commit
e9562655ae
11
ChangeLog
11
ChangeLog
@ -4,11 +4,18 @@ $Id$
|
|||||||
|
|
||||||
v0.35.03 06-Jul-2002
|
v0.35.03 06-Jul-2002
|
||||||
|
|
||||||
|
common.a:
|
||||||
|
Added nodelist override to the nodelist lookup function.
|
||||||
|
|
||||||
lang:
|
lang:
|
||||||
Corrected a spelling error in the Dutch language file.
|
Corrected a spelling error in the Dutch language file.
|
||||||
|
|
||||||
mbcico:
|
mbcico:
|
||||||
Changed IsDoing information.
|
Changed IsDoing information.
|
||||||
|
Makes use of the node nodelist override settings.
|
||||||
|
|
||||||
|
mbout:
|
||||||
|
Makes use of the node nodelist override settings.
|
||||||
|
|
||||||
newuser:
|
newuser:
|
||||||
Check for Unix accounts is now case sensitive.
|
Check for Unix accounts is now case sensitive.
|
||||||
@ -26,6 +33,10 @@ v0.35.03 06-Jul-2002
|
|||||||
Now forces callmode to None if the callflag was cleared.
|
Now forces callmode to None if the callflag was cleared.
|
||||||
The test to add a node to the calllist now also checks the
|
The test to add a node to the calllist now also checks the
|
||||||
internal call flag.
|
internal call flag.
|
||||||
|
Makes use of the node nodelist override settings.
|
||||||
|
|
||||||
|
mbsetup:
|
||||||
|
Enabled setting of nodelist override settings in menu 7.x.3
|
||||||
|
|
||||||
script:
|
script:
|
||||||
The bbsdoor.sh and rundoor.sh scripts are now only installed
|
The bbsdoor.sh and rundoor.sh scripts are now only installed
|
||||||
|
@ -478,9 +478,21 @@ MSN/EAZ the device should listen to. This should for an MSN be your telephone
|
|||||||
number <b>with</b> the area code but <b>without</b> the leading 0. For an
|
number <b>with</b> the area code but <b>without</b> the leading 0. For an
|
||||||
EAZ the last digit of your EAZ.
|
EAZ the last digit of your EAZ.
|
||||||
<p> The ISDN ports </p>
|
<p> The ISDN ports </p>
|
||||||
<pre>port ttyI0<br>modem-type data<br>init-chat "" ATZ OK AT&E714015437&W0 OK AT&B512 OK<br><br>port ttyI1<br>modem-type data<br>init-chat "" ATZ OK AT&E714017198&W0 OK AT&B512 OK<br><br></pre>
|
<pre>
|
||||||
From the mbsetup menu #5 "Edit Modem types" configure the ISDN modem type.
|
port ttyI0
|
||||||
<pre>
|
modem-type data
|
||||||
|
init-chat "" ATZ OK
|
||||||
|
AT&E714015437&W0 OK
|
||||||
|
AT&B512 OK
|
||||||
|
|
||||||
|
port ttyI1
|
||||||
|
modem-type data
|
||||||
|
init-chat "" ATZ OK
|
||||||
|
AT&E714017198&W0 OK
|
||||||
|
AT&B512 OK
|
||||||
|
</pre>
|
||||||
|
From the mbsetup menu #5 "Edit Modem types" configure the ISDN modem type.
|
||||||
|
<pre>
|
||||||
Modem type ISDN Linux
|
Modem type ISDN Linux
|
||||||
Init string ATZ\r
|
Init string ATZ\r
|
||||||
Init string
|
Init string
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.4 KiB |
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
BODY { background-color: white; font-family: Arial, Helvetica; }
|
BODY { background-color: white; font-family: Arial, Helvetica; font-size=10pt; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* H1 is the page header, H3 the paragraph header, H5 is topright update date.
|
* H1 is the page header, H3 the paragraph header, H5 is topright update date.
|
||||||
@ -19,6 +19,10 @@ A:link { color: blue }
|
|||||||
A:visited { color: darkblue }
|
A:visited { color: darkblue }
|
||||||
A:active { color: red }
|
A:active { color: red }
|
||||||
|
|
||||||
|
TABLE { color: black; }
|
||||||
|
TH { font-family: Arial, Helvetica; font-size: 12pt; font-weight: bold; }
|
||||||
|
TD { font-family: Arial, Helvetica; font-size: 12pt; }
|
||||||
|
|
||||||
PRE { color: brown; font-family: fixed; }
|
PRE { color: brown; font-family: fixed; }
|
||||||
CODE { color: brown; font-family: fixed; }
|
CODE { color: brown; font-family: fixed; }
|
||||||
HR { border-top: solid medium navy }
|
HR { border-top: solid medium navy }
|
||||||
|
@ -12,10 +12,9 @@
|
|||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY>
|
<BODY>
|
||||||
<BLOCKQUOTE>
|
<BLOCKQUOTE>
|
||||||
<h5>Last update 28-Jun-2002</h5>
|
<div align=right><h5>Last update 13-Jul-2002</h5></div>
|
||||||
<P> <P>
|
|
||||||
|
|
||||||
<H1>MBSE BBS Setup - Fidonet nodes.</H1>
|
<div align=center><H1>MBSE BBS Setup - Fidonet nodes.</H1></div>
|
||||||
<P>
|
<P>
|
||||||
|
|
||||||
<h3>Introduction</H3>
|
<h3>Introduction</H3>
|
||||||
@ -33,28 +32,44 @@ This screen has the general information for the node. The contact info fields ar
|
|||||||
just for private use, these fields are only used in this screen. The Outbox dir is for
|
just for private use, these fields are only used in this screen. The Outbox dir is for
|
||||||
files to sent to the node, all file you put in there will be sent to the remote if
|
files to sent to the node, all file you put in there will be sent to the remote if
|
||||||
user mbse has read/write access to the file. Only real files are allowed, not symlinks etc.
|
user mbse has read/write access to the file. Only real files are allowed, not symlinks etc.
|
||||||
<pre>
|
<p><table>
|
||||||
<strong>Sysop name </strong>The name of the system operator.
|
<tr><th nowrap align=left valign=top>Sysop name</th><td>The name of the system
|
||||||
<strong>Outbox dir </strong>Private extra outbound directory for this node.
|
operator. The name entered here is used in Areamgr and Filemgr messages etc.</td></tr>
|
||||||
<strong>Pvt. phone </strong>Contact info, node private phone.
|
<tr><th nowrap align=left valign=top>Outbox dir</th><td>Private extra outbound
|
||||||
<strong>Pvt. fax </strong>Contact info, node private fax.
|
directory for this node. Any file dropped into this directory will be sent to
|
||||||
<strong>Pvt. cellphone </strong>Contact info, node cellphone (GSM).
|
the node and removed after it is sent.</td></tr>
|
||||||
<strong>Pvt. e-mail </strong>Contact info, node e-mail address.
|
<tr><th nowrap align=left valign=top>Pvt. phone</th><td>Contact info, node private
|
||||||
<strong>Pvt. remark </strong>Contact info, node remark.
|
phone.</td></tr>
|
||||||
<strong>Route via </strong>A route via Fido address. All mail for this
|
<tr><th nowrap align=left valign=top>Pvt. fax</th><td>Contact info, node private
|
||||||
node will be send via this Aka, even mail
|
fax.</td></tr>
|
||||||
and files for other networks. This can be
|
<tr><th nowrap align=left valign=top>Pvt. cellphone</th><td>Contact info, node
|
||||||
usefull if this node has internet access
|
cellphone (GSM).</td></tr>
|
||||||
so you can send everything to this node
|
<tr><th nowrap align=left valign=top>Pvt. e-mail</th><td>Contact info, node e-mail
|
||||||
over the internet.
|
address.</td></tr>
|
||||||
<strong>Netmail direct </strong>Set "direct" flag in netmail to this node.
|
<tr><th nowrap align=left valign=top>Pvt. remark</th><td>Contact info, node
|
||||||
<strong>Netmail crash </strong>Send netmail always "crash" to this node.
|
remark.</td></tr>
|
||||||
<strong>Netmail hold </strong>Put mail on "hold" for this node.
|
<tr><th nowrap align=left valign=top>Route via</th><td>A route via Fido address. All
|
||||||
<strong>Pack netmail </strong>Should netmail be packed in arcmail archives.
|
mail for this node will be send via this Aka, even mail and files for other
|
||||||
<strong>Send notify </strong>Send automatic generated notify messages.
|
networks. This can be usefull if this node has internet access so you can send
|
||||||
<strong>Language </strong>The language to use for areamgr msgs.
|
everything to this node over the internet. Note that to force calling this node
|
||||||
<strong>Deleted </strong>If this node must be deleted.
|
via internetr, ISDN or pots can also be done by using nodelist flags override. See
|
||||||
</pre>
|
section 3. This setting is more usefull to force routing via another node or
|
||||||
|
aka.</td></tr>
|
||||||
|
<tr><th nowrap align=left valign=top>Netmail direct</th><td>Set "direct" flag in
|
||||||
|
netmail to this node.</td></tr>
|
||||||
|
<tr><th nowrap align=left valign=top>Netmail crash</th><td>Send netmail always "crash"
|
||||||
|
to this node.</td></tr>
|
||||||
|
<tr><th nowrap align=left valign=top>Netmail hold</th><td>Put mail on "hold" for this
|
||||||
|
node.</td></tr>
|
||||||
|
<tr><th nowrap align=left valign=top>Pack netmail</th><td>Should netmail be packed in
|
||||||
|
arcmail archives.</td></tr>
|
||||||
|
<tr><th nowrap align=left valign=top>Send notify</th><td>Send automatic generated
|
||||||
|
notify messages.</td></tr>
|
||||||
|
<tr><th nowrap align=left valign=top>Language</th><td>The language to use for areamgr
|
||||||
|
msgs.</td></tr>
|
||||||
|
<tr><th nowrap align=left valign=top>Deleted</th><td>If this node must be
|
||||||
|
deleted.</td></tr>
|
||||||
|
</table>
|
||||||
<P>
|
<P>
|
||||||
<IMG SRC="../images/nodes1.png">
|
<IMG SRC="../images/nodes1.png">
|
||||||
<P> <p>
|
<P> <p>
|
||||||
@ -68,32 +83,32 @@ In this screen you can setup 20 aka's for the node.
|
|||||||
|
|
||||||
<H3>Edit node session</H3>
|
<H3>Edit node session</H3>
|
||||||
<p>
|
<p>
|
||||||
In this screen you can setup the session defaults. Items 5/8 will be added later.
|
In this screen you can setup the session defaults. Items 7 and 8 will be added later.
|
||||||
<pre>
|
<p><table>
|
||||||
<strong>Session passwd </strong>This is the mailer session password.
|
<tr><th nowrap align=left valign=top>Session passwd</th><td>This is the mailer session password.
|
||||||
<strong>Dial command </strong>You can put an override here for the normal
|
<tr><th nowrap align=left valign=top>Dial command</th><td>You can put an override here for the normal dial command. If you leave this empty the command from the modem setup is used.
|
||||||
dial command. If you leave this empty the
|
<tr><th nowrap align=left valign=top>Phone number 1</th><td>An alternative phone number/ip address to dial.
|
||||||
command from the modem setup is used.
|
<tr><th nowrap align=left valign=top>Phone number 2</th><td>An alternative phone number/ip address to dial. Use these above commands if the node has another phone number as mentioned in the nodelist.
|
||||||
<strong>Phone number 1 </strong>An alternative phone number/ip address to dial.
|
<tr><th nowrap align=left valign=top>Nodelist flags</th><td>Override for the
|
||||||
<strong>Phone number 2 </strong>An alternative phone number/ip address to dial.
|
nodelist flags, the nodelist flags are completly ignored if you enter something
|
||||||
Use these above commands if the node has
|
here so make sure all flags you need are here. All aka's of this node will use
|
||||||
another phone number as mentioned in the
|
the same flags. This can be usefull to force calling this node via the internet.
|
||||||
nodelist. If you call this node via TCP/IP
|
<tr><th nowrap align=left valign=top>Inet hostname</th><td>The FQDN hostname or
|
||||||
and the IP address can't be resolved by
|
IP address of this node. This replaces the original system name from the
|
||||||
the nodelist, you may enter an IP address
|
nodelist and this is then used to make the internet TCP/IP connection. This can
|
||||||
or hostname here.
|
be usefull if the FQDN is not present in the nodelist.
|
||||||
<strong>No EMSI </strong>Disable EMSI handshake.
|
<tr><th nowrap align=left valign=top>No EMSI</th><td>Disable EMSI handshake.
|
||||||
<strong>No YooHoo/2U2 </strong>Disable FTSC-0006 handshake.
|
<tr><th nowrap align=left valign=top>No YooHoo/2U2</th><td>Disable FTSC-0006 handshake.
|
||||||
<strong>No Filerequest </strong>Disable filerquest from this node.
|
<tr><th nowrap align=left valign=top>No Filerequest</th><td>Disable filerequest from this node.
|
||||||
<strong>Don't call </strong>Do not call this node.
|
<tr><th nowrap align=left valign=top>Don't call</th><td>Do not call this node.
|
||||||
<strong>8.3 names </strong>Set this if the node only accepts 8.3 filenames.
|
<tr><th nowrap align=left valign=top>8.3 names</th><td>Set this if the node only accepts 8.3 filenames.
|
||||||
<strong>No Zmodem </strong>Disable Zmodem protocol.
|
<tr><th nowrap align=left valign=top>No Zmodem</th><td>Disable Zmodem protocol.
|
||||||
<strong>No Zedzap </strong>Disable Zedzap protocol.
|
<tr><th nowrap align=left valign=top>No Zedzap</th><td>Disable Zedzap protocol.
|
||||||
<strong>No Hydra </strong>Disable Hydra protocol.
|
<tr><th nowrap align=left valign=top>No Hydra</th><td>Disable Hydra protocol.
|
||||||
<strong>No TCP/IP IBN </strong>Disbale TCP/IP IBN (binkp) protocol.
|
<tr><th nowrap align=left valign=top>No TCP/IP IBN</th><td>Disbale TCP/IP IBN (binkp) protocol.
|
||||||
<strong>No TCP/IP IFC </strong>Disable TCP/IP IFC (ifcico) protocol.
|
<tr><th nowrap align=left valign=top>No TCP/IP IFC</th><td>Disable TCP/IP IFC (ifcico) protocol.
|
||||||
<strong>No TCP/IP ITN </strong>Disable TCP/IP ITN (telnet) protocol.
|
<tr><th nowrap align=left valign=top>No TCP/IP ITN</th><td>Disable TCP/IP ITN (telnet) protocol.
|
||||||
</pre>
|
</table>
|
||||||
<p>
|
<p>
|
||||||
<IMG SRC="../images/nodes3.png">
|
<IMG SRC="../images/nodes3.png">
|
||||||
<P> <p>
|
<P> <p>
|
||||||
@ -101,19 +116,15 @@ In this screen you can setup the session defaults. Items 5/8 will be added later
|
|||||||
|
|
||||||
<H3>Edit node - mail processing</H3>
|
<H3>Edit node - mail processing</H3>
|
||||||
<P>
|
<P>
|
||||||
<pre>
|
<p><table>
|
||||||
<strong>PKT password </strong>The password to insert in .pkt files.
|
<tr><th nowrap align=left valign=top>PKT password</th><td>The password to insert in .pkt files.
|
||||||
<strong>Check PKT pwd </strong>Check password in received .pkt files. If not,
|
<tr><th nowrap align=left valign=top>Check PKT pwd</th><td>Check password in received .pkt files. If not, errors or missing passwords are only logged. If set, errors or missing password are refused and the .pkt files are renamed to .bad
|
||||||
errors or missing passwords are only logged.
|
<tr><th nowrap align=left valign=top>UplMgr program</th><td>The name of the Areamgr program of this node. This could be AreaFix, AreaMgr etc.
|
||||||
If set, errors or missing password are refused
|
<tr><th nowrap align=left valign=top>UplMgr passwd</th><td>The password for the Areamgr of this node.
|
||||||
and the .pkt files are renamed to .bad
|
<tr><th nowrap align=left valign=top>Mail forward</th><td>Not in use yet.
|
||||||
<strong>UplMgr program </strong>The name of the Areamgr program of this node.
|
<tr><th nowrap align=left valign=top>ARCmail comp.</th><td>Use ARCmail 0.60 file naming convention for out of zone mail.
|
||||||
This could be AreaFix, AreaMgr etc.
|
<tr><th nowrap align=left valign=top>ARCmail a..z</th><td>Allow a..z last character for ARCmail filenames.
|
||||||
<strong>UplMgr passwd </strong>The password for the Areamgr of this node.
|
</table>
|
||||||
<strong>Mail forward </strong>Not in use yet.
|
|
||||||
<strong>ARCmail comp. </strong>Use ARCmail 0.60 file naming convention for out of zone mail.
|
|
||||||
<strong>ARCmail a..z </strong>Allow a..z last character for ARCmail filenames.
|
|
||||||
</pre>
|
|
||||||
<P>
|
<P>
|
||||||
<IMG SRC="../images/nodes4.gif">
|
<IMG SRC="../images/nodes4.gif">
|
||||||
<P> <p>
|
<P> <p>
|
||||||
@ -129,25 +140,24 @@ carefull not to allow a node to connect areas from networks he has no aka in.
|
|||||||
|
|
||||||
<H3>File setup</H3>
|
<H3>File setup</H3>
|
||||||
<P>
|
<P>
|
||||||
<pre>
|
<p><table>
|
||||||
<strong>Files password </strong>The password for .tic files.
|
<tr><th nowrap align=left valign=top>Files password</th><td>The password for .tic files.
|
||||||
<strong>Mgr password </strong>The password for the Areamgr and Filemgr.
|
<tr><th nowrap align=left valign=top>Mgr password</th><td>The password for the Areamgr and Filemgr.
|
||||||
<strong>UplMgr program </strong>The name of the Filemgr progrom of this node.
|
<tr><th nowrap align=left valign=top>UplMgr program</th><td>The name of the Filemgr progrom of this node. This could be FileMgr, Allfix, Raid etc.
|
||||||
This could be FileMgr, Allfix, Raid etc.
|
<tr><th nowrap align=left valign=top>UplMgr passwd</th><td>The password of the Filemgr if this node.
|
||||||
<strong>UplMgr passwd </strong>The password of the Filemgr if this node.
|
<tr><th nowrap align=left valign=top>UplMgr Add +</th><td>Add a "+" in the command to connect areas.
|
||||||
<strong>UplMgr Add + </strong>Add a "+" in the command to connect areas.
|
<tr><th nowrap align=left valign=top>Incl. message</th><td>Send a netmail message for each file to send.
|
||||||
<strong>Incl. message </strong>Send a netmail message for each file to send.
|
<tr><th nowrap align=left valign=top>Send TIC file</th><td>Send .tic file to this node.
|
||||||
<strong>Send TIC file </strong>Send .tic file to this node.
|
<tr><th nowrap align=left valign=top>Advanced TIC</th><td>Send advanced or standard .tic files.
|
||||||
<strong>Advanced TIC </strong>Send advanced or standard .tic files.
|
<tr><th nowrap align=left valign=top>File forward</th><td>Forward TIC files for this node (not yet).
|
||||||
<strong>File forward </strong>Forward TIC files for this node (not yet).
|
<tr><th nowrap align=left valign=top>Billing</th><td>Is Costsharing active for this node.
|
||||||
<strong>Billing </strong>Is Costsharing active for this node.
|
<tr><th nowrap align=left valign=top>Bill direct</th><td>Send the bill direct or on command.
|
||||||
<strong>Bill direct </strong>Send the bill direct or on command.
|
<tr><th nowrap align=left valign=top>Credit</th><td>The credit this node has in units.
|
||||||
<strong>Credit </strong>The credit this node has in units.
|
<tr><th nowrap align=left valign=top>Debet</th><td>The debet we have with this node (informational).
|
||||||
<strong>Debet </strong>The debet we have with this node (informational).
|
<tr><th nowrap align=left valign=top>Add</th><td>Add (or substract) factor to the bill.
|
||||||
<strong>Add </strong>Add (or substract) factor to the bill.
|
<tr><th nowrap align=left valign=top>Warn level</th><td>The debet level when to write a warning mesage.
|
||||||
<strong>Warn level </strong>The debet level when to write a warning mesage.
|
<tr><th nowrap align=left valign=top>Stop level</th><td>The debet level when to stop sending files.
|
||||||
<strong>Stop level </strong>The debet level when to stop sending files.
|
</table>
|
||||||
</pre>
|
|
||||||
<P>
|
<P>
|
||||||
<IMG SRC="../images/nodes6.gif">
|
<IMG SRC="../images/nodes6.gif">
|
||||||
<P> <p>
|
<P> <p>
|
||||||
|
793
lib/nodelist.c
793
lib/nodelist.c
@ -174,446 +174,481 @@ int comp_node(struct _nlidx fap1, struct _ixentry fap2)
|
|||||||
|
|
||||||
node *getnlent(faddr *addr)
|
node *getnlent(faddr *addr)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
static node nodebuf;
|
static node nodebuf;
|
||||||
static char buf[256], *p, *q;
|
static char buf[256], *p, *q;
|
||||||
struct _ixentry xaddr;
|
struct _ixentry xaddr;
|
||||||
int i, j, Found = FALSE;
|
int i, j, Found = FALSE, ixflag, stdflag, ndrecord = FALSE;
|
||||||
int ixflag, stdflag;
|
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;
|
||||||
|
static struct _nodes nd;
|
||||||
|
|
||||||
Syslog('s', "getnlent: %s", ascfnode(addr,0xff));
|
Syslog('s', "getnlent: %s", ascfnode(addr,0xff));
|
||||||
|
|
||||||
mydomain = xstrcpy(CFG.aka[0].domain);
|
mydomain = xstrcpy(CFG.aka[0].domain);
|
||||||
if (mydomain == NULL)
|
if (mydomain == NULL)
|
||||||
mydomain = (char *)NULLDOMAIN;
|
mydomain = (char *)NULLDOMAIN;
|
||||||
|
|
||||||
nodebuf.addr.domain = NULL;
|
nodebuf.addr.domain = NULL;
|
||||||
nodebuf.addr.zone = 0;
|
nodebuf.addr.zone = 0;
|
||||||
nodebuf.addr.net = 0;
|
nodebuf.addr.net = 0;
|
||||||
nodebuf.addr.node = 0;
|
nodebuf.addr.node = 0;
|
||||||
nodebuf.addr.point = 0;
|
nodebuf.addr.point = 0;
|
||||||
nodebuf.addr.name = NULL;
|
nodebuf.addr.name = NULL;
|
||||||
nodebuf.upnet = 0;
|
nodebuf.upnet = 0;
|
||||||
nodebuf.upnode = 0;
|
nodebuf.upnode = 0;
|
||||||
nodebuf.region = 0;
|
nodebuf.region = 0;
|
||||||
nodebuf.type = 0;
|
nodebuf.type = 0;
|
||||||
nodebuf.pflag = 0;
|
nodebuf.pflag = 0;
|
||||||
nodebuf.name = NULL;
|
nodebuf.name = NULL;
|
||||||
nodebuf.location = NULL;
|
nodebuf.location = NULL;
|
||||||
nodebuf.sysop = NULL;
|
nodebuf.sysop = NULL;
|
||||||
nodebuf.phone = NULL;
|
nodebuf.phone = NULL;
|
||||||
nodebuf.speed = 0;
|
nodebuf.speed = 0;
|
||||||
nodebuf.mflags = 0L;
|
nodebuf.mflags = 0L;
|
||||||
nodebuf.oflags = 0L;
|
nodebuf.oflags = 0L;
|
||||||
nodebuf.xflags = 0L;
|
nodebuf.xflags = 0L;
|
||||||
nodebuf.iflags = 0L;
|
nodebuf.iflags = 0L;
|
||||||
nodebuf.dflags = 0L;
|
nodebuf.dflags = 0L;
|
||||||
nodebuf.uflags[0] = NULL;
|
nodebuf.uflags[0] = NULL;
|
||||||
nodebuf.t1 = '\0';
|
nodebuf.t1 = '\0';
|
||||||
nodebuf.t2 = '\0';
|
nodebuf.t2 = '\0';
|
||||||
|
|
||||||
if (addr == NULL)
|
if (addr == NULL)
|
||||||
goto retdummy;
|
goto retdummy;
|
||||||
|
|
||||||
if (addr->zone == 0)
|
if (addr->zone == 0)
|
||||||
addr->zone = CFG.aka[0].zone;
|
addr->zone = CFG.aka[0].zone;
|
||||||
xaddr.zone = addr->zone;
|
xaddr.zone = addr->zone;
|
||||||
nodebuf.addr.zone = addr->zone;
|
nodebuf.addr.zone = addr->zone;
|
||||||
xaddr.net = addr->net;
|
xaddr.net = addr->net;
|
||||||
nodebuf.addr.net = addr->net;
|
nodebuf.addr.net = addr->net;
|
||||||
xaddr.node = addr->node;
|
xaddr.node = addr->node;
|
||||||
nodebuf.addr.node = addr->node;
|
nodebuf.addr.node = addr->node;
|
||||||
xaddr.point = addr->point;
|
xaddr.point = addr->point;
|
||||||
nodebuf.addr.point = addr->point;
|
nodebuf.addr.point = addr->point;
|
||||||
|
|
||||||
if (initnl())
|
if (initnl())
|
||||||
goto retdummy;
|
goto retdummy;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First, lookup node in index. NOTE -- NOT 5D YET
|
* First, lookup node in index. NOTE -- NOT 5D YET
|
||||||
*/
|
*/
|
||||||
path = calloc(PATH_MAX, sizeof(char));
|
path = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(path, "%s/%s", CFG.nodelists, "node.index");
|
sprintf(path, "%s/%s", CFG.nodelists, "node.index");
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
if ((fp = fopen(path, "r")) == NULL) {
|
||||||
WriteError("$Can't open %s", path);
|
WriteError("$Can't open %s", path);
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
|
|
||||||
fseek(fp, 0, SEEK_END);
|
|
||||||
highest = ftell(fp) / sizeof(ndx);
|
|
||||||
lowest = 0;
|
|
||||||
|
|
||||||
while (TRUE) {
|
|
||||||
current = ((highest - lowest) / 2) + lowest;
|
|
||||||
fseek(fp, current * sizeof(ndx), SEEK_SET);
|
|
||||||
if (fread(&ndx, sizeof(ndx), 1, fp) != 1)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (comp_node(ndx, xaddr) == 0) {
|
|
||||||
Found = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (comp_node(ndx, xaddr) < 0)
|
|
||||||
lowest = current;
|
|
||||||
else
|
|
||||||
highest = current;
|
|
||||||
if ((highest - lowest) <= 1)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
if (!Found) {
|
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(path, "%s/%s", CFG.nodelists, "node.files");
|
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
|
||||||
WriteError("$Can't open %s", path);
|
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get filename from node.files
|
|
||||||
*/
|
|
||||||
for (i = 0; i < (ndx.fileno +1); i++)
|
|
||||||
fread(&fdx, sizeof(fdx), 1, fp);
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
/* CHECK DOMAIN HERE */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Open and read in real nodelist
|
|
||||||
*/
|
|
||||||
sprintf(path, "%s/%s", CFG.nodelists, fdx.filename);
|
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
|
||||||
WriteError("$Can't open %s", path);
|
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
free(path);
|
free(path);
|
||||||
|
goto retdummy;
|
||||||
|
}
|
||||||
|
|
||||||
if (fseek(fp, ndx.offset, SEEK_SET) != 0) {
|
fseek(fp, 0, SEEK_END);
|
||||||
WriteError("$Seek failed for nodelist entry");
|
highest = ftell(fp) / sizeof(ndx);
|
||||||
fclose(fp);
|
lowest = 0;
|
||||||
goto retdummy;
|
|
||||||
|
while (TRUE) {
|
||||||
|
current = ((highest - lowest) / 2) + lowest;
|
||||||
|
fseek(fp, current * sizeof(ndx), SEEK_SET);
|
||||||
|
if (fread(&ndx, sizeof(ndx), 1, fp) != 1)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (comp_node(ndx, xaddr) == 0) {
|
||||||
|
Found = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
if (comp_node(ndx, xaddr) < 0)
|
||||||
if (fgets(buf, sizeof(buf)-1, fp) == NULL) {
|
lowest = current;
|
||||||
WriteError("$fgets failed for nodelist entry");
|
|
||||||
fclose(fp);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
nodebuf.type = ndx.type;
|
|
||||||
nodebuf.pflag = ndx.pflag;
|
|
||||||
|
|
||||||
if (*(p = buf + strlen(buf) -1) == '\n')
|
|
||||||
*p = '\0';
|
|
||||||
if (*(p = buf + strlen(buf) -1) == '\r')
|
|
||||||
*p = '\0';
|
|
||||||
for (p = buf; *p; p++)
|
|
||||||
if (*p == '_')
|
|
||||||
*p = ' ';
|
|
||||||
|
|
||||||
p = buf;
|
|
||||||
|
|
||||||
if ((q = strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.name = p;
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.location = p;
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.sysop = p;
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
if (strcasecmp(p, "-Unpublished-") == 0)
|
|
||||||
nodebuf.phone = NULL;
|
|
||||||
else
|
else
|
||||||
nodebuf.phone = p;
|
highest = current;
|
||||||
p = q;
|
if ((highest - lowest) <= 1)
|
||||||
if (p == NULL)
|
break;
|
||||||
goto badsyntax;
|
}
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
fclose(fp);
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.speed = atoi(p);
|
|
||||||
|
|
||||||
/*
|
if (!Found) {
|
||||||
* Process the nodelist flags.
|
free(path);
|
||||||
*/
|
goto retdummy;
|
||||||
ixflag = 0;
|
}
|
||||||
stdflag = TRUE;
|
|
||||||
for (p = q; p; p = q) {
|
sprintf(path, "%s/%s", CFG.nodelists, "node.files");
|
||||||
if ((q = strchr(p, ',')))
|
if ((fp = fopen(path, "r")) == NULL) {
|
||||||
*q++ = '\0';
|
WriteError("$Can't open %s", path);
|
||||||
if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) {
|
free(path);
|
||||||
stdflag = FALSE;
|
goto retdummy;
|
||||||
} else {
|
}
|
||||||
/*
|
|
||||||
* Experimental: process authorized flags and
|
/*
|
||||||
* User flags both as authorized.
|
* Get filename from node.files
|
||||||
*/
|
*/
|
||||||
for (j = 0; fkey[j].key; j++)
|
for (i = 0; i < (ndx.fileno +1); i++)
|
||||||
if (strcasecmp(p, fkey[j].key) == 0)
|
fread(&fdx, sizeof(fdx), 1, fp);
|
||||||
nodebuf.mflags |= fkey[j].flag;
|
fclose(fp);
|
||||||
for (j = 0; okey[j].key; j++)
|
|
||||||
if (strcasecmp(p, okey[j].key) == 0)
|
/* CHECK DOMAIN HERE */
|
||||||
nodebuf.oflags |= okey[j].flag;
|
|
||||||
for (j = 0; dkey[j].key; j++)
|
/*
|
||||||
if (strcasecmp(p, dkey[j].key) == 0)
|
* Open and read in real nodelist
|
||||||
nodebuf.dflags |= dkey[j].flag;
|
*/
|
||||||
for (j = 0; ikey[j].key; j++)
|
sprintf(path, "%s/%s", CFG.nodelists, fdx.filename);
|
||||||
if (strncasecmp(p, ikey[j].key, strlen(ikey[j].key)) == 0)
|
if ((fp = fopen(path, "r")) == NULL) {
|
||||||
nodebuf.iflags |= ikey[j].flag;
|
WriteError("$Can't open %s", path);
|
||||||
for (j = 0; xkey[j].key; j++)
|
free(path);
|
||||||
if (strcasecmp(p, xkey[j].key) == 0)
|
goto retdummy;
|
||||||
nodebuf.xflags |= xkey[j].flag;
|
}
|
||||||
if ((p[0] == 'T') && (strlen(p) == 3)) {
|
|
||||||
/*
|
if (fseek(fp, ndx.offset, SEEK_SET) != 0) {
|
||||||
* System open hours flag
|
WriteError("$Seek failed for nodelist entry");
|
||||||
*/
|
fclose(fp);
|
||||||
nodebuf.t1 = p[1];
|
goto retdummy;
|
||||||
nodebuf.t2 = p[2];
|
}
|
||||||
}
|
|
||||||
if (!stdflag) {
|
if (fgets(buf, sizeof(buf)-1, fp) == NULL) {
|
||||||
if (ixflag < MAXUFLAGS) {
|
WriteError("$fgets failed for nodelist entry");
|
||||||
nodebuf.uflags[ixflag++] = p;
|
fclose(fp);
|
||||||
if (ixflag < MAXUFLAGS)
|
goto retdummy;
|
||||||
nodebuf.uflags[ixflag] = NULL;
|
}
|
||||||
}
|
fclose(fp);
|
||||||
}
|
|
||||||
|
/*
|
||||||
|
* Load noderecord if this node has one, if there is one then
|
||||||
|
* nodelist overrides in this record will be used instead of
|
||||||
|
* the nodelist entries.
|
||||||
|
*/
|
||||||
|
sprintf(path, "%s/etc/nodes.data", getenv("MBSE_ROOT"));
|
||||||
|
if ((fp = fopen(path, "r")) != NULL) {
|
||||||
|
fread(&ndhdr, sizeof(nodeshdr), 1, fp);
|
||||||
|
|
||||||
|
while (fread(&nd, ndhdr.recsize, 1, fp) == 1) {
|
||||||
|
fseek(fp, ndhdr.filegrp + ndhdr.mailgrp, SEEK_CUR);
|
||||||
|
for (i = 0; i < 20; i++) {
|
||||||
|
if ((addr->zone == nd.Aka[i].zone) && (addr->net == nd.Aka[i].net) &&
|
||||||
|
(addr->node == nd.Aka[i].node) && (addr->point == nd.Aka[i].point)) {
|
||||||
|
ndrecord = TRUE;
|
||||||
|
Syslog('s', "getnlent: node record is present");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (ndrecord)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nodebuf.addr.name = nodebuf.sysop;
|
fclose(fp);
|
||||||
nodebuf.addr.domain = xstrcpy(fdx.domain);
|
}
|
||||||
nodebuf.upnet = ndx.upnet;
|
free(path);
|
||||||
nodebuf.upnode = ndx.upnode;
|
|
||||||
nodebuf.region = ndx.region;
|
nodebuf.type = ndx.type;
|
||||||
if (addr->domain == NULL)
|
nodebuf.pflag = ndx.pflag;
|
||||||
addr->domain = xstrcpy(nodebuf.addr.domain);
|
|
||||||
|
|
||||||
Syslog('s', "getnlent: system %s, %s", nodebuf.name, nodebuf.location);
|
if (*(p = buf + strlen(buf) -1) == '\n')
|
||||||
Syslog('s', "getnlent: sysop %s, %s", nodebuf.sysop, nodebuf.phone);
|
*p = '\0';
|
||||||
if (nodebuf.mflags)
|
if (*(p = buf + strlen(buf) -1) == '\r')
|
||||||
Syslog('S', "getnlent: mflags 0x%08lx", nodebuf.mflags);
|
*p = '\0';
|
||||||
if (nodebuf.oflags)
|
for (p = buf; *p; p++)
|
||||||
Syslog('S', "getnlent: oflags 0x%08lx", nodebuf.oflags);
|
if (*p == '_')
|
||||||
if (nodebuf.dflags)
|
*p = ' ';
|
||||||
Syslog('S', "getnlent: dflags 0x%08lx", nodebuf.dflags);
|
|
||||||
if (nodebuf.iflags)
|
|
||||||
Syslog('S', "getnlent: iflags 0x%08lx", nodebuf.iflags);
|
|
||||||
if (nodebuf.xflags)
|
|
||||||
Syslog('S', "getnlent: xflags 0x%08lx", nodebuf.xflags);
|
|
||||||
for (j = 0; nodebuf.uflags[j]; j++)
|
|
||||||
Syslog('S', "getnlent: uflag %s", nodebuf.uflags[j]);
|
|
||||||
|
|
||||||
moflags(nodebuf.mflags);
|
p = buf;
|
||||||
diflags(nodebuf.dflags);
|
|
||||||
ipflags(nodebuf.iflags);
|
|
||||||
olflags(nodebuf.oflags);
|
|
||||||
rqflags(nodebuf.xflags);
|
|
||||||
free(mydomain);
|
|
||||||
|
|
||||||
return &nodebuf;
|
if ((q = strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get system name
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
if (ndrecord && strlen(nd.Nl_hostname)) {
|
||||||
|
Syslog('s', "getnlent: system name override with %s", nd.Nl_hostname);
|
||||||
|
nodebuf.name = nd.Nl_hostname;
|
||||||
|
} else
|
||||||
|
nodebuf.name = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get location
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
nodebuf.location = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get sysop name
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
nodebuf.sysop = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get phone number
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
if (strcasecmp(p, "-Unpublished-") == 0)
|
||||||
|
nodebuf.phone = NULL;
|
||||||
|
else
|
||||||
|
nodebuf.phone = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get modem speed
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
nodebuf.speed = atoi(p);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process the nodelist flags.
|
||||||
|
*/
|
||||||
|
if (ndrecord && strlen(nd.Nl_flags)) {
|
||||||
|
Syslog('s', "getnlent: flags override %s", nd.Nl_flags);
|
||||||
|
q = nd.Nl_flags;
|
||||||
|
}
|
||||||
|
ixflag = 0;
|
||||||
|
stdflag = TRUE;
|
||||||
|
for (p = q; p; p = q) {
|
||||||
|
if ((q = strchr(p, ',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) {
|
||||||
|
stdflag = FALSE;
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* Process authorized flags and user flags both as authorized.
|
||||||
|
*/
|
||||||
|
for (j = 0; fkey[j].key; j++)
|
||||||
|
if (strcasecmp(p, fkey[j].key) == 0)
|
||||||
|
nodebuf.mflags |= fkey[j].flag;
|
||||||
|
for (j = 0; okey[j].key; j++)
|
||||||
|
if (strcasecmp(p, okey[j].key) == 0)
|
||||||
|
nodebuf.oflags |= okey[j].flag;
|
||||||
|
for (j = 0; dkey[j].key; j++)
|
||||||
|
if (strcasecmp(p, dkey[j].key) == 0)
|
||||||
|
nodebuf.dflags |= dkey[j].flag;
|
||||||
|
for (j = 0; ikey[j].key; j++)
|
||||||
|
if (strncasecmp(p, ikey[j].key, strlen(ikey[j].key)) == 0)
|
||||||
|
nodebuf.iflags |= ikey[j].flag;
|
||||||
|
for (j = 0; xkey[j].key; j++)
|
||||||
|
if (strcasecmp(p, xkey[j].key) == 0)
|
||||||
|
nodebuf.xflags |= xkey[j].flag;
|
||||||
|
if ((p[0] == 'T') && (strlen(p) == 3)) {
|
||||||
|
/*
|
||||||
|
* System open hours flag
|
||||||
|
*/
|
||||||
|
nodebuf.t1 = p[1];
|
||||||
|
nodebuf.t2 = p[2];
|
||||||
|
}
|
||||||
|
if (!stdflag) {
|
||||||
|
if (ixflag < MAXUFLAGS) {
|
||||||
|
nodebuf.uflags[ixflag++] = p;
|
||||||
|
if (ixflag < MAXUFLAGS)
|
||||||
|
nodebuf.uflags[ixflag] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nodebuf.addr.name = nodebuf.sysop;
|
||||||
|
nodebuf.addr.domain = xstrcpy(fdx.domain);
|
||||||
|
nodebuf.upnet = ndx.upnet;
|
||||||
|
nodebuf.upnode = ndx.upnode;
|
||||||
|
nodebuf.region = ndx.region;
|
||||||
|
if (addr->domain == NULL)
|
||||||
|
addr->domain = xstrcpy(nodebuf.addr.domain);
|
||||||
|
|
||||||
|
Syslog('s', "getnlent: system %s, %s", nodebuf.name, nodebuf.location);
|
||||||
|
Syslog('s', "getnlent: sysop %s, %s", nodebuf.sysop, nodebuf.phone);
|
||||||
|
moflags(nodebuf.mflags);
|
||||||
|
diflags(nodebuf.dflags);
|
||||||
|
ipflags(nodebuf.iflags);
|
||||||
|
olflags(nodebuf.oflags);
|
||||||
|
rqflags(nodebuf.xflags);
|
||||||
|
free(mydomain);
|
||||||
|
|
||||||
|
return &nodebuf;
|
||||||
|
|
||||||
badsyntax:
|
badsyntax:
|
||||||
WriteError("nodelist %d offset +%lu: bad syntax in line \"%s\"",
|
WriteError("nodelist %d offset +%lu: bad syntax in line \"%s\"", ndx.fileno, (unsigned long)ndx.offset, buf);
|
||||||
ndx.fileno, (unsigned long)ndx.offset, buf);
|
/* fallthrough */
|
||||||
/* fallthrough */
|
|
||||||
|
|
||||||
retdummy:
|
retdummy:
|
||||||
memset(&nodebuf, 0, sizeof(nodebuf));
|
memset(&nodebuf, 0, sizeof(nodebuf));
|
||||||
nodebuf.pflag = NL_DUMMY;
|
nodebuf.pflag = NL_DUMMY;
|
||||||
nodebuf.name = (char *)"Unknown";
|
nodebuf.name = (char *)"Unknown";
|
||||||
nodebuf.location = (char *)"Nowhere";
|
nodebuf.location = (char *)"Nowhere";
|
||||||
nodebuf.sysop = (char *)"Sysop";
|
nodebuf.sysop = (char *)"Sysop";
|
||||||
nodebuf.phone = NULL;
|
nodebuf.phone = NULL;
|
||||||
nodebuf.speed = 2400;
|
nodebuf.speed = 2400;
|
||||||
free(mydomain);
|
free(mydomain);
|
||||||
|
|
||||||
return &nodebuf;
|
return &nodebuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void olflags(unsigned long flags)
|
void olflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
t = xstrcpy((char *)"Mailer flags :");
|
t = xstrcpy((char *)"Mailer flags :");
|
||||||
if (flags & OL_CM)
|
if (flags & OL_CM)
|
||||||
t = xstrcat(t, (char *)" CM");
|
t = xstrcat(t, (char *)" CM");
|
||||||
if (flags & OL_MO)
|
if (flags & OL_MO)
|
||||||
t = xstrcat(t, (char *)" MO");
|
t = xstrcat(t, (char *)" MO");
|
||||||
if (flags & OL_LO)
|
if (flags & OL_LO)
|
||||||
t = xstrcat(t, (char *)" LO");
|
t = xstrcat(t, (char *)" LO");
|
||||||
if (flags & OL_MN)
|
if (flags & OL_MN)
|
||||||
t = xstrcat(t, (char *)" MN");
|
t = xstrcat(t, (char *)" MN");
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void rqflags(unsigned long flags)
|
void rqflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
t = xstrcpy((char *)"Request flags:");
|
t = xstrcpy((char *)"Request flags:");
|
||||||
if (flags & RQ_RQ_BR)
|
if (flags & RQ_RQ_BR)
|
||||||
t = xstrcat(t, (char *)" RQ_BR");
|
t = xstrcat(t, (char *)" RQ_BR");
|
||||||
if (flags & RQ_RQ_BU)
|
if (flags & RQ_RQ_BU)
|
||||||
t = xstrcat(t, (char *)" RQ_BU");
|
t = xstrcat(t, (char *)" RQ_BU");
|
||||||
if (flags & RQ_RQ_WR)
|
if (flags & RQ_RQ_WR)
|
||||||
t = xstrcat(t, (char *)" RQ_WR");
|
t = xstrcat(t, (char *)" RQ_WR");
|
||||||
if (flags & RQ_RQ_WU)
|
if (flags & RQ_RQ_WU)
|
||||||
t = xstrcat(t, (char *)" RQ_WU");
|
t = xstrcat(t, (char *)" RQ_WU");
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void moflags(unsigned long flags)
|
void moflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
if (!flags)
|
if (!flags)
|
||||||
return;
|
return;
|
||||||
t = xstrcpy((char *)"Modem flags :");
|
t = xstrcpy((char *)"Modem flags :");
|
||||||
if (flags & NL_V22)
|
if (flags & NL_V22)
|
||||||
t = xstrcat(t, (char *)" V22");
|
t = xstrcat(t, (char *)" V22");
|
||||||
if (flags & NL_V29)
|
if (flags & NL_V29)
|
||||||
t = xstrcat(t, (char *)" V29");
|
t = xstrcat(t, (char *)" V29");
|
||||||
if (flags & NL_V32)
|
if (flags & NL_V32)
|
||||||
t = xstrcat(t, (char *)" V32");
|
t = xstrcat(t, (char *)" V32");
|
||||||
if (flags & NL_V32B)
|
if (flags & NL_V32B)
|
||||||
t = xstrcat(t, (char *)" V32B");
|
t = xstrcat(t, (char *)" V32B");
|
||||||
if (flags & NL_V34)
|
if (flags & NL_V34)
|
||||||
t = xstrcat(t, (char *)" V34");
|
t = xstrcat(t, (char *)" V34");
|
||||||
if (flags & NL_V42)
|
if (flags & NL_V42)
|
||||||
t = xstrcat(t, (char *)" V42");
|
t = xstrcat(t, (char *)" V42");
|
||||||
if (flags & NL_V42B)
|
if (flags & NL_V42B)
|
||||||
t = xstrcat(t, (char *)" V42B");
|
t = xstrcat(t, (char *)" V42B");
|
||||||
if (flags & NL_MNP)
|
if (flags & NL_MNP)
|
||||||
t = xstrcat(t, (char *)" MNP");
|
t = xstrcat(t, (char *)" MNP");
|
||||||
if (flags & NL_H96)
|
if (flags & NL_H96)
|
||||||
t = xstrcat(t, (char *)" H96");
|
t = xstrcat(t, (char *)" H96");
|
||||||
if (flags & NL_HST)
|
if (flags & NL_HST)
|
||||||
t = xstrcat(t, (char *)" HST");
|
t = xstrcat(t, (char *)" HST");
|
||||||
if (flags & NL_H14)
|
if (flags & NL_H14)
|
||||||
t = xstrcat(t, (char *)" H14");
|
t = xstrcat(t, (char *)" H14");
|
||||||
if (flags & NL_H16)
|
if (flags & NL_H16)
|
||||||
t = xstrcat(t, (char *)" H16");
|
t = xstrcat(t, (char *)" H16");
|
||||||
if (flags & NL_MAX)
|
if (flags & NL_MAX)
|
||||||
t = xstrcat(t, (char *)" MAX");
|
t = xstrcat(t, (char *)" MAX");
|
||||||
if (flags & NL_PEP)
|
if (flags & NL_PEP)
|
||||||
t = xstrcat(t, (char *)" PEP");
|
t = xstrcat(t, (char *)" PEP");
|
||||||
if (flags & NL_CSP)
|
if (flags & NL_CSP)
|
||||||
t = xstrcat(t, (char *)" CSP");
|
t = xstrcat(t, (char *)" CSP");
|
||||||
if (flags & NL_V32T)
|
if (flags & NL_V32T)
|
||||||
t = xstrcat(t, (char *)" V32T");
|
t = xstrcat(t, (char *)" V32T");
|
||||||
if (flags & NL_VFC)
|
if (flags & NL_VFC)
|
||||||
t = xstrcat(t, (char *)" VFC");
|
t = xstrcat(t, (char *)" VFC");
|
||||||
if (flags & NL_ZYX)
|
if (flags & NL_ZYX)
|
||||||
t = xstrcat(t, (char *)" ZYX");
|
t = xstrcat(t, (char *)" ZYX");
|
||||||
if (flags & NL_X2C)
|
if (flags & NL_X2C)
|
||||||
t = xstrcat(t, (char *)" X2C");
|
t = xstrcat(t, (char *)" X2C");
|
||||||
if (flags & NL_X2S)
|
if (flags & NL_X2S)
|
||||||
t = xstrcat(t, (char *)" X2S");
|
t = xstrcat(t, (char *)" X2S");
|
||||||
if (flags & NL_V90C)
|
if (flags & NL_V90C)
|
||||||
t = xstrcat(t, (char *)" V90C");
|
t = xstrcat(t, (char *)" V90C");
|
||||||
if (flags & NL_V90S)
|
if (flags & NL_V90S)
|
||||||
t = xstrcat(t, (char *)" V90S");
|
t = xstrcat(t, (char *)" V90S");
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void diflags(unsigned long flags)
|
void diflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
if (!flags)
|
if (!flags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
t = xstrcpy((char *)"ISDN flags :");
|
t = xstrcpy((char *)"ISDN flags :");
|
||||||
if (flags & ND_V110L)
|
if (flags & ND_V110L)
|
||||||
t = xstrcat(t, (char *)" V110L");
|
t = xstrcat(t, (char *)" V110L");
|
||||||
if (flags & ND_V110H)
|
if (flags & ND_V110H)
|
||||||
t = xstrcat(t, (char *)" V110H");
|
t = xstrcat(t, (char *)" V110H");
|
||||||
if (flags & ND_V120L)
|
if (flags & ND_V120L)
|
||||||
t = xstrcat(t, (char *)" V120L");
|
t = xstrcat(t, (char *)" V120L");
|
||||||
if (flags & ND_V120H)
|
if (flags & ND_V120H)
|
||||||
t = xstrcat(t, (char *)" V120H");
|
t = xstrcat(t, (char *)" V120H");
|
||||||
if (flags & ND_X75)
|
if (flags & ND_X75)
|
||||||
t = xstrcat(t, (char *)" X75");
|
t = xstrcat(t, (char *)" X75");
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ipflags(unsigned long flags)
|
void ipflags(unsigned long flags)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
if (!flags)
|
if (!flags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
t = xstrcpy((char *)"TCP/IP flags :");
|
t = xstrcpy((char *)"TCP/IP flags :");
|
||||||
if (flags & IP_IBN)
|
if (flags & IP_IBN)
|
||||||
t = xstrcat(t, (char *)" IBN");
|
t = xstrcat(t, (char *)" IBN");
|
||||||
if (flags & IP_IFC)
|
if (flags & IP_IFC)
|
||||||
t = xstrcat(t, (char *)" IFC");
|
t = xstrcat(t, (char *)" IFC");
|
||||||
if (flags & IP_ITN)
|
if (flags & IP_ITN)
|
||||||
t = xstrcat(t, (char *)" ITN");
|
t = xstrcat(t, (char *)" ITN");
|
||||||
if (flags & IP_IVM)
|
if (flags & IP_IVM)
|
||||||
t = xstrcat(t, (char *)" IVM");
|
t = xstrcat(t, (char *)" IVM");
|
||||||
if (flags & IP_IP)
|
if (flags & IP_IP)
|
||||||
t = xstrcat(t, (char *)" IP");
|
t = xstrcat(t, (char *)" IP");
|
||||||
if (flags & IP_IFT)
|
if (flags & IP_IFT)
|
||||||
t = xstrcat(t, (char *)" IFT");
|
t = xstrcat(t, (char *)" IFT");
|
||||||
Syslog('s', "%s", t);
|
Syslog('s', "%s", t);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -752,8 +752,8 @@ void SessionScreen(void)
|
|||||||
mvprintw( 8, 6, "2. Dial command");
|
mvprintw( 8, 6, "2. Dial command");
|
||||||
mvprintw( 9, 6, "3. Phone number 1");
|
mvprintw( 9, 6, "3. Phone number 1");
|
||||||
mvprintw(10, 6, "4. Phone number 2");
|
mvprintw(10, 6, "4. Phone number 2");
|
||||||
// mvprintw(11, 6, "5. Nodelist flags");
|
mvprintw(11, 6, "5. Nodelist flags");
|
||||||
// mvprintw(12, 6, "6. Inet hostname");
|
mvprintw(12, 6, "6. Inet hostname");
|
||||||
// mvprintw(13, 6, "7. Outbound sess.");
|
// mvprintw(13, 6, "7. Outbound sess.");
|
||||||
// mvprintw(14, 6, "8. Inbound sess.");
|
// mvprintw(14, 6, "8. Inbound sess.");
|
||||||
mvprintw(15, 6, "9. No EMSI");
|
mvprintw(15, 6, "9. No EMSI");
|
||||||
@ -805,8 +805,8 @@ void SessionEdit(void)
|
|||||||
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")
|
||||||
case 3: E_STR( 9,26,20, nodes.phone[0], "Enter ^phone number^ to override the nodelist")
|
case 3: E_STR( 9,26,20, nodes.phone[0], "Enter ^phone number^ to override the nodelist")
|
||||||
case 4: E_STR( 10,26,20, nodes.phone[1], "Enter ^phone number^ to override the nodelist")
|
case 4: E_STR( 10,26,20, nodes.phone[1], "Enter ^phone number^ to override the nodelist")
|
||||||
// case 5: E_STR( 11,26,54, nodes.Nl_flags, "^Nodelist flags^ override")
|
case 5: E_STR( 11,26,54, nodes.Nl_flags, "^Nodelist flags^ override")
|
||||||
// case 6: E_STR( 12,26,40, nodes.Nl_hostname, "Node internet ^hostname/IP address^ override")
|
case 6: E_STR( 12,26,40, nodes.Nl_hostname, "Node internet ^hostname/IP address^ override")
|
||||||
|
|
||||||
case 9: E_BOOL(15,26, nodes.NoEMSI, "Disable ^EMSI handshake^ with this node")
|
case 9: E_BOOL(15,26, nodes.NoEMSI, "Disable ^EMSI handshake^ with this node")
|
||||||
case 10:E_BOOL(16,26, nodes.NoWaZOO, "Disable ^YooHoo/2U2 handshake^ (FTSC-0006) with this node")
|
case 10:E_BOOL(16,26, nodes.NoWaZOO, "Disable ^YooHoo/2U2 handshake^ (FTSC-0006) with this node")
|
||||||
|
@ -172,278 +172,324 @@ int comp_node(struct _nlidx fap1, struct _ixentry fap2)
|
|||||||
|
|
||||||
node *getnlent(faddr *addr)
|
node *getnlent(faddr *addr)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
static node nodebuf;
|
static node nodebuf;
|
||||||
static char buf[256], *p, *q;
|
static char buf[256], *p, *q;
|
||||||
struct _ixentry xaddr;
|
struct _ixentry xaddr;
|
||||||
int i, j, Found = FALSE;
|
int i, j, Found = FALSE, ixflag, stdflag, ndrecord = FALSE;
|
||||||
int ixflag, stdflag;
|
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;
|
||||||
|
static struct _nodes nd;
|
||||||
|
|
||||||
mydomain = xstrcpy(CFG.aka[0].domain);
|
mydomain = xstrcpy(CFG.aka[0].domain);
|
||||||
if (mydomain == NULL)
|
if (mydomain == NULL)
|
||||||
mydomain = (char *)NULLDOMAIN;
|
mydomain = (char *)NULLDOMAIN;
|
||||||
|
|
||||||
nodebuf.addr.domain = NULL;
|
nodebuf.addr.domain = NULL;
|
||||||
nodebuf.addr.zone = 0;
|
nodebuf.addr.zone = 0;
|
||||||
nodebuf.addr.net = 0;
|
nodebuf.addr.net = 0;
|
||||||
nodebuf.addr.node = 0;
|
nodebuf.addr.node = 0;
|
||||||
nodebuf.addr.point = 0;
|
nodebuf.addr.point = 0;
|
||||||
nodebuf.addr.name = NULL;
|
nodebuf.addr.name = NULL;
|
||||||
nodebuf.upnet = 0;
|
nodebuf.upnet = 0;
|
||||||
nodebuf.upnode = 0;
|
nodebuf.upnode = 0;
|
||||||
nodebuf.region = 0;
|
nodebuf.region = 0;
|
||||||
nodebuf.type = 0;
|
nodebuf.type = 0;
|
||||||
nodebuf.pflag = 0;
|
nodebuf.pflag = 0;
|
||||||
nodebuf.name = NULL;
|
nodebuf.name = NULL;
|
||||||
nodebuf.location = NULL;
|
nodebuf.location = NULL;
|
||||||
nodebuf.sysop = NULL;
|
nodebuf.sysop = NULL;
|
||||||
nodebuf.phone = NULL;
|
nodebuf.phone = NULL;
|
||||||
nodebuf.speed = 0;
|
nodebuf.speed = 0;
|
||||||
nodebuf.mflags = 0L;
|
nodebuf.mflags = 0L;
|
||||||
nodebuf.oflags = 0L;
|
nodebuf.oflags = 0L;
|
||||||
nodebuf.xflags = 0L;
|
nodebuf.xflags = 0L;
|
||||||
nodebuf.iflags = 0L;
|
nodebuf.iflags = 0L;
|
||||||
nodebuf.dflags = 0L;
|
nodebuf.dflags = 0L;
|
||||||
nodebuf.uflags[0] = NULL;
|
nodebuf.uflags[0] = NULL;
|
||||||
nodebuf.t1 = '\0';
|
nodebuf.t1 = '\0';
|
||||||
nodebuf.t2 = '\0';
|
nodebuf.t2 = '\0';
|
||||||
|
|
||||||
if (addr == NULL)
|
if (addr == NULL)
|
||||||
goto retdummy;
|
goto retdummy;
|
||||||
|
|
||||||
if (addr->zone == 0)
|
if (addr->zone == 0)
|
||||||
addr->zone = CFG.aka[0].zone;
|
addr->zone = CFG.aka[0].zone;
|
||||||
xaddr.zone = addr->zone;
|
xaddr.zone = addr->zone;
|
||||||
nodebuf.addr.zone = addr->zone;
|
nodebuf.addr.zone = addr->zone;
|
||||||
xaddr.net = addr->net;
|
xaddr.net = addr->net;
|
||||||
nodebuf.addr.net = addr->net;
|
nodebuf.addr.net = addr->net;
|
||||||
xaddr.node = addr->node;
|
xaddr.node = addr->node;
|
||||||
nodebuf.addr.node = addr->node;
|
nodebuf.addr.node = addr->node;
|
||||||
xaddr.point = addr->point;
|
xaddr.point = addr->point;
|
||||||
nodebuf.addr.point = addr->point;
|
nodebuf.addr.point = addr->point;
|
||||||
|
|
||||||
if (initnl())
|
if (initnl())
|
||||||
goto retdummy;
|
goto retdummy;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First, lookup node in index. NOTE -- NOT 5D YET
|
* First, lookup node in index. NOTE -- NOT 5D YET
|
||||||
*/
|
*/
|
||||||
path = calloc(128, sizeof(char));
|
path = calloc(128, sizeof(char));
|
||||||
sprintf(path, "%s/%s", CFG.nodelists, "node.index");
|
sprintf(path, "%s/%s", CFG.nodelists, "node.index");
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
if ((fp = fopen(path, "r")) == NULL) {
|
||||||
tasklog('?', "$Can't open %s", path);
|
tasklog('?', "$Can't open %s", path);
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
|
|
||||||
fseek(fp, 0, SEEK_END);
|
|
||||||
highest = ftell(fp) / sizeof(ndx);
|
|
||||||
lowest = 0;
|
|
||||||
|
|
||||||
while (TRUE) {
|
|
||||||
current = ((highest - lowest) / 2) + lowest;
|
|
||||||
fseek(fp, current * sizeof(ndx), SEEK_SET);
|
|
||||||
if (fread(&ndx, sizeof(ndx), 1, fp) != 1)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (comp_node(ndx, xaddr) == 0) {
|
|
||||||
Found = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (comp_node(ndx, xaddr) < 0)
|
|
||||||
lowest = current;
|
|
||||||
else
|
|
||||||
highest = current;
|
|
||||||
if ((highest - lowest) <= 1)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
if (!Found) {
|
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(path, "%s/%s", CFG.nodelists, "node.files");
|
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
|
||||||
tasklog('?', "$Can't open %s", path);
|
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get filename from node.files
|
|
||||||
*/
|
|
||||||
for (i = 0; i < (ndx.fileno +1); i++)
|
|
||||||
fread(&fdx, sizeof(fdx), 1, fp);
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
/* CHECK DOMAIN HERE */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Open and read in real nodelist
|
|
||||||
*/
|
|
||||||
sprintf(path, "%s/%s", CFG.nodelists, fdx.filename);
|
|
||||||
if ((fp = fopen(path, "r")) == NULL) {
|
|
||||||
tasklog('?', "$Can't open %s", path);
|
|
||||||
free(path);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
free(path);
|
free(path);
|
||||||
|
goto retdummy;
|
||||||
|
}
|
||||||
|
|
||||||
if (fseek(fp, ndx.offset, SEEK_SET) != 0) {
|
fseek(fp, 0, SEEK_END);
|
||||||
tasklog('?', "$Seek failed for nodelist entry");
|
highest = ftell(fp) / sizeof(ndx);
|
||||||
fclose(fp);
|
lowest = 0;
|
||||||
goto retdummy;
|
|
||||||
|
while (TRUE) {
|
||||||
|
current = ((highest - lowest) / 2) + lowest;
|
||||||
|
fseek(fp, current * sizeof(ndx), SEEK_SET);
|
||||||
|
if (fread(&ndx, sizeof(ndx), 1, fp) != 1)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (comp_node(ndx, xaddr) == 0) {
|
||||||
|
Found = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
if (comp_node(ndx, xaddr) < 0)
|
||||||
if (fgets(buf, sizeof(buf)-1, fp) == NULL) {
|
lowest = current;
|
||||||
tasklog('?', "$fgets failed for nodelist entry");
|
|
||||||
fclose(fp);
|
|
||||||
goto retdummy;
|
|
||||||
}
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
nodebuf.type = ndx.type;
|
|
||||||
nodebuf.pflag = ndx.pflag;
|
|
||||||
|
|
||||||
if (*(p = buf + strlen(buf) -1) == '\n')
|
|
||||||
*p = '\0';
|
|
||||||
if (*(p = buf + strlen(buf) -1) == '\r')
|
|
||||||
*p = '\0';
|
|
||||||
for (p = buf; *p; p++)
|
|
||||||
if (*p == '_')
|
|
||||||
*p = ' ';
|
|
||||||
|
|
||||||
p = buf;
|
|
||||||
|
|
||||||
if ((q = strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.name = p;
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.location = p;
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.sysop = p;
|
|
||||||
p = q;
|
|
||||||
if (p == NULL)
|
|
||||||
goto badsyntax;
|
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
|
||||||
*q++ = '\0';
|
|
||||||
if (strcasecmp(p, "-Unpublished-") == 0)
|
|
||||||
nodebuf.phone = NULL;
|
|
||||||
else
|
else
|
||||||
nodebuf.phone = p;
|
highest = current;
|
||||||
p = q;
|
if ((highest - lowest) <= 1)
|
||||||
if (p == NULL)
|
break;
|
||||||
goto badsyntax;
|
}
|
||||||
|
|
||||||
if ((q=strchr(p,',')))
|
fclose(fp);
|
||||||
*q++ = '\0';
|
|
||||||
nodebuf.speed = atoi(p);
|
|
||||||
|
|
||||||
/*
|
if (!Found) {
|
||||||
* Process the nodelist flags.
|
free(path);
|
||||||
*/
|
goto retdummy;
|
||||||
ixflag = 0;
|
}
|
||||||
stdflag = TRUE;
|
|
||||||
for (p = q; p; p = q) {
|
sprintf(path, "%s/%s", CFG.nodelists, "node.files");
|
||||||
if ((q = strchr(p, ',')))
|
if ((fp = fopen(path, "r")) == NULL) {
|
||||||
*q++ = '\0';
|
tasklog('?', "$Can't open %s", path);
|
||||||
if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) {
|
free(path);
|
||||||
stdflag = FALSE;
|
goto retdummy;
|
||||||
} else {
|
}
|
||||||
/*
|
|
||||||
* Experimental: process authorized flags and
|
/*
|
||||||
* User flags both as authorized.
|
* Get filename from node.files
|
||||||
*/
|
*/
|
||||||
for (j = 0; fkey[j].key; j++)
|
for (i = 0; i < (ndx.fileno +1); i++)
|
||||||
if (strcasecmp(p, fkey[j].key) == 0)
|
fread(&fdx, sizeof(fdx), 1, fp);
|
||||||
nodebuf.mflags |= fkey[j].flag;
|
fclose(fp);
|
||||||
for (j = 0; okey[j].key; j++)
|
|
||||||
if (strcasecmp(p, okey[j].key) == 0)
|
/* CHECK DOMAIN HERE */
|
||||||
nodebuf.oflags |= okey[j].flag;
|
|
||||||
for (j = 0; dkey[j].key; j++)
|
/*
|
||||||
if (strcasecmp(p, dkey[j].key) == 0)
|
* Open and read in real nodelist
|
||||||
nodebuf.dflags |= dkey[j].flag;
|
*/
|
||||||
for (j = 0; ikey[j].key; j++)
|
sprintf(path, "%s/%s", CFG.nodelists, fdx.filename);
|
||||||
if (strncasecmp(p, ikey[j].key, strlen(ikey[j].key)) == 0)
|
if ((fp = fopen(path, "r")) == NULL) {
|
||||||
nodebuf.iflags |= ikey[j].flag;
|
tasklog('?', "$Can't open %s", path);
|
||||||
for (j = 0; xkey[j].key; j++)
|
free(path);
|
||||||
if (strcasecmp(p, xkey[j].key) == 0)
|
goto retdummy;
|
||||||
nodebuf.xflags |= xkey[j].flag;
|
}
|
||||||
if ((p[0] == 'T') && (strlen(p) == 3)) {
|
|
||||||
/*
|
if (fseek(fp, ndx.offset, SEEK_SET) != 0) {
|
||||||
* System open hours flag
|
tasklog('?', "$Seek failed for nodelist entry");
|
||||||
*/
|
fclose(fp);
|
||||||
nodebuf.t1 = p[1];
|
goto retdummy;
|
||||||
nodebuf.t2 = p[2];
|
}
|
||||||
}
|
|
||||||
if (!stdflag) {
|
if (fgets(buf, sizeof(buf)-1, fp) == NULL) {
|
||||||
if (ixflag < MAXUFLAGS) {
|
tasklog('?', "$fgets failed for nodelist entry");
|
||||||
nodebuf.uflags[ixflag++] = p;
|
fclose(fp);
|
||||||
if (ixflag < MAXUFLAGS)
|
goto retdummy;
|
||||||
nodebuf.uflags[ixflag] = NULL;
|
}
|
||||||
}
|
fclose(fp);
|
||||||
}
|
|
||||||
|
/*
|
||||||
|
* Load noderecord if this node has one, if there is one then
|
||||||
|
* nodelist overrides in this record will be used instead of
|
||||||
|
* the nodelist entries.
|
||||||
|
*/
|
||||||
|
sprintf(path, "%s/etc/nodes.data", getenv("MBSE_ROOT"));
|
||||||
|
if ((fp = fopen(path, "r")) != NULL) {
|
||||||
|
fread(&ndhdr, sizeof(ndhdr), 1, fp);
|
||||||
|
|
||||||
|
while (fread(&nd, ndhdr.recsize, 1, fp) == 1) {
|
||||||
|
fseek(fp, ndhdr.filegrp + ndhdr.mailgrp, SEEK_CUR);
|
||||||
|
for (i = 0; i < 20; i++) {
|
||||||
|
if ((addr->zone == nd.Aka[i].zone) && (addr->net == nd.Aka[i].net) &&
|
||||||
|
(addr->node == nd.Aka[i].node) && (addr->point == nd.Aka[i].point)) {
|
||||||
|
ndrecord = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (ndrecord)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nodebuf.addr.name = nodebuf.sysop;
|
fclose(fp);
|
||||||
nodebuf.addr.domain = xstrcpy(fdx.domain);
|
}
|
||||||
nodebuf.upnet = ndx.upnet;
|
free(path);
|
||||||
nodebuf.upnode = ndx.upnode;
|
|
||||||
nodebuf.region = ndx.region;
|
|
||||||
if (addr->domain == NULL)
|
|
||||||
addr->domain = xstrcpy(nodebuf.addr.domain);
|
|
||||||
|
|
||||||
free(mydomain);
|
nodebuf.type = ndx.type;
|
||||||
return &nodebuf;
|
nodebuf.pflag = ndx.pflag;
|
||||||
|
|
||||||
|
if (*(p = buf + strlen(buf) -1) == '\n')
|
||||||
|
*p = '\0';
|
||||||
|
if (*(p = buf + strlen(buf) -1) == '\r')
|
||||||
|
*p = '\0';
|
||||||
|
for (p = buf; *p; p++)
|
||||||
|
if (*p == '_')
|
||||||
|
*p = ' ';
|
||||||
|
|
||||||
|
p = buf;
|
||||||
|
|
||||||
|
if ((q = strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get system name
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
if (ndrecord && strlen(nd.Nl_hostname))
|
||||||
|
nodebuf.name = nd.Nl_hostname;
|
||||||
|
else
|
||||||
|
nodebuf.name = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get location
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
nodebuf.location = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get sysop name
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
nodebuf.sysop = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get phone number
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
if (strcasecmp(p, "-Unpublished-") == 0)
|
||||||
|
nodebuf.phone = NULL;
|
||||||
|
else
|
||||||
|
nodebuf.phone = p;
|
||||||
|
p = q;
|
||||||
|
if (p == NULL)
|
||||||
|
goto badsyntax;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get modem speed
|
||||||
|
*/
|
||||||
|
if ((q=strchr(p,',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
nodebuf.speed = atoi(p);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process the nodelist flags, get them from the node override
|
||||||
|
* field if this is present, else use the nodelist.
|
||||||
|
*/
|
||||||
|
if (ndrecord && strlen(nd.Nl_flags))
|
||||||
|
q = nd.Nl_flags;
|
||||||
|
ixflag = 0;
|
||||||
|
stdflag = TRUE;
|
||||||
|
for (p = q; p; p = q) {
|
||||||
|
if ((q = strchr(p, ',')))
|
||||||
|
*q++ = '\0';
|
||||||
|
if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) {
|
||||||
|
stdflag = FALSE;
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* Experimental: process authorized flags and
|
||||||
|
* User flags both as authorized.
|
||||||
|
*/
|
||||||
|
for (j = 0; fkey[j].key; j++)
|
||||||
|
if (strcasecmp(p, fkey[j].key) == 0)
|
||||||
|
nodebuf.mflags |= fkey[j].flag;
|
||||||
|
for (j = 0; okey[j].key; j++)
|
||||||
|
if (strcasecmp(p, okey[j].key) == 0)
|
||||||
|
nodebuf.oflags |= okey[j].flag;
|
||||||
|
for (j = 0; dkey[j].key; j++)
|
||||||
|
if (strcasecmp(p, dkey[j].key) == 0)
|
||||||
|
nodebuf.dflags |= dkey[j].flag;
|
||||||
|
for (j = 0; ikey[j].key; j++)
|
||||||
|
if (strncasecmp(p, ikey[j].key, strlen(ikey[j].key)) == 0)
|
||||||
|
nodebuf.iflags |= ikey[j].flag;
|
||||||
|
for (j = 0; xkey[j].key; j++)
|
||||||
|
if (strcasecmp(p, xkey[j].key) == 0)
|
||||||
|
nodebuf.xflags |= xkey[j].flag;
|
||||||
|
if ((p[0] == 'T') && (strlen(p) == 3)) {
|
||||||
|
/*
|
||||||
|
* System open hours flag
|
||||||
|
*/
|
||||||
|
nodebuf.t1 = p[1];
|
||||||
|
nodebuf.t2 = p[2];
|
||||||
|
}
|
||||||
|
if (!stdflag) {
|
||||||
|
if (ixflag < MAXUFLAGS) {
|
||||||
|
nodebuf.uflags[ixflag++] = p;
|
||||||
|
if (ixflag < MAXUFLAGS)
|
||||||
|
nodebuf.uflags[ixflag] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nodebuf.addr.name = nodebuf.sysop;
|
||||||
|
nodebuf.addr.domain = xstrcpy(fdx.domain);
|
||||||
|
nodebuf.upnet = ndx.upnet;
|
||||||
|
nodebuf.upnode = ndx.upnode;
|
||||||
|
nodebuf.region = ndx.region;
|
||||||
|
if (addr->domain == NULL)
|
||||||
|
addr->domain = xstrcpy(nodebuf.addr.domain);
|
||||||
|
|
||||||
|
free(mydomain);
|
||||||
|
return &nodebuf;
|
||||||
|
|
||||||
badsyntax:
|
badsyntax:
|
||||||
tasklog('?', "nodelist %d offset +%lu: bad syntax in line \"%s\"",
|
tasklog('?', "nodelist %d offset +%lu: bad syntax in line \"%s\"", ndx.fileno, (unsigned long)ndx.offset, buf);
|
||||||
ndx.fileno, (unsigned long)ndx.offset, buf);
|
/* fallthrough */
|
||||||
/* fallthrough */
|
|
||||||
|
|
||||||
retdummy:
|
retdummy:
|
||||||
memset(&nodebuf, 0, sizeof(nodebuf));
|
memset(&nodebuf, 0, sizeof(nodebuf));
|
||||||
nodebuf.pflag = NL_DUMMY;
|
nodebuf.pflag = NL_DUMMY;
|
||||||
nodebuf.name = (char *)"Unknown";
|
nodebuf.name = (char *)"Unknown";
|
||||||
nodebuf.location = (char *)"Nowhere";
|
nodebuf.location = (char *)"Nowhere";
|
||||||
nodebuf.sysop = (char *)"Sysop";
|
nodebuf.sysop = (char *)"Sysop";
|
||||||
nodebuf.phone = NULL;
|
nodebuf.phone = NULL;
|
||||||
nodebuf.speed = 2400;
|
nodebuf.speed = 2400;
|
||||||
free(mydomain);
|
free(mydomain);
|
||||||
|
|
||||||
return &nodebuf;
|
return &nodebuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user