-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconftree.h
45 lines (34 loc) · 1.39 KB
/
conftree.h
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
37
38
39
40
41
42
43
44
45
/* conftree.h
* Copyright (C) 2007 Tillmann Werner <[email protected]>
*
* This file is free software; as a special exception the author gives
* unlimited permission to copy and/or distribute it, with or without
* modifications, as long as this notice is preserved.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef __HONEYTRAP_CONFTREE_H
#define __HONEYTRAP_CONFTREE_H 1
/* config file keyword configuration goes herei
* don't forget to adjust the number */
typedef struct list_entry {
ssize_t size;
void *data;
struct list_entry *next;
} list_entry;
typedef struct conf_node {
char *keyword;
list_entry *val;
struct conf_node *first_leaf;
struct conf_node *next;
} conf_node;
conf_node *config_keywords_tree; // tree for allowed keywords, initialized by core, extended by plugins
conf_node *config_tree; // tree for actual configuration organized in a hierarchical manner
void conftree_children_free(conf_node *tree);
void print_conftree(conf_node *tree, int depth);
conf_node *conf_subtree(conf_node *tree, const char *keyword);
conf_node *check_keyword(conf_node *tree, const char *keyword);
conf_node *add_keyword(conf_node **tree, const char *keyword, const void *data, ssize_t size);
#endif