3 As a programming exercise for learning Python, I wrote a simple rwhois
4 server (described in RFC 2167). It uses in-memory data structures,
5 and it intuits the schema based on the data it sees. The server takes
6 as input a schema file, which for now just describes which attributes
7 should be indexed (and how), and data files which look much like the C
10 This version supports a sort of extended query syntax: IP or CIDR
11 queries ending in "**" will result in a "subnet" search, where all of
12 the found subnets at or below the specified network will be returned.
13 Ending a IP or CIDR query with a single "*" will result in a
16 It supports (as of v0.4) IPv6 CIDR networks and network blocks, and
17 supports indexing network-block type values. That is, you can index
18 values like "10.131.10.0 - 10.131.11.255" and "3ffe:4:5::0 -
27 This can be run from it's source directory, which is a fine way to do
30 However, if you wish to install it, as root:
32 % python setup.py install
34 This is just using the standard Python distutils, so there is actually
35 a great deal of flexibility here. Try
37 % python setup.py install --help
39 to see some of the options available.
43 This is assuming that you are running it from the distribution
46 % tar zxvf python-rwhoisd-0.4.tar.gz
48 % cd python-rwhoisd-0.4
50 % ./bin/pyrwhoisd sample_data/example_schema \
51 sample_data/example_data &
53 Voila! You should now have some sort of rwhois server running on port
58 Edit rwhoisd/config.py.
60 This file has comments describing options that you can change.
64 See the example_schema and example_data files in the sample_data
67 The format of the data files is very similar to the format used by the
68 C rwhois server (rwhoisd-1.5.x from www.rwhois.net). It has the
69 following differences, however:
71 * These files may have records separated by blank lines instead of
74 * They are not sensitive to trailing separators (whitespace or
77 * They do not have to be arranged in any special manner. That is, the
78 C rwhoisd forces (or at least encourages) you to arrange your data
79 files into different directories per authority-area. These can be
82 * This server does not support attribute "aliases".
84 It should be noted that this server in small ways violates the
85 description put forth by RFC 2167. In particular, it does not
86 establish independent schemas for each authority area. There may be
87 other violations as well.