chiark / gitweb /
comm,site: Make peer address configuration the responsibility of comm (udp) wip.comm-does-lookup
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jul 2011 16:21:40 +0000 (17:21 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Aug 2011 15:43:22 +0000 (16:43 +0100)
commit51ed1f1e9fbba07ada8fcda115ba4530b692c3e1
treee27ba632f742147cb914199dfff939fdbd1c11ae
parenta5e3be96865ceaefd8a24614a0666e5e111c7255
comm,site: Make peer address configuration the responsibility of comm (udp)

We want to be able to introduce new kinds of comm.  These may need to
be configured differently to the current udp comm, which expects to be
given a sockaddr_in.

So move the knowledge of how to configure a peer address (ie, which
keys to look up in the site dictionary) to udp.  udp gets passed
site's dictionary during configuration setup, and extracts the
relevant information.  site can then later ask udp to (try to) find
the peer address.

As a side-effect, the resolver key now belongs to comm (ie, udp), not
to the site.  This is a backwards-incompatible change because it means
that (in the usual kind of situation) the resolver must be defined
before the udp comm in the config file.  I don't know what proportion
of existing config files need adjusting but certainly test-example
did.

We could avoid the backward-compatibility problem by having udp look
up the "resolver" key in the supplied site dictionary, and stash the
result away, but this would result in a more-convoluted configuration
setup.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README
secnet.h
site.c
test-example/common.conf
test-example/inside.conf
test-example/outside.conf
test-example/top.conf [new file with mode: 0644]
udp.c