Commit f71e641d authored by rswindell's avatar rswindell
Browse files

Use new struct fidoaddr (5D address).

parent f0edd791
......@@ -14,17 +14,17 @@ FILE* bodyfp;
/****************************************************************************/
/* Returns an ASCII string for FidoNet address 'addr' */
/****************************************************************************/
char *faddrtoa(faddr4d_t* addr, char* outstr)
char *faddrtoa(struct fidoaddr* addr, char* outstr)
{
static char str[64];
char point[25];
if(addr==NULL)
return("0:0/0");
sprintf(str,"%hu:%hu/%hu",addr->zone,addr->net,addr->node);
if(addr->point) {
sprintf(point,".%hu",addr->point);
strcat(str,point); }
if(addr->point)
sprintf(str + strlen(str), ".%hu", addr->point);
if(addr->domain[0])
sprintf(str + strlen(str), "@%s", addr->domain);
if(outstr==NULL)
return(str);
strcpy(outstr,str);
......@@ -52,14 +52,12 @@ int pktdump(FILE* fp, const char* fname)
{
int ch,lastch=0;
char buf[128];
char origdomn[16]="";
char destdomn[16]="";
char to[FIDO_NAME_LEN];
char from[FIDO_NAME_LEN];
char subj[FIDO_SUBJ_LEN];
long offset;
faddr4d_t orig;
faddr4d_t dest;
struct fidoaddr orig = {0};
struct fidoaddr dest = {0};
fpkthdr_t pkthdr;
fpkdmsg_t pkdmsg;
......@@ -105,21 +103,21 @@ int pktdump(FILE* fp, const char* fname)
orig.point=pkthdr.type2plus.origpoint;
}
if(pkthdr.type2plus.origzone != orig.zone)
printf("!Warning: origination zone mistmatch in type 2+ packet header (%u != %u)\n"
printf("!Warning: origination zone mismatch in type 2+ packet header (%u != %u)\n"
,pkthdr.type2plus.origzone, orig.zone);
if(pkthdr.type2plus.destzone != dest.zone)
printf("!Warning: destination zone mistmatch in type 2+ packet header (%u != %u)\n"
printf("!Warning: destination zone mismatch in type 2+ packet header (%u != %u)\n"
,pkthdr.type2plus.destzone, dest.zone);
} else if(pkthdr.type2_2.subversion==2) { /* Type 2.2 Packet Header (FSC-45) */
fprintf(stdout,"2.2 (prod: %02X, rev: %u)", pkthdr.type2_2.prodcode, pkthdr.type2_2.prodrev);
dest.point=pkthdr.type2_2.destpoint;
sprintf(origdomn,"@%s",pkthdr.type2_2.origdomn);
sprintf(destdomn,"@%s",pkthdr.type2_2.destdomn);
memcpy(orig.domain, pkthdr.type2_2.origdomn, sizeof(pkthdr.type2_2.origdomn));
memcpy(dest.domain, pkthdr.type2_2.destdomn, sizeof(pkthdr.type2_2.destdomn));
} else
fprintf(stdout,"2.0 (prod: %02X, serial: %u)", pkthdr.type2.prodcode, pkthdr.type2.sernum);
printf(" from %s%s",faddrtoa(&orig,NULL),origdomn);
printf(" to %s%s\n" ,faddrtoa(&dest,NULL),destdomn);
printf(" from %s",faddrtoa(&orig,NULL));
printf(" to %s\n" ,faddrtoa(&dest,NULL));
if(pkthdr.type2.password[0])
fprintf(stdout,"Password: '%.*s'\n",sizeof(pkthdr.type2.password),pkthdr.type2.password);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment