1 #ifndef _DEVICE_HANDLER_H
2 #define _DEVICE_HANDLER_H
7 struct discover_device;
8 struct discover_server;
15 CONF_METHOD_LOCAL_FILE, /* discover by looking at local files on this
19 struct discover_device {
20 struct device *device;
31 struct list boot_options;
34 struct discover_boot_option {
35 struct parser *source;
36 struct discover_device *device;
37 struct boot_option *option;
38 struct list_item list;
40 struct resource *boot_image;
41 struct resource *initrd;
42 struct resource *icon;
46 struct discover_context {
47 struct parser *parser;
49 struct discover_device *device;
50 struct list boot_options;
51 enum conf_method method;
54 struct device_handler *device_handler_init(struct discover_server *server,
57 void device_handler_destroy(struct device_handler *devices);
59 int device_handler_get_device_count(const struct device_handler *handler);
60 const struct discover_device *device_handler_get_device(
61 const struct device_handler *handler, unsigned int index);
63 struct device *discover_context_device(struct discover_context *ctx);
64 struct discover_boot_option *discover_boot_option_create(
65 struct discover_context *ctx,
66 struct discover_device *dev);
67 void discover_context_add_boot_option(struct discover_context *ctx,
68 struct discover_boot_option *opt);
70 int device_handler_event(struct device_handler *handler, struct event *event);
72 struct discover_device *device_lookup_by_name(struct device_handler *handler,
74 struct discover_device *device_lookup_by_path(struct device_handler *handler,
76 struct discover_device *device_lookup_by_uuid(struct device_handler *handler,
78 struct discover_device *device_lookup_by_label(struct device_handler *handler,
80 struct discover_device *device_lookup_by_id(struct device_handler *handler,
83 void device_handler_boot(struct device_handler *handler,
84 struct boot_command *cmd);
86 #endif /* _DEVICE_HANDLER_H */