diff options
author | Michael Brown | 2008-03-22 01:24:50 +0100 |
---|---|---|
committer | Michael Brown | 2008-03-22 01:31:08 +0100 |
commit | e5cea13e51f5226987048275499314c6f15d526f (patch) | |
tree | d346fa495c66a03eb2a5c40ef2eab3d92326d3c8 /src/include/gpxe/settings.h | |
parent | [Settings] DHCP is now working using the new settings API. (diff) | |
download | ipxe-e5cea13e51f5226987048275499314c6f15d526f.tar.gz ipxe-e5cea13e51f5226987048275499314c6f15d526f.tar.xz ipxe-e5cea13e51f5226987048275499314c6f15d526f.zip |
[Settings] Implement simple_settings backed with extensible DHCP options
Diffstat (limited to 'src/include/gpxe/settings.h')
-rw-r--r-- | src/include/gpxe/settings.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/include/gpxe/settings.h b/src/include/gpxe/settings.h index f20c412b..643bd05b 100644 --- a/src/include/gpxe/settings.h +++ b/src/include/gpxe/settings.h @@ -11,6 +11,7 @@ #include <gpxe/tables.h> #include <gpxe/list.h> #include <gpxe/refcnt.h> +#include <gpxe/dhcpopts.h> struct settings; struct in_addr; @@ -138,12 +139,23 @@ struct settings_applicator { #define __settings_applicator \ __table ( struct settings_applicator, settings_applicators, 01 ) +/** + * A simple settings block + * + */ +struct simple_settings { + /** Settings block */ + struct settings settings; + /** DHCP options */ + struct dhcp_options dhcpopts; +}; + +extern struct settings_operations simple_settings_operations; + 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, void *data, size_t len ); -extern struct settings_operations simple_settings_operations; - extern int register_settings ( struct settings *settings, struct settings *parent ); extern void unregister_settings ( struct settings *settings ); @@ -206,6 +218,20 @@ static inline void settings_init ( struct settings *settings, } /** + * Initialise a settings block + * + * @v simple Simple settings block + * @v refcnt Containing object reference counter, or NULL + * @v name Settings block name + */ +static inline void simple_settings_init ( struct simple_settings *simple, + struct refcnt *refcnt, + const char *name ) { + settings_init ( &simple->settings, &simple_settings_operations, + refcnt, name ); +} + +/** * Delete setting * * @v settings Settings block |