X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fevent.h;fp=discover%2Fevent.h;h=20585f2525d4a5e492fb3f2871462a2565bf652f;hp=0000000000000000000000000000000000000000;hb=d7ce19907ff585e7fb6b950a40bd638d49c96a27;hpb=4414db4f4442009008ef15658bd4df2349c62ec7 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 */