[ipv6] Expose NDP-provided settings (including the DNS server)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-12-05 16:44:50 +00:00
parent 4a6c453b5b
commit 99c679696a
2 changed files with 234 additions and 9 deletions

View File

@@ -67,6 +67,36 @@ struct ndp_prefix_information_option {
/** NDP autonomous address configuration flag */
#define NDP_PREFIX_AUTONOMOUS 0x40
/** NDP recursive DNS server option */
#define NDP_OPT_RDNSS 25
/** NDP recursive DNS server */
struct ndp_rdnss_option {
/** NDP option header */
struct ndp_option_header header;
/** Reserved */
uint16_t reserved;
/** Lifetime */
uint32_t lifetime;
/** Addresses */
struct in6_addr addresses[0];
} __attribute__ (( packed ));
/** NDP DNS search list option */
#define NDP_OPT_DNSSL 31
/** NDP DNS search list */
struct ndp_dnssl_option {
/** NDP option header */
struct ndp_option_header header;
/** Reserved */
uint16_t reserved;
/** Lifetime */
uint32_t lifetime;
/** Domain names */
uint8_t names[0];
} __attribute__ (( packed ));
/** An NDP option */
union ndp_option {
/** Option header */
@@ -75,6 +105,10 @@ union ndp_option {
struct ndp_ll_addr_option ll_addr;
/** Prefix information option */
struct ndp_prefix_information_option prefix;
/** Recursive DNS server option */
struct ndp_rdnss_option rdnss;
/** DNS search list option */
struct ndp_dnssl_option dnssl;
} __attribute__ (( packed ));
/** An NDP neighbour solicitation or advertisement header */
@@ -166,4 +200,7 @@ static inline int ndp_tx ( struct io_buffer *iobuf, struct net_device *netdev,
&ndp_discovery, net_source, ll_source );
}
/** NDP settings block name */
#define NDP_SETTINGS_NAME "ndp"
#endif /* _IPXE_NDP_H */