diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2006-05-06 14:13:33 +0100 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2012-01-05 17:31:12 +0000 |
commit | 7cebd20fe7671ba108625b8d863293da7ca40b09 (patch) | |
tree | e28000e0a8a22ae77d285561facbc23a8ed6a38c /dbus | |
parent | 26d0dbaf2496cfba2abd837fca8b783608b1eadc (diff) | |
download | dnsmasq-7cebd20fe7671ba108625b8d863293da7ca40b09.tar.gz |
import of dnsmasq-2.31.tar.gzv2.31
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/DBus-interface | 94 | ||||
-rw-r--r-- | dbus/dnsmasq.conf | 16 |
2 files changed, 110 insertions, 0 deletions
diff --git a/dbus/DBus-interface b/dbus/DBus-interface new file mode 100644 index 0000000..07bffd4 --- /dev/null +++ b/dbus/DBus-interface @@ -0,0 +1,94 @@ +DBus support must be enabled at compile-time and run-time. Ensure +that src/config.h contains the line + +#define HAVE_DBUS. + +and that /etc/dnsmasq.conf contains the line + +enable-dbus + +Because dnsmasq can operate stand-alone from the DBus, and may need to provide +service before the dbus daemon is available, it will continue to run +if the DBus connection is not available at startup. The DBus will be polled +every 250ms until a connection is established. Start of polling and final +connection establishment are both logged. When dnsmasq establishes a +connection to the dbus, it sends the signal "Up". Anything controlling +the server settings in dnsmasq should re-invoke the SetServers method +(q.v.) when it sees this signal. This allows dnsmasq to be restarted +and avoids startup races with the provider of nameserver information. + + +Dnsmasq provides one service on the DBus: uk.org.thekelleys.dnsmasq +and a single object: /uk/org/thekelleys/dnsmasq + +Methods are of the form + +uk.org.thekelleys.<method> + +Available methods are: + +GetVersion +---------- +Returns a string containing the version of dnsmasq running. + +ClearCache +---------- +Returns nothing. Clears the domain name cache and re-reads +/etc/hosts. The same as sending dnsmasq a HUP signal. + +SetServers +---------- +Returns nothing. Takes a set of arguments representing the new +upstream DNS servers to be used by dnsmasq. IPv4 addresses are +represented as a UINT32 (in network byte order) and IPv6 addresses +are represented as sixteen BYTEs (since there is no UINT128 type). +Each server address may be followed by one or more STRINGS, which are +the domains for which the preceding server should be used. + +Examples. + +UINT32: <address1> +UNIT32: <address2> + +is equivalent to + +--server=<address1> --server=<address2> + + +UINT32 <address1> +UINT32 <address2> +STRING "somedomain.com" + +is equivalent to + +--server=<address1> --server=/somedomain.com/<address2> + +UINT32 <address1> +UINT32 <address2> +STRING "somedomain.com" +UINT32 <address3> +STRING "anotherdomain.com" +STRING "thirddomain.com" + +is equivalent to + +--server=<address1> +--server=/somedomain.com/<address2> +--server=/anotherdomain.com/thirddomain.com/<address3> + +Am IPv4 address of 0.0.0.0 is interpreted as "no address, local only", +so + +UINT32: <0.0.0.0> +STRING "local.domain" + +is equivalent to + +--local=/local.domain/ + + +Each call to SetServers completely replaces the set of servers +specified by via the DBus, but it leaves any servers specified via the +command line or /etc/dnsmasq.conf or /etc/resolv.conf alone. + + diff --git a/dbus/dnsmasq.conf b/dbus/dnsmasq.conf new file mode 100644 index 0000000..f048c00 --- /dev/null +++ b/dbus/dnsmasq.conf @@ -0,0 +1,16 @@ +<!DOCTYPE busconfig PUBLIC + "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow own="uk.org.thekelleys.dnsmasq"/> + <allow send_destination="uk.org.thekelleys.dnsmasq"/> + <allow send_interface="uk.org.thekelleys.dnsmasq"/> + </policy> + <policy context="default"> + <deny own="uk.org.thekelleys.dnsmasq"/> + <deny send_destination="uk.org.thekelleys.dnsmasq"/> + <deny send_interface="uk.org.thekelleys.dnsmasq"/> + </policy> +</busconfig> + |