[Settings] Migrate DHCP and NVO code to the new settings API (untested)
This commit is contained in:
+13
-9
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user