add service_validator support
[project/procd.git] / service.h
index 4e68eed..6448e5e 100644 (file)
--- a/service.h
+++ b/service.h
 
 #include <libubox/avl.h>
 #include <libubox/vlist.h>
 
 #include <libubox/avl.h>
 #include <libubox/vlist.h>
+#include <libubox/list.h>
 
 extern struct avl_tree services;
 
 
 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 service {
        struct avl_node avl;
        const char *name;
 
-       struct blob_attr *config;
+       struct blob_attr *trigger;
        struct vlist_tree instances;
        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
 #endif