]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/hash.h
changing how libtre is dealt with
[irc/evilnet/x3.git] / src / hash.h
index e5aca9c454b3fef4da5dc591369e05bf1790d8c9..1cceb219d7af5d10d4b85500ff0a269ce594f603 100644 (file)
@@ -1,9 +1,9 @@
 /* hash.h - IRC network state database
  * Copyright 2000-2004 srvx Development Team
  *
- * This file is part of srvx.
+ * This file is part of x3.
  *
- * srvx is free software; you can redistribute it and/or modify
+ * x3 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
 #define MODE_OPERSONLY          0x00080000 /* +O Opers only */
 #define MODE_NOQUITMSGS         0x00100000 /* +Q suppress messages from quit notices */
 #define MODE_NOAMSG             0x00200000 /* +T no multi-target messages */
-#define MODE_SSLONLY            0x00400000 /* +z ssl only */
+#define MODE_SSLONLY            0x00400000 /* +Z ssl only */
 #define MODE_HALFOP             0x00800000 /* +h USER */
 #define MODE_EXEMPT             0x01000000 /* +e exempt */
+#define MODE_HIDEMODE          0x02000000 /* +L hide modes */
+#define MODE_APASS             0x04000000 /* +A adminpass */
+#define MODE_UPASS             0x08000000 /* +U userpass */
 #define MODE_REMOVE             0x80000000
 
 #define FLAGS_OPER             0x0001 /* Operator +O */
 #define NICKLEN         30
 #define USERLEN         10
 #define HOSTLEN         63
-#define ACCOUNTLEN     15
+#define SOCKIPLEN       45
+#define ACCOUNTLEN      15
 #define REALLEN         50
 #define TOPICLEN        250
 #define CHANNELLEN      200
+#define MAXOPLEVEL      999
 
 #define MAXMODEPARAMS  6
-#define MAXBANS                45
+#define MAXBANS                128
 #define MAXEXEMPTS     45
 
 /* IDLEN is 6 because it takes 5.33 Base64 digits to store 32 bytes. */
@@ -123,12 +128,15 @@ struct userNode {
     char info[REALLEN + 1];       /* Free form additional client information */
     char hostname[HOSTLEN + 1];   /* DNS name or IP address */
     char fakehost[HOSTLEN + 1];   /* Assigned fake host */
+    char crypthost[HOSTLEN + 30]; /* Crypted hostname */
+    char cryptip[SOCKIPLEN + 30]; /* Crypted IP */
 #ifdef WITH_PROTOCOL_P10
     char numeric[COMBO_NUMERIC_LEN+1];
     unsigned int num_local : 18;
 #endif
+    unsigned int loc;             /* Is user connecting via LOC? */
     unsigned int dead : 1;        /* Is user waiting to be recycled? */
-    struct in_addr ip;            /* User's IP address */
+    irc_in_addr_t ip;             /* User's IP address */
     long modes;                   /* user flags +isw etc... */
 
     // sethost - reed/apples
@@ -148,6 +156,8 @@ struct chanNode {
     chan_mode_t modes;
     unsigned int limit, locks;
     char key[KEYLEN + 1];
+    char upass[KEYLEN + 1];
+    char apass[KEYLEN + 1];
     time_t timestamp; /* creation time */
   
     char topic[TOPICLEN + 1];
@@ -182,6 +192,7 @@ struct modeNode {
     struct chanNode *channel;
     struct userNode *user;
     long modes;
+    short oplevel;
     time_t idle_since;
 };
 
@@ -208,6 +219,42 @@ struct server {
     struct serverList children;
 };
 
+struct waitingConnection {
+    char *server;
+    char *target;
+};
+
+struct routingPlan {
+    dict_t servers;
+};
+
+struct routingPlanServer {
+    char *uplink;
+    char *secondaryuplink;
+    unsigned int port;
+    int karma;
+    int offline;
+};
+
+/* Ported from X2 */
+struct routeList {
+    char* server;              /* Name of the server */
+    unsigned int   port;       /* connection port */
+    char *uplink;              /* Server its linked to (towards us) */
+    char *secondaryuplink; 
+    int outsideness;           /* 0 means leaf, 1 second layer, etc. my uplink is highest */
+    struct routeList *next;
+};
+
+/* Ported from X2 */
+struct route {
+    int count;                 /* how many servers we have */
+    int maxdepth;              /* biggest outsideness value */
+    int centered;              /* set to TRUE when changerouteUplinks is run */
+    struct routeList *servers;
+};
+
+
 extern struct server *self;
 extern dict_t channels;
 extern dict_t clients;
@@ -237,7 +284,7 @@ void NickChange(struct userNode* user, const char *new_nick, int no_announce);
 typedef void (*account_func_t) (struct userNode *user, const char *stamp);
 void reg_account_func(account_func_t handler);
 void call_account_func(struct userNode *user, const char *stamp);
-void StampUser(struct userNode *user, const char *stamp);
+void StampUser(struct userNode *user, const char *stamp, time_t timestamp);
 void assign_fakehost(struct userNode *user, const char *host, int announce);
 
 typedef void (*new_channel_func_t) (struct chanNode *chan);
@@ -268,7 +315,8 @@ 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);
-void SetChannelTopic(struct chanNode *channel, struct userNode *user, const char *topic, int announce);
+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);
 
 void init_structs(void);