mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-01 06:56:38 +02:00
Lots of changes again. Most notable: Cmdoverride -> CommandOverride,
including things like CallCmdoverride() to CallCommandOverride(). Type changes like aTKline -> TKL and many more (in particular aSomething to Something etc. such as aWatch to Watch) but these are less used by 3rd party module coders.
This commit is contained in:
+26
-26
@@ -52,7 +52,7 @@ extern MODVAR char umodestring[UMODETABLESZ+1];
|
||||
#define get_recvq(x) ((x)->local->class->recvq ? (x)->local->class->recvq : DEFAULT_RECVQ)
|
||||
|
||||
#define CMD_FUNC(x) int (x) (Client *cptr, Client *sptr, MessageTag *recv_mtags, int parc, char *parv[])
|
||||
#define CMD_OVERRIDE_FUNC(x) int (x)(Cmdoverride *ovr, Client *cptr, Client *sptr, MessageTag *recv_mtags, int parc, char *parv[])
|
||||
#define CMD_OVERRIDE_FUNC(x) int (x)(CommandOverride *ovr, Client *cptr, Client *sptr, MessageTag *recv_mtags, int parc, char *parv[])
|
||||
|
||||
/* Configuration preprocessor */
|
||||
extern int parse_preprocessor_item(char *start, char *end, char *filename, int linenumber, ConditionalConfig **cc);
|
||||
@@ -379,7 +379,7 @@ extern int del_from_watch_hash_table(char *, Client *);
|
||||
extern int hash_check_watch(Client *, int);
|
||||
extern int hash_del_watch_list(Client *);
|
||||
extern void count_watch_memory(int *, u_long *);
|
||||
extern aWatch *hash_get_watch(char *);
|
||||
extern Watch *hash_get_watch(char *);
|
||||
extern Channel *hash_get_chan_bucket(uint64_t);
|
||||
extern Client *hash_find_client(const char *, Client *);
|
||||
extern Client *hash_find_id(const char *, Client *);
|
||||
@@ -503,7 +503,7 @@ extern int init_conf(char *filename, int rehash);
|
||||
extern void validate_configuration(void);
|
||||
extern void run_configuration(void);
|
||||
extern void rehash_motdrules();
|
||||
extern void read_motd(const char *filename, aMotdFile *motd); /* s_serv.c */
|
||||
extern void read_motd(const char *filename, MOTDFile *motd); /* s_serv.c */
|
||||
extern void send_proto(Client *, ConfigItem_link *);
|
||||
extern void unload_all_modules(void);
|
||||
extern void set_sock_opts(int fd, Client *cptr, int ipv6);
|
||||
@@ -638,37 +638,37 @@ extern MODVAR int (*register_user)(Client *cptr, Client *sptr, char *nick, char
|
||||
extern MODVAR int (*tkl_hash)(unsigned int c);
|
||||
extern MODVAR char (*tkl_typetochar)(int type);
|
||||
extern MODVAR int (*tkl_chartotype)(char c);
|
||||
extern MODVAR char *(*tkl_type_string)(aTKline *tk);
|
||||
extern MODVAR aTKline *(*tkl_add_serverban)(int type, char *usermask, char *hostmask, char *reason, char *setby,
|
||||
extern MODVAR char *(*tkl_type_string)(TKL *tk);
|
||||
extern MODVAR TKL *(*tkl_add_serverban)(int type, char *usermask, char *hostmask, char *reason, char *setby,
|
||||
time_t expire_at, time_t set_at, int soft, int flags);
|
||||
extern MODVAR aTKline *(*tkl_add_banexception)(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
extern MODVAR TKL *(*tkl_add_banexception)(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int soft, char *bantypes, int flags);
|
||||
extern MODVAR aTKline *(*tkl_add_nameban)(int type, char *name, int hold, char *reason, char *setby,
|
||||
extern MODVAR TKL *(*tkl_add_nameban)(int type, char *name, int hold, char *reason, char *setby,
|
||||
time_t expire_at, time_t set_at, int flags);
|
||||
extern MODVAR aTKline *(*tkl_add_spamfilter)(int type, unsigned short target, unsigned short action, Match *match, char *setby,
|
||||
extern MODVAR TKL *(*tkl_add_spamfilter)(int type, unsigned short target, unsigned short action, Match *match, char *setby,
|
||||
time_t expire_at, time_t set_at,
|
||||
time_t spamf_tkl_duration, char *spamf_tkl_reason,
|
||||
int flags);
|
||||
extern MODVAR aTKline *(*find_tkl_serverban)(int type, char *usermask, char *hostmask, int softban);
|
||||
extern MODVAR aTKline *(*find_tkl_banexception)(int type, char *usermask, char *hostmask, int softban);
|
||||
extern MODVAR aTKline *(*find_tkl_nameban)(int type, char *name, int hold);
|
||||
extern MODVAR aTKline *(*find_tkl_spamfilter)(int type, char *match_string, unsigned short action, unsigned short target);
|
||||
extern MODVAR void (*sendnotice_tkl_del)(char *removed_by, aTKline *tkl);
|
||||
extern MODVAR void (*sendnotice_tkl_add)(aTKline *tkl);
|
||||
extern MODVAR void (*free_tkl)(aTKline *tkl);
|
||||
extern MODVAR aTKline *(*tkl_del_line)(aTKline *tkl);
|
||||
extern MODVAR void (*tkl_check_local_remove_shun)(aTKline *tmp);
|
||||
extern MODVAR TKL *(*find_tkl_serverban)(int type, char *usermask, char *hostmask, int softban);
|
||||
extern MODVAR TKL *(*find_tkl_banexception)(int type, char *usermask, char *hostmask, int softban);
|
||||
extern MODVAR TKL *(*find_tkl_nameban)(int type, char *name, int hold);
|
||||
extern MODVAR TKL *(*find_tkl_spamfilter)(int type, char *match_string, unsigned short action, unsigned short target);
|
||||
extern MODVAR void (*sendnotice_tkl_del)(char *removed_by, TKL *tkl);
|
||||
extern MODVAR void (*sendnotice_tkl_add)(TKL *tkl);
|
||||
extern MODVAR void (*free_tkl)(TKL *tkl);
|
||||
extern MODVAR TKL *(*tkl_del_line)(TKL *tkl);
|
||||
extern MODVAR void (*tkl_check_local_remove_shun)(TKL *tmp);
|
||||
extern MODVAR int (*find_tkline_match)(Client *cptr, int skip_soft);
|
||||
extern MODVAR int (*find_shun)(Client *cptr);
|
||||
extern MODVAR int (*find_spamfilter_user)(Client *sptr, int flags);
|
||||
extern MODVAR aTKline *(*find_qline)(Client *cptr, char *nick, int *ishold);
|
||||
extern MODVAR aTKline *(*find_tkline_match_zap)(Client *cptr);
|
||||
extern MODVAR TKL *(*find_qline)(Client *cptr, char *nick, int *ishold);
|
||||
extern MODVAR TKL *(*find_tkline_match_zap)(Client *cptr);
|
||||
extern MODVAR void (*tkl_stats)(Client *cptr, int type, char *para);
|
||||
extern MODVAR void (*tkl_synch)(Client *sptr);
|
||||
extern MODVAR int (*m_tkl)(Client *cptr, Client *sptr, MessageTag *recv_mtags, int parc, char *parv[]);
|
||||
extern MODVAR int (*place_host_ban)(Client *sptr, BanAction action, char *reason, long duration);
|
||||
extern MODVAR int (*run_spamfilter)(Client *sptr, char *str_in, int type, char *target, int flags, aTKline **rettk);
|
||||
extern MODVAR int (*join_viruschan)(Client *sptr, aTKline *tk, int type);
|
||||
extern MODVAR int (*run_spamfilter)(Client *sptr, char *str_in, int type, char *target, int flags, TKL **rettk);
|
||||
extern MODVAR int (*join_viruschan)(Client *sptr, TKL *tk, int type);
|
||||
extern MODVAR void (*send_list)(Client *cptr);
|
||||
extern MODVAR unsigned char *(*StripColors)(unsigned char *text);
|
||||
extern MODVAR const char *(*StripControlCodes)(unsigned char *text);
|
||||
@@ -710,7 +710,7 @@ extern MODVAR int (*tkl_ip_hash_type)(int type);
|
||||
extern MODVAR int (*find_tkl_exception)(int ban_type, Client *cptr);
|
||||
/* /Efuncs */
|
||||
|
||||
extern MODVAR aMotdFile opermotd, svsmotd, motd, botmotd, smotd, rules;
|
||||
extern MODVAR MOTDFile opermotd, svsmotd, motd, botmotd, smotd, rules;
|
||||
extern MODVAR int max_connection_count;
|
||||
extern int add_listmode(Ban **list, Client *cptr, Channel *chptr, char *banid);
|
||||
extern int add_listmode_ex(Ban **list, Client *cptr, Channel *chptr, char *banid, char *setby, time_t seton);
|
||||
@@ -720,8 +720,8 @@ extern char *clean_ban_mask(char *, int, Client *);
|
||||
extern int find_invex(Channel *chptr, Client *sptr);
|
||||
extern void DoMD5(unsigned char *mdout, const unsigned char *src, unsigned long n);
|
||||
extern char *md5hash(unsigned char *dst, const unsigned char *src, unsigned long n);
|
||||
extern MODVAR aTKline *tklines[TKLISTLEN];
|
||||
extern MODVAR aTKline *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2];
|
||||
extern MODVAR TKL *tklines[TKLISTLEN];
|
||||
extern MODVAR TKL *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2];
|
||||
extern char *cmdname_by_spamftarget(int target);
|
||||
extern void unrealdns_delreq_bycptr(Client *cptr);
|
||||
extern void sendtxtnumeric(Client *to, FORMAT_STRING(const char *pattern), ...) __attribute__((format(printf,2,3)));
|
||||
@@ -741,14 +741,14 @@ extern char *cm_getparameter_ex(void **p, char mode);
|
||||
extern void cm_putparameter_ex(void **p, char mode, char *str);
|
||||
extern void cm_freeparameter_ex(void **p, char mode, char *str);
|
||||
extern int file_exists(char* file);
|
||||
extern void free_motd(aMotdFile *motd); /* s_serv.c */
|
||||
extern void free_motd(MOTDFile *motd); /* s_serv.c */
|
||||
extern void fix_timers(void);
|
||||
extern char *chfl_to_sjoin_symbol(int s);
|
||||
extern char chfl_to_chanmode(int s);
|
||||
extern void add_pending_net(Client *sptr, char *str);
|
||||
extern void free_pending_net(Client *sptr);
|
||||
extern Client *find_non_pending_net_duplicates(Client *cptr);
|
||||
extern aPendingNet *find_pending_net_by_sid_butone(char *sid, Client *exempt);
|
||||
extern PendingNet *find_pending_net_by_sid_butone(char *sid, Client *exempt);
|
||||
extern Client *find_pending_net_duplicates(Client *cptr, Client **srv, char **sid);
|
||||
extern MODVAR char serveropts[];
|
||||
extern MODVAR char *IsupportStrings[];
|
||||
|
||||
+10
-10
@@ -97,7 +97,7 @@ typedef enum ModuleObjectType {
|
||||
MOBJ_VERSIONFLAG = 5,
|
||||
MOBJ_SNOMASK = 6,
|
||||
MOBJ_UMODE = 7,
|
||||
MOBJ_CMDOVERRIDE = 8,
|
||||
MOBJ_COMMANDOVERRIDE = 8,
|
||||
MOBJ_EXTBAN = 9,
|
||||
MOBJ_CALLBACK = 10,
|
||||
MOBJ_ISUPPORT = 11,
|
||||
@@ -537,7 +537,7 @@ typedef struct ModuleObject {
|
||||
Versionflag *versionflag;
|
||||
Snomask *snomask;
|
||||
Umode *umode;
|
||||
Cmdoverride *cmdoverride;
|
||||
CommandOverride *cmdoverride;
|
||||
Extban *extban;
|
||||
Callback *callback;
|
||||
Efunction *efunction;
|
||||
@@ -788,10 +788,10 @@ extern Command *AliasAdd(Module *module, char *cmd, AliasCmdFunc aliasfunc, unsi
|
||||
extern void CommandDel(Command *command);
|
||||
extern void CommandDelX(Command *command, RealCommand *cmd);
|
||||
extern int CommandExists(char *name);
|
||||
extern Cmdoverride *CmdoverrideAdd(Module *module, char *cmd, OverrideCmdFunc func);
|
||||
extern Cmdoverride *CmdoverrideAddEx(Module *module, char *name, int priority, OverrideCmdFunc func);
|
||||
extern void CmdoverrideDel(Cmdoverride *ovr);
|
||||
extern int CallCmdoverride(Cmdoverride *ovr, Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[]);
|
||||
extern CommandOverride *CommandOverrideAdd(Module *module, char *cmd, OverrideCmdFunc func);
|
||||
extern CommandOverride *CommandOverrideAddEx(Module *module, char *name, int priority, OverrideCmdFunc func);
|
||||
extern void CommandOverrideDel(CommandOverride *ovr);
|
||||
extern int CallCommandOverride(CommandOverride *ovr, Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[]);
|
||||
|
||||
extern void moddata_free_client(Client *acptr);
|
||||
extern void moddata_free_channel(Channel *chptr);
|
||||
@@ -985,10 +985,10 @@ int hooktype_channel_destroy(Channel *chptr, int *should_destroy);
|
||||
int hooktype_tkl_except(Client *cptr, int ban_type);
|
||||
int hooktype_umode_change(Client *sptr, long setflags, long newflags);
|
||||
int hooktype_rehash_complete(void);
|
||||
int hooktype_tkl_add(Client *cptr, Client *sptr, aTKline *tkl);
|
||||
int hooktype_tkl_del(Client *cptr, Client *sptr, aTKline *tkl);
|
||||
int hooktype_tkl_add(Client *cptr, Client *sptr, TKL *tkl);
|
||||
int hooktype_tkl_del(Client *cptr, Client *sptr, TKL *tkl);
|
||||
int hooktype_log(int flags, char *timebuf, char *buf);
|
||||
int hooktype_local_spamfilter(Client *acptr, char *str, char *str_in, int type, char *target, aTKline *tkl);
|
||||
int hooktype_local_spamfilter(Client *acptr, char *str, char *str_in, int type, char *target, TKL *tkl);
|
||||
int hooktype_silenced(Client *cptr, Client *sptr, Client *to, int notice);
|
||||
int hooktype_rawpacket_in(Client *sptr, char *readbuf, int *length);
|
||||
int hooktype_local_nickpass(Client *sptr, Client *nickserv);
|
||||
@@ -1018,7 +1018,7 @@ int hooktype_require_sasl(Client *sptr, char *reason);
|
||||
int hooktype_sasl_continuation(Client *sptr, char *buf);
|
||||
int hooktype_sasl_result(Client *sptr, int success);
|
||||
int hooktype_place_host_ban(Client *sptr, int action, char *reason, long duration);
|
||||
int hooktype_find_tkline_match(Client *sptr, aTKline *tk);
|
||||
int hooktype_find_tkline_match(Client *sptr, TKL *tk);
|
||||
int hooktype_welcome(Client *sptr, int after_numeric);
|
||||
int hooktype_pre_command(Client *from, MessageTag *mtags, char *buf);
|
||||
int hooktype_post_command(Client *from, MessageTag *mtags, char *buf);
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ extern char *my_itoa(int i);
|
||||
/* s_serv.c */
|
||||
extern void load_tunefile(void);
|
||||
extern EVENT(save_tunefile);
|
||||
extern void read_motd(const char *filename, aMotdFile *motd);
|
||||
extern void read_motd(const char *filename, MOTDFile *motd);
|
||||
|
||||
/* s_user.c */
|
||||
extern int check_for_target_limit(Client *sptr, void *target, const char *name);
|
||||
|
||||
+39
-41
@@ -62,7 +62,7 @@
|
||||
#include "channel.h"
|
||||
|
||||
typedef struct LoopStruct LoopStruct;
|
||||
typedef struct aTKline aTKline;
|
||||
typedef struct TKL TKL;
|
||||
typedef struct Spamfilter Spamfilter;
|
||||
typedef struct ServerBan ServerBan;
|
||||
typedef struct BanException BanException;
|
||||
@@ -116,26 +116,25 @@ typedef struct ListStructPrio ListStructPrio;
|
||||
#define CFG_SIZE 0x0002
|
||||
#define CFG_YESNO 0x0004
|
||||
|
||||
typedef struct Watch aWatch;
|
||||
typedef struct Watch Watch;
|
||||
typedef struct Client Client;
|
||||
typedef struct LocalClient aLocalClient;
|
||||
typedef struct LocalClient LocalClient;
|
||||
typedef struct Channel Channel;
|
||||
typedef struct User ClientUser;
|
||||
typedef struct Server Server;
|
||||
typedef struct SLink Link;
|
||||
typedef struct Link Link;
|
||||
typedef struct Ban Ban;
|
||||
typedef struct Mode Mode;
|
||||
typedef struct MessageTag MessageTag;
|
||||
typedef struct ListOptions LOpts;
|
||||
typedef struct Motd aMotdFile; /* represents a whole MOTD, including remote MOTD support info */
|
||||
typedef struct MotdItem aMotdLine; /* one line of a MOTD stored as a linked list */
|
||||
typedef struct ChannelListOptions ChannelListOptions;
|
||||
typedef struct MOTDFile MOTDFile; /* represents a whole MOTD, including remote MOTD support info */
|
||||
typedef struct MOTDLine MOTDLine; /* one line of a MOTD stored as a linked list */
|
||||
#ifdef USE_LIBCURL
|
||||
typedef struct MotdDownload aMotdDownload; /* used to coordinate download of a remote MOTD */
|
||||
typedef struct MOTDDownload MOTDDownload; /* used to coordinate download of a remote MOTD */
|
||||
#endif
|
||||
|
||||
typedef struct trecord aTrecord;
|
||||
typedef struct RealCommand RealCommand;
|
||||
typedef struct Cmdoverride Cmdoverride;
|
||||
typedef struct CommandOverride CommandOverride;
|
||||
typedef struct Member Member;
|
||||
typedef struct Membership Membership;
|
||||
typedef struct MembershipL MembershipL;
|
||||
@@ -525,16 +524,15 @@ union _moddata
|
||||
};
|
||||
|
||||
#ifdef USE_LIBCURL
|
||||
struct Motd;
|
||||
struct MotdDownload
|
||||
struct MOTDDownload
|
||||
{
|
||||
struct Motd *themotd;
|
||||
MOTDFile *themotd;
|
||||
};
|
||||
#endif /* USE_LIBCURL */
|
||||
|
||||
struct Motd
|
||||
struct MOTDFile
|
||||
{
|
||||
struct MotdItem *lines;
|
||||
struct MOTDLine *lines;
|
||||
struct tm last_modified; /* store the last modification time */
|
||||
|
||||
#ifdef USE_LIBCURL
|
||||
@@ -547,7 +545,7 @@ struct Motd
|
||||
|
||||
To prevent such a situation from leading to a segfault, we
|
||||
introduce this remote control pointer. It works like this:
|
||||
1. read_motd() is called with a URL. A new MotdDownload is
|
||||
1. read_motd() is called with a URL. A new MOTDDownload is
|
||||
allocated and the pointer is placed here. This pointer is
|
||||
also passed to the asynchrnous download handler.
|
||||
2.a. The download is completed and read_motd_asynch_downloaded()
|
||||
@@ -560,13 +558,13 @@ struct Motd
|
||||
the download. read_motd_asynch_downloaded() is eventually called
|
||||
and frees motd_download.
|
||||
*/
|
||||
struct MotdDownload *motd_download;
|
||||
struct MOTDDownload *motd_download;
|
||||
#endif /* USE_LIBCURL */
|
||||
};
|
||||
|
||||
struct MotdItem {
|
||||
struct MOTDLine {
|
||||
char *line;
|
||||
struct MotdItem *next;
|
||||
struct MOTDLine *next;
|
||||
};
|
||||
|
||||
struct LoopStruct {
|
||||
@@ -648,7 +646,7 @@ struct User {
|
||||
char *virthost;
|
||||
char *server;
|
||||
SWhois *swhois; /* special whois entries */
|
||||
LOpts *lopt; /* Saved /list options */
|
||||
ChannelListOptions *lopt; /* Saved /list options */
|
||||
aWhowas *whowas;
|
||||
int snomask;
|
||||
#ifdef LIST_DEBUG
|
||||
@@ -820,8 +818,8 @@ struct BanException {
|
||||
#define TKL_FLAG_CONFIG 0x0001 /* Entry from configuration file. Cannot be removed by using commands. */
|
||||
|
||||
/** A TKL entry, such as a KLINE, GLINE, Spamfilter, QLINE, Exception, .. */
|
||||
struct aTKline {
|
||||
aTKline *prev, *next;
|
||||
struct TKL {
|
||||
TKL *prev, *next;
|
||||
unsigned int type; /**< TKL type. One of TKL_*, such as TKL_KILL|TKL_GLOBAL for gline */
|
||||
unsigned short flags; /**< One of TKL_FLAG_*, such as TKL_FLAG_CONFIG */
|
||||
char *set_by; /**< By who was this entry added */
|
||||
@@ -860,7 +858,7 @@ extern MODVAR ircstats IRCstats;
|
||||
|
||||
typedef int (*CmdFunc)(Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[]);
|
||||
typedef int (*AliasCmdFunc)(Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[], char *cmd);
|
||||
typedef int (*OverrideCmdFunc)(Cmdoverride *ovr, Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[]);
|
||||
typedef int (*OverrideCmdFunc)(CommandOverride *ovr, Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[]);
|
||||
|
||||
#include "modules.h"
|
||||
|
||||
@@ -912,7 +910,7 @@ struct Client {
|
||||
struct list_head client_node; /* for global client list (client_list) */
|
||||
struct list_head client_hash; /* for clientTable */
|
||||
struct list_head id_hash; /* for idTable */
|
||||
aLocalClient *local; /* for locally connected clients */
|
||||
LocalClient *local; /* for locally connected clients */
|
||||
ClientUser *user; /* ...defined, if this is a User */
|
||||
Server *serv; /* ...defined, if this is a server */
|
||||
time_t lastnick; /* TimeStamp on nick */
|
||||
@@ -1250,7 +1248,7 @@ struct ConfigItem_tld {
|
||||
char *mask, *channel;
|
||||
char *motd_file, *rules_file, *smotd_file;
|
||||
char *botmotd_file, *opermotd_file;
|
||||
aMotdFile rules, motd, smotd, botmotd, opermotd;
|
||||
MOTDFile rules, motd, smotd, botmotd, opermotd;
|
||||
u_short options;
|
||||
};
|
||||
|
||||
@@ -1450,7 +1448,7 @@ struct ConfigItem_help {
|
||||
ConfigItem_help *prev, *next;
|
||||
ConfigFlag flag;
|
||||
char *command;
|
||||
aMotdLine *text;
|
||||
MOTDLine *text;
|
||||
};
|
||||
|
||||
struct ConfigItem_offchans {
|
||||
@@ -1504,8 +1502,8 @@ typedef struct MemoryInfo {
|
||||
unsigned long classesmem;
|
||||
} MemoryInfo;
|
||||
|
||||
struct ListOptions {
|
||||
LOpts *next;
|
||||
struct ChannelListOptions {
|
||||
ChannelListOptions *next;
|
||||
Link *yeslist, *nolist;
|
||||
unsigned int starthash;
|
||||
short int showall;
|
||||
@@ -1537,7 +1535,7 @@ struct Mode {
|
||||
/* Used for notify-hash buckets... -Donwulff */
|
||||
|
||||
struct Watch {
|
||||
aWatch *hnext;
|
||||
Watch *hnext;
|
||||
time_t lasttime;
|
||||
Link *watch;
|
||||
char nick[1];
|
||||
@@ -1545,14 +1543,14 @@ struct Watch {
|
||||
|
||||
/* general link structure used for chains */
|
||||
|
||||
struct SLink {
|
||||
struct SLink *next;
|
||||
struct Link {
|
||||
struct Link *next;
|
||||
int flags;
|
||||
union {
|
||||
Client *cptr;
|
||||
Channel *chptr;
|
||||
ListStruct *aconf;
|
||||
aWatch *wptr;
|
||||
Watch *wptr;
|
||||
aName *whowas;
|
||||
char *cp;
|
||||
struct {
|
||||
@@ -1850,16 +1848,16 @@ struct RealCommand {
|
||||
unsigned long bytes;
|
||||
Module *owner;
|
||||
RealCommand *friend; /* cmd if token, token if cmd */
|
||||
Cmdoverride *overriders;
|
||||
Cmdoverride *overridetail;
|
||||
CommandOverride *overriders;
|
||||
CommandOverride *overridetail;
|
||||
#ifdef DEBUGMODE
|
||||
unsigned long lticks;
|
||||
unsigned long rticks;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct Cmdoverride {
|
||||
Cmdoverride *prev, *next;
|
||||
struct CommandOverride {
|
||||
CommandOverride *prev, *next;
|
||||
int priority;
|
||||
Module *owner;
|
||||
RealCommand *command;
|
||||
@@ -1893,17 +1891,17 @@ struct ParseMode {
|
||||
char buf[512]; /* internal parse buffer */
|
||||
};
|
||||
|
||||
typedef struct PendingServer aPendingServer;
|
||||
typedef struct PendingServer PendingServer;
|
||||
struct PendingServer {
|
||||
aPendingServer *prev, *next;
|
||||
PendingServer *prev, *next;
|
||||
char sid[IDLEN+1];
|
||||
};
|
||||
|
||||
typedef struct PendingNet aPendingNet;
|
||||
typedef struct PendingNet PendingNet;
|
||||
struct PendingNet {
|
||||
aPendingNet *prev, *next; /* Previous and next in list */
|
||||
PendingNet *prev, *next; /* Previous and next in list */
|
||||
Client *sptr; /**< Client to which these servers belong */
|
||||
aPendingServer *servers; /**< The list of servers connected to the client */
|
||||
PendingServer *servers; /**< The list of servers connected to the client */
|
||||
};
|
||||
|
||||
extern void init_throttling();
|
||||
|
||||
+2
-2
@@ -104,7 +104,7 @@ Command *AliasAdd(Module *module, char *cmd, AliasCmdFunc aliasfunc, unsigned ch
|
||||
|
||||
void CommandDelX(Command *command, RealCommand *cmd)
|
||||
{
|
||||
Cmdoverride *ovr, *ovrnext;
|
||||
CommandOverride *ovr, *ovrnext;
|
||||
|
||||
DelListItem(cmd, CommandHash[toupper(*cmd->cmd)]);
|
||||
if (command && cmd->owner)
|
||||
@@ -123,7 +123,7 @@ void CommandDelX(Command *command, RealCommand *cmd)
|
||||
for (ovr = cmd->overriders; ovr; ovr = ovrnext)
|
||||
{
|
||||
ovrnext = ovr->next;
|
||||
CmdoverrideDel(ovr);
|
||||
CommandOverrideDel(ovr);
|
||||
}
|
||||
MyFree(cmd->cmd);
|
||||
MyFree(cmd);
|
||||
|
||||
+18
-18
@@ -45,30 +45,30 @@ int (*register_user)(Client *cptr, Client *sptr, char *nick, char *username, cha
|
||||
int (*tkl_hash)(unsigned int c);
|
||||
char (*tkl_typetochar)(int type);
|
||||
int (*tkl_chartotype)(char c);
|
||||
char *(*tkl_type_string)(aTKline *tk);
|
||||
aTKline *(*tkl_add_serverban)(int type, char *usermask, char *hostmask, char *reason, char *setby,
|
||||
char *(*tkl_type_string)(TKL *tk);
|
||||
TKL *(*tkl_add_serverban)(int type, char *usermask, char *hostmask, char *reason, char *setby,
|
||||
time_t expire_at, time_t set_at, int soft, int flags);
|
||||
aTKline *(*tkl_add_nameban)(int type, char *name, int hold, char *reason, char *setby,
|
||||
TKL *(*tkl_add_nameban)(int type, char *name, int hold, char *reason, char *setby,
|
||||
time_t expire_at, time_t set_at, int flags);
|
||||
aTKline *(*tkl_add_spamfilter)(int type, unsigned short target, unsigned short action, Match *match, char *setby,
|
||||
TKL *(*tkl_add_spamfilter)(int type, unsigned short target, unsigned short action, Match *match, char *setby,
|
||||
time_t expire_at, time_t set_at,
|
||||
time_t spamf_tkl_duration, char *spamf_tkl_reason,
|
||||
int flags);
|
||||
aTKline *(*tkl_add_banexception)(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
TKL *(*tkl_add_banexception)(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int soft, char *bantypes, int flags);
|
||||
aTKline *(*tkl_del_line)(aTKline *tkl);
|
||||
void (*tkl_check_local_remove_shun)(aTKline *tmp);
|
||||
TKL *(*tkl_del_line)(TKL *tkl);
|
||||
void (*tkl_check_local_remove_shun)(TKL *tmp);
|
||||
int (*find_tkline_match)(Client *cptr, int skip_soft);
|
||||
int (*find_shun)(Client *cptr);
|
||||
int(*find_spamfilter_user)(Client *sptr, int flags);
|
||||
aTKline *(*find_qline)(Client *cptr, char *nick, int *ishold);
|
||||
aTKline *(*find_tkline_match_zap)(Client *cptr);
|
||||
TKL *(*find_qline)(Client *cptr, char *nick, int *ishold);
|
||||
TKL *(*find_tkline_match_zap)(Client *cptr);
|
||||
void (*tkl_stats)(Client *cptr, int type, char *para);
|
||||
void (*tkl_synch)(Client *sptr);
|
||||
int (*m_tkl)(Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[]);
|
||||
int (*place_host_ban)(Client *sptr, BanAction action, char *reason, long duration);
|
||||
int (*run_spamfilter)(Client *sptr, char *str_in, int type, char *target, int flags, aTKline **rettk);
|
||||
int (*join_viruschan)(Client *sptr, aTKline *tk, int type);
|
||||
int (*run_spamfilter)(Client *sptr, char *str_in, int type, char *target, int flags, TKL **rettk);
|
||||
int (*join_viruschan)(Client *sptr, TKL *tk, int type);
|
||||
void (*send_list)(Client *cptr);
|
||||
unsigned char *(*StripColors)(unsigned char *text);
|
||||
const char *(*StripControlCodes)(unsigned char *text);
|
||||
@@ -109,13 +109,13 @@ void (*broadcast_md_globalvar)(ModDataInfo *mdi, ModData *md);
|
||||
void (*broadcast_md_globalvar_cmd)(Client *except, Client *sender, char *varname, char *value);
|
||||
int (*tkl_ip_hash)(char *ip);
|
||||
int (*tkl_ip_hash_type)(int type);
|
||||
void (*sendnotice_tkl_del)(char *removed_by, aTKline *tkl);
|
||||
void (*sendnotice_tkl_add)(aTKline *tkl);
|
||||
void (*free_tkl)(aTKline *tkl);
|
||||
aTKline *(*find_tkl_serverban)(int type, char *usermask, char *hostmask, int softban);
|
||||
aTKline *(*find_tkl_banexception)(int type, char *usermask, char *hostmask, int softban);
|
||||
aTKline *(*find_tkl_nameban)(int type, char *name, int hold);
|
||||
aTKline *(*find_tkl_spamfilter)(int type, char *match_string, unsigned short action, unsigned short target);
|
||||
void (*sendnotice_tkl_del)(char *removed_by, TKL *tkl);
|
||||
void (*sendnotice_tkl_add)(TKL *tkl);
|
||||
void (*free_tkl)(TKL *tkl);
|
||||
TKL *(*find_tkl_serverban)(int type, char *usermask, char *hostmask, int softban);
|
||||
TKL *(*find_tkl_banexception)(int type, char *usermask, char *hostmask, int softban);
|
||||
TKL *(*find_tkl_nameban)(int type, char *name, int hold);
|
||||
TKL *(*find_tkl_spamfilter)(int type, char *match_string, unsigned short action, unsigned short target);
|
||||
int (*find_tkl_exception)(int ban_type, Client *cptr);
|
||||
|
||||
Efunction *EfunctionAddMain(Module *module, EfunctionType eftype, int (*func)(), void (*vfunc)(), void *(*pvfunc)(), char *(*cfunc)())
|
||||
|
||||
@@ -888,7 +888,7 @@ Client *add_connection(ConfigItem_listen *listener, int fd)
|
||||
{
|
||||
Client *acptr, *acptr2;
|
||||
ConfigItem_ban *bconf;
|
||||
aTKline *tk;
|
||||
TKL *tk;
|
||||
int i, j;
|
||||
char *ip;
|
||||
int port = 0;
|
||||
|
||||
+5
-5
@@ -1596,7 +1596,7 @@ ConfigItem_log *ca = MyMallocEx(sizeof(ConfigItem_log));
|
||||
void postconf_defaults(void)
|
||||
{
|
||||
char tmpbuf[512];
|
||||
aTKline *tk;
|
||||
TKL *tk;
|
||||
char *encoded;
|
||||
|
||||
if (!iConf.plaintext_policy_user_message)
|
||||
@@ -2104,7 +2104,7 @@ int load_conf(char *filename, const char *original_path)
|
||||
*/
|
||||
void remove_config_tkls(void)
|
||||
{
|
||||
aTKline *tk, *tk_next;
|
||||
TKL *tk, *tk_next;
|
||||
int index, index2;
|
||||
|
||||
/* IP hashed TKL list */
|
||||
@@ -2403,7 +2403,7 @@ void config_rehash()
|
||||
MyFree(alias_ptr);
|
||||
}
|
||||
for (help_ptr = conf_help; help_ptr; help_ptr = (ConfigItem_help *)next) {
|
||||
aMotdLine *text;
|
||||
MOTDLine *text;
|
||||
next = (ListStruct *)help_ptr->next;
|
||||
safefree(help_ptr->command);
|
||||
while (help_ptr->text) {
|
||||
@@ -5823,7 +5823,7 @@ int _conf_help(ConfigFile *conf, ConfigEntry *ce)
|
||||
{
|
||||
ConfigEntry *cep;
|
||||
ConfigItem_help *ca;
|
||||
aMotdLine *last = NULL, *temp;
|
||||
MOTDLine *last = NULL, *temp;
|
||||
ca = MyMallocEx(sizeof(ConfigItem_help));
|
||||
|
||||
if (!ce->ce_vardata)
|
||||
@@ -5833,7 +5833,7 @@ int _conf_help(ConfigFile *conf, ConfigEntry *ce)
|
||||
|
||||
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
|
||||
{
|
||||
temp = MyMallocEx(sizeof(aMotdLine));
|
||||
temp = MyMallocEx(sizeof(MOTDLine));
|
||||
temp->line = strdup(cep->ce_varname);
|
||||
temp->next = NULL;
|
||||
if (!last)
|
||||
|
||||
+15
-15
@@ -260,7 +260,7 @@ void siphash_generate_key(char *k)
|
||||
static struct list_head clientTable[NICK_HASH_TABLE_SIZE];
|
||||
static struct list_head idTable[NICK_HASH_TABLE_SIZE];
|
||||
static Channel *channelTable[CHAN_HASH_TABLE_SIZE];
|
||||
static aWatch *watchTable[WATCH_HASH_TABLE_SIZE];
|
||||
static Watch *watchTable[WATCH_HASH_TABLE_SIZE];
|
||||
|
||||
static char siphashkey_nick[SIPHASH_KEY_LENGTH];
|
||||
static char siphashkey_chan[SIPHASH_KEY_LENGTH];
|
||||
@@ -586,7 +586,7 @@ Channel *hash_get_chan_bucket(uint64_t hashv)
|
||||
void count_watch_memory(int *count, u_long *memory)
|
||||
{
|
||||
int i = WATCH_HASH_TABLE_SIZE;
|
||||
aWatch *anptr;
|
||||
Watch *anptr;
|
||||
|
||||
while (i--)
|
||||
{
|
||||
@@ -594,7 +594,7 @@ void count_watch_memory(int *count, u_long *memory)
|
||||
while (anptr)
|
||||
{
|
||||
(*count)++;
|
||||
(*memory) += sizeof(aWatch)+strlen(anptr->nick);
|
||||
(*memory) += sizeof(Watch)+strlen(anptr->nick);
|
||||
anptr = anptr->hnext;
|
||||
}
|
||||
}
|
||||
@@ -606,7 +606,7 @@ void count_watch_memory(int *count, u_long *memory)
|
||||
int add_to_watch_hash_table(char *nick, Client *cptr, int awaynotify)
|
||||
{
|
||||
unsigned int hashv;
|
||||
aWatch *anptr;
|
||||
Watch *anptr;
|
||||
Link *lp;
|
||||
|
||||
|
||||
@@ -614,13 +614,13 @@ int add_to_watch_hash_table(char *nick, Client *cptr, int awaynotify)
|
||||
hashv = hash_watch_nick_name(nick);
|
||||
|
||||
/* Find the right nick (header) in the bucket, or NULL... */
|
||||
if ((anptr = (aWatch *)watchTable[hashv]))
|
||||
if ((anptr = (Watch *)watchTable[hashv]))
|
||||
while (anptr && mycmp(anptr->nick, nick))
|
||||
anptr = anptr->hnext;
|
||||
|
||||
/* If found NULL (no header for this nick), make one... */
|
||||
if (!anptr) {
|
||||
anptr = (aWatch *)MyMallocEx(sizeof(aWatch)+strlen(nick));
|
||||
anptr = (Watch *)MyMallocEx(sizeof(Watch)+strlen(nick));
|
||||
anptr->lasttime = timeofday;
|
||||
strcpy(anptr->nick, nick);
|
||||
|
||||
@@ -659,7 +659,7 @@ int add_to_watch_hash_table(char *nick, Client *cptr, int awaynotify)
|
||||
int hash_check_watch(Client *cptr, int reply)
|
||||
{
|
||||
unsigned int hashv;
|
||||
aWatch *anptr;
|
||||
Watch *anptr;
|
||||
Link *lp;
|
||||
int awaynotify = 0;
|
||||
|
||||
@@ -671,7 +671,7 @@ int hash_check_watch(Client *cptr, int reply)
|
||||
hashv = hash_watch_nick_name(cptr->name);
|
||||
|
||||
/* Find the right header in this bucket */
|
||||
if ((anptr = (aWatch *)watchTable[hashv]))
|
||||
if ((anptr = (Watch *)watchTable[hashv]))
|
||||
while (anptr && mycmp(anptr->nick, cptr->name))
|
||||
anptr = anptr->hnext;
|
||||
if (!anptr)
|
||||
@@ -721,14 +721,14 @@ int hash_check_watch(Client *cptr, int reply)
|
||||
/*
|
||||
* hash_get_watch
|
||||
*/
|
||||
aWatch *hash_get_watch(char *nick)
|
||||
Watch *hash_get_watch(char *nick)
|
||||
{
|
||||
unsigned int hashv;
|
||||
aWatch *anptr;
|
||||
Watch *anptr;
|
||||
|
||||
hashv = hash_watch_nick_name(nick);
|
||||
|
||||
if ((anptr = (aWatch *)watchTable[hashv]))
|
||||
if ((anptr = (Watch *)watchTable[hashv]))
|
||||
while (anptr && mycmp(anptr->nick, nick))
|
||||
anptr = anptr->hnext;
|
||||
|
||||
@@ -741,14 +741,14 @@ aWatch *hash_get_watch(char *nick)
|
||||
int del_from_watch_hash_table(char *nick, Client *cptr)
|
||||
{
|
||||
unsigned int hashv;
|
||||
aWatch *anptr, *nlast = NULL;
|
||||
Watch *anptr, *nlast = NULL;
|
||||
Link *lp, *last = NULL;
|
||||
|
||||
/* Get the bucket for this nick... */
|
||||
hashv = hash_watch_nick_name(nick);
|
||||
|
||||
/* Find the right header, maintaining last-link pointer... */
|
||||
if ((anptr = (aWatch *)watchTable[hashv]))
|
||||
if ((anptr = (Watch *)watchTable[hashv]))
|
||||
while (anptr && mycmp(anptr->nick, nick)) {
|
||||
nlast = anptr;
|
||||
anptr = anptr->hnext;
|
||||
@@ -817,7 +817,7 @@ int del_from_watch_hash_table(char *nick, Client *cptr)
|
||||
int hash_del_watch_list(Client *cptr)
|
||||
{
|
||||
unsigned int hashv;
|
||||
aWatch *anptr;
|
||||
Watch *anptr;
|
||||
Link *np, *lp, *last;
|
||||
|
||||
|
||||
@@ -852,7 +852,7 @@ int hash_del_watch_list(Client *cptr)
|
||||
* remove it. Need to find the last-pointer!
|
||||
*/
|
||||
if (!anptr->watch) {
|
||||
aWatch *np2, *nl;
|
||||
Watch *np2, *nl;
|
||||
|
||||
hashv = hash_watch_nick_name(anptr->nick);
|
||||
|
||||
|
||||
+7
-7
@@ -869,14 +869,14 @@ int InitUnrealIRCd(int argc, char *argv[])
|
||||
|
||||
init_random(); /* needs to be done very early!! */
|
||||
|
||||
memset(&botmotd, '\0', sizeof(aMotdFile));
|
||||
memset(&rules, '\0', sizeof(aMotdFile));
|
||||
memset(&opermotd, '\0', sizeof(aMotdFile));
|
||||
memset(&motd, '\0', sizeof(aMotdFile));
|
||||
memset(&smotd, '\0', sizeof(aMotdFile));
|
||||
memset(&svsmotd, '\0', sizeof(aMotdFile));
|
||||
memset(&botmotd, '\0', sizeof(MOTDFile));
|
||||
memset(&rules, '\0', sizeof(MOTDFile));
|
||||
memset(&opermotd, '\0', sizeof(MOTDFile));
|
||||
memset(&motd, '\0', sizeof(MOTDFile));
|
||||
memset(&smotd, '\0', sizeof(MOTDFile));
|
||||
memset(&svsmotd, '\0', sizeof(MOTDFile));
|
||||
memset(&me, 0, sizeof(me));
|
||||
me.local = MyMallocEx(sizeof(aLocalClient));
|
||||
me.local = MyMallocEx(sizeof(LocalClient));
|
||||
memset(&loop, 0, sizeof(loop));
|
||||
|
||||
init_hash();
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@
|
||||
|
||||
// FIXME: with so little here, why have a file for it? Move it!
|
||||
|
||||
MODVAR aTKline *tklines[TKLISTLEN];
|
||||
MODVAR aTKline *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2];
|
||||
MODVAR TKL *tklines[TKLISTLEN];
|
||||
MODVAR TKL *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2];
|
||||
int MODVAR spamf_ugly_vchanoverride = 0;
|
||||
|
||||
void tkl_init(void)
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ Client *make_client(Client *from, Client *servr)
|
||||
/* Local client */
|
||||
const char *id;
|
||||
|
||||
cptr->local = MyMallocEx(sizeof(aLocalClient));
|
||||
cptr->local = MyMallocEx(sizeof(LocalClient));
|
||||
|
||||
INIT_LIST_HEAD(&cptr->lclient_node);
|
||||
INIT_LIST_HEAD(&cptr->special_node);
|
||||
|
||||
+11
-11
@@ -493,8 +493,8 @@ void FreeModObj(ModuleObject *obj, Module *m)
|
||||
else if (obj->type == MOBJ_CMODE) {
|
||||
CmodeDel(obj->object.cmode);
|
||||
}
|
||||
else if (obj->type == MOBJ_CMDOVERRIDE) {
|
||||
CmdoverrideDel(obj->object.cmdoverride);
|
||||
else if (obj->type == MOBJ_COMMANDOVERRIDE) {
|
||||
CommandOverrideDel(obj->object.cmdoverride);
|
||||
}
|
||||
else if (obj->type == MOBJ_EXTBAN) {
|
||||
ExtbanDel(obj->object.extban);
|
||||
@@ -1125,10 +1125,10 @@ Callback *CallbackDel(Callback *cb)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Cmdoverride *CmdoverrideAddEx(Module *module, char *name, int priority, OverrideCmdFunc function)
|
||||
CommandOverride *CommandOverrideAddEx(Module *module, char *name, int priority, OverrideCmdFunc function)
|
||||
{
|
||||
RealCommand *p;
|
||||
Cmdoverride *ovr;
|
||||
CommandOverride *ovr;
|
||||
|
||||
if (!(p = find_Command_simple(name)))
|
||||
{
|
||||
@@ -1145,14 +1145,14 @@ Cmdoverride *CmdoverrideAddEx(Module *module, char *name, int priority, Override
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
ovr = MyMallocEx(sizeof(Cmdoverride));
|
||||
ovr = MyMallocEx(sizeof(CommandOverride));
|
||||
ovr->func = function;
|
||||
ovr->owner = module; /* TODO: module objects */
|
||||
ovr->priority = priority;
|
||||
if (module)
|
||||
{
|
||||
ModuleObject *cmdoverobj = MyMallocEx(sizeof(ModuleObject));
|
||||
cmdoverobj->type = MOBJ_CMDOVERRIDE;
|
||||
cmdoverobj->type = MOBJ_COMMANDOVERRIDE;
|
||||
cmdoverobj->object.cmdoverride = ovr;
|
||||
AddListItem(cmdoverobj, module->objects);
|
||||
module->errorcode = MODERR_NOERROR;
|
||||
@@ -1170,12 +1170,12 @@ Cmdoverride *CmdoverrideAddEx(Module *module, char *name, int priority, Override
|
||||
return ovr;
|
||||
}
|
||||
|
||||
Cmdoverride *CmdoverrideAdd(Module *module, char *name, OverrideCmdFunc function)
|
||||
CommandOverride *CommandOverrideAdd(Module *module, char *name, OverrideCmdFunc function)
|
||||
{
|
||||
return CmdoverrideAddEx(module, name, 0, function);
|
||||
return CommandOverrideAddEx(module, name, 0, function);
|
||||
}
|
||||
|
||||
void CmdoverrideDel(Cmdoverride *cmd)
|
||||
void CommandOverrideDel(CommandOverride *cmd)
|
||||
{
|
||||
if (!cmd->next)
|
||||
cmd->command->overridetail = cmd->prev;
|
||||
@@ -1193,7 +1193,7 @@ void CmdoverrideDel(Cmdoverride *cmd)
|
||||
ModuleObject *obj;
|
||||
for (obj = cmd->owner->objects; obj; obj = obj->next)
|
||||
{
|
||||
if (obj->type != MOBJ_CMDOVERRIDE)
|
||||
if (obj->type != MOBJ_COMMANDOVERRIDE)
|
||||
continue;
|
||||
if (obj->object.cmdoverride == cmd)
|
||||
{
|
||||
@@ -1206,7 +1206,7 @@ void CmdoverrideDel(Cmdoverride *cmd)
|
||||
MyFree(cmd);
|
||||
}
|
||||
|
||||
int CallCmdoverride(Cmdoverride *ovr, Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[])
|
||||
int CallCommandOverride(CommandOverride *ovr, Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[])
|
||||
{
|
||||
if (ovr->next)
|
||||
return ovr->next->func(ovr->next, cptr, sptr, mtags, parc, parv);
|
||||
|
||||
@@ -177,7 +177,7 @@ CMD_OVERRIDE_FUNC(override_msg)
|
||||
if (!MyClient(sptr) || (parc < 3) || BadPtr(parv[2]))
|
||||
{
|
||||
/* Short circuit for: remote clients or insufficient parameters */
|
||||
return CallCmdoverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
return CallCommandOverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
}
|
||||
|
||||
score = lookalikespam_score(StripControlCodes(parv[2]));
|
||||
@@ -202,7 +202,7 @@ CMD_OVERRIDE_FUNC(override_msg)
|
||||
}
|
||||
}
|
||||
|
||||
return CallCmdoverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
return CallCommandOverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
}
|
||||
|
||||
/*** rest is module and config stuff ****/
|
||||
@@ -224,10 +224,10 @@ MOD_INIT(antimixedutf8)
|
||||
|
||||
MOD_LOAD(antimixedutf8)
|
||||
{
|
||||
if (!CmdoverrideAdd(modinfo->handle, "PRIVMSG", override_msg))
|
||||
if (!CommandOverrideAdd(modinfo->handle, "PRIVMSG", override_msg))
|
||||
return MOD_FAILED;
|
||||
|
||||
if (!CmdoverrideAdd(modinfo->handle, "NOTICE", override_msg))
|
||||
if (!CommandOverrideAdd(modinfo->handle, "NOTICE", override_msg))
|
||||
return MOD_FAILED;
|
||||
|
||||
return MOD_SUCCESS;
|
||||
|
||||
@@ -60,7 +60,7 @@ int authprompt_require_sasl(Client *acptr, char *reason);
|
||||
int authprompt_sasl_continuation(Client *acptr, char *buf);
|
||||
int authprompt_sasl_result(Client *acptr, int success);
|
||||
int authprompt_place_host_ban(Client *sptr, int action, char *reason, long duration);
|
||||
int authprompt_find_tkline_match(Client *sptr, aTKline *tk);
|
||||
int authprompt_find_tkline_match(Client *sptr, TKL *tk);
|
||||
int authprompt_pre_connect(Client *sptr);
|
||||
CMD_FUNC(m_auth);
|
||||
void authprompt_md_free(ModData *md);
|
||||
@@ -448,7 +448,7 @@ int authprompt_place_host_ban(Client *sptr, int action, char *reason, long durat
|
||||
}
|
||||
|
||||
/** Called upon "check for KLINE/GLINE" */
|
||||
int authprompt_find_tkline_match(Client *sptr, aTKline *tkl)
|
||||
int authprompt_find_tkline_match(Client *sptr, TKL *tkl)
|
||||
{
|
||||
/* If it's a soft-xx action and the user is not logged in
|
||||
* and the user is not yet online, then we will handle this user.
|
||||
|
||||
@@ -57,7 +57,7 @@ MOD_UNLOAD(botmotd)
|
||||
*/
|
||||
CMD_FUNC(m_botmotd)
|
||||
{
|
||||
aMotdLine *motdline;
|
||||
MOTDLine *motdline;
|
||||
ConfigItem_tld *tld;
|
||||
|
||||
if (hunt_server(cptr, sptr, recv_mtags, ":%s BOTMOTD :%s", 1, parc, parv) != HUNTED_ISME)
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ ConfigItem_help *Find_Help(char *command)
|
||||
int parse_help(Client *sptr, char *name, char *help)
|
||||
{
|
||||
ConfigItem_help *helpitem;
|
||||
aMotdLine *text;
|
||||
MOTDLine *text;
|
||||
if (BadPtr(help))
|
||||
{
|
||||
helpitem = Find_Help(NULL);
|
||||
|
||||
@@ -95,10 +95,10 @@ MOD_INIT(hideserver)
|
||||
|
||||
MOD_LOAD(hideserver)
|
||||
{
|
||||
if (!CmdoverrideAdd(MyMod, "MAP", override_map))
|
||||
if (!CommandOverrideAdd(MyMod, "MAP", override_map))
|
||||
return MOD_FAILED;
|
||||
|
||||
if (!CmdoverrideAdd(MyMod, "LINKS", override_links))
|
||||
if (!CommandOverrideAdd(MyMod, "LINKS", override_links))
|
||||
return MOD_FAILED;
|
||||
|
||||
return MOD_SUCCESS;
|
||||
@@ -326,7 +326,7 @@ CMD_OVERRIDE_FUNC(override_map)
|
||||
parv[1] = "*";
|
||||
|
||||
if (IsOper(sptr))
|
||||
return CallCmdoverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
return CallCommandOverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
|
||||
if (Settings.disable_map)
|
||||
{
|
||||
@@ -366,7 +366,7 @@ CMD_OVERRIDE_FUNC(override_links)
|
||||
int flat = (FLAT_MAP && !IsOper(sptr)) ? 1 : 0;
|
||||
|
||||
if (IsOper(sptr))
|
||||
return CallCmdoverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
return CallCommandOverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
|
||||
if (Settings.disable_links)
|
||||
{
|
||||
|
||||
+1
-1
@@ -370,7 +370,7 @@ int _do_join(Client *cptr, Client *sptr, int parc, char *parv[])
|
||||
char *name, *key = NULL;
|
||||
int i, flags = 0, ishold;
|
||||
char *p = NULL, *p2 = NULL;
|
||||
aTKline *tklban;
|
||||
TKL *tklban;
|
||||
int ntargets = 0;
|
||||
int maxtargets = max_targets_for_command("JOIN");
|
||||
|
||||
|
||||
+4
-4
@@ -74,7 +74,7 @@ CMD_FUNC(m_list)
|
||||
Channel *chptr;
|
||||
time_t currenttime = TStime();
|
||||
char *name, *p = NULL;
|
||||
LOpts *lopt = NULL;
|
||||
ChannelListOptions *lopt = NULL;
|
||||
Link *lp;
|
||||
int usermax, usermin, error = 0, doall = 0;
|
||||
time_t chantimemin, chantimemax;
|
||||
@@ -120,7 +120,7 @@ CMD_FUNC(m_list)
|
||||
{
|
||||
|
||||
sendnumeric(sptr, RPL_LISTSTART);
|
||||
lopt = sptr->user->lopt = MyMallocEx(sizeof(LOpts));
|
||||
lopt = sptr->user->lopt = MyMallocEx(sizeof(ChannelListOptions));
|
||||
lopt->showall = 1;
|
||||
|
||||
if (DBufLength(&cptr->local->sendQ) < 2048)
|
||||
@@ -256,7 +256,7 @@ CMD_FUNC(m_list)
|
||||
|
||||
if (doall)
|
||||
{
|
||||
lopt = sptr->user->lopt = MyMallocEx(sizeof(LOpts));
|
||||
lopt = sptr->user->lopt = MyMallocEx(sizeof(ChannelListOptions));
|
||||
lopt->usermin = usermin;
|
||||
lopt->usermax = usermax;
|
||||
lopt->topictimemax = topictimemax;
|
||||
@@ -285,7 +285,7 @@ CMD_FUNC(m_list)
|
||||
void _send_list(Client *cptr)
|
||||
{
|
||||
Channel *chptr;
|
||||
LOpts *lopt = cptr->user->lopt;
|
||||
ChannelListOptions *lopt = cptr->user->lopt;
|
||||
unsigned int hashnum;
|
||||
int numsend = (get_sendq(cptr) / 768) + 1; /* (was previously hard-coded) */
|
||||
/* ^
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ MOD_UNLOAD(motd)
|
||||
CMD_FUNC(m_motd)
|
||||
{
|
||||
ConfigItem_tld *ptr;
|
||||
aMotdFile *themotd;
|
||||
aMotdLine *motdline;
|
||||
MOTDFile *themotd;
|
||||
MOTDLine *motdline;
|
||||
int svsnofile = 0;
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -261,7 +261,7 @@ void nick_collision(Client *cptr, char *newnick, char *newid, Client *new, Clien
|
||||
*/
|
||||
CMD_FUNC(m_uid)
|
||||
{
|
||||
aTKline *tklban;
|
||||
TKL *tklban;
|
||||
int ishold;
|
||||
Client *acptr, *serv = NULL;
|
||||
Client *acptrs;
|
||||
@@ -567,7 +567,7 @@ nickkill2done:
|
||||
*/
|
||||
CMD_FUNC(m_nick)
|
||||
{
|
||||
aTKline *tklban;
|
||||
TKL *tklban;
|
||||
int ishold;
|
||||
Client *acptr, *serv = NULL;
|
||||
Client *acptrs;
|
||||
@@ -1216,7 +1216,7 @@ int _register_user(Client *cptr, Client *sptr, char *nick, char *username, char
|
||||
NULL, /*7 set_at */
|
||||
NULL /*8 reason */
|
||||
};
|
||||
aTKline *savetkl = NULL;
|
||||
TKL *savetkl = NULL;
|
||||
ConfigItem_tld *tlds;
|
||||
cptr->local->last = TStime();
|
||||
nick = sptr->name; /* <- The data is always the same, but the pointer is sometimes not,
|
||||
|
||||
@@ -57,7 +57,7 @@ MOD_UNLOAD(opermotd)
|
||||
*/
|
||||
CMD_FUNC(m_opermotd)
|
||||
{
|
||||
aMotdLine *motdline;
|
||||
MOTDLine *motdline;
|
||||
ConfigItem_tld *tld;
|
||||
|
||||
if (!ValidatePermissionsForPath("server:opermotd",sptr,NULL,NULL,NULL))
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ MOD_UNLOAD(pass)
|
||||
/** Handles zlines/gzlines/throttling/unknown connections */
|
||||
int _check_banned(Client *cptr, int exitflags)
|
||||
{
|
||||
aTKline *tk;
|
||||
TKL *tk;
|
||||
ConfigItem_ban *bconf;
|
||||
|
||||
if ((tk = find_tkline_match_zap(cptr)))
|
||||
|
||||
@@ -249,7 +249,7 @@ int rcmd_configrun(ConfigFile *cf, ConfigEntry *ce, int type)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!CmdoverrideAdd(ModInf.handle, cmd, rcmd_override))
|
||||
if (!CommandOverrideAdd(ModInf.handle, cmd, rcmd_override))
|
||||
{
|
||||
config_warn("[restrict-commands] Failed to add override for '%s' (NO RESTRICTIONS APPLY)", cmd);
|
||||
continue;
|
||||
@@ -351,7 +351,7 @@ CMD_OVERRIDE_FUNC(rcmd_override)
|
||||
RestrictedCmd *rcmd;
|
||||
|
||||
if (!MyClient(sptr) || !sptr->local || IsOper(sptr) || IsULine(sptr))
|
||||
return CallCmdoverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
return CallCommandOverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
|
||||
rcmd = find_restrictions_bycmd(ovr->command->cmd);
|
||||
if (rcmd)
|
||||
@@ -369,5 +369,5 @@ CMD_OVERRIDE_FUNC(rcmd_override)
|
||||
}
|
||||
|
||||
// No restrictions apply, process command as normal =]
|
||||
return CallCmdoverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
return CallCommandOverride(ovr, cptr, sptr, recv_mtags, parc, parv);
|
||||
}
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ typedef struct {
|
||||
static int dump_str(Client *sptr, char **buf);
|
||||
static TKLType *find_TKLType_by_flag(char flag);
|
||||
void rmtkl_check_options(char *param, int *skipperm, int *silent);
|
||||
int rmtkl_tryremove(Client *sptr, Client *cptr, TKLType *tkltype, aTKline *tkl, char *uhmask, char *commentmask, int skipperm, int silent);
|
||||
int rmtkl_tryremove(Client *sptr, Client *cptr, TKLType *tkltype, TKL *tkl, char *uhmask, char *commentmask, int skipperm, int silent);
|
||||
CMD_FUNC(rmtkl);
|
||||
|
||||
TKLType tkl_types[] = {
|
||||
@@ -134,7 +134,7 @@ void rmtkl_check_options(char *param, int *skipperm, int *silent) {
|
||||
*silent = 1;
|
||||
}
|
||||
|
||||
int rmtkl_tryremove(Client *sptr, Client *cptr, TKLType *tkltype, aTKline *tkl, char *uhmask, char *commentmask, int skipperm, int silent)
|
||||
int rmtkl_tryremove(Client *sptr, Client *cptr, TKLType *tkltype, TKL *tkl, char *uhmask, char *commentmask, int skipperm, int silent)
|
||||
{
|
||||
char *timeret;
|
||||
char gmt[256];
|
||||
@@ -184,7 +184,7 @@ int rmtkl_tryremove(Client *sptr, Client *cptr, TKLType *tkltype, aTKline *tkl,
|
||||
}
|
||||
|
||||
CMD_FUNC(rmtkl) {
|
||||
aTKline *tkl, *next;
|
||||
TKL *tkl, *next;
|
||||
TKLType *tkltype;
|
||||
char *types, *uhmask, *commentmask, *p;
|
||||
char tklchar;
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ MOD_UNLOAD(rules)
|
||||
CMD_FUNC(m_rules)
|
||||
{
|
||||
ConfigItem_tld *ptr;
|
||||
aMotdLine *temp;
|
||||
MOTDLine *temp;
|
||||
|
||||
temp = NULL;
|
||||
|
||||
|
||||
+6
-6
@@ -48,7 +48,7 @@ ModuleHeader MOD_HEADER(staff)
|
||||
#define ircfree(x) do { if (x) MyFree(x); x = NULL; } while(0)
|
||||
|
||||
/* Forward declarations */
|
||||
static void unload_motd_file(aMotdFile *list);
|
||||
static void unload_motd_file(MOTDFile *list);
|
||||
CMD_FUNC(m_staff);
|
||||
static int cb_rehashflag(Client *cptr, Client *sptr, char *flag);
|
||||
static int cb_test(ConfigFile *, ConfigEntry *, int, int *);
|
||||
@@ -62,7 +62,7 @@ static void download_staff_file_complete(char *url, char *file, char *errorbuf,
|
||||
static void InitConf();
|
||||
static void FreeConf();
|
||||
|
||||
static aMotdFile staff;
|
||||
static MOTDFile staff;
|
||||
static char *staff_file;
|
||||
|
||||
#ifdef USE_LIBCURL
|
||||
@@ -246,9 +246,9 @@ static void download_staff_file_complete(char *url, char *file, char *errorbuf,
|
||||
}
|
||||
#endif
|
||||
|
||||
static void unload_motd_file(aMotdFile *list)
|
||||
static void unload_motd_file(MOTDFile *list)
|
||||
{
|
||||
aMotdLine *old, *new;
|
||||
MOTDLine *old, *new;
|
||||
|
||||
if (!list)
|
||||
return;
|
||||
@@ -364,8 +364,8 @@ static int cb_rehashflag(Client *cptr, Client *sptr, char *flag)
|
||||
/** The routine that actual does the /STAFF command */
|
||||
CMD_FUNC(m_staff)
|
||||
{
|
||||
aMotdFile *temp;
|
||||
aMotdLine *aLine;
|
||||
MOTDFile *temp;
|
||||
MOTDLine *aLine;
|
||||
|
||||
if (!IsPerson(sptr))
|
||||
return -1;
|
||||
|
||||
+2
-2
@@ -866,7 +866,7 @@ int stats_mem(Client *sptr, char *para)
|
||||
(long)(sizeof(struct list_head) * NICK_HASH_TABLE_SIZE),
|
||||
CHAN_HASH_TABLE_SIZE,
|
||||
(long)(sizeof(Channel *) * CHAN_HASH_TABLE_SIZE), WATCH_HASH_TABLE_SIZE,
|
||||
(long)(sizeof(aWatch *) * WATCH_HASH_TABLE_SIZE));
|
||||
(long)(sizeof(Watch *) * WATCH_HASH_TABLE_SIZE));
|
||||
|
||||
for (link = freelink; link; link = link->next)
|
||||
fl++;
|
||||
@@ -881,7 +881,7 @@ int stats_mem(Client *sptr, char *para)
|
||||
tot += fl * sizeof(Link);
|
||||
tot += sizeof(struct list_head) * NICK_HASH_TABLE_SIZE;
|
||||
tot += sizeof(Channel *) * CHAN_HASH_TABLE_SIZE;
|
||||
tot += sizeof(aWatch *) * WATCH_HASH_TABLE_SIZE;
|
||||
tot += sizeof(Watch *) * WATCH_HASH_TABLE_SIZE;
|
||||
|
||||
sendnumericfmt(sptr, RPL_STATSDEBUG, "Total: ww %ld ch %ld cl %ld co %ld db %ld",
|
||||
totww, totch, totcl, com, db);
|
||||
|
||||
+81
-81
@@ -51,44 +51,44 @@ int m_tkl_line(Client *cptr, Client *sptr, int parc, char *parv[], char* type);
|
||||
int _tkl_hash(unsigned int c);
|
||||
char _tkl_typetochar(int type);
|
||||
int _tkl_chartotype(char c);
|
||||
char *_tkl_type_string(aTKline *tk);
|
||||
char *_tkl_type_string(TKL *tk);
|
||||
char *tkl_banexception_configname_to_chars(char *name);
|
||||
aTKline *_tkl_add_serverban(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
TKL *_tkl_add_serverban(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int soft, int flags);
|
||||
aTKline *_tkl_add_banexception(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
TKL *_tkl_add_banexception(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int soft, char *bantypes, int flags);
|
||||
aTKline *_tkl_add_nameban(int type, char *name, int hold, char *reason, char *set_by,
|
||||
TKL *_tkl_add_nameban(int type, char *name, int hold, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int flags);
|
||||
aTKline *_tkl_add_spamfilter(int type, unsigned short target, unsigned short action, Match *match, char *set_by,
|
||||
TKL *_tkl_add_spamfilter(int type, unsigned short target, unsigned short action, Match *match, char *set_by,
|
||||
time_t expire_at, time_t set_at,
|
||||
time_t spamf_tkl_duration, char *spamf_tkl_reason,
|
||||
int flags);
|
||||
void _sendnotice_tkl_del(char *removed_by, aTKline *tkl);
|
||||
void _sendnotice_tkl_add(aTKline *tkl);
|
||||
void _free_tkl(aTKline *tkl);
|
||||
void _tkl_del_line(aTKline *tkl);
|
||||
static void _tkl_check_local_remove_shun(aTKline *tmp);
|
||||
void tkl_expire_entry(aTKline * tmp);
|
||||
void _sendnotice_tkl_del(char *removed_by, TKL *tkl);
|
||||
void _sendnotice_tkl_add(TKL *tkl);
|
||||
void _free_tkl(TKL *tkl);
|
||||
void _tkl_del_line(TKL *tkl);
|
||||
static void _tkl_check_local_remove_shun(TKL *tmp);
|
||||
void tkl_expire_entry(TKL * tmp);
|
||||
EVENT(tkl_check_expire);
|
||||
int _find_tkline_match(Client *cptr, int skip_soft);
|
||||
int _find_shun(Client *cptr);
|
||||
int _find_spamfilter_user(Client *sptr, int flags);
|
||||
aTKline *_find_qline(Client *cptr, char *nick, int *ishold);
|
||||
aTKline *_find_tkline_match_zap(Client *cptr);
|
||||
TKL *_find_qline(Client *cptr, char *nick, int *ishold);
|
||||
TKL *_find_tkline_match_zap(Client *cptr);
|
||||
void _tkl_stats(Client *cptr, int type, char *para);
|
||||
void _tkl_synch(Client *sptr);
|
||||
CMD_FUNC(_m_tkl);
|
||||
int _place_host_ban(Client *sptr, BanAction action, char *reason, long duration);
|
||||
int _run_spamfilter(Client *sptr, char *str_in, int type, char *target, int flags, aTKline **rettk);
|
||||
int _join_viruschan(Client *sptr, aTKline *tk, int type);
|
||||
int _run_spamfilter(Client *sptr, char *str_in, int type, char *target, int flags, TKL **rettk);
|
||||
int _join_viruschan(Client *sptr, TKL *tk, int type);
|
||||
void _spamfilter_build_user_string(char *buf, char *nick, Client *acptr);
|
||||
int _match_user(char *rmask, Client *acptr, int options);
|
||||
int _tkl_ip_hash(char *ip);
|
||||
int _tkl_ip_hash_type(int type);
|
||||
aTKline *_find_tkl_serverban(int type, char *usermask, char *hostmask, int softban);
|
||||
aTKline *_find_tkl_banexception(int type, char *usermask, char *hostmask, int softban);
|
||||
aTKline *_find_tkl_nameban(int type, char *name, int hold);
|
||||
aTKline *_find_tkl_spamfilter(int type, char *match_string, unsigned short action, unsigned short target);
|
||||
TKL *_find_tkl_serverban(int type, char *usermask, char *hostmask, int softban);
|
||||
TKL *_find_tkl_banexception(int type, char *usermask, char *hostmask, int softban);
|
||||
TKL *_find_tkl_nameban(int type, char *name, int hold);
|
||||
TKL *_find_tkl_spamfilter(int type, char *match_string, unsigned short action, unsigned short target);
|
||||
int _find_tkl_exception(int ban_type, Client *cptr);
|
||||
|
||||
/* Externals (only for us :D) */
|
||||
@@ -425,7 +425,7 @@ int tkl_config_run_spamfilter(ConfigFile *cf, ConfigEntry *ce, int type)
|
||||
{
|
||||
ConfigEntry *cep;
|
||||
ConfigEntry *cepp;
|
||||
aTKline *tk;
|
||||
TKL *tk;
|
||||
char *word = NULL, *reason = NULL;
|
||||
time_t bantime = (SPAMFILTER_BAN_TIME ? SPAMFILTER_BAN_TIME : 86400);
|
||||
char *banreason = "<internally added by ircd>";
|
||||
@@ -847,8 +847,8 @@ int tkl_config_run_except(ConfigFile *cf, ConfigEntry *ce, int configtype)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Return unique spamfilter id for aTKline */
|
||||
char *spamfilter_id(aTKline *tk)
|
||||
/** Return unique spamfilter id for TKL */
|
||||
char *spamfilter_id(TKL *tk)
|
||||
{
|
||||
static char buf[128];
|
||||
|
||||
@@ -1046,7 +1046,7 @@ CMD_FUNC(m_kline)
|
||||
void tkl_general_stats(Client *sptr)
|
||||
{
|
||||
int index, index2;
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int total = 0;
|
||||
int subtotal;
|
||||
|
||||
@@ -1600,7 +1600,7 @@ int spamfilter_new_usage(Client *cptr, Client *sptr, char *parv[])
|
||||
int spamfilter_del_by_id(Client *sptr, char *id)
|
||||
{
|
||||
int index;
|
||||
aTKline *tk;
|
||||
TKL *tk;
|
||||
int found = 0;
|
||||
char mo[32], mo2[32];
|
||||
char *tkllayer[13] = {
|
||||
@@ -1927,7 +1927,7 @@ char *tkl_banexception_configname_to_chars(char *name)
|
||||
}
|
||||
|
||||
/** Show TKL type as a string (used when adding/removing) */
|
||||
char *_tkl_type_string(aTKline *tkl)
|
||||
char *_tkl_type_string(TKL *tkl)
|
||||
{
|
||||
static char txt[256];
|
||||
|
||||
@@ -1950,7 +1950,7 @@ char *_tkl_type_string(aTKline *tkl)
|
||||
return txt;
|
||||
}
|
||||
|
||||
int tkl_banexception_matches_type(aTKline *except, int bantype)
|
||||
int tkl_banexception_matches_type(TKL *except, int bantype)
|
||||
{
|
||||
char *p;
|
||||
int extype;
|
||||
@@ -2018,7 +2018,7 @@ int _tkl_ip_hash(char *ip)
|
||||
}
|
||||
|
||||
// TODO: consider efunc
|
||||
int tkl_ip_hash_tkl(aTKline *tkl)
|
||||
int tkl_ip_hash_tkl(TKL *tkl)
|
||||
{
|
||||
if (TKLIsServerBan(tkl))
|
||||
return tkl_ip_hash(tkl->ptr.serverban->hostmask);
|
||||
@@ -2049,7 +2049,7 @@ int _tkl_ip_hash_type(int type)
|
||||
* This is simply a helper that is used at 3 places and I hate duplicate code.
|
||||
* NOTE: this function may return NULL.
|
||||
*/
|
||||
aTKline *tkl_find_head(char type, char *hostmask, aTKline *def)
|
||||
TKL *tkl_find_head(char type, char *hostmask, TKL *def)
|
||||
{
|
||||
int index, index2;
|
||||
|
||||
@@ -2082,18 +2082,18 @@ aTKline *tkl_find_head(char type, char *hostmask, aTKline *def)
|
||||
* @returns The TKL entry, or NULL in case of a problem,
|
||||
* such as a regex failing to compile, memory problem, ..
|
||||
*/
|
||||
aTKline *_tkl_add_spamfilter(int type, unsigned short target, unsigned short action, Match *match, char *set_by,
|
||||
TKL *_tkl_add_spamfilter(int type, unsigned short target, unsigned short action, Match *match, char *set_by,
|
||||
time_t expire_at, time_t set_at,
|
||||
time_t tkl_duration, char *tkl_reason,
|
||||
int flags)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int index;
|
||||
|
||||
if (!(type & TKL_SPAMF))
|
||||
abort();
|
||||
|
||||
tkl = MyMallocEx(sizeof(aTKline));
|
||||
tkl = MyMallocEx(sizeof(TKL));
|
||||
/* First the common fields */
|
||||
tkl->type = type;
|
||||
tkl->flags = flags;
|
||||
@@ -2137,16 +2137,16 @@ aTKline *_tkl_add_spamfilter(int type, unsigned short target, unsigned short act
|
||||
* Be sure not to call this function for spamfilters,
|
||||
* qlines or exempts, which have their own function!
|
||||
*/
|
||||
aTKline *_tkl_add_serverban(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
TKL *_tkl_add_serverban(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int soft, int flags)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int index, index2;
|
||||
|
||||
if (!TKLIsServerBanType(type))
|
||||
abort();
|
||||
|
||||
tkl = MyMallocEx(sizeof(aTKline));
|
||||
tkl = MyMallocEx(sizeof(TKL));
|
||||
/* First the common fields */
|
||||
tkl->type = type;
|
||||
tkl->flags = flags;
|
||||
@@ -2197,16 +2197,16 @@ aTKline *_tkl_add_serverban(int type, char *usermask, char *hostmask, char *reas
|
||||
* Be sure not to call this function for spamfilters,
|
||||
* qlines or exempts, which have their own function!
|
||||
*/
|
||||
aTKline *_tkl_add_banexception(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
TKL *_tkl_add_banexception(int type, char *usermask, char *hostmask, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int soft, char *bantypes, int flags)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int index, index2;
|
||||
|
||||
if (!TKLIsBanExceptionType(type))
|
||||
abort();
|
||||
|
||||
tkl = MyMallocEx(sizeof(aTKline));
|
||||
tkl = MyMallocEx(sizeof(TKL));
|
||||
/* First the common fields */
|
||||
tkl->type = type;
|
||||
tkl->flags = flags;
|
||||
@@ -2257,16 +2257,16 @@ aTKline *_tkl_add_banexception(int type, char *usermask, char *hostmask, char *r
|
||||
* Be sure not to call this function for spamfilters,
|
||||
* qlines or exempts, which have their own function!
|
||||
*/
|
||||
aTKline *_tkl_add_nameban(int type, char *name, int hold, char *reason, char *set_by,
|
||||
TKL *_tkl_add_nameban(int type, char *name, int hold, char *reason, char *set_by,
|
||||
time_t expire_at, time_t set_at, int flags)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int index, index2;
|
||||
|
||||
if (!TKLIsNameBanType(type))
|
||||
abort();
|
||||
|
||||
tkl = MyMallocEx(sizeof(aTKline));
|
||||
tkl = MyMallocEx(sizeof(TKL));
|
||||
/* First the common fields */
|
||||
tkl->type = type;
|
||||
tkl->flags = flags;
|
||||
@@ -2291,7 +2291,7 @@ aTKline *_tkl_add_nameban(int type, char *name, int hold, char *reason, char *se
|
||||
* (this assumes that it was not added yet or is already removed)
|
||||
* Most people will use tkl_del_line() instead.
|
||||
*/
|
||||
void _free_tkl(aTKline *tkl)
|
||||
void _free_tkl(TKL *tkl)
|
||||
{
|
||||
/* Free the entry */
|
||||
/* First, the common fields */
|
||||
@@ -2332,7 +2332,7 @@ void _free_tkl(aTKline *tkl)
|
||||
/** Delete a TKL entry from the list and free it.
|
||||
* @param tkl The TKL entry.
|
||||
*/
|
||||
void _tkl_del_line(aTKline *tkl)
|
||||
void _tkl_del_line(TKL *tkl)
|
||||
{
|
||||
int index, index2;
|
||||
int found = 0;
|
||||
@@ -2348,7 +2348,7 @@ void _tkl_del_line(aTKline *tkl)
|
||||
{
|
||||
#if 1
|
||||
/* Temporary validation until an rmtkl(?) bug is fixed */
|
||||
aTKline *d;
|
||||
TKL *d;
|
||||
int really_found = 0;
|
||||
for (d = tklines_ip_hash[index][index2]; d; d = d->next)
|
||||
if (d == tkl)
|
||||
@@ -2394,14 +2394,14 @@ void _tkl_del_line(aTKline *tkl)
|
||||
* removes shun from currently connected users affected by tmp.
|
||||
*/
|
||||
// TODO / FIXME: audit this function, it looks crazy
|
||||
void _tkl_check_local_remove_shun(aTKline *tmp)
|
||||
void _tkl_check_local_remove_shun(TKL *tmp)
|
||||
{
|
||||
long i;
|
||||
char *chost, *cname, *cip;
|
||||
int is_ip;
|
||||
Client *acptr;
|
||||
|
||||
aTKline *tk;
|
||||
TKL *tk;
|
||||
int keep_shun;
|
||||
|
||||
for (i = 0; i <= 5; i++)
|
||||
@@ -2457,7 +2457,7 @@ void _tkl_check_local_remove_shun(aTKline *tmp)
|
||||
/** Deal with expiration of a specific TKL entry.
|
||||
* This is a helper function for tkl_check_expire().
|
||||
*/
|
||||
void tkl_expire_entry(aTKline *tkl)
|
||||
void tkl_expire_entry(TKL *tkl)
|
||||
{
|
||||
char *whattype = tkl_type_string(tkl);
|
||||
|
||||
@@ -2504,7 +2504,7 @@ void tkl_expire_entry(aTKline *tkl)
|
||||
/** Regularly check TKL entries for expiration */
|
||||
EVENT(tkl_check_expire)
|
||||
{
|
||||
aTKline *tkl, *next;
|
||||
TKL *tkl, *next;
|
||||
time_t nowtime;
|
||||
int index, index2;
|
||||
|
||||
@@ -2541,7 +2541,7 @@ EVENT(tkl_check_expire)
|
||||
}
|
||||
|
||||
/* This is just a helper function for find_tkl_exception() */
|
||||
static int find_tkl_exception_matcher(Client *cptr, int ban_type, aTKline *except_tkl)
|
||||
static int find_tkl_exception_matcher(Client *cptr, int ban_type, TKL *except_tkl)
|
||||
{
|
||||
char uhost[NICKLEN+HOSTLEN+1];
|
||||
Hook *hook;
|
||||
@@ -2579,7 +2579,7 @@ static int find_tkl_exception_matcher(Client *cptr, int ban_type, aTKline *excep
|
||||
*/
|
||||
int _find_tkl_exception(int ban_type, Client *cptr)
|
||||
{
|
||||
aTKline *tkl, *ret;
|
||||
TKL *tkl, *ret;
|
||||
int index, index2;
|
||||
Hook *hook;
|
||||
|
||||
@@ -2614,7 +2614,7 @@ int _find_tkl_exception(int ban_type, Client *cptr)
|
||||
}
|
||||
|
||||
/** Helper function for find_tkline_match() */
|
||||
int find_tkline_match_matcher(Client *cptr, int skip_soft, aTKline *tkl)
|
||||
int find_tkline_match_matcher(Client *cptr, int skip_soft, TKL *tkl)
|
||||
{
|
||||
char uhost[NICKLEN+HOSTLEN+1];
|
||||
ConfigItem_except *excepts;
|
||||
@@ -2650,7 +2650,7 @@ int find_tkline_match_matcher(Client *cptr, int skip_soft, aTKline *tkl)
|
||||
*/
|
||||
int _find_tkline_match(Client *cptr, int skip_soft)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int banned = 0;
|
||||
int index, index2;
|
||||
|
||||
@@ -2717,7 +2717,7 @@ int _find_tkline_match(Client *cptr, int skip_soft)
|
||||
/** Check if user is shunned. Returns 2 in such a case (FIXME: why 2 ?) */
|
||||
int _find_shun(Client *cptr)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
ConfigItem_except *excepts;
|
||||
int match_type = 0;
|
||||
Hook *hook;
|
||||
@@ -2806,7 +2806,7 @@ int _find_spamfilter_user(Client *sptr, int flags)
|
||||
/** Check a spamfilter against all local users and print a message.
|
||||
* This is only used for the 'warn' action (BAN_ACT_WARN).
|
||||
*/
|
||||
int spamfilter_check_users(aTKline *tkl)
|
||||
int spamfilter_check_users(TKL *tkl)
|
||||
{
|
||||
char spamfilter_user[NICKLEN + USERLEN + HOSTLEN + REALLEN + 64]; /* n!u@h:r */
|
||||
char buf[1024];
|
||||
@@ -2841,7 +2841,7 @@ int spamfilter_check_users(aTKline *tkl)
|
||||
/** Similarly to previous, but match against all global users.
|
||||
* FUNCTION IS UNUSED !!
|
||||
*/
|
||||
int spamfilter_check_all_users(Client *from, aTKline *tkl)
|
||||
int spamfilter_check_all_users(Client *from, TKL *tkl)
|
||||
{
|
||||
char spamfilter_user[NICKLEN + USERLEN + HOSTLEN + REALLEN + 64]; /* n!u@h:r */
|
||||
int matches = 0;
|
||||
@@ -2877,9 +2877,9 @@ int spamfilter_check_all_users(Client *from, aTKline *tkl)
|
||||
* #*ble* will match with #bbleh
|
||||
* *ble* will NOT match with #bbleh, will with bbleh
|
||||
*/
|
||||
aTKline *_find_qline(Client *cptr, char *name, int *ishold)
|
||||
TKL *_find_qline(Client *cptr, char *name, int *ishold)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int points = 0;
|
||||
ConfigItem_except *excepts;
|
||||
*ishold = 0;
|
||||
@@ -2919,7 +2919,7 @@ aTKline *_find_qline(Client *cptr, char *name, int *ishold)
|
||||
}
|
||||
|
||||
/** Helper function for find_tkline_match_zap() */
|
||||
aTKline *find_tkline_match_zap_matcher(Client *cptr, aTKline *tkl)
|
||||
TKL *find_tkline_match_zap_matcher(Client *cptr, TKL *tkl)
|
||||
{
|
||||
ConfigItem_except *excepts;
|
||||
Hook *hook;
|
||||
@@ -2941,9 +2941,9 @@ aTKline *find_tkline_match_zap_matcher(Client *cptr, aTKline *tkl)
|
||||
* Note: function prototype changed as per UnrealIRCd 4.2.0.
|
||||
* @retval The (G)Z-Line that matched, or NULL if no such ban was found.
|
||||
*/
|
||||
aTKline *_find_tkline_match_zap(Client *cptr)
|
||||
TKL *_find_tkline_match_zap(Client *cptr)
|
||||
{
|
||||
aTKline *tkl, *ret;
|
||||
TKL *tkl, *ret;
|
||||
int index, index2;
|
||||
|
||||
if (IsServer(cptr) || IsMe(cptr))
|
||||
@@ -3046,7 +3046,7 @@ static void parse_stats_params(char *para, TKLFlag *flag)
|
||||
/** Does this TKL entry match the search terms?
|
||||
* This is a helper function for tkl_stats().
|
||||
*/
|
||||
void tkl_stats_matcher(Client *cptr, int type, char *para, TKLFlag *tklflags, aTKline *tkl)
|
||||
void tkl_stats_matcher(Client *cptr, int type, char *para, TKLFlag *tklflags, TKL *tkl)
|
||||
{
|
||||
/***** First, handle the selection ******/
|
||||
|
||||
@@ -3204,7 +3204,7 @@ void tkl_stats_matcher(Client *cptr, int type, char *para, TKLFlag *tklflags, aT
|
||||
/* TKL Stats. This is used by /STATS gline and all the others */
|
||||
void _tkl_stats(Client *cptr, int type, char *para)
|
||||
{
|
||||
aTKline *tk;
|
||||
TKL *tk;
|
||||
TKLFlag tklflags;
|
||||
int index, index2;
|
||||
|
||||
@@ -3249,7 +3249,7 @@ void _tkl_stats(Client *cptr, int type, char *para)
|
||||
* @param to The remote server.
|
||||
* @param tkl The TKL entry.
|
||||
*/
|
||||
void tkl_synch_send_entry(int add, Client *sender, Client *to, aTKline *tkl)
|
||||
void tkl_synch_send_entry(int add, Client *sender, Client *to, TKL *tkl)
|
||||
{
|
||||
char typ;
|
||||
|
||||
@@ -3317,7 +3317,7 @@ void tkl_synch_send_entry(int add, Client *sender, Client *to, aTKline *tkl)
|
||||
* @param skip The client to skip, eg cptr or NULL.
|
||||
* @param tkl The TKL entry to synchronize with the other servers.
|
||||
*/
|
||||
void tkl_broadcast_entry(int add, Client *sender, Client *skip, aTKline *tkl)
|
||||
void tkl_broadcast_entry(int add, Client *sender, Client *skip, TKL *tkl)
|
||||
{
|
||||
Client *cptr;
|
||||
|
||||
@@ -3335,7 +3335,7 @@ void tkl_broadcast_entry(int add, Client *sender, Client *skip, aTKline *tkl)
|
||||
*/
|
||||
void _tkl_synch(Client *sptr)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int index, index2;
|
||||
|
||||
/* First, hashed entries.. */
|
||||
@@ -3361,10 +3361,10 @@ void _tkl_synch(Client *sptr)
|
||||
}
|
||||
|
||||
/** Find a server ban TKL - only used to prevent duplicates and for deletion */
|
||||
aTKline *_find_tkl_serverban(int type, char *usermask, char *hostmask, int softban)
|
||||
TKL *_find_tkl_serverban(int type, char *usermask, char *hostmask, int softban)
|
||||
{
|
||||
char tpe = tkl_typetochar(type);
|
||||
aTKline *head, *tkl;
|
||||
TKL *head, *tkl;
|
||||
|
||||
if (!TKLIsServerBanType(type))
|
||||
abort();
|
||||
@@ -3387,10 +3387,10 @@ aTKline *_find_tkl_serverban(int type, char *usermask, char *hostmask, int softb
|
||||
}
|
||||
|
||||
/** Find a ban exception TKL - only used to prevent duplicates and for deletion */
|
||||
aTKline *_find_tkl_banexception(int type, char *usermask, char *hostmask, int softban)
|
||||
TKL *_find_tkl_banexception(int type, char *usermask, char *hostmask, int softban)
|
||||
{
|
||||
char tpe = tkl_typetochar(type);
|
||||
aTKline *head, *tkl;
|
||||
TKL *head, *tkl;
|
||||
|
||||
if (!TKLIsBanExceptionType(type))
|
||||
abort();
|
||||
@@ -3413,10 +3413,10 @@ aTKline *_find_tkl_banexception(int type, char *usermask, char *hostmask, int so
|
||||
}
|
||||
|
||||
/** Find a name ban TKL (qline) - only used to prevent duplicates and for deletion */
|
||||
aTKline *_find_tkl_nameban(int type, char *name, int hold)
|
||||
TKL *_find_tkl_nameban(int type, char *name, int hold)
|
||||
{
|
||||
char tpe = tkl_typetochar(type);
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
|
||||
if (!TKLIsNameBanType(type))
|
||||
abort();
|
||||
@@ -3430,10 +3430,10 @@ aTKline *_find_tkl_nameban(int type, char *name, int hold)
|
||||
}
|
||||
|
||||
/** Find a spamfilter TKL - only used to prevent duplicates and for deletion */
|
||||
aTKline *_find_tkl_spamfilter(int type, char *match_string, unsigned short action, unsigned short target)
|
||||
TKL *_find_tkl_spamfilter(int type, char *match_string, unsigned short action, unsigned short target)
|
||||
{
|
||||
char tpe = tkl_typetochar(type);
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
|
||||
if (!TKLIsSpamfilterType(type))
|
||||
abort();
|
||||
@@ -3452,7 +3452,7 @@ aTKline *_find_tkl_spamfilter(int type, char *match_string, unsigned short actio
|
||||
}
|
||||
|
||||
/** Send a notice to opers about the TKL that is being added */
|
||||
void _sendnotice_tkl_add(aTKline *tkl)
|
||||
void _sendnotice_tkl_add(TKL *tkl)
|
||||
{
|
||||
char buf[512];
|
||||
char set_at[128];
|
||||
@@ -3538,7 +3538,7 @@ void _sendnotice_tkl_add(aTKline *tkl)
|
||||
}
|
||||
|
||||
/** Send a notice to opers about the TKL that is being deleted */
|
||||
void _sendnotice_tkl_del(char *removed_by, aTKline *tkl)
|
||||
void _sendnotice_tkl_del(char *removed_by, TKL *tkl)
|
||||
{
|
||||
char buf[512];
|
||||
char set_at[128];
|
||||
@@ -3592,7 +3592,7 @@ void _sendnotice_tkl_del(char *removed_by, aTKline *tkl)
|
||||
/** Add a TKL using the TKL layer. See m_tkl for parv[] and protocol documentation. */
|
||||
CMD_FUNC(m_tkl_add)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int type;
|
||||
time_t expire_at, set_at;
|
||||
char *set_by;
|
||||
@@ -3879,7 +3879,7 @@ CMD_FUNC(m_tkl_add)
|
||||
/** Delete a TKL using the TKL layer. See m_tkl for parv[] and protocol documentation. */
|
||||
CMD_FUNC(m_tkl_del)
|
||||
{
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
int type;
|
||||
char *removed_by;
|
||||
|
||||
@@ -4179,7 +4179,7 @@ int _place_host_ban(Client *sptr, BanAction action, char *reason, long duration)
|
||||
* to ensure we (almost) always return the same winner regardless of the
|
||||
* order of the spamfilters (which may differ between servers).
|
||||
*/
|
||||
aTKline *choose_winning_spamfilter(aTKline *one, aTKline *two)
|
||||
TKL *choose_winning_spamfilter(TKL *one, TKL *two)
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -4237,7 +4237,7 @@ static int target_is_spamexcept(char *target)
|
||||
* @param type The spamfilter type (SPAMF_*)
|
||||
* TODO: Looks redundant?
|
||||
*/
|
||||
int _join_viruschan(Client *sptr, aTKline *tkl, int type)
|
||||
int _join_viruschan(Client *sptr, TKL *tkl, int type)
|
||||
{
|
||||
char *xparv[3], chbuf[CHANNELLEN + 16], buf[2048];
|
||||
Channel *chptr;
|
||||
@@ -4289,10 +4289,10 @@ int _join_viruschan(Client *sptr, aTKline *tkl, int type)
|
||||
* _NOT_ valid anymore so you should return immediately
|
||||
* (like from m_message, m_part, m_quit, etc).
|
||||
*/
|
||||
int _run_spamfilter(Client *sptr, char *str_in, int target, char *destination, int flags, aTKline **rettkl)
|
||||
int _run_spamfilter(Client *sptr, char *str_in, int target, char *destination, int flags, TKL **rettkl)
|
||||
{
|
||||
aTKline *tkl;
|
||||
aTKline *winner_tkl = NULL;
|
||||
TKL *tkl;
|
||||
TKL *winner_tkl = NULL;
|
||||
char *str;
|
||||
int ret = -1;
|
||||
char *reason = NULL;
|
||||
|
||||
+5
-5
@@ -85,7 +85,7 @@ int tkldb_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs);
|
||||
int tkldb_configrun(ConfigFile *cf, ConfigEntry *ce, int type);
|
||||
EVENT(write_tkldb_evt);
|
||||
int write_tkldb(void);
|
||||
int write_tkline(FILE *fd, const char *tmpfname, aTKline *tkl);
|
||||
int write_tkline(FILE *fd, const char *tmpfname, TKL *tkl);
|
||||
int read_tkldb(void);
|
||||
|
||||
// Globals
|
||||
@@ -231,7 +231,7 @@ int write_tkldb(void)
|
||||
FILE *fd;
|
||||
uint64_t tklcount;
|
||||
int index, index2;
|
||||
aTKline *tkl;
|
||||
TKL *tkl;
|
||||
#ifdef BENCHMARK
|
||||
struct timeval tv_alpha, tv_beta;
|
||||
|
||||
@@ -324,7 +324,7 @@ int write_tkldb(void)
|
||||
}
|
||||
|
||||
/** Write a TKL entry */
|
||||
int write_tkline(FILE *fd, const char *tmpfname, aTKline *tkl)
|
||||
int write_tkline(FILE *fd, const char *tmpfname, TKL *tkl)
|
||||
{
|
||||
char tkltype;
|
||||
char buf[256];
|
||||
@@ -377,7 +377,7 @@ int write_tkline(FILE *fd, const char *tmpfname, aTKline *tkl)
|
||||
int read_tkldb(void)
|
||||
{
|
||||
FILE *fd;
|
||||
aTKline *tkl = NULL;
|
||||
TKL *tkl = NULL;
|
||||
uint32_t magic = 0;
|
||||
uint64_t cnt;
|
||||
uint64_t tklcount = 0;
|
||||
@@ -440,7 +440,7 @@ int read_tkldb(void)
|
||||
{
|
||||
int do_not_add = 0;
|
||||
|
||||
tkl = MyMallocEx(sizeof(aTKline));
|
||||
tkl = MyMallocEx(sizeof(TKL));
|
||||
|
||||
/* First, fetch the TKL type.. */
|
||||
R_SAFE(read_data(fd, &c, sizeof(c)));
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ CMD_FUNC(m_watch)
|
||||
if ((*s == 'S' || *s == 's') && !did_s)
|
||||
{
|
||||
Link *lp;
|
||||
aWatch *anptr;
|
||||
Watch *anptr;
|
||||
int count = 0;
|
||||
|
||||
did_s = 1;
|
||||
|
||||
+40
-40
@@ -37,20 +37,20 @@ extern ircstats IRCstats;
|
||||
extern int do_garbage_collect;
|
||||
/* We need all these for cached MOTDs -- codemastr */
|
||||
extern char *buildid;
|
||||
aMotdFile opermotd;
|
||||
aMotdFile rules;
|
||||
aMotdFile motd;
|
||||
aMotdFile svsmotd;
|
||||
aMotdFile botmotd;
|
||||
aMotdFile smotd;
|
||||
MOTDFile opermotd;
|
||||
MOTDFile rules;
|
||||
MOTDFile motd;
|
||||
MOTDFile svsmotd;
|
||||
MOTDFile botmotd;
|
||||
MOTDFile smotd;
|
||||
|
||||
void read_motd(const char *filename, aMotdFile *motd);
|
||||
void do_read_motd(const char *filename, aMotdFile *themotd);
|
||||
void read_motd(const char *filename, MOTDFile *motd);
|
||||
void do_read_motd(const char *filename, MOTDFile *themotd);
|
||||
#ifdef USE_LIBCURL
|
||||
void read_motd_asynch_downloaded(const char *url, const char *filename, const char *errorbuf, int cached, aMotdDownload *motd_download);
|
||||
void read_motd_asynch_downloaded(const char *url, const char *filename, const char *errorbuf, int cached, MOTDDownload *motd_download);
|
||||
#endif
|
||||
|
||||
extern aMotdLine *Find_file(char *, short);
|
||||
extern MOTDLine *Find_file(char *, short);
|
||||
|
||||
void reread_motdsandrules();
|
||||
|
||||
@@ -825,8 +825,8 @@ char *reason = parv[1];
|
||||
int short_motd(Client *sptr)
|
||||
{
|
||||
ConfigItem_tld *tld;
|
||||
aMotdFile *themotd;
|
||||
aMotdLine *motdline;
|
||||
MOTDFile *themotd;
|
||||
MOTDLine *motdline;
|
||||
struct tm *tm;
|
||||
char is_short;
|
||||
|
||||
@@ -897,11 +897,11 @@ int short_motd(Client *sptr)
|
||||
* @param filename Filename of file to read or URL. NULL is accepted and causes the *motd to be free()d.
|
||||
* @param motd Reference to motd pointer (used for freeing if needed and for asynchronous remote MOTD support)
|
||||
*/
|
||||
void read_motd(const char *filename, aMotdFile *themotd)
|
||||
void read_motd(const char *filename, MOTDFile *themotd)
|
||||
{
|
||||
#ifdef USE_LIBCURL
|
||||
time_t modtime;
|
||||
aMotdDownload *motd_download;
|
||||
MOTDDownload *motd_download;
|
||||
#endif
|
||||
|
||||
/* TODO: if themotd points to a tld's motd,
|
||||
@@ -922,7 +922,7 @@ void read_motd(const char *filename, aMotdFile *themotd)
|
||||
if(filename && url_is_valid(filename))
|
||||
{
|
||||
/* prepare our payload for read_motd_asynch_downloaded() */
|
||||
motd_download = MyMallocEx(sizeof(aMotdDownload));
|
||||
motd_download = MyMallocEx(sizeof(MOTDDownload));
|
||||
if(!motd_download)
|
||||
outofmemory();
|
||||
motd_download->themotd = themotd;
|
||||
@@ -949,14 +949,14 @@ void read_motd(const char *filename, aMotdFile *themotd)
|
||||
@param errorbuf NULL or an errorstring if there was an error while downloading the MOTD.
|
||||
@param cached 0 if the URL was downloaded freshly or 1 if the last download was canceled and the local copy should be used.
|
||||
*/
|
||||
void read_motd_asynch_downloaded(const char *url, const char *filename, const char *errorbuf, int cached, aMotdDownload *motd_download)
|
||||
void read_motd_asynch_downloaded(const char *url, const char *filename, const char *errorbuf, int cached, MOTDDownload *motd_download)
|
||||
{
|
||||
aMotdFile *themotd;
|
||||
MOTDFile *themotd;
|
||||
|
||||
themotd = motd_download->themotd;
|
||||
/*
|
||||
check if the download was soft-canceled. See struct.h's docs on
|
||||
struct MotdDownload for details.
|
||||
struct MOTDDownload for details.
|
||||
*/
|
||||
if(!themotd)
|
||||
{
|
||||
@@ -1007,7 +1007,7 @@ void read_motd_asynch_downloaded(const char *url, const char *filename, const ch
|
||||
Does the actual reading of the MOTD. To be called only by
|
||||
read_motd() or read_motd_asynch_downloaded().
|
||||
*/
|
||||
void do_read_motd(const char *filename, aMotdFile *themotd)
|
||||
void do_read_motd(const char *filename, MOTDFile *themotd)
|
||||
{
|
||||
FILE *fd;
|
||||
struct tm *tm_tmp;
|
||||
@@ -1016,7 +1016,7 @@ void do_read_motd(const char *filename, aMotdFile *themotd)
|
||||
char line[512];
|
||||
char *tmp;
|
||||
|
||||
aMotdLine *last, *temp;
|
||||
MOTDLine *last, *temp;
|
||||
|
||||
free_motd(themotd);
|
||||
|
||||
@@ -1043,7 +1043,7 @@ void do_read_motd(const char *filename, aMotdFile *themotd)
|
||||
if (strlen(line) > 510)
|
||||
line[510] = '\0';
|
||||
|
||||
temp = MyMallocEx(sizeof(aMotdLine));
|
||||
temp = MyMallocEx(sizeof(MOTDLine));
|
||||
temp->line = strdup(line);
|
||||
|
||||
if(last)
|
||||
@@ -1064,14 +1064,14 @@ void do_read_motd(const char *filename, aMotdFile *themotd)
|
||||
}
|
||||
|
||||
/**
|
||||
Frees the contents of a aMotdFile structure.
|
||||
The aMotdFile structure itself should be statically
|
||||
Frees the contents of a MOTDFile structure.
|
||||
The MOTDFile structure itself should be statically
|
||||
allocated and deallocated. If the caller wants, it must
|
||||
manually free the aMotdFile structure itself.
|
||||
manually free the MOTDFile structure itself.
|
||||
*/
|
||||
void free_motd(aMotdFile *themotd)
|
||||
void free_motd(MOTDFile *themotd)
|
||||
{
|
||||
aMotdLine *next, *motdline;
|
||||
MOTDLine *next, *motdline;
|
||||
|
||||
if(!themotd)
|
||||
return;
|
||||
@@ -1168,12 +1168,12 @@ int localdie(void)
|
||||
|
||||
#endif
|
||||
|
||||
aPendingNet *pendingnet = NULL;
|
||||
PendingNet *pendingnet = NULL;
|
||||
|
||||
void add_pending_net(Client *sptr, char *str)
|
||||
{
|
||||
aPendingNet *net;
|
||||
aPendingServer *srv;
|
||||
PendingNet *net;
|
||||
PendingServer *srv;
|
||||
int num = 1;
|
||||
char *p, *name;
|
||||
|
||||
@@ -1181,7 +1181,7 @@ void add_pending_net(Client *sptr, char *str)
|
||||
return;
|
||||
|
||||
/* Allocate */
|
||||
net = MyMallocEx(sizeof(aPendingNet));
|
||||
net = MyMallocEx(sizeof(PendingNet));
|
||||
net->sptr = sptr;
|
||||
|
||||
/* Fill in */
|
||||
@@ -1192,7 +1192,7 @@ void add_pending_net(Client *sptr, char *str)
|
||||
if (!*name)
|
||||
continue;
|
||||
|
||||
srv = MyMallocEx(sizeof(aPendingServer));
|
||||
srv = MyMallocEx(sizeof(PendingServer));
|
||||
strlcpy(srv->sid, name, sizeof(srv->sid));
|
||||
AddListItem(srv, net->servers);
|
||||
}
|
||||
@@ -1202,8 +1202,8 @@ void add_pending_net(Client *sptr, char *str)
|
||||
|
||||
void free_pending_net(Client *sptr)
|
||||
{
|
||||
aPendingNet *net, *net_next;
|
||||
aPendingServer *srv, *srv_next;
|
||||
PendingNet *net, *net_next;
|
||||
PendingServer *srv, *srv_next;
|
||||
|
||||
for (net = pendingnet; net; net = net_next)
|
||||
{
|
||||
@@ -1222,10 +1222,10 @@ void free_pending_net(Client *sptr)
|
||||
}
|
||||
}
|
||||
|
||||
aPendingNet *find_pending_net_by_sid_butone(char *sid, Client *exempt)
|
||||
PendingNet *find_pending_net_by_sid_butone(char *sid, Client *exempt)
|
||||
{
|
||||
aPendingNet *net;
|
||||
aPendingServer *srv;
|
||||
PendingNet *net;
|
||||
PendingServer *srv;
|
||||
|
||||
if (BadPtr(sid))
|
||||
return NULL;
|
||||
@@ -1244,8 +1244,8 @@ aPendingNet *find_pending_net_by_sid_butone(char *sid, Client *exempt)
|
||||
/** Search the pending connections list for any identical sids */
|
||||
Client *find_pending_net_duplicates(Client *cptr, Client **srv, char **sid)
|
||||
{
|
||||
aPendingNet *net, *other;
|
||||
aPendingServer *s;
|
||||
PendingNet *net, *other;
|
||||
PendingServer *s;
|
||||
|
||||
*srv = NULL;
|
||||
*sid = NULL;
|
||||
@@ -1273,8 +1273,8 @@ Client *find_pending_net_duplicates(Client *cptr, Client **srv, char **sid)
|
||||
|
||||
Client *find_non_pending_net_duplicates(Client *cptr)
|
||||
{
|
||||
aPendingNet *net;
|
||||
aPendingServer *s;
|
||||
PendingNet *net;
|
||||
PendingServer *s;
|
||||
Client *acptr;
|
||||
|
||||
for (net = pendingnet; net; net = net->next)
|
||||
|
||||
Reference in New Issue
Block a user