[Settings] Migrate DHCP and NVO code to the new settings API (untested)

This commit is contained in:
Michael Brown
2008-03-21 22:15:31 +00:00
parent bb32b8999c
commit 8afb36c3bc
16 changed files with 966 additions and 936 deletions
+13 -9
View File
@@ -8,9 +8,11 @@
*/
#include <stdint.h>
#include <gpxe/dhcpopts.h>
#include <gpxe/settings.h>
struct nvs_device;
struct dhcp_option_block;
struct refcnt;
/**
* A fragment of a non-volatile storage device used for stored options
@@ -26,6 +28,8 @@ struct nvo_fragment {
* A block of non-volatile stored options
*/
struct nvo_block {
/** Settings block */
struct settings settings;
/** Underlying non-volatile storage device */
struct nvs_device *nvs;
/** List of option-containing fragments
@@ -33,17 +37,17 @@ struct nvo_block {
* The list is terminated by a fragment with a length of zero.
*/
struct nvo_fragment *fragments;
/** Total length of all fragments
*
* This field is filled in by nvo_register().
*/
/** Total length of option-containing fragments */
size_t total_len;
/** Option-containing data */
void *data;
/** DHCP options block */
struct dhcp_option_block *options;
struct dhcp_options dhcpopts;
};
extern int nvo_register ( struct nvo_block *nvo );
extern int nvo_save ( struct nvo_block *nvo );
extern void nvo_unregister ( struct nvo_block *nvo );
extern void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
struct nvo_fragment *fragments, struct refcnt *refcnt );
extern int register_nvo ( struct nvo_block *nvo, struct settings *parent );
extern void unregister_nvo ( struct nvo_block *nvo );
#endif /* _GPXE_NVO_H */