tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Embedded dhcpcd options
Hi List
I've just added support for decoding user defined, embedded and
encapsulation option to dhcpcd(8) here:
http://roy.marples.name/cgi-bin/gitweb.cgi?p=dhcpcd.git;a=commit;h=0fe99f0519d2dc9dbcc098a1dc671c5d164d2ed6
Now, dhcpcd embeds inside itself static constant structures to define
DHCP and DHCPv6 options.
I found that I cannot easily extent this to support embedded or
encapsulated options as defined in RFC's, so it's an easy fix to create
a small dhcpcd-embedded.conf file and parse this before
/etc/dhcpcd.conf.
dhcpcd-embedded.conf is installed to LIBEXECDIR as it's not meant to be
user editable.
I've attached it to demonstrate how to define options for decoding :)
So before this gets rolled out, does anyone have any feelings about the
following?
1) Move the entire DHCP option setup from embedded structs in the code
to dhcpcd-embedded.conf
Benefit would be smaller binary and maybe changing the struct to a
TAILQ list rather than being doing reallocs per directive.
Downside means that this file NEEDS be to installed, currently it's
optional.
Also, more types would have to be exposed which may not be desirable.
2) Install dhcpcd-embedded.conf to /etc instead of LIBEXECDIR
Benefit would be that it's more user visible as to the decoding
rather than having to read RFC's or dhcpcd code.
Downside is that the dhcpcd install process won't update it by
default as /etc is supposed to be sacrosanct, but we could make an
exception here.
Also, disributions often have a seperate process to update /etc,
removed from just updating dhcpcd or itself. Sometimes the user may not
enact this setp and if an up-to-date dhcpcd-embedded.conf isn't
installed / updated there stands more chance of breakage.
Thoughts?
Thanks
Roy
# Embedded option definitions for dhcpcd(8)
# DHCP option 81, Fully Qualified Domain Name, RFC4702
define 81 embed
embed byte fqdn_flags
embed byte fqdn_rcode1
embed byte fqdn_rcode2
embed domain fqdn
# DHCPv6 option 39, Fully Qualified Domain Name, RFC4704
define6 39 embed
embed byte fqdn_flags
embed domain fqdn
# DHCPv6 option 56 NTP Server, RFC5908
define6 56 encap
encap 1 ip6address ntp_server_addr
encap 2 ip6address ntp_mcast_addr
encap 3 ip6address ntp_fqdn
Home |
Main Index |
Thread Index |
Old Index