PennMUSH Community
Show
Ignore:
Timestamp:
10/05/07 15:36:32 (1 year ago)
Author:
shawnw
Message:

Merge with devel

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/trunk/hdrs/access.h

    r919 r1117  
    1010  char comment[BUFFER_LEN];     /**< A comment about the rule */ 
    1111  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 */ 
    1415  struct access *next;          /**< Pointer to next rule in the list */ 
    1516}; 
     
    1718 
    1819/* 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 */ 
    2324/* 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 */ 
    2829 
    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 */ 
    3233 
    3334/* This is the usual default access */ 
     
    4546 
    4647/* Public functions */ 
    47 int read_access_file(void); 
     48bool read_access_file(void); 
    4849void write_access_file(void); 
    49 int site_can_access(const char *hname, int flag, dbref who); 
     50bool site_can_access(const char *hname, uint32_t flag, dbref who); 
    5051struct access *site_check_access(const char *hname, dbref who, int *rulenum); 
    51 int format_access(struct access *ap, int rulenum, 
    52                   dbref who 
    53                   __attribute__ ((__unused__)), char *buff, char **bp); 
    54 int add_access_sitelock(dbref player, const char *host, dbref who, int can
    55                         int cant); 
     52void format_access(struct access *ap, int rulenum, 
     53                  dbref who 
     54                  __attribute__ ((__unused__)), char *buff, char **bp); 
     55bool add_access_sitelock(dbref player, const char *host, dbref who
     56                        uint32_t can, uint32_t cant); 
    5657int remove_access_sitelock(const char *pattern); 
    5758void do_list_access(dbref player); 
    5859int 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); 
    6061 
    6162#endif                          /* __ACCESS_H */