From ffbcff160474cd45fbcbbadaff32f38e1d7fea71 Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Sun, 16 Nov 2008 19:31:31 +0000 Subject: Added support for multiple uplink blocks in the new config. Moved the type and id directives from the uplink block to the serverinfo block. Small config fixes. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1746 5417fbe8-f217-4b02-8779-1006273d7864 --- include/extern.h | 12 ++---------- include/services.h | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/extern.h b/include/extern.h index b1706b622..1ff32aba5 100644 --- a/include/extern.h +++ b/include/extern.h @@ -227,15 +227,7 @@ char *sockstrerror(int error); /**** config.c ****/ -E char *RemoteServer; -E int RemotePort; -E char *RemotePassword; -E char *RemoteServer2; -E int RemotePort2; -E char *RemotePassword2; -E char *RemoteServer3; -E int RemotePort3; -E char *RemotePassword3; +E std::list Uplinks; E char *LocalHost; E int LocalPort; @@ -514,7 +506,7 @@ E void set_lastmask(User * u); E void introduce_user(const char *user); E int init_primary(int ac, char **av); E int init_secondary(int ac, char **av); -E int servernum; +E Uplink *uplink_server; /**** ircd.c ****/ E void pmodule_ircd_proto(IRCDProto *); diff --git a/include/services.h b/include/services.h index ba04d873a..8ba6db085 100644 --- a/include/services.h +++ b/include/services.h @@ -229,6 +229,7 @@ extern int strncasecmp(const char *, const char *, size_t); #include #include #include +#include /** This class can be used on its own to represent an exception, or derived to represent a module-specific exception. * When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or @@ -351,7 +352,7 @@ class Extensible * @return Returns true on success. */ bool Shrink(const std::string &key); - + /** Get an extension item. * * @param key The key parameter is an arbitary string which identifies the extension data @@ -372,12 +373,12 @@ class Extensible return false; } } - + /** Get an extension item. * * @param key The key parameter is an arbitary string which identifies the extension data * @return Returns true if the item was found and false if it was not. - * + * * This single-parameter version only checks if the key exists, it does nothing with * the 'data' field and is probably only useful in conjunction with the single-parameter * version of Extend(). @@ -1249,11 +1250,11 @@ struct capabinfo_ { /*************************************************************************/ - /* * Forward declaration reqired, because the base IRCDProto class uses some crap from in here. */ class IRCDProto; +struct Uplink; #include "extern.h" class IRCDProto { @@ -1517,4 +1518,23 @@ class IRCDTS6Proto : public IRCDProto /*************************************************************************/ +struct Uplink { + char *host; + int port; + char *password; + Uplink(const char *_host, int _port, const char *_password) + { + host = sstrdup(_host); + port = _port; + password = sstrdup(_password); + } + ~Uplink() + { + free(host); + free(password); + } +}; + +/*************************************************************************/ + #endif /* SERVICES_H */ -- cgit