From 10972218f687742525e685f1e339de5bc3cc2d49 Mon Sep 17 00:00:00 2001 From: mid Date: Tue, 28 Dec 1999 06:16:07 +0000 Subject: [PATCH] Fixed to handle ACK-only (non-SNAC) frames. --- utils/aimdump/main.c | 63 ++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/utils/aimdump/main.c b/utils/aimdump/main.c index f6d422c..523ce98 100644 --- a/utils/aimdump/main.c +++ b/utils/aimdump/main.c @@ -427,37 +427,48 @@ void detectaim(struct pcap_pkthdr *hdr, char *pkt) flap->channel, flap->seqnum, flap->len); - printf("SNAC:\n"); - - /* for overrun checking... */ - for (maxfamily=1;snactypes[maxfamily].family; maxfamily++) - ; - if (snac->family <= maxfamily) + /* jump around flap */ + pkt += 6; + newlen -= 6; + + if ((snac->family == 0x0000) && (snac->subtype == 0x0001)) { - for (maxsubtype=1;snactypes[snac->family].subtypes[maxsubtype].name; maxsubtype++) - ; + printf("\t\tNo SNAC. ACK only.\n"); } - maxfamily--; - maxsubtype--; - - printf("\tFamily:\t\t0x%04x (%s)\n", - snac->family, - (snac->family > maxfamily)?"Out of Range":snactypes[snac->family].family); - printf("\tSubtype:\t0x%04x (%s)\n", - snac->subtype, - (snac->subtype > maxsubtype)?"Out of Range":snactypes[snac->family].subtypes[snac->subtype].name); - printf("\tFlags:\t\t0x%02x,0x%02x\tID:\t0x%08lx\n", snac->flags[0], snac->flags[1], snac->id); - - /* jump around flap+snac */ - pkt += 16; - newlen -= 16; - - if (snactypes[snac->family].subtypes[snac->subtype].parser) - (*(snactypes[snac->family].subtypes[snac->subtype].parser))((u_char *)pkt, newlen); + else + { + printf("SNAC:\n"); + + /* for overrun checking... */ + for (maxfamily=1;snactypes[maxfamily].family; maxfamily++) + ; + if (snac->family <= maxfamily) + { + for (maxsubtype=1;snactypes[snac->family].subtypes[maxsubtype].name; maxsubtype++) + ; + } + maxfamily--; + maxsubtype--; + + printf("\tFamily:\t\t0x%04x (%s)\n", + snac->family, + (snac->family > maxfamily)?"Out of Range":snactypes[snac->family].family); + printf("\tSubtype:\t0x%04x (%s)\n", + snac->subtype, + (snac->subtype > maxsubtype)?"Out of Range":snactypes[snac->family].subtypes[snac->subtype].name); + printf("\tFlags:\t\t0x%02x,0x%02x\tID:\t0x%08lx\n", snac->flags[0], snac->flags[1], snac->id); + + /* jump around snac */ + pkt += 16; + newlen -= 16; + if (snactypes[snac->family].subtypes[snac->subtype].parser) + (*(snactypes[snac->family].subtypes[snac->subtype].parser))((u_char *)pkt, newlen); + } + printf("\nRAW:\n"); - + for (i=0;i