A replacement for RFC 865
RFC 865 defines the Quote of the Day protocol for listening on port 17, and delivering a quote when a connection is established. TCP and UDP is allowed, the quote is advised to be no more than 512 characters long. Any data sent to port 17 is discarded.
That protocol is 19 years old, and in need of updating. The fortune(6) program provides a non-network equivalent to this, and has a bunch of options for refining the type of fortune returned. A replacement to rfc865 should do this, and more.
So what does fortune provide?
- The ability to choose which datafile to choose the fortune from
- Grouping of fortune datafiles into two categories, offensive and non-offensive. Fortunes can be chosen from either category (or both)
- list the datafiles available
- only return a "long" or "short" fortune, as well as a method to state the length that determines "long" and "short".
- Return all fortunes that match a specific pattern.
Note that there are other functions provided, but I feel they do not translate usefully into features needed in a networked fortune protocol.
So what does RFC 865 provide that should be discarded?
The rfc states:
A useful debugging and measurement tool is a quote of the day service. A quote of the day service simply sends a short message without regard to the input
- Debugging? This may have been valid in 1983, but in 2002 there are better tools
- Without regard to input? Again, maybe in 1983 that was OK, but we expect better in 2002.
Note that today, writing a qotd server can be accomplished in a shell script such as:
while true ; do fortune | nc -l -p 17 ; done
It's simple, vulnerable to DoS attacks, and you would need to add more options to the fortune command itself to be wholly compliant to rfc865's 512 character limit (-n 512 -s). But for "debugging" or "measurement", it's plenty fine ;)
Note that win2k provides a qotd server by default, yet you're hard pressed to find a "real" one for linux!
So what should the fortune protocol provide?
- The ability to do everything that fortune does, except better ;)
- eg, a Genre-like system instead of the rather inflexible and arbitrary long/short / offensive/inoffensive rules.
- A fairly simple and memorable protocol so that it is not hard to use telnet(1) as your client.
- Unicode for advanced ascii replacement goodness
- Ability to submit fortunes, as well as retrieve
- This could extend into the ability for fortune servers to exchange fortunes, in a p2p-like manner?
What else is out there?
- dict / dictd - operates on port 2628 and provides some measure of this functionality
- refer to RFC 2229 - the dictionary server protocol