]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/hash.h
Minor typo in previous commit where returning 0 when it should have been 1 from opser...
[irc/evilnet/x3.git] / src / hash.h
index af76748c465cdb2656bbf5715df34c554e0869a9..14378e849e3afd44bdd23669fa574a9f3020c31f 100644 (file)
 #define MODE_HIDEMODE          0x02000000 /* +L hide modes */
 #define MODE_APASS             0x04000000 /* +A adminpass */
 #define MODE_UPASS             0x08000000 /* +U userpass */
+#define MODE_ADMINSONLY         0x10000000 /* +a Admins only */
 #define MODE_REMOVE             0x80000000
 
 #define FLAGS_OPER             0x000001 /* Operator +O */
 #define FLAGS_LOCOP            0x000002 /* Local operator +o */
 #define FLAGS_INVISIBLE                0x000004 /* invisible +i */
 #define FLAGS_WALLOP           0x000008 /* receives wallops +w */
-#define FLAGS_SERVNOTICE       0x000010 /* receives server notices +s */
+#define FLAGS_DUMMY             0x000010 /* user is not announced to other servers */
 #define FLAGS_DEAF             0x000020 /* deaf +d */
 #define FLAGS_SERVICE          0x000040 /* cannot be kicked, killed or deoped +k */
 #define FLAGS_GLOBAL           0x000080 /* receives global messages +g */
@@ -84,7 +85,6 @@
 #define IsInvisible(x)          ((x)->modes & FLAGS_INVISIBLE)
 #define IsGlobal(x)             ((x)->modes & FLAGS_GLOBAL)
 #define IsWallOp(x)             ((x)->modes & FLAGS_WALLOP)
-#define IsServNotice(x)         ((x)->modes & FLAGS_SERVNOTICE)
 #define IsBotM(x)                      ((x)->modes & FLAGS_BOT)
 #define IsHideChans(x)         ((x)->modes & FLAGS_HIDECHANS)
 #define IsHideIdle(x)          ((x)->modes & FLAGS_HIDEIDLE)
 #define IsHiddenHost(x)         ((x)->modes & FLAGS_HIDDEN_HOST)
 #define IsReggedNick(x)         ((x)->modes & FLAGS_REGNICK)
 #define IsRegistering(x)       ((x)->modes & FLAGS_REGISTERING)
+#define IsDummy(x)              ((x)->modes & FLAGS_DUMMY)
 #define IsFakeHost(x)           ((x)->fakehost[0] != '\0')
 #define IsLocal(x)              ((x)->uplink == self)
 
 #define NICKLEN         30
 #define USERLEN         10
-#define HOSTLEN         63
+#define HOSTLEN         75
 #define SOCKIPLEN       45
 #define ACCOUNTLEN      15
 #define REALLEN         50
