diff options
author | Michael Brown | 2008-03-21 00:15:48 +0100 |
---|---|---|
committer | Michael Brown | 2008-03-21 00:15:48 +0100 |
commit | cf033046206aede5064c798bfa887fbb888b9217 (patch) | |
tree | 9836e9742cda7fd923a75eeb100b467817bd31b6 /src/include | |
parent | [Settings] Add per-netdevice settings block (diff) | |
download | ipxe-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')
-rw-r--r-- | src/include/gpxe/dhcp.h | 17 | ||||
-rw-r--r-- | src/include/gpxe/settings.h | 32 |
2 files changed, 18 insertions, 31 deletions
diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 3da96525..a8fa811f 100644 --- a/src/include/gpxe/dhcp.h +++ b/src/include/gpxe/dhcp.h @@ -489,23 +489,6 @@ struct dhcp_packet { struct dhcp_option_block options; }; -/** A DHCP option applicator */ -struct dhcp_option_applicator { - /** DHCP option tag */ - unsigned int tag; - /** Applicator - * - * @v tag DHCP option tag - * @v option DHCP option - * @ret rc Return status code - */ - int ( * apply ) ( unsigned int tag, struct dhcp_option *option ); -}; - -/** Declare a DHCP option applicator */ -#define __dhcp_applicator \ - __table ( struct dhcp_option_applicator, dhcp_applicators, 01 ) - /** * Get reference to DHCP options block * 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 |