home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR18
/
PKTVIEWD.ZIP
/
STRUCTS.H
< prev
next >
Wrap
Text File
|
1993-04-12
|
3KB
|
135 lines
/*
* Copyright, KLOS Technologies, Inc.
* All Right Reserved
*/
typedef unsigned char byte;
typedef unsigned short int word;
typedef unsigned long int dword;
#define ETHERNET 0x00
#define TOKENRING 0x08
#define ARCNET 0x10
#define FDDI 0x18
#define PPP 0x20
#define SLIP 0x28
#define MEDIA_MASK 0x38
#define IEEE8022 0x01
#define IEEE8022SNAP 0x02
#define DIX 0x04
#define MEDIA_ETHERNET_8022 (ETHERNET+IEEE8022)
#define MEDIA_ETHERNET_8022_SNAP (ETHERNET+IEEE8022+IEEE8022SNAP)
#define MEDIA_ETHERNET_DIX (ETHERNET+DIX)
#define MEDIA_TOKENRING_8022 (TOKENRING+IEEE8022)
#define MEDIA_TOKENRING_8022_SNAP (TOKENRING+IEEE8022+IEEE8022SNAP)
#define MEDIA_ARCNET (ARCNET)
#define MEDIA_ARCNET_8022 (ARCNET+IEEE8022)
#define MEDIA_ARCNET_8022_SNAP (ARCNET+IEEE8022+IEEE8022SNAP)
#define MEDIA_FDDI_8022 (FDDI+IEEE8022)
#define MEDIA_FDDI_8022_SNAP (FDDI+IEEE8022+IEEE8022SNAP)
#define MEDIA_PPP (PPP)
#define MEDIA_SLIP (SLIP)
#define BLUE 0x01
#define GREEN 0x02
#define CYAN 0x03
#define RED 0x04
#define MAGENTA 0x05
#define BROWN 0x06
#define WHITE 0x07
#define GREY 0x08
#define LTBLUE 0x09
#define LTGREEN 0x0a
#define LTCYAN 0x0b
#define LTRED 0x0c
#define LTMAGENTA 0x0d
#define YELLOW 0x0e
struct ethernet_header
{ byte destination[6];
byte source[6];
word type;
byte data[];
};
struct token_ring_header
{ byte access_control;
byte frame_control;
byte destination[6];
byte source[6];
byte data[];
};
struct arcnet_header
{ byte source;
byte destination;
byte type;
};
struct fddi_header
{ byte frame_control;
byte destination[6];
byte source[6];
byte data[];
};
struct PPP_header
{ byte direction;
byte address;
byte control;
word type;
};
struct SLIP_header
{ byte direction;
};
struct sap_header
{ byte dsap;
byte ssap;
byte control;
};
struct snap_header
{ byte organization[3];
word type;
};
struct protocol
{ struct protocol *next;
char *protocol_name;
word type1; /* type field for DIX and SNAP */
byte type2; /* type field for 802.2 headers */
byte type3; /* type field for ARCNET */
word type4; /* type field for PPP */
word dgroup;
void (*show_line)();
void (*show_packet)();
};
struct interface
{ byte signature[8];
struct protocol *(*initialize)();
byte *(*sprintf)();
void (*printf)();
void (*decode_line)();
void (*decode_packet)();
void (*format_raw)();
void (*set_color)();
byte *(*falloc)();
int (*open)();
int (*read)();
int (*write)();
long (*lseek)();
int (*close)();
};
unsigned int swap();
unsigned long dswap();
char *sprintf();