* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
/* Warning for those looking at how this code does multi-protocol
* support: It's an awful, nasty hack job. It is intended for short
/* Warning for those looking at how this code does multi-protocol
* support: It's an awful, nasty hack job. It is intended for short
- * term use, not long term, since we are already developing srvx2,
+ * term use, not long term, since we are already developing x3,
* which has much nicer interfaces that hide most of the ugly
* differences between protocol dialects. */
* which has much nicer interfaces that hide most of the ugly
* differences between protocol dialects. */
-typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, char *text, struct userNode *bot);
-void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler);
+typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, const char *text, struct userNode *bot, unsigned int is_notice, void *extra);
+void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler, void *extra);
void reg_allchanmsg_func(struct userNode *service, chanmsg_func_t handler);
struct userNode *get_chanmsg_bot(unsigned char prefix);
void reg_allchanmsg_func(struct userNode *service, chanmsg_func_t handler);
struct userNode *get_chanmsg_bot(unsigned char prefix);
-typedef void (*privmsg_func_t) (struct userNode *user, struct userNode *target, char *text, int server_qualified);
+typedef void (*privmsg_func_t) (struct userNode *user, struct userNode *target, const char *text, int server_qualified);
void reg_privmsg_func(struct userNode *user, privmsg_func_t handler);
void reg_notice_func(struct userNode *user, privmsg_func_t handler);
void reg_privmsg_func(struct userNode *user, privmsg_func_t handler);
void reg_notice_func(struct userNode *user, privmsg_func_t handler);
-void unreg_privmsg_func(struct userNode *user, privmsg_func_t handler);
-void unreg_notice_func(struct userNode *user, privmsg_func_t handler);
-
-typedef void (*oper_func_t) (struct userNode *user);
-void reg_oper_func(oper_func_t handler);
+void unreg_privmsg_func(struct userNode *user);
+void unreg_notice_func(struct userNode *user);
void irc_pong(const char *who, const char *data);
void irc_quit(struct userNode *user, const char *message);
void irc_squit(struct server *srv, const char *message, const char *service_message);
void irc_pong(const char *who, const char *data);
void irc_quit(struct userNode *user, const char *message);
void irc_squit(struct server *srv, const char *message, const char *service_message);
+void irc_squit_route(struct server *srv, const char *message, ...);
+void irc_connect(struct userNode *user, char *server, unsigned int port, struct server *target);
void irc_notice(struct userNode *from, const char *to, const char *message);
void irc_notice_user(struct userNode *from, struct userNode *to, const char *message);
void irc_notice(struct userNode *from, const char *to, const char *message);
void irc_notice_user(struct userNode *from, struct userNode *to, const char *message);
/* channel maintenance */
void irc_join(struct userNode *who, struct chanNode *what);
void irc_invite(struct userNode *from, struct userNode *who, struct chanNode *to);
void irc_mode(struct userNode *who, struct chanNode *target, const char *modes);
/* channel maintenance */
void irc_join(struct userNode *who, struct chanNode *what);
void irc_invite(struct userNode *from, struct userNode *who, struct chanNode *to);
void irc_mode(struct userNode *who, struct chanNode *target, const char *modes);
void irc_kick(struct userNode *who, struct userNode *target, struct chanNode *from, const char *msg);
void irc_part(struct userNode *who, struct chanNode *what, const char *reason);
void irc_kick(struct userNode *who, struct userNode *target, struct chanNode *from, const char *msg);
void irc_part(struct userNode *who, struct chanNode *what, const char *reason);
-void irc_topic(struct userNode *who, struct chanNode *what, const char *topic);
+void irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what, const char *topic);
+void irc_svsjoin(struct userNode *from, struct userNode *who, struct chanNode *to);
+void irc_svspart(struct userNode *from, struct userNode *who, struct chanNode *to);
+void irc_svsquit(struct userNode *from, struct userNode *who, char const *reason);
-void irc_gline(struct server *srv, struct gline *gline);
+void irc_silence(struct userNode *who, const char *mask, int add);
+void irc_gline(struct server *srv, struct gline *gline, int silent);
+void irc_shun(struct server *srv, struct shun *shun);
void irc_settime(const char *srv_name_mask, time_t new_time);
void irc_ungline(const char *mask);
void irc_settime(const char *srv_name_mask, time_t new_time);
void irc_ungline(const char *mask);
void irc_error(const char *to, const char *message);
void irc_kill(struct userNode *from, struct userNode *target, const char *message);
void irc_raw(const char *what);
void irc_stats(struct userNode *from, struct server *target, char type);
void irc_svsnick(struct userNode *from, struct userNode *target, const char *newnick);
void irc_error(const char *to, const char *message);
void irc_kill(struct userNode *from, struct userNode *target, const char *message);
void irc_raw(const char *what);
void irc_stats(struct userNode *from, struct server *target, char type);
void irc_svsnick(struct userNode *from, struct userNode *target, const char *newnick);
+void irc_swhois(struct userNode *from, struct userNode *target, const char *message);
+void irc_tempshun(struct userNode *from, struct userNode *target, int remove, const char *reason);
+void irc_privs(struct userNode *target, char *flag, int add);
+void irc_raw_privs(struct userNode *target, const char *privs);
void irc_account(struct userNode *user, const char *stamp, time_t timestamp);
void irc_regnick(struct userNode *user);
void irc_fakehost(struct userNode *user, const char *host);
void irc_account(struct userNode *user, const char *stamp, time_t timestamp);
void irc_regnick(struct userNode *user);
void irc_fakehost(struct userNode *user, const char *host);
+void irc_mark(struct userNode *user, char *mark);
+void irc_sno(unsigned int mask, char const* format, ...);
+void irc_sasl(struct server* dest, const char *identifier, const char *subcmd, const char *data);
/* numeric messages */
void irc_numeric(struct userNode *user, unsigned int num, const char *format, ...);
/* numeric messages */
void irc_numeric(struct userNode *user, unsigned int num, const char *format, ...);
#define RPL_ENDOFSTATS 219
#define RPL_STATSUPTIME 242
#define RPL_MAXCONNECTIONS 250
#define RPL_ENDOFSTATS 219
#define RPL_STATSUPTIME 242
#define RPL_MAXCONNECTIONS 250
#define RPL_WHOISUSER 311
#define RPL_WHOISSERVER 312
#define RPL_WHOISOPERATOR 313
#define RPL_WHOISUSER 311
#define RPL_WHOISSERVER 312
#define RPL_WHOISOPERATOR 313
#define ERR_NOSUCHNICK 401
/* stuff originally from other headers that is really protocol-specific */
int IsChannelName(const char *name);
int is_valid_nick(const char *nick);
#define ERR_NOSUCHNICK 401
/* stuff originally from other headers that is really protocol-specific */
int IsChannelName(const char *name);
int is_valid_nick(const char *nick);
-struct userNode *AddService(const char *nick, const char *modes, const char *desc, const char *hostname);
-struct userNode *AddClone(const char *nick, const char *ident, const char *hostname, const char *desc);
+struct userNode *AddLocalUser(const char *nick, const char *ident, const char *hostname, const char *desc, const char *modes);
struct server* AddServer(struct server* uplink, const char *name, int hops, time_t boot, time_t link, const char *numeric, const char *description);
void DelServer(struct server* serv, int announce, const char *message);
void DelUser(struct userNode* user, struct userNode *killer, int announce, const char *why);
struct server* AddServer(struct server* uplink, const char *name, int hops, time_t boot, time_t link, const char *numeric, const char *description);
void DelServer(struct server* serv, int announce, const char *message);
void DelUser(struct userNode* user, struct userNode *killer, int announce, const char *why);
#define MCP_FROM_SERVER 0x0002 /* parse as from a server */
#define MCP_KEY_FREE 0x0004 /* -k without a key argument */
#define MCP_REGISTERED 0x0008 /* chan is already registered; do not allow changes to MODE_REGISTERED */
#define MCP_FROM_SERVER 0x0002 /* parse as from a server */
#define MCP_KEY_FREE 0x0004 /* -k without a key argument */
#define MCP_REGISTERED 0x0008 /* chan is already registered; do not allow changes to MODE_REGISTERED */
#define MC_ANNOUNCE 0x0100 /* send a mod_chanmode() change out */
#define MC_NOTIFY 0x0200 /* make local callbacks to announce */
#ifdef NDEBUG
#define MC_ANNOUNCE 0x0100 /* send a mod_chanmode() change out */
#define MC_NOTIFY 0x0200 /* make local callbacks to announce */
#ifdef NDEBUG
struct mod_chanmode *mod_chanmode_alloc(unsigned int argc);
struct mod_chanmode *mod_chanmode_dup(struct mod_chanmode *orig, unsigned int extra);
struct mod_chanmode *mod_chanmode_alloc(unsigned int argc);
struct mod_chanmode *mod_chanmode_dup(struct mod_chanmode *orig, unsigned int extra);
-struct mod_chanmode *mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, unsigned int flags);
+struct mod_chanmode *mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, unsigned int flags, short base_oplevel);
void mod_chanmode_apply(struct userNode *who, struct chanNode *channel, struct mod_chanmode *change);
void mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod_chanmode *change);
char *mod_chanmode_format(struct mod_chanmode *desc, char *buffer);
void mod_chanmode_free(struct mod_chanmode *change);
int mod_chanmode(struct userNode *who, struct chanNode *channel, char **modes, unsigned int argc, unsigned int flags);
void mod_chanmode_apply(struct userNode *who, struct chanNode *channel, struct mod_chanmode *change);
void mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod_chanmode *change);
char *mod_chanmode_format(struct mod_chanmode *desc, char *buffer);
void mod_chanmode_free(struct mod_chanmode *change);
int mod_chanmode(struct userNode *who, struct chanNode *channel, char **modes, unsigned int argc, unsigned int flags);
-typedef void (*mode_change_func_t) (struct chanNode *channel, struct userNode *user, const struct mod_chanmode *change);
-void reg_mode_change_func(mode_change_func_t handler);
+typedef void (*mode_change_func_t) (struct chanNode *channel, struct userNode *user, const struct mod_chanmode *change, void *extra);
+void reg_mode_change_func(mode_change_func_t handler, void *extra);
/* The "default" for generate_hostmask is to have all of these options off. */
#define GENMASK_STRICT_HOST 1
/* The "default" for generate_hostmask is to have all of these options off. */
#define GENMASK_STRICT_HOST 1
#define GENMASK_NO_HIDING 128
char *generate_hostmask(struct userNode *user, int options);
#define GENMASK_NO_HIDING 128
char *generate_hostmask(struct userNode *user, int options);