The connection broker is implemented using a fully functional version of
bind9. Certain types of requests are intercepted, and passed to a module
(cchcoordinator.c) in the CCH library code. This module handles parsing
the request and coordinating the peers. An "answer" is then passed
back through the bind9 code as a response to the query.
This is loosely shrouded to look like it has something to do with a
load balancing algorithm, and is contained in "balance.c". A hook function
in "balance.c" is called from the named file "query.c".
To implement this, the makefile for named has to be modified to include
the file balance.c and balance.o in the appropriate macros. This is done
by modifying the Makefile.in file, which is used to generate the Makefile.
In ./bind9/bin/named/Makefile.in, edit the following macros to include
the additional file "balance.c/balance.o":
OBJS = ......... balance.@O@ \
SRCS = ......... balance.c \
You also have to indicate that named has to be linked with the cch
library, by adding it to the DNSLIBS macro:
DNSLIBS = ....................... -lcch
Once the balance.c file is added, and the query.c is patched to include
the call to the hook function (refer to the included query.c file for
a reference of where to put it -- it may be different in your version
of bind9), the named program should build.
WARNING--> Don't just include the version of query.c that's provided
with the source. Make sure to compare it to the version in your
bind9 distribution, to ensure your not using an old version of
query.c.