summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/settings.h
diff options
context:
space:
mode:
authorMichael Brown2013-07-13 15:06:20 +0200
committerMichael Brown2013-07-13 15:11:45 +0200
commit66ea4581256449fe9dcb26340851c09ffd9d6290 (patch)
tree89144d4ecd20220f55328cd9d267d27dc4495465 /src/include/ipxe/settings.h
parent[settings] Expose PCI configuration space via settings mechanism (diff)
downloadipxe-66ea4581256449fe9dcb26340851c09ffd9d6290.tar.gz
ipxe-66ea4581256449fe9dcb26340851c09ffd9d6290.tar.xz
ipxe-66ea4581256449fe9dcb26340851c09ffd9d6290.zip
[settings] Make "netX" settings block function as a symbolic link
Add a facility for settings blocks to act as symbolic links to other settings blocks, and reimplement the "netX" virtual settings block using this facility. The primary advantage of this approach is that unscoped settings such as ${mac} and ${filename} will now reflect the settings obtained from the most recently opened network device: in most cases, this will mean the settings obtained from the most recent DHCP attempt. This should improve conformance to the principle of least astonishment. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/settings.h')
-rw-r--r--src/include/ipxe/settings.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/ipxe/settings.h b/src/include/ipxe/settings.h
index 8ee9516e..6e75251c 100644
--- a/src/include/ipxe/settings.h
+++ b/src/include/ipxe/settings.h
@@ -77,6 +77,12 @@ struct setting {
/** Settings block operations */
struct settings_operations {
+ /** Redirect to underlying settings block (if applicable)
+ *
+ * @v settings Settings block
+ * @ret settings Underlying settings block
+ */
+ struct settings * ( * redirect ) ( struct settings *settings );
/** Check applicability of setting
*
* @v settings Settings block
@@ -248,6 +254,7 @@ extern int register_settings ( struct settings *settings,
struct settings *parent, const char *name );
extern void unregister_settings ( struct settings *settings );
+extern struct settings * settings_target ( struct settings *settings );
extern int setting_applies ( struct settings *settings,
struct setting *setting );
extern int store_setting ( struct settings *settings, struct setting *setting,