erdgeist-opentracker/ot_accesslist.h

37 lines
1010 B
C
Raw Normal View History

/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2007-12-20 05:59:34 +00:00
It is considered beerware. Prost. Skol. Cheers or whatever.
2008-10-28 01:27:22 +00:00
2007-12-20 05:59:34 +00:00
$id$ */
#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.
#endif
#if defined ( WANT_ACCESSLIST_BLACK ) || defined (WANT_ACCESSLIST_WHITE )
#define WANT_ACCESSLIST
void accesslist_init( );
2008-12-07 03:50:51 +00:00
void accesslist_deinit( );
int accesslist_hashisvalid( ot_hash *hash );
extern char *g_accesslist_filename;
#else
#define accesslist_init( accesslist_filename )
2008-12-07 03:50:51 +00:00
#define accesslist_deinit( )
#define accesslist_hashisvalid( hash ) 1
#endif
typedef enum {
OT_PERMISSION_MAY_FULLSCRAPE = 0x1,
OT_PERMISSION_MAY_STAT = 0x2,
OT_PERMISSION_MAY_LIVESYNC = 0x4
} ot_permissions;
int accesslist_blessip( char * ip, ot_permissions permissions );
int accesslist_isblessed( char * ip, ot_permissions permissions );
#endif