chiark / gitweb /
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>