Added debugging info for the ESLF experiment

This commit is contained in:
Michiel Broek 2002-12-16 20:58:14 +00:00
parent a8ad268c00
commit b3f78e2934
2 changed files with 57 additions and 20 deletions

View File

@ -16,6 +16,11 @@ v0.35.07 11-Dec-2002
On FreeBSD the lsz and lrz programs are found as alternate for On FreeBSD the lsz and lrz programs are found as alternate for
lz and sz. lz and sz.
common.a:
For testing purposes of the ESLF (Extended St. Louis Format)
nodelist, debugging is added to show the information in the
ESLF lines. Only visible with utilities debug 's'.
mbsebbs: mbsebbs:
With menu 201 there is now a new optional data parameter N. With menu 201 there is now a new optional data parameter N.
When used if a user selects a different message area, areas When used if a user selects a different message area, areas

View File

@ -174,9 +174,9 @@ int comp_node(struct _nlidx fap1, struct _ixentry fap2)
node *getnlent(faddr *addr) node *getnlent(faddr *addr)
{ {
FILE *fp; FILE *fp, *np;
static node nodebuf; static node nodebuf;
static char buf[256], *p, *q; static char buf[2048], ebuf[2048], *p, *q;
struct _ixentry xaddr; struct _ixentry xaddr;
int i, j, Found = FALSE, ixflag, stdflag, ndrecord = FALSE; int i, j, Found = FALSE, ixflag, stdflag, ndrecord = FALSE;
char *mydomain, *path; char *mydomain, *path;
@ -311,7 +311,6 @@ node *getnlent(faddr *addr)
fclose(fp); fclose(fp);
goto retdummy; goto retdummy;
} }
fclose(fp);
/* /*
* Load noderecord if this node has one, if there is one then * Load noderecord if this node has one, if there is one then
@ -319,11 +318,11 @@ node *getnlent(faddr *addr)
* the nodelist entries. * the nodelist entries.
*/ */
sprintf(path, "%s/etc/nodes.data", getenv("MBSE_ROOT")); sprintf(path, "%s/etc/nodes.data", getenv("MBSE_ROOT"));
if ((fp = fopen(path, "r")) != NULL) { if ((np = fopen(path, "r")) != NULL) {
fread(&ndhdr, sizeof(nodeshdr), 1, fp); fread(&ndhdr, sizeof(nodeshdr), 1, np);
while (fread(&nd, ndhdr.recsize, 1, fp) == 1) { while (fread(&nd, ndhdr.recsize, 1, np) == 1) {
fseek(fp, ndhdr.filegrp + ndhdr.mailgrp, SEEK_CUR); fseek(np, ndhdr.filegrp + ndhdr.mailgrp, SEEK_CUR);
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
if ((addr->zone == nd.Aka[i].zone) && (addr->net == nd.Aka[i].net) && 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)) { (addr->node == nd.Aka[i].node) && (addr->point == nd.Aka[i].point)) {
@ -336,7 +335,7 @@ node *getnlent(faddr *addr)
break; break;
} }
fclose(fp); fclose(np);
} }
free(path); free(path);
@ -357,14 +356,18 @@ node *getnlent(faddr *addr)
*q++ = '\0'; *q++ = '\0';
p = q; p = q;
if (p == NULL) if (p == NULL) {
fclose(fp);
goto badsyntax; goto badsyntax;
}
if ((q=strchr(p,','))) if ((q=strchr(p,',')))
*q++ = '\0'; *q++ = '\0';
p = q; p = q;
if (p == NULL) if (p == NULL) {
fclose(fp);
goto badsyntax; goto badsyntax;
}
/* /*
* Get system name * Get system name
@ -377,8 +380,10 @@ node *getnlent(faddr *addr)
} else } else
nodebuf.name = p; nodebuf.name = p;
p = q; p = q;
if (p == NULL) if (p == NULL) {
fclose(fp);
goto badsyntax; goto badsyntax;
}
/* /*
* Get location * Get location
@ -387,8 +392,10 @@ node *getnlent(faddr *addr)
*q++ = '\0'; *q++ = '\0';
nodebuf.location = p; nodebuf.location = p;
p = q; p = q;
if (p == NULL) if (p == NULL) {
fclose(fp);
goto badsyntax; goto badsyntax;
}
/* /*
* Get sysop name * Get sysop name
@ -397,8 +404,10 @@ node *getnlent(faddr *addr)
*q++ = '\0'; *q++ = '\0';
nodebuf.sysop = p; nodebuf.sysop = p;
p = q; p = q;
if (p == NULL) if (p == NULL) {
fclose(fp);
goto badsyntax; goto badsyntax;
}
/* /*
* Get phone number * Get phone number
@ -410,8 +419,10 @@ node *getnlent(faddr *addr)
else else
nodebuf.phone = p; nodebuf.phone = p;
p = q; p = q;
if (p == NULL) if (p == NULL) {
fclose(fp);
goto badsyntax; goto badsyntax;
}
/* /*
* Get modem speed * Get modem speed
@ -470,6 +481,27 @@ node *getnlent(faddr *addr)
} }
} }
/*
* Now we read the next line from the nodelist and see if this
* is a ESLF (Extended St. Louis Format) line. This is for test
* and nothing is defined yet. For now, debug logging only.
*/
while (TRUE) {
if (fgets(ebuf, sizeof(ebuf)-1, fp) == NULL) {
WriteError("$fgets failed for nodelist entry");
break;
}
/*
* Linse starting with ;E space are real errors.
*/
if (strncmp(ebuf, (char *)";E ", 3) == 0)
break;
if (strncmp(ebuf, (char *)";E", 2))
break;
Syslog('s', "ESLF: \"%s\"", printable(ebuf, 0));
}
fclose(fp);
nodebuf.addr.name = nodebuf.sysop; nodebuf.addr.name = nodebuf.sysop;
nodebuf.addr.domain = xstrcpy(fdx.domain); nodebuf.addr.domain = xstrcpy(fdx.domain);
nodebuf.upnet = ndx.upnet; nodebuf.upnet = ndx.upnet;