diff options
Diffstat (limited to 'ot_accesslist.h')
| -rw-r--r-- | ot_accesslist.h | 20 |
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 |
| 17 | void accesslist_init(void); | 17 | void accesslist_init(void); |
| 18 | void accesslist_deinit(void); | 18 | void accesslist_deinit(void); |
| 19 | int accesslist_hashisvalid(ot_hash hash); | 19 | int accesslist_hashisvalid(const ot_hash hash); |
| 20 | void accesslist_cleanup(void); | 20 | void accesslist_cleanup(void); |
| 21 | 21 | ||
| 22 | extern 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 */ | ||
| 24 | size_t accesslist_parse_hashes(ot_hash *dest, size_t capacity, const char *buf, size_t len); | ||
| 25 | |||
| 26 | extern const char *g_accesslist_filename; | ||
| 23 | #ifdef WANT_DYNAMIC_ACCESSLIST | 27 | #ifdef WANT_DYNAMIC_ACCESSLIST |
| 24 | extern char *g_accesslist_pipe_add; | 28 | extern const char *g_accesslist_pipe_add; |
| 25 | extern char *g_accesslist_pipe_delete; | 29 | extern 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 */ |
| 39 | int address_in_net(const ot_ip6 address, const ot_net *net); | 43 | int 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 | */ |
| 50 | void *set_value_for_net(const ot_net *net, ot_vector *vector, const void *value, const size_t member_size); | 54 | void *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 | */ |
| 56 | void *get_value_for_net(const ot_ip6 address, const ot_vector *vector, const size_t member_size); | 60 | void *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 |
| 59 | int proxylist_add_network(const ot_net *proxy, const ot_net *net); | 63 | int proxylist_add_network(const ot_net *proxy, const ot_net *net); |
| @@ -72,7 +76,7 @@ struct ot_log { | |||
| 72 | extern ot_log *g_logchain_first, *g_logchain_last; | 76 | extern ot_log *g_logchain_first, *g_logchain_last; |
| 73 | 77 | ||
| 74 | void loglist_add_network(const ot_net *net); | 78 | void loglist_add_network(const ot_net *net); |
| 75 | void loglist_reset(); | 79 | void loglist_reset(void); |
| 76 | int loglist_check_address(const ot_ip6 address); | 80 | int loglist_check_address(const ot_ip6 address); |
| 77 | #endif | 81 | #endif |
| 78 | 82 | ||
