/* Copyright 1984 by the Massachusetts Institute of Technology */
/* This file contains IN routing table initialization.
 */

/* Version for MIT-Sewage  */

/*
 *------------------------------------------------------------------
 *
 * $Source: /afs/net.mit.edu/project/cgw/conf/sewage/RCS/inga.sewage.c,v $
 * $Revision: 1.23 $
 * $Date: 92/05/22 14:39:53 $
 * $State: Exp $
 * $Author: tom $
 * $Locker:  $
 *
 * $Log:	inga.sewage.c,v $
 * Revision 1.23  92/05/22  14:39:53  tom
 * commented out symbolics entry
 * 
 * Revision 1.22  90/12/04  13:54:36  jon
 * stop listening for cayman
 * 
 * Revision 1.21  90/10/01  15:33:29  jon
 * remove gold hill.  change ftp and cayman to listen for RIP, in prepartion
 * of not routing any more via LCS
 * 
 * Revision 1.20  90/06/11  14:45:31  jon
 * fix typo
 * 
 * Revision 1.19  90/06/11  14:43:20  jon
 * add subnet 111 for LCS
 * 
 * Revision 1.18  90/04/11  17:42:42  jon
 * add LCS routes listening restrictions, per MAP's request.
 * 
 * Revision 1.17  90/02/28  16:15:09  jon
 * remove static route to proteon, since they now have a real NEARnet connection
 * 
 * Revision 1.16  90/02/06  18:28:52  jon
 * add 2nd ether and listen to 18.30
 * 
 * Revision 1.15  89/06/26  13:00:10  jon
 * add 18.31 to the NE43 nets.
 * 
 * Revision 1.14  89/06/21  16:18:04  jon
 * Add 18.52 to the NE43 list for map ...
 * 
 * Revision 1.13  89/05/16  23:05:09  jis
 * Change static route for proteon to go to gross instead of sludge.
 * 
 * Revision 1.12  89/05/15  11:44:54  jis
 * Add static routes for hangers on in Tech Square (NEARnet cutover)
 * 
 * Revision 1.11  89/05/11  23:32:18  jis
 * Remove fixed routes for nets 10 and 26 (NearNet cutover bugfix).
 * 
 * Revision 1.10  89/05/11  23:15:55  jis
 * Change default route to go to W91GW (NearNet cutover)
 * 
 * Revision 1.9  89/03/22  11:01:37  jon
 * remove static route for 18.9.0.0 and listen to it via RIP from 18.10/18.26
 * 
 * Revision 1.8  89/01/15  20:29:14  jon
 * add routing restrictions for 18.10 and 18.26.  Only listen for 18.27 via
 * RIP for now ...
 * 
 * Revision 1.7  88/11/05  22:19:30  jon
 * route 18.43 via 18.26.0.176 (per Chris Hanson's request cph@zurich.ai.mit.edu)
 * 
 * Revision 1.6  88/06/24  23:56:06  jon
 * Fix typo.
 * 
 * Revision 1.5  88/06/24  23:52:07  jon
 * Add route to 18.43 per Mike Patton's request.
 * 
 * Revision 1.4  87/12/04  17:59:38  jon
 * Adds back 18.48 static route to moss ... seems to work
 * 
 * Revision 1.3  87/11/24  16:36:49  jon
 * Comment out losing static routes (why do they lose?  do they really lose?)
 * 
 * Revision 1.2  87/11/19  15:26:26  jon
 * Adds routes to 18.30, 18.48, and 18.41 (lcs subnets) through moss (18.10.0.11)
 * instead of using a default route to GW.  This will cause spine gateways
 * to arp hack reply for them.
 * 
 *------------------------------------------------------------------
 */

#ifndef lint
static char *rcsid_inga_c = "$Header: /afs/net.mit.edu/project/cgw/conf/sewage/RCS/inga.sewage.c,v 1.23 92/05/22 14:39:53 tom Exp $";
#endif	lint

#include	<types.h>
#include	<sys.h>
#include	<gw/src/defs.h>
#include	<gw/src/net.h>
#include	<gw/in/in.h>
#include	<gw/in/inrte.h>

#include	"../inga.h"
#include	"../mit-inga.h"

/* Allocate and init storage for gateway names using defs in inga.h. */

