summaryrefslogtreecommitdiff
path: root/ot_accesslist.h
diff options
context:
space:
mode:
Diffstat (limited to 'ot_accesslist.h')
-rw-r--r--ot_accesslist.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/ot_accesslist.h b/ot_accesslist.h
index 5954a4a..a1e4ad2 100644
--- a/ot_accesslist.h
+++ b/ot_accesslist.h
@@ -24,6 +24,48 @@ extern char *g_accesslist_filename;
24#define accesslist_hashisvalid( hash ) 1 24#define accesslist_hashisvalid( hash ) 1
25#endif 25#endif
26 26
27/* Test if an address is subset of an ot_net, return value is considered a bool */
28int address_in_net( const ot_ip6 address, const ot_net *net );
29
30/* Store a value into a vector of struct { ot_net net, uint8_t[x] value } member;
31 returns NULL
32 if member_size is too small, or
33 if one of the nets inside the vector are a subnet of _net_, or
34 if _net_ is a subnet of one of the nets inside the vector, or
35 if the vector could not be resized
36 returns pointer to new member in vector for success
37 member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping
38*/
39void *set_value_for_net( const ot_net *net, ot_vector *vector, const void *value, const size_t member_size );
40
41/* Takes a vector filled with struct { ot_net net, uint8_t[x] value } member;
42 Returns pointer to _member_ associated with the net, or NULL if not found
43 member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping
44*/
45void *get_value_for_net( const ot_ip6 address, const ot_vector *vector, const size_t member_size );
46
47
48#ifdef WANT_IP_FROM_PROXY
49int proxylist_add_network( const ot_net *proxy, const ot_net *net );
50int proxylist_check_network( const ot_ip6 *proxy, const ot_ip6 address /* can be NULL to only check proxy */ );
51#endif
52
53#ifdef WANT_FULLLOG_NETWORKS
54typedef struct ot_log ot_log;
55struct ot_log {
56 ot_ip6 ip;
57 uint8_t *data;
58 size_t size;
59 ot_time time;
60 ot_log *next;
61};
62extern ot_log *g_logchain_first, *g_logchain_last;
63
64void loglist_add_network( const ot_net *net );
65void loglist_reset( );
66int loglist_check_address( const ot_ip6 address );
67#endif
68
27typedef enum { 69typedef enum {
28 OT_PERMISSION_MAY_FULLSCRAPE = 0x1, 70 OT_PERMISSION_MAY_FULLSCRAPE = 0x1,
29 OT_PERMISSION_MAY_STAT = 0x2, 71 OT_PERMISSION_MAY_STAT = 0x2,