implemented set KeepConn time function for later use (relay command)
[srvx.git] / src / proto.h
index 3d8e2e74083b30d637b3ad0c2609d10a36250600..36de9a8d759bea84fcf259c769509afbe1f6b2a5 100644 (file)
@@ -104,6 +104,9 @@ void unreg_notice_func(struct userNode *user);
 typedef void (*oper_func_t) (struct userNode *user);
 void reg_oper_func(oper_func_t handler);
 
+typedef void (*xquery_func_t) (struct server *source, const char routing[], const char query[]);
+void reg_xquery_func(xquery_func_t handler);
+
 /* replay silliness */
 void replay_read_line(void);
 void replay_event_loop(void);
@@ -142,11 +145,20 @@ void irc_kill(struct userNode *from, struct userNode *target, const char *messag
 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_xresponse(struct server *target, const char *routing, const char *response);
 
 /* account maintenance */
 void irc_account(struct userNode *user, const char *stamp, unsigned long timestamp, unsigned long serial);
 void irc_regnick(struct userNode *user);
 void irc_fakehost(struct userNode *user, const char *host, const char *ident, int force);
+void irc_keepconn(struct userNode *target, unsigned int timeout);
+
+/* svs maintenance */
+void irc_svsmode(struct userNode *from, struct userNode *user, const char *modes);
+void irc_svsjoin(struct userNode *from, struct userNode *user, struct chanNode *chan);
+void irc_svsjoinchan(struct userNode *from, struct userNode *user, const char *chan);
+void irc_relay(char *message);
+void irc_simul(struct userNode *target, char *command);
 
 /* numeric messages */
 void irc_numeric(struct userNode *user, unsigned int num, const char *format, ...);
@@ -181,6 +193,8 @@ unsigned int irc_user_modes(const struct userNode *user, char modes[], size_t le
 
 /* Channel mode manipulation */
 #define KEYLEN          23
+#define NOFLOODLEN      15
+#define CHANNELLEN      200
 typedef unsigned long chan_mode_t;
 /* Rules for struct mod_chanmode:
  * For a membership mode change, args[n].mode can contain more than
@@ -189,11 +203,13 @@ typedef unsigned long chan_mode_t;
  */
 struct mod_chanmode {
     chan_mode_t modes_set, modes_clear;
-    unsigned int new_limit, argc;
+    unsigned int new_limit, new_access, argc;
 #ifndef NDEBUG
     unsigned int alloc_argc;
 #endif
     char new_key[KEYLEN + 1];
+    char new_altchan[CHANNELLEN + 1];
+    char new_noflood[NOFLOODLEN + 1];
     char new_upass[KEYLEN + 1];
     char new_apass[KEYLEN + 1];
     struct {
@@ -204,14 +220,17 @@ struct mod_chanmode {
         } u;
     } args[1];
 };
-#define MCP_ALLOW_OVB     0x0001 /* allow op, voice, ban manipulation */
-#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_UPASS_FREE    0x0010 /* -U without a key argument */
-#define MCP_APASS_FREE    0x0020 /* -A without a key argument */
-#define MC_ANNOUNCE       0x0100 /* send a mod_chanmode() change out */
-#define MC_NOTIFY         0x0200 /* make local callbacks to announce */
+#define MCP_ALLOW_OVB      0x0001 /* allow op, voice, ban manipulation */
+#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_UPASS_FREE     0x0010 /* -U without a key argument */
+#define MCP_APASS_FREE     0x0020 /* -A without a key argument */
+#define MCP_NO_APASS       0x0040 /* Do not allow +/-A or +/-U */
+#define MCP_IGN_REGISTERED 0x0080 /* chan is already registered; ignore changes to MODE_REGISTERED */
+#define MC_ANNOUNCE        0x0100 /* send a mod_chanmode() change out */
+#define MC_NOTIFY          0x0200 /* make local callbacks to announce */
+#define MCP_OPERMODE       0x0400
 #ifdef NDEBUG
 #define mod_chanmode_init(CHANMODE) do { memset((CHANMODE), 0, sizeof(*CHANMODE)); } while (0)
 #else
@@ -220,7 +239,7 @@ struct mod_chanmode {
 
 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, short base_oplevel);
+struct mod_chanmode *mod_chanmode_parse(struct chanNode *channel, struct userNode *user, 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);