#
/* Copyright 1984 by the Massachusetts Institute of Technology */
/* See permission and disclaimer notice in file notice.h */
#include	"notice.h"

#define INMNET	160	/* Max number of A,B,C nets */
#define INMMASK	0177	/* Mask for hash into A,B,C net table */
			/* If INMNET changed should consider whether
				mask should also change */

#define INMSNET	150	/* Max number of subnets */

#define	CLAA	1
#define	CLAB	2
#define	CLAC	3

/* Routing info */
struct inrte {
	net	*inr_netp;	/* My machine's net interface */
	inaddr	inr_gw;		/* Gateway address */
	};

/* Dynamic routing info */
struct innrte	{
	struct inrte	inn_rte;	/* Routing info to net */
	inaddr		inn_dstnet;	/* Dest. net address */
	unsb		inn_dist;	/* Distance to net */
	unsb		inn_age;	/* Age of entry */
	unsb		inn_flags;	/* Flags */
	};

/* Flags */
#define	NATTACHED	01
#define NFIXED		02


ext	unsb		myanet;

ext	struct innrte	innrte[];
ext	struct inrte	insrte[];

ext	net		*indefgi;	/* Default gw interface */
ext	inaddr		indefga;	/* Default gw address */

ext	opc		inage;
ext	unsw		rte_time;
ext	unsw		rte_age;

/* In routing errors (displ. into inrterr array) */
#define INRTABOV	0	/* Net routing table overflow */
#define INTO		1	/* Subnet table overflow */
#define INNBR		2	/* No bridge to subnet */
#define INNGW		3	/* No gateway to net */

#define NINRTERR	4

/* Static init decls */

/* Subnet */
struct sgwent	{
	unsb	s_net;
	byte	*s_gw;
	};

/* Net */
struct gwent	{
	byte	*g_net;
	byte	*g_gw;
	};

ext struct sgwent	sgwlst[];
ext struct gwent	gwlst[];
ext byte		*defgw;