dmitbr
dmittiu
dmitgw2
dmitsl
dmitmoss
dgrime
dgrossl

/* Allocate and init nets and subnets. */
byte w91gw[4] = { 18, 68, 0, 22 };
byte pc1[4] = { 18, 9, 0, 0 };	/* Serial line PC net */
byte eth3[4] = { 18, 2, 0, 0 };	/* 3 Mbit Ethernet */
byte sub30[4] = { 18, 30, 0, 0 };
byte sub48[4] = { 18, 48, 0, 0 };
byte p1[4] = { 18, PRSL, 0, 0 };
byte p2[4] = { 18, PRRING, 0, 0 };
byte p3[4] = { 18, PR3, 0, 0 };
byte p4[4] = { 18, PR4, 0, 0 };
byte p5[4] = { 18, PR5, 0, 0 };
byte ainet[4] = { 128, 52, 0, 0 };
byte arpa[4] = { 10, 0, 0, 0 };	/* ARPANet */
byte milnet[4] = { 26, 0, 0, 0 }; /* MILNET */
byte lcs2[4] = { 18, 30, 0, 0 };
byte lcs3[4] = { 18, 48, 0, 0 };
byte lcs4[4] = { 18, 41, 0, 0 };
byte slipnet[4] = {18, 31, 0, 0};
byte ai2net[4] = {18, 43, 0, 0};
byte dspnet[4] = {18, 27, 0, 0};
byte ftpnet[4] = {128, 127, 0, 0 };
byte goldh[4] = {128, 168, 0, 0 };
byte apollo[4] = {129, 248, 0, 0 };
byte proteon[4] = {128, 185, 0, 0 };
byte symbolics[4] = {128, 81, 0, 0 };
byte mapnet[4] = {18, 52, 0, 0};
byte zurich[4] = {18, 26, 0, 176};

byte lcs9net[4] = {18, 9, 0, 0};
byte lcs23net[4] = {18, 23, 0, 0};
byte lcs24net[4] = {18, 24, 0, 0};
byte lcs27net[4] = {18, 27, 0, 0};
byte lcs29net[4] = {18, 29, 0, 0};
byte lcs31net[4] = {18, 31, 0, 0};
byte lcs43net[4] = {18, 43, 0, 0};
byte lcs45net[4] = {18, 45, 0, 0};
byte lcs49net[4] = {18, 49, 0, 0};
byte lcs105net[4] = {18, 105, 0, 0};
byte lcs110net[4] = {18, 110, 0, 0};
byte lcs111net[4] = { 18, 111, 0, 0 };

byte mit_net_mask[4] = {255, 255, 0, 0};

/* Default Gateway */
byte *defgw = { w91gw };

/* Static routes */
struct ipsrte iprte_sinit[] = {
/*  pc1, mittiu, 4, 0, */
    eth3, mitbr, 1, 0,
    p1, grime, 1, 0,
    p2, grime, 2, 0,
    p3, grime, 3, 0,
    p4, grime, 3, 0,
    p5, grime, 3, 0,
    ainet, grossl, 1, 0,
/*  lcs2, mitmoss, 1, 0, */
    lcs3, mitmoss, 1, 0,
/* this seems to lose for some reason
    lcs4, mitmoss, 2, 0, */
    ai2net, zurich, 1, 0,
/*  proteon, grossl, 3, 0, */
/*  symbolics, grossl, 1, 0, */
    0, 0, 0, 0,
};

ipr_res_entry_init ne43_restrictions[] = {
  dspnet, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  pc1, mit_net_mask, 0, F_LISTEN |  F_RES_RIP,
  mapnet, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  slipnet, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs2, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs24net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs23net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs24net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs29net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs43net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs45net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs49net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs105net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs110net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  lcs111net, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  ftpnet, mit_net_mask, 0, F_LISTEN | F_RES_RIP,
  0, 0, 0, 0,
};

#ifndef NULL
#define NULL 0
#endif

ipr_res_entry_init *ipr_init_restrictions[] = {
  /* Spine */ NULL,
  /* 18.10 */ &ne43_restrictions[0],
  /* 18.26 */ &ne43_restrictions[0],
  /* 18.52 */ &ne43_restrictions[0],
};
