1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
/****************************************************************************
** File: spx.c
**
** Author: Mike Borella
**
** Comments: Dump SPX header information
**
** $Log: spx.c,v $
** Revision 1.2 1998/06/12 21:01:14 mborella
** Added log tag
**
*****************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "config.h"
#include "spx.h"
extern struct arg_t *my_args;
/*----------------------------------------------------------------------------
**
** dump_spx()
**
** Parse SPX header and dump fields
**
**----------------------------------------------------------------------------
*/
void dump_spx(u_char *bp, int length)
{
SPXhdr *spx;
/*
* Check length
*/
if (length < sizeof(SPXhdr))
{
printf("Truncated header, length = %d bytes\n", length);
return;
}
/*
* Dump header announcement
*/
printf("-----------------------------------------------------------------\n");
printf(" SPX Header\n");
printf("-----------------------------------------------------------------\n");
/*
* View the packet as an SPX header
*/
spx = (SPXhdr *) bp;
/*
* Dump header fields
*/
if (!my_args->t)
{
printf("Connection control: %d\n", spx->cc);
printf("Data stream type: %d\n", spx->ds_type);
printf("Source conn ID: %d\n", ntohs(spx->s_id));
printf("Dest conn ID: %d\n", ntohs(spx->d_id));
printf("Sequence number: %d\n", ntohs(spx->seqno));
printf("Ack number: %d\n", ntohs(spx->ackno));
printf("Allocation number: %d\n", ntohs(spx->allocno));
}
}
|