2
0
mirror of https://github.com/xcat2/xNBA.git synced 2026-08-05 10:17:46 +00:00
Files
xNBA/src/include/ipxe/dhcpopts.h
T
Michael Brown f5fd4dec3b [settings] Formalise notion of setting applicability
Expose a function setting_applies() to allow a caller to determine
whether or not a particular setting is applicable to a particular
settings block.

Restrict DHCP-backed settings blocks to accepting only DHCP-based
settings.

Restrict network device settings blocks to accepting only DHCP-based
settings and network device-specific settings such as "mac".

Inspired-by: Glenn Brown <glenn@myri.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-22 19:54:58 +00:00

44 lines
1.1 KiB
C

#ifndef _IPXE_DHCPOPTS_H
#define _IPXE_DHCPOPTS_H
/** @file
*
* DHCP options
*
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
/** A DHCP options block */
struct dhcp_options {
/** Option block raw data */
void *data;
/** Option block used length */
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_applies ( unsigned int tag );
extern int dhcpopt_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,
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 */