summaryrefslogtreecommitdiffstats
path: root/service.h
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-11-11 19:28:13 +0100
committerJohn Crispin <blogic@openwrt.org>2013-11-12 10:32:32 +0100
commitf9d31edb8938341b9217ee4c14eb58111414eb97 (patch)
treeeeb48ec34c2f8a30df50de201b5f103e991466f0 /service.h
parentcd4af8eb78c30718f999c487c93e257bbd969cb1 (diff)
downloadunitd-f9d31edb8938341b9217ee4c14eb58111414eb97.tar
unitd-f9d31edb8938341b9217ee4c14eb58111414eb97.zip
add service_validator support
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'service.h')
-rw-r--r--service.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/service.h b/service.h
index 9d3c308..6448e5e 100644
--- a/service.h
+++ b/service.h
@@ -17,15 +17,40 @@
#include <libubox/avl.h>
#include <libubox/vlist.h>
+#include <libubox/list.h>
extern struct avl_tree services;
+struct vrule {
+ struct avl_node avl;
+ char *option;
+ char *rule;
+};
+
+struct validate {
+ struct avl_node avl;
+ struct list_head list;
+
+ char *package;
+ char *type;
+
+ struct avl_tree rules;
+};
+
struct service {
struct avl_node avl;
const char *name;
struct blob_attr *trigger;
struct vlist_tree instances;
+ struct list_head validators;
};
+void service_validate_add(struct service *s, struct blob_attr *attr);
+void service_validate_dump(struct blob_buf *b, struct service *s);
+void service_validate_dump_all(struct blob_buf *b, char *p, char *s);
+void service_validate_del(struct service *s);
+void service_validate_init(void);
+void service_init(void);
+
#endif