[bind10-dev] Option definition in BIND 10 DHCP
Stephen Morris
stephen at isc.org
Thu Dec 29 11:03:20 UTC 2011
On 23/12/2011 14:50, Jelte Jansen wrote:
> On 12/23/2011 03:33 PM, Stephen Morris wrote:
>> On 20/12/2011 17:39, Stephen Morris wrote:
>
> That may not be the best of examples, we have a better structure for
> those now, the named set; Boss/components is one of the examples. (IMO
> we should move config settings identified by their zone name to that as
> well).
>
> Assuming that vendor and option names are unique (don't know if that is
> true for both), if you use a named_set, you can directly access them
> without 'weird' indexes;
> config add DhcpX/vendor ISC
> config set DhcpX/vendor/ISC/enterprise_number 42
>
> There are some known issues with named sets (in the above example, you
> can't use config add DhcpX/vendor/ISC for instance, and there is a bug
> where a failed update can result in the entire set being cleared). Then
> again, there is one for lists too (tab completion currently breaks at
> the list index) :p
We know that the vendor names will be unique, but it is possible that
options names will be duplicated, although they will be unique for a
given vendor. However, we don't know in advance what vendors will be
defined, neither do we know the names of the options. So both the
vendor names and option names need to be defined on the command line,
without a .spec file.
I'm not too familiar with that aspect of BIND 10, but I agree that a
named set looks more elegant. But as noted above, there are two
user-defined variables, vendor name and option name: can the syntax cope
with both, e.g.
# Add vendor ISC
config add Dhcp4/vendor ISC
# Add ISC option "server_address":
config add Dhcp4/vendor/ISC server_address
config add Dhcp4/vendor/ISC/server_address/code 246
config add Dhcp4/vendor/ISC/server_address/type "ip4-address"
:
# Add ISC option "source_port"
config add Dhcp4/vendor/ISC source_port
config add Dhcp4/vendor/ISC/source_port/code 247
config add Dhcp4/vendor/ISC/server_address/type "uint16"
":
... or are we restricted to just one named set (for the vendor name) and
would need to use a list for the options, e.g.
# Add vendor ISC
config add Dhcp4/vendor ISC
# Add ISC option "server_address":
config add Dhcp4/vendor/ISC/options[0]
config add Dhcp4/vendor/ISC/options[0]/name "server_address"
config add Dhcp4/vendor/ISC/options[0]/code 246
config add Dhcp4/vendor/ISC/options[0]/type "ip4-address"
:
# Add ISC option "source_port"
config add Dhcp4/vendor/ISC/options[1]
config add Dhcp4/vendor/ISC/options[1]/name "source_port"
config add Dhcp4/vendor/ISC/options[1]/code 247
config add Dhcp4/vendor/ISC/options[1]/type "uint16"
Stephen
More information about the bind10-dev
mailing list