aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/dhcpopts.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-01-10 23:58:11 +0000
committerMichael Brown <mcb30@ipxe.org>2011-01-11 21:24:40 +0000
commit17b6a3c506d94b8dc8bdae89828bac20ef56b1ef (patch)
tree68e953fe63ac12df77198e1c80de0ba8d45da881 /src/include/ipxe/dhcpopts.h
parent310d46c1edcefeb918125de0ee2e123c2940a70b (diff)
downloadipxe-17b6a3c506d94b8dc8bdae89828bac20ef56b1ef.tar.gz
[dhcp] Allow use of custom reallocation functions for DHCP option blocks
Allow functions other than realloc() to be used to reallocate DHCP option block data, and specify the reallocation function at the time of calling dhcpopt_init(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/dhcpopts.h')
-rw-r--r--src/include/ipxe/dhcpopts.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/include/ipxe/dhcpopts.h b/src/include/ipxe/dhcpopts.h
index d88036e3a..fe07d903d 100644
--- a/src/include/ipxe/dhcpopts.h
+++ b/src/include/ipxe/dhcpopts.h
@@ -19,16 +19,23 @@ struct dhcp_options {
size_t used_len;
/** Option block allocated length */
size_t alloc_len;
+ /** Reallocate option block raw data
+ *
+ * @v options DHCP option block
+ * @v len New length
+ * @ret rc Return status code
+ */
+ int ( * realloc ) ( struct dhcp_options *options, size_t len );
};
extern int dhcpopt_store ( struct dhcp_options *options, unsigned int tag,
const void *data, size_t len );
-extern int dhcpopt_extensible_store ( struct dhcp_options *options,
- unsigned int tag,
- const void *data, size_t len );
extern int dhcpopt_fetch ( struct dhcp_options *options, unsigned int tag,
void *data, size_t len );
extern void dhcpopt_init ( struct dhcp_options *options,
- void *data, size_t alloc_len );
+ void *data, size_t alloc_len,
+ int ( * realloc ) ( struct dhcp_options *options,
+ size_t len ) );
+extern int dhcpopt_no_realloc ( struct dhcp_options *options, size_t len );
#endif /* _IPXE_DHCPOPTS_H */