summaryrefslogtreecommitdiffstats
path: root/discover/event.h
blob: 35c07679db17eeb31bd75d533ef4b1ac9bf896ab (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
31
32
33
34
35
36
#ifndef _PB_EVENT_H
#define _PB_EVENT_H

enum event_type {
	EVENT_TYPE_UDEV = 10,
	EVENT_TYPE_USER,
	EVENT_TYPE_MAX,
};

enum event_action {
	EVENT_ACTION_ADD = 20,
	EVENT_ACTION_REMOVE,
	EVENT_ACTION_URL,
	EVENT_ACTION_CONF,
	EVENT_ACTION_DHCP,
	EVENT_ACTION_BOOT,
	EVENT_ACTION_MAX,
};

struct event {
	enum event_type type;
	enum event_action action;
	const 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);
void event_set_param(struct event *event, const char *name, const char *value);

#endif /* _PB_EVENT_H */
OpenPOWER on IntegriCloud