summaryrefslogtreecommitdiff
path: root/ot_accesslist.h
diff options
context:
space:
mode:
Diffstat (limited to 'ot_accesslist.h')
-rw-r--r--ot_accesslist.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/ot_accesslist.h b/ot_accesslist.h
index 0a7488e..0a8bf4c 100644
--- a/ot_accesslist.h
+++ b/ot_accesslist.h
@@ -16,13 +16,17 @@
16#define WANT_ACCESSLIST 16#define WANT_ACCESSLIST
17void accesslist_init(void); 17void accesslist_init(void);
18void accesslist_deinit(void); 18void accesslist_deinit(void);
19int accesslist_hashisvalid(ot_hash hash); 19int accesslist_hashisvalid(const ot_hash hash);
20void accesslist_cleanup(void); 20void accesslist_cleanup(void);
21 21
22extern char *g_accesslist_filename; 22/* Scan buf for up to capacity info_hashes in hexadecimal notation, one per
23 line, and return how many were written to dest */
24size_t accesslist_parse_hashes(ot_hash *dest, size_t capacity, const char *buf, size_t len);
25
26extern const char *g_accesslist_filename;
23#ifdef WANT_DYNAMIC_ACCESSLIST 27#ifdef WANT_DYNAMIC_ACCESSLIST
24extern char *g_accesslist_pipe_add; 28extern const char *g_accesslist_pipe_add;
25extern char *g_accesslist_pipe_delete; 29extern const char *g_accesslist_pipe_delete;
26#endif 30#endif
27 31
28#else 32#else
@@ -36,7 +40,7 @@ extern char *g_accesslist_pipe_delete;
36#endif 40#endif
37 41
38/* Test if an address is subset of an ot_net, return value is considered a bool */ 42/* Test if an address is subset of an ot_net, return value is considered a bool */
39int address_in_net(const ot_ip6 address, const ot_net *net); 43int accesslist_address_in_net(const ot_ip6 address, const ot_net *net);
40 44
41/* Store a value into a vector of struct { ot_net net, uint8_t[x] value } member; 45/* Store a value into a vector of struct { ot_net net, uint8_t[x] value } member;
42 returns NULL 46 returns NULL
@@ -47,13 +51,13 @@ int address_in_net(const ot_ip6 address, const ot_net *net);
47 returns pointer to new member in vector for success 51 returns pointer to new member in vector for success
48 member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping 52 member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping
49*/ 53*/
50void *set_value_for_net(const ot_net *net, ot_vector *vector, const void *value, const size_t member_size); 54void *accesslist_set_value_for_net(const ot_net *net, ot_vector *vector, const void *value, const size_t member_size);
51 55
52/* Takes a vector filled with struct { ot_net net, uint8_t[x] value } member; 56/* Takes a vector filled with struct { ot_net net, uint8_t[x] value } member;
53 Returns pointer to _member_ associated with the net, or NULL if not found 57 Returns pointer to _member_ associated with the net, or NULL if not found
54 member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping 58 member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping
55*/ 59*/
56void *get_value_for_net(const ot_ip6 address, const ot_vector *vector, const size_t member_size); 60void *accesslist_get_value_for_net(const ot_ip6 address, const ot_vector *vector, const size_t member_size);
57 61
58#ifdef WANT_IP_FROM_PROXY 62#ifdef WANT_IP_FROM_PROXY
59int proxylist_add_network(const ot_net *proxy, const ot_net *net); 63int proxylist_add_network(const ot_net *proxy, const ot_net *net);
@@ -72,7 +76,7 @@ struct ot_log {
72extern ot_log *g_logchain_first, *g_logchain_last; 76extern ot_log *g_logchain_first, *g_logchain_last;
73 77
74void loglist_add_network(const ot_net *net); 78void loglist_add_network(const ot_net *net);
75void loglist_reset(); 79void loglist_reset(void);
76int loglist_check_address(const ot_ip6 address); 80int loglist_check_address(const ot_ip6 address);
77#endif 81#endif
78 82