| 1 |
#ifndef __ACCESS_H |
|---|
| 2 |
#define __ACCESS_H |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
struct access { |
|---|
| 9 |
char host[BUFFER_LEN]; |
|---|
| 10 |
char comment[BUFFER_LEN]; |
|---|
| 11 |
dbref who; |
|---|
| 12 |
uint32_t can; |
|---|
| 13 |
uint32_t cant; |
|---|
| 14 |
pcre *re; |
|---|
| 15 |
struct access *next; |
|---|
| 16 |
}; |
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
#define ACS_CONNECT 0x1U |
|---|
| 21 |
#define ACS_CREATE 0x2U |
|---|
| 22 |
#define ACS_GUEST 0x4U |
|---|
| 23 |
#define ACS_REGISTER 0x8U |
|---|
| 24 |
|
|---|
| 25 |
#define ACS_SITELOCK 0x10U |
|---|
| 26 |
#define ACS_SUSPECT 0x20U |
|---|
| 27 |
#define ACS_DENY_SILENT 0x40U |
|---|
| 28 |
#define ACS_REGEXP 0x80U |
|---|
| 29 |
|
|---|
| 30 |
#define ACS_GOD 0x100U |
|---|
| 31 |
#define ACS_WIZARD 0x200U |
|---|
| 32 |
#define ACS_ADMIN 0x400U |
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
#define ACS_DEFAULT (ACS_CONNECT|ACS_CREATE|ACS_GUEST) |
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
#define Site_Can_Connect(hname, who) site_can_access(hname,ACS_CONNECT, who) |
|---|
| 40 |
#define Site_Can_Create(hname) site_can_access(hname,ACS_CREATE, AMBIGUOUS) |
|---|
| 41 |
#define Site_Can_Guest(hname,who) site_can_access(hname,ACS_GUEST, who) |
|---|
| 42 |
#define Site_Can_Register(hname) site_can_access(hname,ACS_REGISTER, AMBIGUOUS) |
|---|
| 43 |
#define Deny_Silent_Site(hname, who) site_can_access(hname,ACS_DENY_SILENT, who) |
|---|
| 44 |
#define Suspect_Site(hname, who) site_can_access(hname,ACS_SUSPECT, who) |
|---|
| 45 |
#define Forbidden_Site(hname) (!site_can_access(hname,ACS_DEFAULT, AMBIGUOUS)) |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
bool read_access_file(void); |
|---|
| 49 |
void write_access_file(void); |
|---|
| 50 |
bool site_can_access(const char *hname, uint32_t flag, dbref who); |
|---|
| 51 |
struct access *site_check_access(const char *hname, dbref who, int *rulenum); |
|---|
| 52 |
void format_access(struct access *ap, int rulenum, |
|---|
| 53 |
dbref who |
|---|
| 54 |
__attribute__ ((__unused__)), char *buff, char **bp); |
|---|
| 55 |
bool add_access_sitelock(dbref player, const char *host, dbref who, |
|---|
| 56 |
uint32_t can, uint32_t cant); |
|---|
| 57 |
int remove_access_sitelock(const char *pattern); |
|---|
| 58 |
void do_list_access(dbref player); |
|---|
| 59 |
int parse_access_options |
|---|
| 60 |
(const char *opts, dbref *who, uint32_t * can, uint32_t * cant, dbref player); |
|---|
| 61 |
|
|---|
| 62 |
#endif |
|---|