summaryrefslogtreecommitdiffstats
path: root/discover/parser.c
blob: 5b1a7abdab600656bc803721bef66f07bdcc9b88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#include <stdlib.h>

#include "pb-protocol/pb-protocol.h"

#include "device-handler.h"
#include "log.h"
#include "parser.h"
extern struct parser kboot_parser;

/* array of parsers, ordered by priority */
static struct parser *parsers[] = {
	&kboot_parser,
	NULL
};

void iterate_parsers(struct discover_context *ctx)
{
	int i;

	pb_log("trying parsers for %s\n", ctx->device_path);

	for (i = 0; parsers[i]; i++) {
		pb_log("\ttrying parser '%s'\n", parsers[i]->name);
		/* just use a dummy device path for now */
		if (parsers[i]->parse(ctx))
			return;
	}
	pb_log("\tno boot_options found\n");
}
OpenPOWER on IntegriCloud