X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fs_conf.h;h=ea4f1c21706066755795585fd2702ac166c2f844;hb=e22c93b27e9f501b7869b310dff7df384e06f7e6;hp=3d48e8cbc75070466959dba659ef30ada3590edf;hpb=5246a6127cca4385da318f2e75271b4f5907947b;p=ircu2.10.12-pk.git diff --git a/include/s_conf.h b/include/s_conf.h index 3d48e8c..ea4f1c2 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -30,10 +30,10 @@ struct Message; #define CONF_CLIENT 0x0002 /**< ConfItem describes a Client block */ #define CONF_SERVER 0x0004 /**< ConfItem describes a Connect block */ #define CONF_OPERATOR 0x0020 /**< ConfItem describes an Operator block */ -#define CONF_LEAF 0x1000 /**< ConfItem describes a Server leaf */ -#define CONF_HUB 0x4000 /**< ConfItem describes a Server hub */ #define CONF_UWORLD 0x8000 /**< ConfItem describes a Uworld server */ +#define CONF_AUTOCONNECT 0x0001 /**< Autoconnect to a server */ + /** Indicates ConfItem types that count associated clients. */ #define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER) @@ -50,17 +50,24 @@ struct ConfItem struct ConfItem *next; /**< Next ConfItem in #GlobalConfList */ unsigned int status; /**< Set of CONF_* bits. */ unsigned int clients; /**< Number of *LOCAL* clients using this */ + unsigned int maximum; /**< For CONF_SERVER, max hops. + For CONF_CLIENT, max connects per IP. */ struct ConnectionClass *conn_class; /**< Class of connection */ - struct irc_sockaddr origin; /**< local address for outbound connections */ - struct irc_sockaddr address; /**< ip and port */ - char *host; /**< peer hostname */ - char *origin_name; /**< text form of origin address */ - char *passwd; /**< password field */ - char *name; /**< name of peer */ - time_t hold; /**< Earliest time to attempt an outbound connect on this ConfItem. */ - int dns_pending; /**< a dns request is pending */ - unsigned char bits; /**< Number of bits for ipkills. */ - struct Privs privs; /**< Priviledges for opers. */ + struct irc_sockaddr origin; /**< Local address for outbound connections */ + struct irc_sockaddr address; /**< IP and port */ + char *username; /**< For CONF_CLIENT and CONF_OPERATOR, username mask. */ + char *host; /**< Peer hostname */ + char *origin_name; /**< Text form of origin address */ + char *passwd; /**< Password field */ + char *name; /**< Name of peer */ + char *hub_limit; /**< Mask that limits servers allowed behind + this one. */ + time_t hold; /**< Earliest time to attempt an outbound + connect on this ConfItem. */ + int dns_pending; /**< A dns request is pending. */ + int flags; /**< Additional modifiers for item. */ + int addrbits; /**< Number of bits valid in ConfItem::address. */ + struct Privs privs; /**< Privileges for all users in this class. */ /** Used to detect if a privilege has been set by this ConfItem. */ struct Privs privs_dirty; }; @@ -76,17 +83,16 @@ struct qline /** Local K-line structure. */ struct DenyConf { struct DenyConf* next; /**< Next DenyConf in #denyConfList. */ - char* hostmask; /**< Mask for realname, IP or hostname. */ + char* hostmask; /**< Mask for IP or hostname. */ char* message; /**< Message to send to denied users. */ char* usermask; /**< Mask for client's username. */ + char* realmask; /**< Mask for realname. */ struct irc_in_addr address; /**< Address for IP-based denies. */ unsigned int flags; /**< Interpretation flags for the above. */ unsigned char bits; /**< Number of bits for ipkills */ }; #define DENY_FLAGS_FILE 0x0001 /**< Comment is a filename */ -#define DENY_FLAGS_IP 0x0002 /**< K-line by IP address */ -#define DENY_FLAGS_REALNAME 0x0004 /**< K-line by real name */ /** Local server configuration. */ struct LocalConf { @@ -130,6 +136,8 @@ struct nick_host { char nick[1]; /**< start of nick\@server string */ }; +#define SMAP_FAST 1 /**< Command does not have MFLG_SLOW. */ + /** Target set for a service pseudo-command. */ struct s_map { struct s_map *next; /**< Next element in #GlobalServiceMapList. */ @@ -137,6 +145,7 @@ struct s_map { char *name; /**< Text name of the mapping. */ char *command; /**< Command name to use. */ char *prepend; /**< Extra text to prepend to user's text. */ + unsigned int flags; /**< Bitwise map of SMAP_* flags. */ struct nick_host *services; /**< Linked list of possible targets. */ }; @@ -168,17 +177,16 @@ extern struct ConfItem* conf_find_server(const char* name); extern void det_confs_butmask(struct Client *cptr, int mask); extern enum AuthorizationCheckResult attach_conf(struct Client *cptr, struct ConfItem *aconf); -extern struct ConfItem* find_conf_exact(const char* name, const char* user, - const char* host, int statmask); +extern struct ConfItem* find_conf_exact(const char* name, struct Client *cptr, int statmask); extern enum AuthorizationCheckResult conf_check_client(struct Client *cptr); extern int conf_check_server(struct Client *cptr); -extern struct ConfItem* find_conf_name(const char* name, int statmask); extern int rehash(struct Client *cptr, int sig); -extern void read_tlines(void); extern int find_kill(struct Client *cptr); -extern int find_restrict(struct Client *cptr); extern const char *find_quarantine(const char* chname); extern void lookup_confhost(struct ConfItem *aconf); +extern void conf_parse_userhost(struct ConfItem *aconf, char *host); +extern struct ConfItem *conf_debug_iline(const char *client); +extern void free_mapping(struct s_map *smap); extern void yyerror(const char *msg);