Category : Network Files
Archive   : PACKDEMO.ZIP
Filename : STRUCTS.H

 
Output of file : STRUCTS.H contained in archive : PACKDEMO.ZIP

/*
* 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 (FDDI)
#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 type5; /* to be defined */
void (*show_line)();
void (*show_packet)();
};

struct interface /* REV 1 */
{ byte i_signature[8];
struct protocol *(*i_initialize)();
byte *(*i_sprintf)();
void (*i_printf)();
void (*i_format_protocol)();
void (*i_format_protocol_line)();
void (*i_format_raw)();
void (*i_format_raw_line)();
void (*i_set_color)();
byte *(*i_falloc)();
int (*i_open)();
int (*i_read)();
int (*i_write)();
long (*i_lseek)();
int (*i_close)();
char *i_home_dir;
int *i_current_level;
};

#ifdef INTERNAL_DECODER
char *sprintf();

extern char home_dir[];
extern int current_level;
#else /* EXTERNAL_DECODER */
extern struct interface *decoder_header;

#define sprintf (decoder_header->i_sprintf)
#define printf (decoder_header->i_printf)
#define format_protocol (decoder_header->i_format_protocol)
#define format_protocol_line \
(decoder_header->i_format_protocol_line)
#define format_raw (decoder_header->i_format_raw)
#define format_raw_line (decoder_header->i_format_raw_line)
#define set_color (decoder_header->i_set_color)
#define open (decoder_header->i_open)
#define read (decoder_header->i_read)
#define write (decoder_header->i_write)
#define lseek (decoder_header->i_lseek)
#define close (decoder_header->i_close)

#define home_dir (decoder_header->i_home_dir)
#define current_level (decoder_header->i_current_level)
#endif

unsigned int htons();
#define ntohs htons
unsigned long htonl();
#define ntohl htonl



  3 Responses to “Category : Network Files
Archive   : PACKDEMO.ZIP
Filename : STRUCTS.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/