summaryrefslogtreecommitdiffstats
path: root/discover/parser.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-19 14:00:53 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-04-29 14:43:04 +1000
commit5e7c90eddd7ac2e4a3b05a7a5f6e29166edfa161 (patch)
tree2ad50697e3380c2c14f72522fa719d3d571e7f8b /discover/parser.h
parent45e92aa32a80fdbbf5ad3ad64e34b1ac872018ef (diff)
downloadtalos-petitboot-5e7c90eddd7ac2e4a3b05a7a5f6e29166edfa161.tar.gz
talos-petitboot-5e7c90eddd7ac2e4a3b05a7a5f6e29166edfa161.zip
discover: Add configuration methods
We'd like to be able to download petitboot configurations from other sources (not just local files), but we'll need some way to indicate to the parsers that a chunk of config data is from a specific source. This change adds "configuration methods". At present, we have only one: CONF_METHOD_LOCAL_FILE. For any incoming configuration data, we only run parsers that have registered themselves with that configuration method. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/parser.h')
-rw-r--r--discover/parser.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/discover/parser.h b/discover/parser.h
index 03ba8d4..b738577 100644
--- a/discover/parser.h
+++ b/discover/parser.h
@@ -3,6 +3,8 @@
#include <stdbool.h>
+#include "device-handler.h"
+
struct discover_context;
struct device_handler;
struct resource;
@@ -25,6 +27,7 @@ struct resource;
*/
struct parser {
char *name;
+ enum conf_method method;
const char * const *filenames;
int (*parse)(struct discover_context *ctx,
char *buf, int len);
@@ -45,7 +48,7 @@ enum generic_icon_type {
void parser_init(void);
-void iterate_parsers(struct discover_context *ctx);
+void iterate_parsers(struct discover_context *ctx, enum conf_method method);
int parse_user_event(struct discover_context *ctx, struct event *event);
#endif /* _PARSER_H */
OpenPOWER on IntegriCloud