discover: Hookup --no-autoboot to config
[petitboot] / lib / pb-config / pb-config.h
1 #ifndef CONFIGURATION_H
2 #define CONFIGURATION_H
3
4 #include <stdbool.h>
5 #include <stdint.h>
6
7 #define HWADDR_SIZE     6
8
9 struct network_config {
10         uint8_t hwaddr[HWADDR_SIZE];
11         bool    ignore;
12         enum {
13                 CONFIG_METHOD_DHCP,
14                 CONFIG_METHOD_STATIC,
15         } method;
16         union {
17                 struct {
18                 } dhcp_config;
19                 struct {
20                         char *address;
21                         char *gateway;
22                         char *dns;
23                 } static_config;
24         };
25 };
26
27 struct config {
28         bool                    autoboot_enabled;
29         struct network_config   **network_configs;
30         int                     n_network_configs;
31 };
32
33
34 int config_init(void *ctx);
35 const struct config *config_get(void);
36 void config_set_autoboot(bool autoboot_enabled);
37 int config_fini(void);
38
39 #endif /* CONFIGURATION_H */
40