/* definitions used to find out the network characteristics */
#define MAXROUTER 5
typedef unsigned int address; /* addresses held in coded form (2^n8) ie AABBCCDD */
/* lego kit time, I need a building brick like this
.--------.
|Details |- (active?) -> Other router outwards
back to top level start <-----|of node |- (active?) ->
| |- (active?) ->
`--------'
*/
/* this struct is purely to help in producing the nice debugging pictures in */
/* the project write up */
struct hosts {
char other_hosts[255]; /* 256 bytes containing encoded info on other hosts */
};
struct node {
address ip; /* holds the routers ip address in coded form */
address netmask; /* holds the netmask for this node */
address broadcast; /* holds the bradcast address for this node */
char *last_updated; /* when the whole net cell was last looked at (update?) */
Widget w; /* wonderfully descriptive pointer to X11 tree widget */
struct hosts local_cell; /* 256 bytes containing info on other hosts */
/* in the same local network cell (max 255) */
/* eg hosts[0]=0xFF means the host is active */
/* problem, I need multiple occurances of this as a list */
struct node *face; /* this points back at the last level router */
struct node *out[MAXROUTER]; /* pointer to next router out in the list */
};
struct net_attrib {
address ip; /* host ip */
address netmask; /* netmask of host's network */
address broadcast; /* broadcast of the host's netnork */
};
struct range {
address start; /* starting ip of the local network */
address finish; /* ending ip of the local network */
};
/* humm,.. well the fifo list we wish to use is a linked list
something like this
<-----[ IP ]----->
*/
struct ip_chain {
address ip; /* ip we caught */
char *next; /* next in list */
char *prev; /* just in case we need it */
};
/* Typedefs */
/* These are defines for the byte number of class's in an ip held as a 4 byte int */
#define SN_RCV_BUF_SIZE 128
/* above was 1600, but kernel discards*/
/* excess and tells us full length, */
/* so we only need enough to analyze. */