Commit 49b28fe0 authored by rswindell's avatar rswindell
Browse files

Output product/revision information.

Print wanring if type 2+ orig/dest zones don't match the zone fields in the
type-2 portion of the header.
Updated some pkt header field names in fidodefs.h.
parent 4ee84e18
......@@ -111,7 +111,7 @@ typedef struct _PACK { /* Fidonet Packet Header (types 2+), FSC-48 */
uint16_t orignet; // Origination Net of Packet
uint16_t destnet; // Destination Net of Packet
uint8_t prodcodeLo; // Product Code (00h is Fido)
uint8_t revisionMaj; // Revision (major)
uint8_t prodrevMajor; // Revision (major)
uint8_t password[FIDO_PASS_LEN]; // Session Password or NULL
uint16_t oldOrigZone; // Origination Zone in type 2.0 packet, unused in 2+
uint16_t oldDestZone; // Destination Zone in type 2.0 packet, unused in 2+
......@@ -119,7 +119,7 @@ typedef struct _PACK { /* Fidonet Packet Header (types 2+), FSC-48 */
uint16_t auxnet; // Orig Net if Origin is a Point
uint16_t cwcopy; // Must be Equal to cword (byte-swapped)
uint8_t prodcodeHi; // Product Code
uint8_t revisionMinor; // Revision (minor)
uint8_t prodrevMinor; // Revision (minor)
uint16_t cword; // Compatibility Word
uint16_t origzone; // Zone of Packet Sender or NULL
uint16_t destzone; // Zone of Packet Receiver or NULL
......@@ -139,7 +139,7 @@ typedef struct _PACK { /* Fidonet Packet Header (types 2.2), FSC-45 */
uint16_t orignet; // Origination Net of Packet
uint16_t destnet; // Destination Net of Packet
uint8_t prodcode; // Product code (00h is Fido)
uint8_t prodrevision; // Product revision level
uint8_t prodrev; // Product revision level
uint8_t password[FIDO_PASS_LEN]; // Session Password or NULL
uint16_t origzone; // Origination Zone of Packet or NULL (added in rev 12 of FTS-1)
uint16_t destzone; // Destination Zone of Packet or NULL (added in rev 12 of FTS-1)
......
......@@ -95,19 +95,27 @@ int pktdump(FILE* fp, const char* fname)
if(pkthdr.type2plus.cword==BYTE_SWAP_16(pkthdr.type2plus.cwcopy) /* 2+ Packet Header */
&& pkthdr.type2plus.cword&1) {
fprintf(stdout,"2+");
fprintf(stdout,"2+ (prod: %02X%02X, rev: %u.%u)"
,pkthdr.type2plus.prodcodeHi ,pkthdr.type2plus.prodcodeLo
,pkthdr.type2plus.prodrevMajor ,pkthdr.type2plus.prodrevMinor);
dest.point=pkthdr.type2plus.destpoint;
if(pkthdr.type2plus.origpoint!=0 && orig.net==0xffff) { /* see FSC-0048 for details */
orig.net=pkthdr.type2plus.auxnet;
orig.point=pkthdr.type2plus.origpoint;
}
if(pkthdr.type2plus.origzone != orig.zone)
printf("!Warning: origination zone mistmatch 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"
,pkthdr.type2plus.destzone, dest.zone);
} else if(pkthdr.type2_2.subversion==2) { /* Type 2.2 Packet Header (FSC-45) */
fprintf(stdout,"2.2");
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);
} else
fprintf(stdout,"2.0");
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);
......
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