xref: /dflybsd-src/libexec/bootpd/ToDo (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn MarinoToDo:							-*- text -*-
286d7f5d3SJohn Marino
386d7f5d3SJohn Marino----------------------------------------------------------------------
486d7f5d3SJohn MarinoMemory allocation locality:
586d7f5d3SJohn Marino
686d7f5d3SJohn MarinoCurrently mallocs memory in a very haphazard manner.  As such, most of
786d7f5d3SJohn Marinothe program ends up core-resident all the time just to follow all the
886d7f5d3SJohn Marinostupid pointers around. . . .
986d7f5d3SJohn Marino
1086d7f5d3SJohn Marino----------------------------------------------------------------------
1186d7f5d3SJohn MarinoInput parser:
1286d7f5d3SJohn Marino
1386d7f5d3SJohn MarinoThe reader implemented in readfile.c could use improvement.  Some sort
1486d7f5d3SJohn Marinoof "data-driven" parser should be used so the big switch statements
1586d7f5d3SJohn Marinowould have only one case for each data type instead of one case for
1686d7f5d3SJohn Marinoevery recognized option symbol.  Then adding a new tag would involve
1786d7f5d3SJohn Marinoonly adding a new element to the data table describing known symbols.
1886d7f5d3SJohn MarinoHopefully, this would shrink the code a bit too. -gwr
1986d7f5d3SJohn Marino
2086d7f5d3SJohn Marino----------------------------------------------------------------------
2186d7f5d3SJohn MarinoSLIP Initialization via BOOTP:
2286d7f5d3SJohn Marino
2386d7f5d3SJohn MarinoIn the function handle_request(), both in bootpd and bootpgw,
2486d7f5d3SJohn Marinowe might want to add code like the following just before testing
2586d7f5d3SJohn Marinothe client IP address field for zero. (bp->bp_ciaddr == 0)
2686d7f5d3SJohn Marino(David suggests we leave this out for now. -gwr)
2786d7f5d3SJohn Marino
2886d7f5d3SJohn Marino#if 1	/* XXX - Experimental */
2986d7f5d3SJohn Marino	/*
3086d7f5d3SJohn Marino	 * SLIP initialization support.
3186d7f5d3SJohn Marino	 *
3286d7f5d3SJohn Marino	 * If this packet came from a SLIP driver that does
3386d7f5d3SJohn Marino	 * automatic IP address initialization, then the socket
3486d7f5d3SJohn Marino	 * will have the IP address and the packet will
3586d7f5d3SJohn Marino	 * have zeros for both the IP and HW addresses.
3686d7f5d3SJohn Marino	 *
3786d7f5d3SJohn Marino	 * Thanks to David P. Maynard <dpm@depend.com>
3886d7f5d3SJohn Marino	 * for explaining how this works. -gwr
3986d7f5d3SJohn Marino	 */
4086d7f5d3SJohn Marino	if ((bp->bp_ciaddr.s_addr == 0) &&
4186d7f5d3SJohn Marino		(bp->bp_htype == 0))
4286d7f5d3SJohn Marino	{
4386d7f5d3SJohn Marino		/* Pretend the client knows its address.  It will soon. */
4486d7f5d3SJohn Marino		bp->bp_ciaddr = recv_addr.sin_addr;
4586d7f5d3SJohn Marino		if (debug)
4686d7f5d3SJohn Marino			report(LOG_INFO, "fixed blank request from IP addr %s",
4786d7f5d3SJohn Marino				   inet_ntoa(recv_addr.sin_addr));
4886d7f5d3SJohn Marino	}
4986d7f5d3SJohn Marino#endif
5086d7f5d3SJohn Marino
5186d7f5d3SJohn Marino----------------------------------------------------------------------
5286d7f5d3SJohn MarinoDHCP Support:
5386d7f5d3SJohn Marino
5486d7f5d3SJohn MarinoThere is a set of patches from Jeanette Pauline Middelink
5586d7f5d3SJohn Marino<middelin@calvin.polyware.iaf.nl> to add DHCP support.
5686d7f5d3SJohn Marino
5786d7f5d3SJohn MarinoThose patches will be integrated into the BOOTP release stream
5886d7f5d3SJohn Marinovery soon, but if you can't wait, you can get them from:
5986d7f5d3SJohn Marinonimbus.anu.edu.au:/pub/tridge/samba/contributed/DHCP.patch
6086d7f5d3SJohn Marino
6186d7f5d3SJohn Marino----------------------------------------------------------------------
62