aboutsummaryrefslogtreecommitdiffstats
path: root/include/struct.h
diff options
context:
space:
mode:
authorGravatar Bram Matthys2010-01-01 19:49:06 +0000
committerGravatar Bram Matthys2010-01-01 19:49:06 +0000
commitdddc8f07e4e752a1b2fda175e2023ed8ae15b98c (patch)
treeec487ead069a08f7deb4e7a415810168d0033d73 /include/struct.h
parentAutomatic weekly version update: 200952 (diff)
downloadunrealircd-dddc8f07e4e752a1b2fda175e2023ed8ae15b98c.tar.gz
unrealircd-dddc8f07e4e752a1b2fda175e2023ed8ae15b98c.tar.bz2
unrealircd-dddc8f07e4e752a1b2fda175e2023ed8ae15b98c.zip
PROTOCTL EAUTH/SERVERS/new linking protocol:
- Server protocol: added PROTOCTL EATH=servername, which allows us to authenticate the server very early in the handshake process. That way, certain commands and PROTOCTL tokens can 'trust' the server. See doc/technical/protoctl.txt for details. - Server protocol: between new Unreal servers we now do the handshake a little bit different, so it waits with sending the SERVER command until the first PROTOCTL is received. Needed for next. - Server protocol: added PROTOCTL SERVERS=1,2,3,4,etc by which a server can inform the other server which servers (server numeric, actually) it has linked. See doc/technical/protoctl.txt and next for details. - When our server was trying to link to some server, and at the same time another server was also trying to link with us, this would lead to a server collision: the server would link (twice) ok at first, but then a second later or so both would quit with 'Server Exists' with quite some mess as a result. This isn't unique to Unreal, btw. This happened more often when you had a low connfreq in your link blocks (aka: quick reconnects), or had multiple hubs on autoconnect (with same connfreq), or when you (re)started all servers at the same time. This should now be solved by a new server handshake design, which detects this race condition and solves it by closing one of the two (or more) connections to avoid the issue. This also means that it should now be safe to have multiple hubs with low connfreq's (eg: 10s) without risking that your network falls apart. This new server handshake (protocol updates, etc) was actually quite some work, especially for something that only happened sporadically. I felt it was needed though, because (re)linking stability is extremely important. This new feature/design/fix requires extensive testing. This feature can be disabled by: set { new-linking-protocol 0; };
Diffstat (limited to 'include/struct.h')
-rw-r--r--include/struct.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/struct.h b/include/struct.h
index 692700b64..7b4be9921 100644
--- a/include/struct.h
+++ b/include/struct.h
@@ -151,6 +151,7 @@ typedef struct SMember Member;
typedef struct SMembership Membership;
typedef struct SMembershipL MembershipL;
typedef struct JFlood aJFlood;
+typedef struct PendingNet aPendingNet;
#ifdef ZIP_LINKS
typedef struct Zdata aZdata;
@@ -317,7 +318,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define FLAGS_SQUIT 0x20000 /* Server has been /squit by an oper */
#define FLAGS_PROTOCTL 0x40000 /* Received a PROTOCTL message */
#define FLAGS_PING 0x80000
-#define FLAGS_ASKEDPING 0x100000
+#define FLAGS_EAUTH 0x100000
#define FLAGS_NETINFO 0x200000
#define FLAGS_HYBNOTICE 0x400000
#define FLAGS_QUARANTINE 0x800000
@@ -412,7 +413,8 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define GotNetInfo(x) ((x)->flags & FLAGS_NETINFO)
#define SetNetInfo(x) ((x)->flags |= FLAGS_NETINFO)
#define IsCGIIRC(x) ((x)->flags & FLAGS_CGIIRC)
-
+#define SetEAuth(x) ((x)->flags |= FLAGS_EAUTH)
+#define IsEAuth(x) ((x)->flags & FLAGS_EAUTH)
#define IsShunned(x) ((x)->flags & FLAGS_SHUNNED)
#define SetShunned(x) ((x)->flags |= FLAGS_SHUNNED)
#define ClearShunned(x) ((x)->flags &= ~FLAGS_SHUNNED)
@@ -1855,6 +1857,13 @@ struct JFlood {
};
#endif
+struct PendingNet {
+ aPendingNet *prev, *next; /* Previous and next in list */
+ aClient *sptr; /**< Client to which these servers belong */
+ int numservers; /**< Amount of servers in list */
+ int servers[1]; /** The list of servers (array of integer server numerics) */
+};
+
void init_throttling_hash();
int hash_throttling(struct IN_ADDR *in);
struct ThrottlingBucket *find_throttling_bucket(struct IN_ADDR *in);