blob: 0a0222b3845b3102eaef88f13567863f6535d5e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#ifndef _IPXE_NVO_H
#define _IPXE_NVO_H
/** @file
*
* Non-volatile stored options
*
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
#include <ipxe/dhcpopts.h>
#include <ipxe/settings.h>
struct nvs_device;
struct refcnt;
/**
* A fragment of a non-volatile storage device used for stored options
*/
struct nvo_fragment {
/** Starting address of fragment within NVS device */
unsigned int address;
/** Length of fragment */
size_t len;
};
/**
* 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
*
* The list is terminated by a fragment with a length of zero.
*/
struct nvo_fragment *fragments;
/** Total length of option-containing fragments */
size_t total_len;
/** Option-containing data */
void *data;
/** DHCP options block */
struct dhcp_options dhcpopts;
};
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 /* _IPXE_NVO_H */
|