--- ftnaddr.c.orig Sun Apr 26 10:37:26 1998 +++ ftnaddr.c Sat Apr 8 16:44:54 2000 @@ -225,6 +225,7 @@ } else { +#ifndef AMIGADOS_4D_OUTBOUND char ext[] = "\0ext"; /* ".ext" */ char pnt[] = "\0pnt/0000xxxx"; /* ".pnt..." */ @@ -233,6 +234,7 @@ if (fa->p != 0) sprintf (pnt, ".pnt%s%08x", PATH_SEPARATOR, fa->p); +#endif /* AMIGADOS_4D_OUTBOUND */ #ifdef HAVE_SNPRINTF snprintf @@ -243,8 +245,13 @@ #ifdef HAVE_SNPRINTF MAXPATHLEN, #endif +#ifdef AMIGADOS_4D_OUTBOUND + "%s%s%s%s%u.%u.%u.%u", d->path, PATH_SEPARATOR, d->dir, + PATH_SEPARATOR, fa->z, fa->net, fa->node, fa->p); +#else "%s%s%s%s%s%04x%04x%s", d->path, PATH_SEPARATOR, d->dir, ext, PATH_SEPARATOR, fa->net, fa->node, pnt); +#endif /* AMIGADOS_4D_OUTBOUND */ } } --- ftnq.c.orig Tue Jul 27 17:25:00 1999 +++ ftnq.c Sat Apr 8 16:44:54 2000 @@ -163,9 +163,11 @@ FTN_ADDR fa; FA_ZERO (&fa); +#ifndef AMIGADOS_4D_OUTBOUND fa.z = ((de->d_name[len] == '.') ? strtol (de->d_name + len + 1, (char **) NULL, 16) : curr_domain->z[0]); +#endif /* AMIGADOS_4D_OUTBOUND */ if (de->d_name[len] == 0 || fa.z != curr_domain->z[0]) { strcpy (fa.domain, curr_domain->name); @@ -446,7 +448,9 @@ DIR *dp; FTN_ADDR fa2; char buf[MAXPATHLEN + 1]; +#ifndef AMIGADOS_4D_OUTBOUND int j; +#endif /* AMIGADOS_4D_OUTBOUND */ char *s; if ((dp = opendir (dir)) != 0) @@ -455,6 +459,52 @@ while ((de = readdir (dp)) != 0) { +#ifdef AMIGADOS_4D_OUTBOUND + char ext[4]; + int matched = 0; + size_t nlen = strlen(s = de->d_name); + + for (; *s && isgraph(*s) != 0; s++); + if (s - de->d_name != nlen) + continue; + + memcpy (&fa2, fa1, sizeof(FTN_ADDR)); + + if (sscanf(s = de->d_name, "%u.%u.%u.%u.%3s%n", + &fa2.z, &fa2.net, &fa2.node, &fa2.p, ext, &matched) != 5 || + matched != nlen || strlen(ext) != 3) + continue; + + if ((fa1->z != -1 && fa1->z != fa2.z) || + (fa1->net != -1 && fa1->net != fa2.net) || + (fa1->node != -1 && fa1->node != fa2.node) || + (fa1->p != -1 && fa1->p != fa2.p)) + continue; + + strnzcpy(buf, dir, sizeof(buf)); + strnzcpy(buf + strlen(buf), PATH_SEPARATOR, sizeof(buf) - strlen(buf)); + strnzcpy(buf + strlen(buf), s, sizeof(buf) - strlen(buf)); + + if (!STRICMP(ext, "bsy") || !STRICMP(ext, "csy")) + process_bsy(&fa2, buf); + + if (!(get_node_info(&fa2) || is5D(fa1))) + continue; + + if (strchr(out_flvrs, ext[0]) && + tolower(ext[1]) == 'u' && tolower(ext[2]) == 't') + /* Adding *.?ut */ + q = q_add_file(q, buf, &fa2, ext[0], 'd', 'm'); + else if (!STRICMP(ext, "req")) + /* Adding *.req */ + q = q_add_file(q, buf, &fa2, 'h', 's', 'r'); + else if (!STRICMP(ext, "hld")) + process_hld(&fa2, buf); + else if (strchr(flo_flvrs, ext[0]) && + tolower(ext[1]) == 'l' && tolower(ext[2]) == 'o') + /* Adding *.?lo */ + q = q_add_file(q, buf, &fa2, ext[0], 'd', 'l'); +#else /* AMIGADOS_4D_OUTBOUND */ s = de->d_name; for (j = 0; j < 8; ++j) @@ -527,6 +577,7 @@ } } } +#endif /* AMIGADOS_4D_OUTBOUND */ } closedir (dp); } --- prothlp.c.orig Fri May 8 07:08:20 1998 +++ prothlp.c Sat Apr 8 16:44:54 2000 @@ -115,7 +115,41 @@ *n_rcvdlist = 0; } -void netname (char *s, TFILE *q) +#ifdef AMIGADOS_4D_OUTBOUND +extern FTN_ADDR *pAddr; + +static unsigned int gen_arcname(FTN_ADDR *remote) +{ + if (remote->z == pAddr->z) + { + if (remote->p==0 && pAddr->p==0) + return ((((unsigned)(pAddr->net -remote->net )) & 0xffffu) << 16) + + (((unsigned)(pAddr->node-remote->node)) & 0xffffu); + else + return ((((unsigned)(pAddr->net -remote->net )) & 0xfffu) << 20) + + ((((unsigned)(pAddr->node-remote->node)) & 0xfffu) << 8 ) + + (((unsigned)(pAddr->p -remote->p )) & 0xffu ); + } + else + { + if (remote->p==0 && pAddr->p==0) + return ((((unsigned)(pAddr->z -remote->z )) & 0xfu ) << 28) + + ((((unsigned)(pAddr->net -remote->net )) & 0xfffu ) << 16) + + (((unsigned)(pAddr->node-remote->node)) & 0xffffu); + else + return ((((unsigned)(pAddr->z -remote->z )) & 0xfu ) << 28) + + ((((unsigned)(pAddr->net -remote->net )) & 0xffu ) << 20) + + ((((unsigned)(pAddr->node-remote->node)) & 0xfffu) << 8 ) + + (((unsigned)(pAddr->p -remote->p )) & 0xffu ); + } +} +#endif /* AMIGADOS_4D_OUTBOUND */ + +void netname (char *s, TFILE *q +#ifdef AMIGADOS_4D_OUTBOUND + , FTN_ADDR *remote +#endif + ) { static char *weekext[] = {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}; @@ -137,8 +171,20 @@ /* gul: bt+ arcshield */ if ((z = strrchr (s, '.')) != NULL) if (strlen (++z) == 3) + { if ((*z >= '0') && (*z < '7') && (z[1] == '#')) memcpy (z, weekext[*z - '0'], 2); +#ifdef AMIGADOS_4D_OUTBOUND + else { + char saddr[MAXPATHLEN]; + sprintf(saddr, "%u.%u.%u.%u.", + remote->z, remote->net, remote->node, remote->p); + if (strncmp(saddr, s, strlen(saddr)) == 0 && + strlen(s + strlen(saddr)) == 3 && isarcmail(s)) + sprintf(s, "%08lx.%s", gen_arcname(remote), z); + } +#endif + } z = strquote(s, SQ_CNTRL | SQ_SPACE); strnzcpy (s, z, MAX_NETNAME); --- prothlp.h.orig Fri Mar 28 08:54:18 1997 +++ prothlp.h Sat Apr 8 16:47:28 2000 @@ -71,6 +71,10 @@ void free_rcvdlist (RCVDLIST **rcvdlist, int *n_rcvdlist); /* Creates a netname from a local name */ -void netname (char *s, TFILE *q); +void netname (char *s, TFILE *q +#ifdef AMIGADOS_4D_OUTBOUND + , FTN_ADDR *remote +#endif + ); #endif --- protocol.c.orig Tue Jul 27 18:38:58 1999 +++ protocol.c Sat Apr 8 16:44:54 2000 @@ -1515,7 +1515,11 @@ state->waiting_for_GOT = 0; Log(9, "Dont waiting for M_GOT"); state->out.start = time (0); - netname (state->out.netname, &state->out); + netname (state->out.netname, &state->out +#ifdef AMIGADOS_4D_OUTBOUND + , &state->out_addr +#endif + ); Log (3, "sending %s as %s (%li)", state->out.path, state->out.netname, (long) state->out.size);