[Dnsmasq-discuss] [PATCH 2/2] dbus: add SetServersEx method

Simon Kelley simon at thekelleys.org.uk
Sat Aug 18 07:28:19 BST 2012


On 17/08/12 23:35, Dan Williams wrote:
> The SetServers method has a few deficiencies:
>
> First, given its argument structure, you cannot actually
> introspect it since it expects a variable number of arguments.
> Typically these are encoded into arrays, but that's not the
> case with SetServers.  This means it's hard to use the method
> from dbus client libraries like dbus-glib, gdbus, or many bound
> languages like python or javascript.
>
> Second, given that the address arguments are either uint32
> or a number of bytes, additional options like IPv6 scope or
> DNS server port numbers are impossible.
>
> To address these issues, create a new method SetServersEx that
> performs the same function, but accepts arrays of strings as input.
> This allows more complex parsing of addresses and easier groupings
> of addresses and domains from clients.
>
> For example, from Python:
>
> import dbus
>
> bus = dbus.SystemBus()
> p = bus.get_object("uk.org.thekelleys.dnsmasq", "/uk/org/thekelleys/dnsmasq")
> l = dbus.Interface(p, dbus_interface="uk.org.thekelleys.dnsmasq")
>
> array = dbus.Array()
> array.append(["1.2.3.5"])
> array.append(["1.2.3.4#664", "foobar.com"])
> array.append(["1003:1234:abcd::1%eth0", "eng.mycorp.com", "lab.mycorp.com"])
> print l.SetServersEx(array)
>


This looks very sensible to me. Your timing is highly suspect as we 
released 2.63 yesterday and I am about to go away for 10 days or so. 
When I get back this, or something very like it, will be the first 
change into 2.64.

Cheers,

Simon.





More information about the Dnsmasq-discuss mailing list