lib/efi: Cleanup read/write routines
[petitboot] / discover / event.h
1 #ifndef _PB_EVENT_H
2 #define _PB_EVENT_H
3
4 enum event_type {
5         EVENT_TYPE_UDEV = 10,
6         EVENT_TYPE_USER,
7         EVENT_TYPE_MAX,
8 };
9
10 enum event_action {
11         EVENT_ACTION_ADD = 20,
12         EVENT_ACTION_REMOVE,
13         EVENT_ACTION_URL,
14         EVENT_ACTION_DHCP,
15         EVENT_ACTION_BOOT,
16         EVENT_ACTION_SYNC,
17         EVENT_ACTION_PLUGIN,
18         EVENT_ACTION_MAX,
19 };
20
21 struct event {
22         enum event_type type;
23         enum event_action action;
24         const char *device;
25
26         struct param {
27                 char *name;
28                 char *value;
29         } *params;
30         int n_params;
31 };
32
33 int event_parse_ad_message(struct event *event, char *buf, int len);
34 const char *event_get_param(const struct event *event, const char *name);
35 void event_set_param(struct event *event, const char *name, const char *value);
36
37 #endif /* _PB_EVENT_H */