#
#
#
+# G: OPTIONAL. General configuration options. These control runtime behavior
+# that was previously set at compile time.
+#
+# G:option
+#
+# Currently supported options:
+# hub - Enable hub mode. A hub server accepts multiple server connections
+# and routes traffic between them. Without this option, the server
+# runs as a leaf and will only maintain a single server link.
+# This setting is re-evaluated on /rehash.
+#
+# Uncomment the following line if this server is a hub:
+#G:hub
+#
+#
+#
# Q: OPTIONAL. Nick quarantine. This line prevents non opers from using
# nicks covered by the Q-line.
#
#define MAXIMUM_LINKS 1
/*
- * If your server is running as a a HUB Server then define this.
- * A HUB Server has many servers connect to it at the same as opposed
- * to a leaf which just has 1 server (typically the uplink). Define this
- * correctly for performance reasons.
+ * Hub mode is now a runtime setting via ircd.conf:
+ * G:hub
+ * Default is leaf mode (non-hub) if not set.
*/
-/* #define HUB */
/*
* NOTE: defining CMDLINE_CONFIG and installing ircd SUID or SGID is a MAJOR
extern int dbufalloc, dbufblocks, debuglevel, errno, h_errno;
extern int highest_fd, debuglevel, portnum, debugtty, maxusersperchannel;
+extern int is_hub;
extern int readcalls, udpfd, resfd;
extern aClient *add_connection (aClient *, int);
extern int add_listener (aConfItem *);
--- /dev/null
+#define IRCD_VERSION "Serene5.28"
+#undef HAVE_PARAM_H
+#define HAVE_UNISTD_H
+#define HAVE_STRING_H
+#define HAVE_STRINGS_H
+#define HAVE_STDLIB_H
+#define HAVE_INDEX
+#define HAVE_STRERROR
+#undef HAVE_STRTOKEN
+#define HAVE_STRTOK
+#define HAVE_INET_ADDR
+#define HAVE_INET_NTOA
+#define HAVE_INET_NETOF
+#define GETTIMEOFDAY
+#undef HAVE_LRAND48
+#define HAVE_STRCASECMP
+#define HAVE_BZERO
+#define HAVE_POSIX_NBLOCK
+#undef HAVE_BSD_NBLOCK
+#define HAVE_POSIX_SIGNALS
+#undef HAVE_BSD_SIGNALS
+#undef HAVE_TIMES_2
+#define HAVE_GETRUSAGE_2
+#define DPATH "/home/remmy/ircd"
+#define SPATH "/home/remmy/ircd/ircd"
+#define MAXCONNECTIONS 1024
+#define CRYPT_OPER_PASSWORD 1
+#define CRYPT_ILINE_PASSWORD 1
+#define CONTACT_URL "http://www.serenity-irc.net/connect.html"
+#define SERVICES_NAME "Services.Serenity-IRC.Net"
+#define KLINE_ADDRESS "remmy@serenity-irc.net"
+#define DOMAINNAME "glenmoor"
+#define ZIP_LINKS 1
int lu_noninv, lu_inv, lu_serv, lu_oper, lu_unknown, lu_channel, lu_lu,
lu_lulocal, lu_lserv, lu_clu, lu_mlu, lu_cglobalu, lu_mglobalu;
+int is_hub = 0;
+
#ifdef CLONE_CHECK
aClone *Clones = NULL;
char clonekillhost[100];
** and see if this server is already connected?
*/
cptr = find_name (aconf->name, (aClient *) NULL);
-#ifndef HUB
- /* Leaf servers should not connect to other servers, no matter
- what connect rules might exist when they are already connected
+ /* Leaf servers should not connect to other servers, no matter
+ what connect rules might exist when they are already connected
to another server. -- Remmy */
- if (cptr)
+ if (!is_hub && cptr)
am_connected_leaf = TRUE;
-#endif /* HUB */
/* zero second connect frequincy should mean "DISABLED" not
"connect every time we find the unconnected server in this
loop" dammit
int ccount = 0, ncount = 0;
aConfItem *aconf = NULL;
+ is_hub = 0;
Debug ((DEBUG_DEBUG, "initconf(): ircd.conf = %s", configfile));
if ((fd = openconf ()) == -1) {
return -1;
** is much better! -Aeto
*/
if ((aconf->status & CONF_CONFIG) == CONF_CONFIG) {
-
+ if (aconf->host && !mycmp (aconf->host, "hub"))
+ is_hub = 1;
continue;
}
/* Check if Z:line time -taz */
#ifdef DEBUGMODE
'D',
#endif
-#ifdef HUB
- 'H',
-#endif
#ifdef SHOW_INVISIBLE_LUSERS
'i',
#endif
int m_version (aClient *cptr, aClient *sptr, int parc, char *parv[])
{
extern char serveropts[];
+ char opts[64];
/* Make sure they stick to the local server if not registered.
* -Studded */
return -1;
}
if (hunt_server (cptr, sptr, ":%s VERSION :%s", 1, parc, parv) ==
- HUNTED_ISME)
+ HUNTED_ISME) {
+ /* Build options string, inserting 'H' if hub mode is active */
+ if (is_hub)
+ (void) sprintf (opts, "H%s", serveropts);
+ else
+ (void) strcpy (opts, serveropts);
sendto_one (sptr, rpl_str (RPL_VERSION), me.name, parv[0], version,
- debugmode, me.name, serveropts);
+ debugmode, me.name, opts);
+ }
return 0;
}
}
memset (cptr->passwd, 0, sizeof (cptr->passwd));
-#ifndef HUB
- for (i = 0; i <= highest_fd; i++)
- if (local[i] && IsServer (local[i])) {
- ircstp->is_ref++;
- sendto_one (cptr, "ERROR :I'm a leaf not a hub");
- return exit_client (cptr, cptr, cptr, "I'm a leaf");
- }
-#endif
+ if (!is_hub) {
+ for (i = 0; i <= highest_fd; i++)
+ if (local[i] && IsServer (local[i])) {
+ ircstp->is_ref++;
+ sendto_one (cptr, "ERROR :I'm a leaf not a hub");
+ return exit_client (cptr, cptr, cptr, "I'm a leaf");
+ }
+ }
synchmode = 1;
/* Check for bitflags here */
cptr->flags |= FLAGS_ULINE;
cptr->flags |= FLAGS_TS8;
nextping = time (NULL);
-#ifdef HUB
- sendto_serv_butone (&me, ":%s GLOBOPS :Link with %s established.",
- me.name, inpath);
-#endif
+ if (is_hub)
+ sendto_serv_butone (&me, ":%s GLOBOPS :Link with %s established.",
+ me.name, inpath);
sendto_locfailops ("Link with %s established.", inpath);
/* Insert here */
(void) add_to_client_hash_table (cptr->name, cptr);