From 7c633c259ebc4a863c5076462c5792ecb8b9f617 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 15 Apr 2024 00:39:02 +0200 Subject: clang-format --- ot_accesslist.h | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'ot_accesslist.h') diff --git a/ot_accesslist.h b/ot_accesslist.h index a988791..0a7488e 100644 --- a/ot_accesslist.h +++ b/ot_accesslist.h @@ -6,16 +6,18 @@ #ifndef OT_ACCESSLIST_H__ #define OT_ACCESSLIST_H__ -#if defined ( WANT_ACCESSLIST_BLACK ) && defined ( WANT_ACCESSLIST_WHITE ) -# error WANT_ACCESSLIST_BLACK and WANT_ACCESSLIST_WHITE are exclusive. +#include "trackerlogic.h" + +#if defined(WANT_ACCESSLIST_BLACK) && defined(WANT_ACCESSLIST_WHITE) +#error WANT_ACCESSLIST_BLACK and WANT_ACCESSLIST_WHITE are exclusive. #endif -#if defined ( WANT_ACCESSLIST_BLACK ) || defined (WANT_ACCESSLIST_WHITE ) +#if defined(WANT_ACCESSLIST_BLACK) || defined(WANT_ACCESSLIST_WHITE) #define WANT_ACCESSLIST -void accesslist_init( void ); -void accesslist_deinit( void ); -int accesslist_hashisvalid( ot_hash hash ); -void accesslist_cleanup( void ); +void accesslist_init(void); +void accesslist_deinit(void); +int accesslist_hashisvalid(ot_hash hash); +void accesslist_cleanup(void); extern char *g_accesslist_filename; #ifdef WANT_DYNAMIC_ACCESSLIST @@ -25,16 +27,16 @@ extern char *g_accesslist_pipe_delete; #else #ifdef WANT_DYNAMIC_ACCESSLIST -# error WANT_DYNAMIC_ACCESSLIST needs either WANT_ACCESSLIST_BLACK or WANT_ACCESSLIST_WHITE +#error WANT_DYNAMIC_ACCESSLIST needs either WANT_ACCESSLIST_BLACK or WANT_ACCESSLIST_WHITE #endif -#define accesslist_init( accesslist_filename ) -#define accesslist_deinit( ) -#define accesslist_hashisvalid( hash ) 1 +#define accesslist_init(accesslist_filename) +#define accesslist_deinit() +#define accesslist_hashisvalid(hash) 1 #endif /* Test if an address is subset of an ot_net, return value is considered a bool */ -int address_in_net( const ot_ip6 address, const ot_net *net ); +int address_in_net(const ot_ip6 address, const ot_net *net); /* Store a value into a vector of struct { ot_net net, uint8_t[x] value } member; returns NULL @@ -45,18 +47,17 @@ int address_in_net( const ot_ip6 address, const ot_net *net ); returns pointer to new member in vector for success member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping */ -void *set_value_for_net( const ot_net *net, ot_vector *vector, const void *value, const size_t member_size ); +void *set_value_for_net(const ot_net *net, ot_vector *vector, const void *value, const size_t member_size); /* Takes a vector filled with struct { ot_net net, uint8_t[x] value } member; Returns pointer to _member_ associated with the net, or NULL if not found member_size can be sizeof(ot_net) to reduce the lookup to a boolean mapping */ -void *get_value_for_net( const ot_ip6 address, const ot_vector *vector, const size_t member_size ); - +void *get_value_for_net(const ot_ip6 address, const ot_vector *vector, const size_t member_size); #ifdef WANT_IP_FROM_PROXY -int proxylist_add_network( const ot_net *proxy, const ot_net *net ); -int proxylist_check_network( const ot_ip6 *proxy, const ot_ip6 address /* can be NULL to only check proxy */ ); +int proxylist_add_network(const ot_net *proxy, const ot_net *net); +int proxylist_check_network(const ot_ip6 *proxy, const ot_ip6 address /* can be NULL to only check proxy */); #endif #ifdef WANT_FULLLOG_NETWORKS @@ -70,10 +71,10 @@ struct ot_log { }; extern ot_log *g_logchain_first, *g_logchain_last; -void loglist_add_network( const ot_net *net ); -void loglist_reset( ); -int loglist_check_address( const ot_ip6 address ); -#endif +void loglist_add_network(const ot_net *net); +void loglist_reset(); +int loglist_check_address(const ot_ip6 address); +#endif typedef enum { OT_PERMISSION_MAY_FULLSCRAPE = 0x1, @@ -82,7 +83,7 @@ typedef enum { OT_PERMISSION_MAY_PROXY = 0x8 } ot_permissions; -int accesslist_bless_net( ot_net *net, ot_permissions permissions ); -int accesslist_is_blessed( ot_ip6 ip, ot_permissions permissions ); +int accesslist_bless_net(ot_net *net, ot_permissions permissions); +int accesslist_is_blessed(ot_ip6 ip, ot_permissions permissions); #endif -- cgit v1.2.3