#
#	$Id: TODO,v 1.1.4.1 1997/03/14 18:45:37 wfs Exp $
#
# Gated Release 3.5
# Copyright (c) 1990,1991,1992,1993,1994,1995 by Cornell University.  All
# rights reserved.  Refer to Particulars and other Copyright notices at
# the end of this file. 
# 
#

		Things to do.


Compilation:
	
	Change PROTOTYPE() and _PROTOTYPE() to only apply to arguments
	(so tags and stuff will work).  Use on all function
	definitions so ANSI prototypes are used.

	Better specification of makefile configuration and
	interdependencies. 

Configuration:

	Redo configuration/protocol initialization to be more general
	and less confusing.

Interfaces:

	If task_send() and MSG_DONTROUTE and E*UNREACH, call if_check()?

	All protocols should do the right thing if the receiving
	interface is down.

	Flag an interface as "ignore" so gated will totally ignore it.

	Interface addresses for down interfaces should not always be
	ignored.  Like if it is the router-id.

Kernel:

	The kernel should use the rth_changes stuff to avoid wasting memory
	by keeping a sockaddr_un pointer in TSI.  Flags should only be set
	during flash update.  Need to figure out which routes are installed
	already and just set their bit on.

	krt_recv() needs to be cleaned up, both in it's handling of
	routing table changes and the addition of interface status
	changes. 

	Set route MTU, use generally good default (subnets are local).
	What does MK have to say?

Other:
	Try to make sockbuild_in, sock2gated, sock2unix macros.

	Some way to specify that a route should point to whatever
	gateway is at the end of a P2P link.

Policy:	

	Should the protocol be optional for policy based on tag and/or AS
	path?

	What metric translation (if any) whould be allowed?  Need to figure
	out reasonable default metrics and importation types.

	Generic policy, using Dennis' radix tree code.
	
