diff options
| author | Michael Brown | 2011-01-11 01:53:50 +0100 |
|---|---|---|
| committer | Michael Brown | 2011-01-19 14:52:48 +0100 |
| commit | 17d28f48776b909d031bcb0435c852ade1bd8988 (patch) | |
| tree | 476b71c1eff4ec7ec5999504c112ae321d3acbb6 /src/include | |
| parent | [nvo] Remove the non-volatile options fragment list (diff) | |
| download | ipxe-17d28f48776b909d031bcb0435c852ade1bd8988.tar.gz ipxe-17d28f48776b909d031bcb0435c852ade1bd8988.tar.xz ipxe-17d28f48776b909d031bcb0435c852ade1bd8988.zip | |
[nvo] Allow resizing of non-volatile stored option blocks
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ipxe/dhcpopts.h | 1 | ||||
| -rw-r--r-- | src/include/ipxe/nvo.h | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/include/ipxe/dhcpopts.h b/src/include/ipxe/dhcpopts.h index fe07d903d..8fb3d2d79 100644 --- a/src/include/ipxe/dhcpopts.h +++ b/src/include/ipxe/dhcpopts.h @@ -36,6 +36,7 @@ extern void dhcpopt_init ( struct dhcp_options *options, void *data, size_t alloc_len, int ( * realloc ) ( struct dhcp_options *options, size_t len ) ); +extern void dhcpopt_update_used_len ( struct dhcp_options *options ); extern int dhcpopt_no_realloc ( struct dhcp_options *options, size_t len ); #endif /* _IPXE_DHCPOPTS_H */ diff --git a/src/include/ipxe/nvo.h b/src/include/ipxe/nvo.h index 1fdc12ccb..995afd749 100644 --- a/src/include/ipxe/nvo.h +++ b/src/include/ipxe/nvo.h @@ -30,12 +30,22 @@ struct nvo_block { size_t len; /** Option-containing data */ void *data; + /** + * Resize non-volatile stored option block + * + * @v nvo Non-volatile options block + * @v len New size + * @ret rc Return status code + */ + int ( * resize ) ( struct nvo_block *nvo, size_t len ); /** DHCP options block */ struct dhcp_options dhcpopts; }; extern void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs, - size_t address, size_t len, struct refcnt *refcnt ); + size_t address, size_t len, + int ( * resize ) ( struct nvo_block *nvo, size_t len ), + struct refcnt *refcnt ); extern int register_nvo ( struct nvo_block *nvo, struct settings *parent ); extern void unregister_nvo ( struct nvo_block *nvo ); |
