diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2009-04-12 15:11:53 +0000 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2009-06-30 15:29:20 +0800 |
commit | d7ce19907ff585e7fb6b950a40bd638d49c96a27 (patch) | |
tree | 16ce0e186e9a99a676fc925465823fe744b71d03 /discover/event.h | |
parent | 4414db4f4442009008ef15658bd4df2349c62ec7 (diff) | |
download | talos-petitboot-d7ce19907ff585e7fb6b950a40bd638d49c96a27.tar.gz talos-petitboot-d7ce19907ff585e7fb6b950a40bd638d49c96a27.zip |
Make udev_event a generic event
The struct udev_event can be used as a generic event, so rename it
struct event and move it from udev.h into a new file event.h.
Also, rename the emums UDEV_ACTION_ADD and UDEV_ACTION_REMOVE
to ACTION_UDEV_ADD and ACTION_UDEV_REMOVE.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/event.h')
-rw-r--r-- | discover/event.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/discover/event.h b/discover/event.h new file mode 100644 index 0000000..20585f2 --- /dev/null +++ b/discover/event.h @@ -0,0 +1,29 @@ +#ifndef _PB_EVENT_H +#define _PB_EVENT_H + +enum event_type { + EVENT_TYPE_UDEV = 10, + EVENT_TYPE_USER, +}; + +enum event_action { + EVENT_ACTION_ADD = 20, + EVENT_ACTION_REMOVE, +}; + +struct event { + enum event_type type; + enum event_action action; + char *device; + + struct param { + char *name; + char *value; + } *params; + int n_params; +}; + +int event_parse_ad_message(struct event *event, char *buf, int len); +const char *event_get_param(const struct event *event, const char *name); + +#endif /* _PB_EVENT_H */ |