]> git.ozlabs.org Git - petitboot/blob - lib/types/types.h
lib/log: Always flush after writing logs
[petitboot] / lib / types / types.h
1 #ifndef _TYPES_H
2 #define _TYPES_H
3
4 #include <stdbool.h>
5 #include <stdint.h>
6 #include <list/list.h>
7
8 enum device_type {
9         DEVICE_TYPE_NETWORK,
10         DEVICE_TYPE_DISK,
11         DEVICE_TYPE_OPTICAL,
12         DEVICE_TYPE_UNKNOWN,
13 };
14
15 struct device {
16         char            *id;
17         enum device_type type;
18         char            *name;
19         char            *description;
20         char            *icon_file;
21
22         int             n_options;
23         struct list     boot_options;
24
25         void            *ui_info;
26 };
27
28 struct boot_option {
29         char            *device_id;
30         char            *id;
31         char            *name;
32         char            *description;
33         char            *icon_file;
34         char            *boot_image_file;
35         char            *initrd_file;
36         char            *dtb_file;
37         char            *boot_args;
38         bool            is_default;
39
40         struct list_item        list;
41
42         void            *ui_info;
43 };
44
45 struct boot_command {
46         char *option_id;
47         char *boot_image_file;
48         char *initrd_file;
49         char *dtb_file;
50         char *boot_args;
51 };
52
53 struct boot_status {
54         enum {
55                 BOOT_STATUS_INFO,
56                 BOOT_STATUS_ERROR,
57         } type;
58         char    *message;
59         char    *detail;
60         int     progress;
61 };
62
63 struct interface_info {
64         unsigned int    hwaddr_size;
65         uint8_t         *hwaddr;
66         char            *name;
67 };
68
69 struct system_info {
70         char                    *type;
71         char                    *identifier;
72         struct interface_info   **interfaces;
73         unsigned int            n_interfaces;
74 };
75
76
77 #endif /* _TYPES_H */