--- sbbs/src/sbbs3/pktdump.c 2018/04/24 16:41:23 1.1.1.1 +++ sbbs/src/sbbs3/pktdump.c 2018/04/24 16:42:41 1.1.1.2 @@ -1,6 +1,6 @@ /* pktdump.c */ -/* $Id: pktdump.c,v 1.1.1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: pktdump.c,v 1.1.1.2 2018/04/24 16:42:41 root Exp $ */ #include "fidodefs.h" #include "sbbsdefs.h" /* faddr_t */ @@ -90,6 +90,10 @@ int pktdump(FILE* fp, const char* fname) && pkthdr.fill.two_plus.cword&1) { fprintf(stdout,"2+"); dest.point=pkthdr.fill.two_plus.destpoint; + if(pkthdr.fill.two_plus.origpoint!=0 && orig.net==0xffff) { /* see FSC-0048 for details */ + orig.net=pkthdr.fill.two_plus.auxnet; + orig.point=pkthdr.fill.two_plus.origpoint; + } } else if(pkthdr.baud==2) { /* Type 2.2 Packet Header */ fprintf(stdout,"2.2"); dest.point=pkthdr.month; @@ -101,6 +105,9 @@ int pktdump(FILE* fp, const char* fname) printf(" from %s%s",faddrtoa(&orig,NULL),origdomn); printf(" to %s%s\n" ,faddrtoa(&dest,NULL),destdomn); + if(pkthdr.password[0]) + fprintf(stdout,"Password: '%.*s'\n",sizeof(pkthdr.password),pkthdr.password); + fseek(fp,sizeof(pkthdr),SEEK_SET); /* Read/Display packed messages */ @@ -145,10 +152,24 @@ int pktdump(FILE* fp, const char* fname) return(0); } +char* usage = "usage: pktdump [-body] [file2.pkt] [...]\n"; + int main(int argc, char** argv) { FILE* fp; int i; + char revision[16]; + + sscanf("$Revision: 1.1.1.2 $", "%*s %s", revision); + + fprintf(stderr,"pktdump rev %s - Dump FidoNet Packets\n\n" + ,revision + ); + + if(argc<2) { + fprintf(stderr,"%s",usage); + return -1; + } if((nulfp=fopen(_PATH_DEVNULL,"w+"))==NULL) { perror(_PATH_DEVNULL); @@ -176,7 +197,7 @@ int main(int argc, char** argv) bodyfp=stdout;; break; default: - printf("usage: pktdump [-text] \n"); + printf("%s",usage); return(0); } continue;