[settings] Formalise notion of setting applicability

Expose a function setting_applies() to allow a caller to determine
whether or not a particular setting is applicable to a particular
settings block.

Restrict DHCP-backed settings blocks to accepting only DHCP-based
settings.

Restrict network device settings blocks to accepting only DHCP-based
settings and network device-specific settings such as "mac".

Inspired-by: Glenn Brown <glenn@myri.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-03-22 16:56:35 +00:00
parent 9215b7f4c0
commit f5fd4dec3b
12 changed files with 235 additions and 17 deletions

View File

@@ -206,6 +206,7 @@ struct setting net80211_ssid_setting __setting = {
.name = "ssid",
.description = "802.11 SSID (network name)",
.type = &setting_type_string,
.tag = NET80211_SETTING_TAG_SSID,
};
/** Whether to use active scanning
@@ -218,6 +219,7 @@ struct setting net80211_active_setting __setting = {
.name = "active-scan",
.description = "Use an active scan during 802.11 association",
.type = &setting_type_int8,
.tag = NET80211_SETTING_TAG_ACTIVE_SCAN,
};
/** The cryptographic key to use
@@ -230,6 +232,7 @@ struct setting net80211_key_setting __setting = {
.name = "key",
.description = "Encryption key for protected 802.11 networks",
.type = &setting_type_string,
.tag = NET80211_SETTING_TAG_KEY,
};
/** @} */