Routing table:

	Keep martians and other bad routes, but flag with RTS_BOGUS.  Make
	sure that all protocols check for RTS_BOGUS as well as
	RTS_NOADVISE.  Or use just RTS_NOADVISE.  For either one, set flag
	in rth_state to avoid extra search for bogus network.

	Rt_add should allow off-net gateways if RTS_NOADVISE and
	RTS_NOTINSTALL are set.  Several places need tests for null
	ifps.

	Increase preference to 32 bits.  Make preference zero a route
	that will be ignored.

	Add another linked list through rt_entry`s rooted off the gw_entry
	which installed them.  Use this list instead of rtlist_*() when
	re-evaluating policy, interface status changes, going away.

Tasks:

	Should we renice?

	Is there a way for protocols not to send packets before policy is run?

	Have a no-send flag per task.


Tracing:

	Redo tracing with flags per task.


AS paths:

	AS path patten matching needs more extensive testing.

	AS path patterns should have an ID number which is printed in
	gated_dump.  Complete list of AS path patterns should be dumped
	from the ASPath task in a readable form.

BGP:

	Update documentation for BGP and tags.  And IGP/EGP interaction.

	BGP read/write/listen/accept need intefaces in task.c for
	portability.

EGP:
	
	Should EGP use tag information to set interior/exterior?

	Imbed sorted peer list into peer structures.

OSPF:

	Allow OSPF to compile without AS paths?  Allow any tag?

	OSPF ASE, when importing from EGP, should use a preference higher than EGP.

	Parser defaults and specification of OSPF tags.

	Network summaries should be part of gated aggregation rules
	(with reject routes).  Until that is done, add reject routes
	for summaries.

	Allow areas to be specified in any order and resolve virtual
	links later.

	Defer startup if RouterID is not present.
	
RIP:

	RIP and HELLO do not send host routes when subsumer is not being announced.

	RIP/HELLO should maintain a structure of linked lists indicating
	which routes they annouce to peers.  This should be used when
	sending updates instead of scanning the whole table.  Could be
	rooted in the target list.  Needed to set router in v2 packets.

	When interface status changes to ignore an interface
	previously heard from, RIP & HELLO should delete the routes
	via that interface?

	RIP and HELLO should put all routes to a target in holddown
	when it is deleted?  This includes all targets when
	nobroadcast is turned on.


ISO:
	If an ISO address is specified without a mask and the number
	of nibbles is odd, generate a mask with an odd number of
	nibbles.

BGP Communities:

	Right now we merge community sets (take their union) by 
	looping through both sets each time we do this.  This costs
	more than it needs to.  It doesn't matter if we combine 
	communities infrequently, but if we start to deal with lots
	of communities and community policy, we can optimize this quite
	a lot by memorizing the results of the merges.

	A possible design for two-way memorized merging.  Make a new
	kind of struct:

		typedef struct _comm_derived {
			aspath_hash pathhash;
			struct _comm_derived *next;
			struct _comm_derived *prev;
			struct _comm_derived *sibling;
			as_comm *derived;
			as_comm *parent; /* need this for linked list */
					 /* code unless we are tricky */
		} comm_derived;

	and augment the as_comm struct with:

			comm_derived *derived;

	Make a hash table of comm_derived guys using the generic hash
	code.  We use comm_derived to track who is derived from us so
	that we can free them if we go away.  We also have to have the
	comm_derived guys track each other so that the related one can
	go away when one goes away.

	Now, when we run aspath_community_merge(comm1, comm2), we will
	first hash together make a comm_derived from comm1 and comm2
	(xor their already-computed hash values for the new hash value?).
	Do a comm_derived_find().  If it gives us back an existing entry,
	we win:  Return comm_derived->comm.  (alloc it too?)

	If it gives us back ourself, do the merge and alloc it.

	When we go to delete as_comm guys, we must now walk their 
	comm_derived chains freeing (a) the dependent as_comm guys
	(this can be recursive) and (b) the chains themselves.

	Be careful about when to alloc and free.

	This should do a pretty good job of letting us touch each
	community only twice -- once to read and once to send.  Of
	course, we have to take into account the work to do the 
	hash table lookup and the overhead to maintain the data
	structures.

#
# ------------------------------------------------------------------------
# 
# 	GateD, Release 3.5
# 
# 	Copyright (c) 1990,1991,1992,1993,1994,1995 by Cornell University.
# 	    All rights reserved.
# 
# 	THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY
# 	EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
# 	LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
# 	AND FITNESS FOR A PARTICULAR PURPOSE.
# 
# 	Royalty-free licenses to redistribute GateD Release
# 	3 in whole or in part may be obtained by writing to:
# 
# 	    GateDaemon Project
# 	    Information Technologies/Network Resources
# 	    200 CCC
# 	    Cornell University
# 	    Ithaca, NY  14853-2601  USA
# 
# 	GateD is based on Kirton's EGP, UC Berkeley's routing
# 	daemon	 (routed), and DCN's HELLO routing Protocol.
# 	Development of GateD has been supported in part by the
# 	National Science Foundation.
# 
# 	Please forward bug fixes, enhancements and questions to the
# 	gated mailing list: gated-people@gated.cornell.edu.
# 
# ------------------------------------------------------------------------
# 
#       Portions of this software may fall under the following
#       copyrights:
# 
# 	Copyright (c) 1988 Regents of the University of California.
# 	All rights reserved.
# 
# 	Redistribution and use in source and binary forms are
# 	permitted provided that the above copyright notice and
# 	this paragraph are duplicated in all such forms and that
# 	any documentation, advertising materials, and other
# 	materials related to such distribution and use
# 	acknowledge that the software was developed by the
# 	University of California, Berkeley.  The name of the
# 	University may not be used to endorse or promote
# 	products derived from this software without specific
# 	prior written permission.  THIS SOFTWARE IS PROVIDED
# 	``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
# 	INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# 	MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
