summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/settings.h
diff options
context:
space:
mode:
authorMichael Brown2008-03-21 00:15:48 +0100
committerMichael Brown2008-03-21 00:15:48 +0100
commitcf033046206aede5064c798bfa887fbb888b9217 (patch)
tree9836e9742cda7fd923a75eeb100b467817bd31b6 /src/include/gpxe/settings.h
parent[Settings] Add per-netdevice settings block (diff)
downloadipxe-cf033046206aede5064c798bfa887fbb888b9217.tar.gz
ipxe-cf033046206aede5064c798bfa887fbb888b9217.tar.xz
ipxe-cf033046206aede5064c798bfa887fbb888b9217.zip
[Settings] Introduce settings applicators.
Convert DHCP option applicators in dns.c and iscsi.c to settings applicators. Kill off DHCP option applicators.
Diffstat (limited to 'src/include/gpxe/settings.h')
-rw-r--r--src/include/gpxe/settings.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/include/gpxe/settings.h b/src/include/gpxe/settings.h
index 5333c4f2..94ca9e0f 100644
--- a/src/include/gpxe/settings.h
+++ b/src/include/gpxe/settings.h
@@ -122,6 +122,22 @@ struct named_setting {
/** Declare a configuration setting */
#define __named_setting __table ( struct named_setting, named_settings, 01 )
+/**
+ * A settings applicator
+ *
+ */
+struct settings_applicator {
+ /** Apply updated settings
+ *
+ * @ret rc Return status code
+ */
+ int ( * apply ) ( void );
+};
+
+/** Declare a settings applicator */
+#define __settings_applicator \
+ __table ( struct settings_applicator, settings_applicators, 01 )
+
extern int simple_settings_store ( struct settings *settings, unsigned int tag,
const void *data, size_t len );
extern int simple_settings_fetch ( struct settings *settings, unsigned int tag,
@@ -131,6 +147,8 @@ extern struct settings_operations simple_settings_operations;
extern int register_settings ( struct settings *settings,
struct settings *parent );
extern void unregister_settings ( struct settings *settings );
+extern int store_setting ( struct settings *settings, unsigned int tag,
+ const void *data, size_t len );
extern int fetch_setting ( struct settings *settings, unsigned int tag,
void *data, size_t len );
extern int fetch_setting_len ( struct settings *settings, unsigned int tag );
@@ -180,20 +198,6 @@ static inline void settings_init ( struct settings *settings,
}
/**
- * Store value of setting
- *
- * @v settings Settings block
- * @v tag Setting tag number
- * @v data Setting data, or NULL to clear setting
- * @v len Length of setting data
- * @ret rc Return status code
- */
-static inline int store_setting ( struct settings *settings, unsigned int tag,
- const void *data, size_t len ) {
- return settings->op->store ( settings, tag, data, len );
-}
-
-/**
* Delete setting
*
* @v settings Settings block