[ntp:hackers] A possible roadmap for migration to isc eventlib

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Aug 12 21:11:10 UTC 2005


OK, in the interest of getting things moving, here is a possible roadmap
for how to migrate NTPD to isc's eventlib.


1.
	Create a eventlib context and replace the central select(2)
	call in ntpd with the eventloop.

	This means registering the file descriptors + callback
	function with eventlib.

	This is probably about 1 days work for somebody.

	Put all this under an #ifdef which is off by default.

2.
	Test this by hand on various platforms to determine if portability
	is sufficient for our purposes.


3.
	Commit ourselves to eventlib or remove the code again and
	find another idea.

4.
	Teach the configuration stuff about the eventlib

5.
	Make eventlib a requirement for ntpd.

6-N
	Start reaping benefits from eventlib. [1]

-----------------------------------------------------------------------

[1] One of the possible benefits we can gain is that we can pick
up my "configkit" and rewamp the configuration system.

Configkit is a lex/yacc tool which takes a specification and builds
a data structure based on it.  The datastructure and some library
functions are compiled into the application.

At runtime configkit operates with a number of independent but
concurrent configuration sources, which can be used in a batch or
interactive fashion.

It is therefore trivial to read a file or give the application a
telnet port so that one can poke around at run time.

The userinterface is pretty close to what we have gotten used to
from all sorts of network gadgets.

Here is a snippet of a config file for a telnet interface:

	NODE telnet {
		name config_telnet
		desc "TELNET remote configuration interface"
		show show_telnet
		WORD host WORD {
			desc "Hostname to listen on"
			func cfg_telnet_host
		}
		WORD port WORD {
			desc "Port number to listen on"
			func cfg_telnet_port
		}
		WORD enable {
			desc "Enable TELNET remote configuration interface"
			func cfg_telnet_enable
		}
	}

The resulting syntax allows for amongst other things:

	telnet port 2222
	no telnet port
		(remove port configuration)
	telnet host localhost
	no telnet host
		(remove host configuration)
	telnet enable
	no telnet enable
		(don't listen to telnet)
	show telnet
		(shows active telnet sessions)
	conf [telnet]
		(outputs config in same syntax, can be used for save)
		telnet port 2222
		telnet host localhost
		telnet enable
	telnet ?
		(shows help, looks like this:)
		host    Hostname to listen on
		port    Port number to listen on
		enable  Enable TELNET remote configuration interface

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


More information about the hackers mailing list