Changeset 1117 for 1.8.3/trunk/hdrs/access.h
- Timestamp:
- 10/05/07 15:36:32 (1 year ago)
- Files:
-
- 1.8.3/trunk/hdrs/access.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/trunk/hdrs/access.h
r919 r1117 10 10 char comment[BUFFER_LEN]; /**< A comment about the rule */ 11 11 dbref who; /**< Who created this rule if sitelock used */ 12 int can; /**< Bitflags of what the host can do */ 13 int cant; /**< Bitflags of what the host can't do */ 12 uint32_t can; /**< Bitflags of what the host can do */ 13 uint32_t cant; /**< Bitflags of what the host can't do */ 14 pcre *re; /**< Compiled regexp */ 14 15 struct access *next; /**< Pointer to next rule in the list */ 15 16 }; … … 17 18 18 19 /* These flags are can/can't - a site may or may not be allowed to do them */ 19 #define ACS_CONNECT 0x1 /* Connect to non-guests */20 #define ACS_CREATE 0x2 /* Create new players */21 #define ACS_GUEST 0x4 /* Connect to guests */22 #define ACS_REGISTER 0x8 /* Site can use the 'register' command */20 #define ACS_CONNECT 0x1U /* Connect to non-guests */ 21 #define ACS_CREATE 0x2U /* Create new players */ 22 #define ACS_GUEST 0x4U /* Connect to guests */ 23 #define ACS_REGISTER 0x8U /* Site can use the 'register' command */ 23 24 /* These flags are set in the 'can' bit, but they mark special processing */ 24 #define ACS_SITELOCK 0x10 /* Marker for where to insert @sitelock */25 #define ACS_SUSPECT 0x20 /* All players from this site get SUSPECT */26 #define ACS_DENY_SILENT 0x40 /* Don't log failed attempts */27 #define ACS_REGEXP 0x80 /* Treat the host pattern as a regexp */25 #define ACS_SITELOCK 0x10U /* Marker for where to insert @sitelock */ 26 #define ACS_SUSPECT 0x20U /* All players from this site get SUSPECT */ 27 #define ACS_DENY_SILENT 0x40U /* Don't log failed attempts */ 28 #define ACS_REGEXP 0x80U /* Treat the host pattern as a regexp */ 28 29 29 #define ACS_GOD 0x100 /* God can connect from this site */30 #define ACS_WIZARD 0x200 /* Wizards can connect from this site */31 #define ACS_ADMIN 0x400 /* Admins can connect from this site */30 #define ACS_GOD 0x100U /* God can connect from this site */ 31 #define ACS_WIZARD 0x200U /* Wizards can connect from this site */ 32 #define ACS_ADMIN 0x400U /* Admins can connect from this site */ 32 33 33 34 /* This is the usual default access */ … … 45 46 46 47 /* Public functions */ 47 intread_access_file(void);48 bool read_access_file(void); 48 49 void write_access_file(void); 49 int site_can_access(const char *hname, int flag, dbref who);50 bool site_can_access(const char *hname, uint32_t flag, dbref who); 50 51 struct access *site_check_access(const char *hname, dbref who, int *rulenum); 51 intformat_access(struct access *ap, int rulenum,52 dbref who53 __attribute__ ((__unused__)), char *buff, char **bp);54 int add_access_sitelock(dbref player, const char *host, dbref who, int can,55 int cant);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); 56 57 int remove_access_sitelock(const char *pattern); 57 58 void do_list_access(dbref player); 58 59 int parse_access_options 59 (const char *opts, dbref *who, int *can, int *cant, dbref player);60 (const char *opts, dbref *who, uint32_t * can, uint32_t * cant, dbref player); 60 61 61 62 #endif /* __ACCESS_H */
