Define the IPv4 NTP server setting to simplify the use of a
DHCP-provided NTP server in scripts, using e.g.
#!ipxe
dhcp
ntp ${ntp}
Signed-off-by: Michael Brown <mcb30@ipxe.org>
/** Maximum transmission unit */
#define DHCP_MTU 26
+/** NTP servers */
+#define DHCP_NTP_SERVERS 42
+
/** Vendor encapsulated options */
#define DHCP_VENDOR_ENCAP 43
#include <ipxe/timer.h>
#include <ipxe/time.h>
#include <ipxe/tcpip.h>
+#include <ipxe/dhcp.h>
+#include <ipxe/settings.h>
#include <ipxe/ntp.h>
/** @file
err_alloc:
return rc;
}
+
+/** IPv4 NTP server setting */
+const struct setting ntp_setting __setting ( SETTING_IP4_EXTRA, ntp ) = {
+ .name = "ntp",
+ .description = "NTP server",
+ .tag = DHCP_NTP_SERVERS,
+ .type = &setting_type_ipv4,
+};