Changed mbfido test routing tests
This commit is contained in:
parent
4ead3d8489
commit
f2ad132b99
@ -44,6 +44,9 @@ v0.35.02 22-Jun-2002
|
|||||||
tag, mbfido would crash.
|
tag, mbfido would crash.
|
||||||
Filefind netmail replies now set the private flag.
|
Filefind netmail replies now set the private flag.
|
||||||
Removed debugging messages displaying the incoming tic files.
|
Removed debugging messages displaying the incoming tic files.
|
||||||
|
The mbfid test command now needs a extra parameter, the final
|
||||||
|
destination to test. It doesn't use the internal fixed table
|
||||||
|
anymore.
|
||||||
|
|
||||||
mbindex:
|
mbindex:
|
||||||
Fixed a crash when a pointlist contained Point,5,reservered,
|
Fixed a crash when a pointlist contained Point,5,reservered,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY>
|
<BODY>
|
||||||
<BLOCKQUOTE>
|
<BLOCKQUOTE>
|
||||||
<h5>Last update 01-May-2002</h5>
|
<h5>Last update 29-Jun-2002</h5>
|
||||||
<P> <P>
|
<P> <P>
|
||||||
|
|
||||||
<H1>mbfido, the fidonet mail and files processor.</H1>
|
<H1>mbfido, the fidonet mail and files processor.</H1>
|
||||||
@ -187,10 +187,11 @@ It is wise to do this sometimes, on my bbs I run this once a day.
|
|||||||
The command will create tag- and areas files in the doc directory for each group of
|
The command will create tag- and areas files in the doc directory for each group of
|
||||||
mail and files.
|
mail and files.
|
||||||
<P>
|
<P>
|
||||||
<code><strong>mbfido</strong> test</code>
|
<code><strong>mbfido</strong> test <node></code>
|
||||||
This is for testing of the mail routing. In the source "tracker.c" I have
|
This is for testing of the mail routing. The node on the commandline must be in
|
||||||
included a list of nodes that will be tested. This is for development only,
|
the format f28.n280.z2 etc. The results are printed on the tty. If you have
|
||||||
but it might be handy for you to test your netmail routing.
|
debug logging on in menu 1.5.16 items 17 and 18, then all needed debug
|
||||||
|
information is written to the logfile. You can use this to debug your routing.
|
||||||
<P>
|
<P>
|
||||||
<code><strong>mbfido</strong> tic</code>
|
<code><strong>mbfido</strong> tic</code>
|
||||||
Process incoming files accompanied with .tic control files. Several actions can
|
Process incoming files accompanied with .tic control files. Several actions can
|
||||||
|
@ -125,7 +125,7 @@ void Help(void)
|
|||||||
printf(" r roll Rollover statistic counters\n");
|
printf(" r roll Rollover statistic counters\n");
|
||||||
printf(" s scan Scan outgoing Fido mail\n");
|
printf(" s scan Scan outgoing Fido mail\n");
|
||||||
printf(" ta tag Create taglists\n");
|
printf(" ta tag Create taglists\n");
|
||||||
printf(" te test Do some testing\n");
|
printf(" te test <node> Do routing test for node\n");
|
||||||
printf(" ti tic Process .tic files\n");
|
printf(" ti tic Process .tic files\n");
|
||||||
printf(" to toss Toss incoming Fido mail\n");
|
printf(" to toss Toss incoming Fido mail\n");
|
||||||
printf(" u uucp Process UUCP batchfile\n");
|
printf(" u uucp Process UUCP batchfile\n");
|
||||||
@ -254,7 +254,7 @@ int main(int argc, char **argv)
|
|||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
struct tm *t;
|
struct tm *t;
|
||||||
fa_list **envrecip, *envrecip_start = NULL;
|
fa_list **envrecip, *envrecip_start = NULL;
|
||||||
faddr *taddr;
|
faddr *taddr = NULL;
|
||||||
int envrecip_count = 0;
|
int envrecip_count = 0;
|
||||||
FILE *ofp;
|
FILE *ofp;
|
||||||
|
|
||||||
@ -362,9 +362,15 @@ int main(int argc, char **argv)
|
|||||||
do_tags = TRUE;
|
do_tags = TRUE;
|
||||||
else if (strncmp(tl(argv[i]), "ti", 2) == 0)
|
else if (strncmp(tl(argv[i]), "ti", 2) == 0)
|
||||||
do_tic = TRUE;
|
do_tic = TRUE;
|
||||||
else if (strncmp(tl(argv[i]), "te", 2) == 0)
|
else if (strncmp(tl(argv[i]), "te", 2) == 0) {
|
||||||
do_test = TRUE;
|
do_test = TRUE;
|
||||||
else if (strncmp(tl(argv[i]), "to", 2) == 0)
|
if ((i + 1) < argc) {
|
||||||
|
if ((taddr = parsefaddr(argv[i + 1])) == NULL) {
|
||||||
|
Help();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} else if (strncmp(tl(argv[i]), "to", 2) == 0)
|
||||||
do_toss = TRUE;
|
do_toss = TRUE;
|
||||||
else if (strncmp(tl(argv[i]), "u", 1) == 0)
|
else if (strncmp(tl(argv[i]), "u", 1) == 0)
|
||||||
do_uucp = TRUE;
|
do_uucp = TRUE;
|
||||||
@ -526,8 +532,12 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (!do_uucp)
|
if (!do_uucp)
|
||||||
newspost();
|
newspost();
|
||||||
if (do_test)
|
if (do_test) {
|
||||||
TestTracker();
|
if (taddr == NULL)
|
||||||
|
Help();
|
||||||
|
TestTracker(taddr);
|
||||||
|
tidy_faddr(taddr);
|
||||||
|
}
|
||||||
if (do_tags)
|
if (do_tags)
|
||||||
MakeTags();
|
MakeTags();
|
||||||
if (do_stat)
|
if (do_stat)
|
||||||
|
@ -190,6 +190,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
}
|
}
|
||||||
best = bestaka_s(dest);
|
best = bestaka_s(dest);
|
||||||
Syslog('r', "Get route for: %s", ascfnode(dest, 0xff));
|
Syslog('r', "Get route for: %s", ascfnode(dest, 0xff));
|
||||||
|
Syslog('r', "Our best aka is: %s", ascfnode(best, 0xff));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the destination is ourself.
|
* Check if the destination is ourself.
|
||||||
@ -221,6 +222,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
* We are a point, so don't bother the rest of the tests, route
|
* We are a point, so don't bother the rest of the tests, route
|
||||||
* to our boss.
|
* to our boss.
|
||||||
*/
|
*/
|
||||||
|
Syslog('r', "We are a point");
|
||||||
res->zone = best->zone;
|
res->zone = best->zone;
|
||||||
res->net = best->net;
|
res->net = best->net;
|
||||||
res->node = best->node;
|
res->node = best->node;
|
||||||
@ -243,6 +245,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
/*
|
/*
|
||||||
* First direct match
|
* First direct match
|
||||||
*/
|
*/
|
||||||
|
Syslog('r', "Checking for a direct link, 4d");
|
||||||
if (SearchNode(dir)) {
|
if (SearchNode(dir)) {
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
if ((dir.zone == nodes.Aka[i].zone) &&
|
if ((dir.zone == nodes.Aka[i].zone) &&
|
||||||
@ -261,6 +264,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
/*
|
/*
|
||||||
* Again, but now for points
|
* Again, but now for points
|
||||||
*/
|
*/
|
||||||
|
Syslog('r', "Checking for a direct link, 3d");
|
||||||
dir.point = 0;
|
dir.point = 0;
|
||||||
if (SearchNode(dir)) {
|
if (SearchNode(dir)) {
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
@ -280,6 +284,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
/*
|
/*
|
||||||
* Check if we know the uplink, but first check if the node is listed.
|
* Check if we know the uplink, but first check if the node is listed.
|
||||||
*/
|
*/
|
||||||
|
Syslog('r', "Checking for a known uplink");
|
||||||
dnlent = (node *)malloc(sizeof(node));
|
dnlent = (node *)malloc(sizeof(node));
|
||||||
memcpy(dnlent, getnlent(dest), sizeof(node));
|
memcpy(dnlent, getnlent(dest), sizeof(node));
|
||||||
if (dnlent->addr.domain)
|
if (dnlent->addr.domain)
|
||||||
@ -314,6 +319,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
me_hub = AreWeHub(dest);
|
me_hub = AreWeHub(dest);
|
||||||
bnlent = getnlent(best);
|
bnlent = getnlent(best);
|
||||||
myregion = bnlent->region;
|
myregion = bnlent->region;
|
||||||
|
Syslog('r', "We are in region %d", myregion);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is default routing for hosts:
|
* This is default routing for hosts:
|
||||||
@ -323,6 +329,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
* 4. The rest goes to the hubs.
|
* 4. The rest goes to the hubs.
|
||||||
*/
|
*/
|
||||||
if (me_host != -1) {
|
if (me_host != -1) {
|
||||||
|
Syslog('r', "We are a host");
|
||||||
sprintf(res->domain, "%s", CFG.aka[me_host].domain);
|
sprintf(res->domain, "%s", CFG.aka[me_host].domain);
|
||||||
if (((myregion != dnlent->region) && (!(dnlent->pflag & NL_DUMMY))) ||
|
if (((myregion != dnlent->region) && (!(dnlent->pflag & NL_DUMMY))) ||
|
||||||
(CFG.aka[me_host].zone != dest->zone)) {
|
(CFG.aka[me_host].zone != dest->zone)) {
|
||||||
@ -377,6 +384,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
* 2. Kick everything else to the host.
|
* 2. Kick everything else to the host.
|
||||||
*/
|
*/
|
||||||
if (me_hub != -1) {
|
if (me_hub != -1) {
|
||||||
|
Syslog('r', "We are a hub");
|
||||||
sprintf(res->domain, "%s", CFG.aka[me_hub].domain);
|
sprintf(res->domain, "%s", CFG.aka[me_hub].domain);
|
||||||
if ((dnlent->upnode == CFG.aka[me_hub].node) &&
|
if ((dnlent->upnode == CFG.aka[me_hub].node) &&
|
||||||
(dnlent->upnet == CFG.aka[me_hub].net) &&
|
(dnlent->upnet == CFG.aka[me_hub].net) &&
|
||||||
@ -410,6 +418,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
* Routing for normal nodes, everything goes to the hub or host.
|
* Routing for normal nodes, everything goes to the hub or host.
|
||||||
*/
|
*/
|
||||||
if ((me_hub == -1) && (me_host == -1)) {
|
if ((me_hub == -1) && (me_host == -1)) {
|
||||||
|
Syslog('r', "We are a normal node");
|
||||||
if (bnlent->pflag != NL_DUMMY) {
|
if (bnlent->pflag != NL_DUMMY) {
|
||||||
res->zone = bnlent->addr.zone;
|
res->zone = bnlent->addr.zone;
|
||||||
res->net = bnlent->upnet;
|
res->net = bnlent->upnet;
|
||||||
@ -430,6 +439,7 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
* If the above failed, we are probably a new node without
|
* If the above failed, we are probably a new node without
|
||||||
* a nodelist entry. We will switch to plan B.
|
* a nodelist entry. We will switch to plan B.
|
||||||
*/
|
*/
|
||||||
|
Syslog('r', "Plan B, we are a unlisted node");
|
||||||
if ((fil = fopen(nodes_fil, "r")) != NULL) {
|
if ((fil = fopen(nodes_fil, "r")) != NULL) {
|
||||||
fread(&nodeshdr, sizeof(nodeshdr), 1, fil);
|
fread(&nodeshdr, sizeof(nodeshdr), 1, fil);
|
||||||
nodes_pos = -1;
|
nodes_pos = -1;
|
||||||
@ -470,49 +480,51 @@ int GetRoute(char *ftn, fidoaddr *res)
|
|||||||
|
|
||||||
void TestRoute(char *dest)
|
void TestRoute(char *dest)
|
||||||
{
|
{
|
||||||
fidoaddr result;
|
fidoaddr result;
|
||||||
int rc;
|
int rc;
|
||||||
|
char *res;
|
||||||
|
|
||||||
|
rc = GetRoute(dest, &result);
|
||||||
rc = GetRoute(dest, &result);
|
switch (rc) {
|
||||||
if (rc == R_NOROUTE)
|
case R_NOROUTE: res = xstrcpy((char *)"No Route");
|
||||||
printf("Route %d %23s => no route\n", rc, dest);
|
break;
|
||||||
else if (rc == R_UNLISTED)
|
case R_LOCAL: res = xstrcpy((char *)"Local address");
|
||||||
printf("Route %d %23s => unlisted node\n", rc, dest);
|
break;
|
||||||
|
case R_DIRECT: res = xstrcpy((char *)"Direct link");
|
||||||
|
break;
|
||||||
|
case R_ROUTE: res = xstrcpy((char *)"Routed");
|
||||||
|
break;
|
||||||
|
case R_UNLISTED: res = xstrcpy((char *)"Unlisted node");
|
||||||
|
break;
|
||||||
|
default: res = xstrcpy((char *)"Internal error");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Route %s => %s, route result: %s\n", dest, aka2str(result), res);
|
||||||
|
free(res);
|
||||||
|
|
||||||
|
if ((rc == R_NOROUTE) || (rc == R_UNLISTED) || (rc == R_LOCAL))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (SearchNode(result)) {
|
||||||
|
if (nodes.RouteVia.zone)
|
||||||
|
printf("Node is in the setup, route via is %s\n", aka2str(nodes.RouteVia));
|
||||||
else
|
else
|
||||||
printf("Route %d %23s => %s\n", rc, dest, aka2str(result));
|
printf("Node is in the setup, no route via address\n");
|
||||||
|
} else {
|
||||||
|
printf("Node is not in the setup\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TestTracker(void)
|
void TestTracker(faddr *dest)
|
||||||
{
|
{
|
||||||
colour(7, 0);
|
char *addr;
|
||||||
TestRoute((char *)"2:2801/16@fidonet");
|
|
||||||
TestRoute((char *)"2:2801/16.1");
|
colour(7, 0);
|
||||||
TestRoute((char *)"2:2801/805.3");
|
addr = ascfnode(dest, 0x2f);
|
||||||
TestRoute((char *)"2:2801/899.1@fidonet");
|
Syslog('+', "Search route for %s", addr);
|
||||||
TestRoute((char *)"2:2801/890@fidonet");
|
TestRoute(addr);
|
||||||
TestRoute((char *)"2:2801/1008");
|
|
||||||
TestRoute((char *)"2:2801/21");
|
|
||||||
TestRoute((char *)"2:2801/899@fidonet");
|
|
||||||
TestRoute((char *)"2:2801/807");
|
|
||||||
TestRoute((char *)"92:100/0@bibnet");
|
|
||||||
TestRoute((char *)"92:100/5@bibnet");
|
|
||||||
TestRoute((char *)"92:100/45");
|
|
||||||
TestRoute((char *)"2:28/0");
|
|
||||||
TestRoute((char *)"2:2801/1002@fidonet");
|
|
||||||
TestRoute((char *)"2:2801/206");
|
|
||||||
TestRoute((char *)"2:2/0@fidonet");
|
|
||||||
TestRoute((char *)"2:2/3001");
|
|
||||||
TestRoute((char *)"2:2801/28");
|
|
||||||
TestRoute((char *)"2:2801/307.50");
|
|
||||||
TestRoute((char *)"2:280/901");
|
|
||||||
TestRoute((char *)"2:280/9");
|
|
||||||
TestRoute((char *)"2:203/111");
|
|
||||||
TestRoute((char *)"1:213/350");
|
|
||||||
TestRoute((char *)"9:314/8@virnet");
|
|
||||||
TestRoute((char *)"9:314/8.1@virnet");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
int TrackMail(fidoaddr, fidoaddr *);
|
int TrackMail(fidoaddr, fidoaddr *);
|
||||||
int GetRoute(char *, fidoaddr *);
|
int GetRoute(char *, fidoaddr *);
|
||||||
void TestTracker(void);
|
void TestTracker(faddr *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user