On Mon, 2017-10-02 at 16:08 +0300, Patrik Flykt wrote:
Actually, if we leave resolver.c as it is, and instead conditionally
compile src/dnsproxy.c or src/systemd-resolved.c, wouldn't that solve
most of the code changes in a cleaner way? The "API" would then be
connman_dnsproxy_* functions in connman.h, that could then move to
It might. Originally I was thinking of doing something along these
lines. Then I figured that the third option (writing a /etc/resolv.conf
file) is actually bit closer to my approach, because systemd-resolved
doesn't allow adding the servers or domains one-by-one. You need to add
them all in a single D-Bus call, which meant that I could (re)use the
data structures and logic for managing the /etc/resolv.conf writing.
However, a concept of having different DNS backends (/etc/resolv.conf,
dnsproxy, systemd-resolved) is not a bad one. We could just select one
on connman command line (connmand --dns-backend=dnsproxy). Should this
be a full plugin API with function pointers and all? Stuff like mDNS
handling could then be handled as plugin functions.