]> jfr.im git - solanum.git/commitdiff
Cleanup defaults.h config file.
authorElizabeth Myers <redacted>
Thu, 7 Apr 2016 09:47:48 +0000 (04:47 -0500)
committerElizabeth Myers <redacted>
Thu, 7 Apr 2016 09:47:48 +0000 (04:47 -0500)
Clean up spaces/tabs mixing mess (bleh), add some defaults for authd
stuff, and get rid of CHARYBDIS_SOMAXCONN (just define SOMAXCONN if it's
available...).

authd/providers/blacklist.c
authd/providers/ident.c
authd/providers/opm.c
authd/providers/rdns.c
include/defaults.h
ircd/listener.c

index e0278a20fd21ffe80c2b44f0c7ea11180058617b..be1b194d26f2af14b3a346a3adcb7ca961f2c911 100644 (file)
@@ -38,6 +38,7 @@
  */
 
 #include "authd.h"
+#include "defaults.h"
 #include "provider.h"
 #include "notice.h"
 #include "stdinc.h"
@@ -111,7 +112,7 @@ static void initiate_blacklist_dnsquery(struct blacklist *, struct auth_client *
 
 /* Variables */
 static rb_dlink_list blacklist_list = { NULL, NULL, 0 };
-static int blacklist_timeout = 15;
+static int blacklist_timeout = BLACKLIST_TIMEOUT_DEFAULT;
 
 /* private interfaces */
 
index 40b67f9b4354f40787f752f5267f372a8b28f4ed..f3733ceaf6ae3002bd7a3fcf6acda7b2e523ea29 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "stdinc.h"
+#include "defaults.h"
 #include "match.h"
 #include "authd.h"
 #include "notice.h"
@@ -66,7 +67,7 @@ static void client_fail(struct auth_client *auth, ident_message message);
 static void client_success(struct auth_client *auth);
 static char * get_valid_ident(char *buf);
 
-static int ident_timeout = 5;
+static int ident_timeout = IDENT_TIMEOUT_DEFAULT;
 static bool ident_enable = true;
 
 
index 3c53e77c15946641053e7b58680b9a9db480c588..ce30e749a97cb4610043629fc7fc68bfbe51be4f 100644 (file)
@@ -18,8 +18,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "rb_lib.h"
 #include "stdinc.h"
+#include "rb_lib.h"
+#include "defaults.h"
 #include "setup.h"
 #include "authd.h"
 #include "notice.h"
@@ -94,7 +95,7 @@ static CNCB opm_connected;
 static void opm_cancel(struct auth_client *auth);
 static bool create_listener(const char *ip, uint16_t port);
 
-static int opm_timeout = 10;
+static int opm_timeout = OPM_TIMEOUT_DEFAULT;
 static bool opm_enable = false;
 
 #define LISTEN_IPV4 0
index 5583fd6e68633829687714b57cca49e559b189e0..d263415a8544cd4cc4f58c638f1e1d0facea9737 100644 (file)
@@ -52,7 +52,7 @@ static void client_fail(struct auth_client *auth, dns_message message);
 static void client_success(struct auth_client *auth);
 static void dns_answer_callback(const char *res, bool status, query_type type, void *data);
 
-static int rdns_timeout = 15;
+static int rdns_timeout = RDNS_TIMEOUT_DEFAULT;
 
 static void
 dns_answer_callback(const char *res, bool status, query_type type, void *data)
index 599b2611f59fb9d0924baea915e1567d779731e0..4e36981dfae3ae06a2ed90f7a2b8e40827631396 100644 (file)
 
 #include "setup.h"
 
-/*
- * First, set other fd limits based on values from user
- */
-
+/* Below are the elements for default paths. */
 typedef enum {
        IRCD_PATH_PREFIX,
        IRCD_PATH_MODULES,
@@ -58,35 +55,42 @@ typedef enum {
 
 extern const char *ircd_paths[IRCD_PATH_COUNT];
 
-#define MAXCONNECTIONS 65535 /* default max connections if getrlimit doesn't work */
+/* The below are used as defaults if not found in the configuration file (or on ircd warm-up).
+ * Don't change these - edit the conf file instead.
+ */
+#define MAXCONNECTIONS                 65535           /* default max connections if getrlimit doesn't work */
 /* class {} default values */
-#define DEFAULT_SENDQ 20000000 /* default max SendQ */
-#define PORTNUM 6667           /* default outgoing portnum */
-#define DEFAULT_PINGFREQUENCY    120   /* Default ping frequency */
-#define DEFAULT_CONNECTFREQUENCY 600   /* Default connect frequency */
-#define TS_MAX_DELTA_MIN      10       /* min value for ts_max_delta */
-#define TS_MAX_DELTA_DEFAULT  600      /* default for ts_max_delta */
-#define TS_WARN_DELTA_MIN     10       /* min value for ts_warn_delta */
-#define TS_WARN_DELTA_DEFAULT 30       /* default for ts_warn_delta */
+#define DEFAULT_SENDQ                  20000000        /* default max SendQ */
+#define PORTNUM                                6667            /* default outgoing portnum */
+#define DEFAULT_PINGFREQUENCY          120             /* Default ping frequency */
+#define DEFAULT_CONNECTFREQUENCY       600             /* Default connect frequency */
+#define TS_MAX_DELTA_MIN               10              /* min value for ts_max_delta */
+#define TS_MAX_DELTA_DEFAULT           600             /* default for ts_max_delta */
+#define TS_WARN_DELTA_MIN              10              /* min value for ts_warn_delta */
+#define TS_WARN_DELTA_DEFAULT          30              /* default for ts_warn_delta */
 /* ServerInfo default values */
-#define NETWORK_NAME_DEFAULT "EFnet"   /* default for network_name */
+#define NETWORK_NAME_DEFAULT           "DefaultNet"    /* default for network_name */
 /* General defaults */
-#define CLIENT_FLOOD_DEFAULT 20        /* default for client_flood */
-#define CLIENT_FLOOD_MAX     2000
-#define CLIENT_FLOOD_MIN     10
-#define LINKS_DELAY_DEFAULT  300
-#define MAX_TARGETS_DEFAULT 4  /* default for max_targets */
-#define IDENT_TIMEOUT_DEFAULT 5
-#define MIN_JOIN_LEAVE_TIME  60
-#define MAX_JOIN_LEAVE_COUNT  25
-#define OPER_SPAM_COUNTDOWN   5
-#define JOIN_LEAVE_COUNT_EXPIRE_TIME 120
-#define MIN_SPAM_NUM 5
-#define MIN_SPAM_TIME 60
+#define CLIENT_FLOOD_DEFAULT           20              /* default for client_flood */
+#define CLIENT_FLOOD_MAX               2000
+#define CLIENT_FLOOD_MIN               10
+#define LINKS_DELAY_DEFAULT            300
+#define MAX_TARGETS_DEFAULT            4               /* default for max_targets */
+#define IDENT_TIMEOUT_DEFAULT          5
+#define BLACKLIST_TIMEOUT_DEFAULT      10
+#define OPM_TIMEOUT_DEFAULT            10
+#define RDNS_TIMEOUT_DEFAULT           5
+#define MIN_JOIN_LEAVE_TIME            60
+#define MAX_JOIN_LEAVE_COUNT           25
+#define OPER_SPAM_COUNTDOWN            5
+#define JOIN_LEAVE_COUNT_EXPIRE_TIME   120
+#define MIN_SPAM_NUM                   5
+#define MIN_SPAM_TIME                  60
 
 /*
  * Directory paths and filenames for UNIX systems.
  * IRCD_PREFIX is set using ./configure --prefix, see INSTALL.
+ * Do not change these without corresponding changes in the build system.
  *
  * IRCD_PREFIX = prefix for all directories,
  * DPATH       = root directory of installation,
@@ -97,21 +101,25 @@ extern const char *ircd_paths[IRCD_PATH_COUNT];
  * AUTOMODPATH = directory for autoloaded modules
  */
 
-#define DPATH   IRCD_PREFIX
-#define BINPATH IRCD_PREFIX "/bin/"
-#define MODPATH MODULE_DIR
-#define AUTOMODPATH MODULE_DIR "/autoload/"
-#define ETCPATH ETC_DIR
-#define LOGPATH LOG_DIR
-#define UHPATH   HELP_DIR "/users"
-#define HPATH  HELP_DIR "/opers"
-#define SPATH    BINPATH "/" PROGRAM_PREFIX "charybdis"                   /* ircd executable */
-#define CPATH    ETCPATH "/ircd.conf"                             /* ircd.conf file */
-#define MPATH    ETCPATH "/ircd.motd"                             /* MOTD file */
-#define LPATH    LOGPATH "/ircd.log"                              /* ircd logfile */
-#define PPATH    PKGRUNDIR "/ircd.pid"                            /* pid file */
-#define OPATH    ETCPATH "/opers.motd"                            /* oper MOTD file */
-#define DBPATH   PKGLOCALSTATEDIR "/ban.db"                        /* bandb file */
+#define DPATH          IRCD_PREFIX
+#define BINPATH                IRCD_PREFIX "/bin/"
+#define MODPATH                MODULE_DIR
+#define AUTOMODPATH    MODULE_DIR "/autoload/"
+#define ETCPATH                ETC_DIR
+#define LOGPATH                LOG_DIR
+#define UHPATH         HELP_DIR "/users"
+#define HPATH          HELP_DIR "/opers"
+#define SPATH          BINPATH "/" PROGRAM_PREFIX "/" BRANDING_NAME    /* ircd executable */
+#define CPATH          ETCPATH "/ircd.conf"                            /* ircd.conf file */
+#define MPATH          ETCPATH "/ircd.motd"                            /* MOTD file */
+#define LPATH          LOGPATH "/ircd.log"                             /* ircd logfile */
+#define PPATH          PKGRUNDIR "/ircd.pid"                           /* pid file */
+#define OPATH          ETCPATH "/opers.motd"                           /* oper MOTD file */
+#define DBPATH         PKGLOCALSTATEDIR "/ban.db"                      /* bandb file */
+
+/* Below are somewhat configurable settings (though it's probably a bad idea
+ * to blindly mess with them). If in any doubt, leave them alone.
+ */
 
 /* HANGONGOODLINK and HANGONRETRYDELAY
  * Often net breaks for a short time and it's useful to try to
@@ -122,25 +130,27 @@ extern const char *ircd_paths[IRCD_PATH_COUNT];
  * (HANGONRETRYDELAY). This latter has to be long enough that the
  * other end of the connection has time to notice it broke too.
  */
-#define HANGONRETRYDELAY 60    /* Recommended value: 30-60 seconds */
-#define HANGONGOODLINK 3600    /* Recommended value: 30-60 minutes */
+#define HANGONRETRYDELAY       60      /* Recommended value: 30-60 seconds */
+#define HANGONGOODLINK         3600    /* Recommended value: 30-60 minutes */
 
 /* KILLCHASETIMELIMIT -
  * Max time from the nickname change that still causes KILL
  * automatically to switch for the current nick of that user. (seconds)
  */
-#define KILLCHASETIMELIMIT 90  /* Recommended value: 90 */
+#define KILLCHASETIMELIMIT     90      /* Recommended value: 90 */
 
 /* MAX_BUFFER
  * The amount of fds to reserve for clients exempt from limits
  * and dns lookups.
  */
-#define MAX_BUFFER      60
+#define MAX_BUFFER             60
 
-/* CHARYBDIS_SOMAXCONN
+/*
  * Use SOMAXCONN if OS has it, otherwise use this value for the
  * listen(); backlog.  5 for AIX/SUNOS, 25 for other OSs.
  */
-#define CHARYBDIS_SOMAXCONN 25
+#ifndef SOMAXCONN
+#      define SOMAXCONN        25
+#endif
 
 #endif                         /* INCLUDED_defaults_h */
index 2757ad37356e4945b8daa8acc6449437c9e76eab..fd4c103d05a4522c054d70037aac49e0f63ec477 100644 (file)
@@ -153,14 +153,7 @@ show_ports(struct Client *source_p)
  * inetport - create a listener socket in the AF_INET or AF_INET6 domain,
  * bind it to the port given in 'port' and listen to it
  * returns true (1) if successful false (0) on error.
- *
- * If the operating system has a define for SOMAXCONN, use it, otherwise
- * use CHARYBDIS_SOMAXCONN
  */
-#ifdef SOMAXCONN
-#undef CHARYBDIS_SOMAXCONN
-#define CHARYBDIS_SOMAXCONN SOMAXCONN
-#endif
 
 static int
 inetport(struct Listener *listener)
@@ -247,7 +240,7 @@ inetport(struct Listener *listener)
                return 0;
        }
 
-       if(rb_listen(F, CHARYBDIS_SOMAXCONN, listener->defer_accept))
+       if(rb_listen(F, SOMAXCONN, listener->defer_accept))
        {
                errstr = strerror(rb_get_sockerr(F));
                sendto_realops_snomask(SNO_GENERAL, L_ALL,