iPXE
dhcpopts.h
Go to the documentation of this file.
1#ifndef _IPXE_DHCPOPTS_H
2#define _IPXE_DHCPOPTS_H
3
4/** @file
5 *
6 * DHCP options
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14
15/** A DHCP options block */
17 /** Option block raw data */
18 void *data;
19 /** Option block used length */
20 size_t used_len;
21 /** Option block allocated length */
22 size_t alloc_len;
23 /** Reallocate option block raw data
24 *
25 * @v options DHCP option block
26 * @v len New length
27 * @ret rc Return status code
28 */
29 int ( * realloc ) ( struct dhcp_options *options, size_t len );
30};
31
32extern int dhcpopt_applies ( unsigned int tag );
33extern int dhcpopt_store ( struct dhcp_options *options, unsigned int tag,
34 const void *data, size_t len );
35extern int dhcpopt_fetch ( struct dhcp_options *options, unsigned int tag,
36 void *data, size_t len );
37extern void dhcpopt_init ( struct dhcp_options *options,
38 void *data, size_t alloc_len,
39 int ( * realloc ) ( struct dhcp_options *options,
40 size_t len ) );
41extern void dhcpopt_update_used_len ( struct dhcp_options *options );
42extern int dhcpopt_no_realloc ( struct dhcp_options *options, size_t len );
43
44#endif /* _IPXE_DHCPOPTS_H */
static int options
Definition 3c515.c:286
int dhcpopt_no_realloc(struct dhcp_options *options, size_t len)
Refuse to reallocate DHCP option block.
Definition dhcpopts.c:185
int dhcpopt_applies(unsigned int tag)
Check applicability of DHCP option setting.
Definition dhcpopts.c:360
void dhcpopt_init(struct dhcp_options *options, void *data, size_t alloc_len, int(*realloc)(struct dhcp_options *options, size_t len))
Initialise prepopulated block of DHCP options.
Definition dhcpopts.c:452
int dhcpopt_fetch(struct dhcp_options *options, unsigned int tag, void *data, size_t len)
Fetch value of DHCP option setting.
Definition dhcpopts.c:394
void dhcpopt_update_used_len(struct dhcp_options *options)
Recalculate length of DHCP options block.
Definition dhcpopts.c:421
int dhcpopt_store(struct dhcp_options *options, unsigned int tag, const void *data, size_t len)
Store value of DHCP option setting.
Definition dhcpopts.c:375
ring len
Length.
Definition dwmac.h:226
uint64_t tag
Identity tag.
Definition edd.h:1
uint8_t data[48]
Additional event data.
Definition ena.h:11
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
void * realloc(void *old_ptr, size_t new_size)
Reallocate memory.
Definition malloc.c:607
A DHCP options block.
Definition dhcpopts.h:16
void * data
Option block raw data.
Definition dhcpopts.h:18
int(* realloc)(struct dhcp_options *options, size_t len)
Reallocate option block raw data.
Definition dhcpopts.h:29
size_t used_len
Option block used length.
Definition dhcpopts.h:20
size_t alloc_len
Option block allocated length.
Definition dhcpopts.h:22