@@ -150,6 +151,7 @@ enum Priv {
   PRIV_SEE_CHAN,        /**< oper can see in secret chans */
   PRIV_PROPAGATE,       /**< propagate oper status */
   PRIV_DISPLAY,         /**< "Is an oper" displayed */
+  PRIV_DISPLAY_MODE,    /**< oper can set +H hide oper */
   PRIV_SEE_OPERS,       /**< display hidden opers */
   PRIV_WIDE_GLINE,      /**< oper can set wider G-lines */
   PRIV_WIDE_ZLINE,      /**< oper can set wider Z-Lines */
@@ -163,6 +165,11 @@ enum Priv {
   PRIV_HIDE_IDLE,       /**< oper can set/unset user mode +I */
   PRIV_XTRAOP,          /**< oper can set/unset user mode +X */
   PRIV_HIDE_CHANNELS,   /**< oper can set/unset user mode +n */
+  PRIV_FREEFORM,        /**< oper can set any host on themseves using set host
+                              as long as its a valid host */
+  PRIV_REMOVE,          /**< oper can force remove deactivated glines,
+                             shuns and zlines. */
+  PRIV_SPAMFILTER,      /**< oper can set spamfilters via SPAMFILTER */
   PRIV_LAST_PRIV        /**< number of privileges */
 };
 
@@ -221,8 +228,10 @@ struct userNode {
     
     char *mark;                   /* only filled if they are marked */
     char *version_reply;          /* only filled in if a version query was triggered */
+    char *sslfp;                  /* only filled in if a mark SSLCLIFP is received */
 
     time_t timestamp;             /* Time of last nick change */
+    time_t idle_since;
     struct server *uplink;        /* Server that user is connected to */
     struct modeList channels;     /* Vector of channels user is in */
     struct Privs   privs;
@@ -298,7 +307,7 @@ struct modeNode {
 struct server {
     char name[SERVERNAMEMAX+1];
     time_t boot;
-    time_t link;
+    time_t link_time;
     char description[SERVERDESCRIPTMAX+1];
 #ifdef WITH_PROTOCOL_P10
     char numeric[COMBO_NUMERIC_LEN+1];
@@ -363,18 +372,23 @@ struct server* GetServerH(const char *name); /* using full name */
 struct userNode* GetUserH(const char *nick);   /* using nick */
 struct chanNode* GetChannel(const char *name);
 struct modeNode* GetUserMode(struct chanNode* channel, struct userNode* user);
-
-typedef void (*server_link_func_t) (struct server *server);
-void reg_server_link_func(server_link_func_t handler);
-
-typedef int (*new_user_func_t) (struct userNode *user);
-void reg_new_user_func(new_user_func_t handler);
-typedef void (*del_user_func_t) (struct userNode *user, struct userNode *killer, const char *why);
-void reg_del_user_func(del_user_func_t handler);
-void unreg_del_user_func(del_user_func_t handler);
+int userList_contains(struct userList *list, struct userNode *user);
+unsigned int IsUserP(struct userNode *user);
+
+typedef int (*server_link_func_t) (struct server *server, void *extra);
+void reg_server_link_func(server_link_func_t handler, void *extra);
+void call_server_link_funcs(struct server *server);
+
+typedef int (*new_user_func_t) (struct userNode *user, void *extra);
+void reg_new_user_func(new_user_func_t handler, void *extra);
+void call_new_user_funcs(struct userNode *user);
+typedef void (*del_user_func_t) (struct userNode *user, struct userNode *killer, const char *why, void *extra);
+void reg_del_user_func(del_user_func_t handler, void *extra);
+void call_del_user_funcs(struct userNode *user, struct userNode *killer, const char *why);
+void unreg_del_user_func(del_user_func_t handler, void *extra);
 void ReintroduceUser(struct userNode* user);
-typedef void (*nick_change_func_t)(struct userNode *user, const char *old_nick);
-void reg_nick_change_func(nick_change_func_t handler);
+typedef void (*nick_change_func_t)(struct userNode *user, const char *old_nick, void *extra);
+void reg_nick_change_func(nick_change_func_t handler, void *extra);
 void NickChange(struct userNode* user, const char *new_nick, int no_announce);
 void SVSNickChange(struct userNode* user, const char *new_nick);
 
@@ -385,12 +399,12 @@ void StampUser(struct userNode *user, const char *stamp, time_t timestamp);
 void assign_fakehost(struct userNode *user, const char *host, int announce);
 void set_geoip_info(struct userNode *user);
 
-typedef void (*new_channel_func_t) (struct chanNode *chan);
-void reg_new_channel_func(new_channel_func_t handler);
-typedef int (*join_func_t) (struct modeNode *mNode);
-void reg_join_func(join_func_t handler);
-typedef void (*del_channel_func_t) (struct chanNode *chan);
-void reg_del_channel_func(del_channel_func_t handler);
+typedef void (*new_channel_func_t) (struct chanNode *chan, void *extra);
+void reg_new_channel_func(new_channel_func_t handler, void *extra);
+typedef int (*join_func_t) (struct modeNode *mNode, void *extra);
+void reg_join_func(join_func_t handler, void *extra);
+typedef void (*del_channel_func_t) (struct chanNode *chan, void *extra);
+void reg_del_channel_func(del_channel_func_t handler, void *extra);
 
 struct chanNode* AddChannel(const char *name, time_t time_, const char *modes, char *banlist, char *exemptlist);
 void LockChannel(struct chanNode *channel);
@@ -398,21 +412,21 @@ void UnlockChannel(struct chanNode *channel);
 
 struct modeNode* AddChannelUser(struct userNode* user, struct chanNode* channel);
 
-typedef void (*part_func_t) (struct modeNode *mn, const char *reason);
-void reg_part_func(part_func_t handler);
-void unreg_part_func(part_func_t handler);
+typedef void (*part_func_t) (struct modeNode *mn, const char *reason, void *extra);
+void reg_part_func(part_func_t handler, void *extra);
+void unreg_part_func(part_func_t handler, void *extra);
 void DelChannelUser(struct userNode* user, struct chanNode* channel, const char *reason, int deleting);
 void KickChannelUser(struct userNode* target, struct chanNode* channel, struct userNode *kicker, const char *why);
 
-typedef void (*kick_func_t) (struct userNode *kicker, struct userNode *user, struct chanNode *chan);
-void reg_kick_func(kick_func_t handler);
+typedef void (*kick_func_t) (struct userNode *kicker, struct userNode *user, struct chanNode *chan, void *extra);
+void reg_kick_func(kick_func_t handler, void *extra);
 void ChannelUserKicked(struct userNode* kicker, struct userNode* victim, struct chanNode* channel);
 
 int ChannelBanExists(struct chanNode *channel, const char *ban);
 int ChannelExemptExists(struct chanNode *channel, const char *exempt);
 
-typedef int (*topic_func_t)(struct userNode *who, struct chanNode *chan, const char *old_topic);
-void reg_topic_func(topic_func_t handler);
+typedef int (*topic_func_t)(struct userNode *who, struct chanNode *chan, const char *old_topic, void *extra);
+void reg_topic_func(topic_func_t handler, void *extra);
 void SetChannelTopic(struct chanNode *channel, struct userNode *service, struct userNode *user, const char *topic, int announce);
 struct userNode *IsInChannel(struct chanNode *channel, struct userNode *user);