--- sbbs/src/sbbs3/startup.h 2018/04/24 16:41:23 1.1.1.1 +++ sbbs/src/sbbs3/startup.h 2018/04/24 16:42:50 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet main/telnet server thread startup structure */ -/* $Id: startup.h,v 1.1.1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: startup.h,v 1.1.1.2 2018/04/24 16:42:50 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -44,6 +44,10 @@ #include "semwrap.h" /* sem_t */ #include "ini_file.h" /* INI_MAX_VALUE_LEN */ #include "sbbsdefs.h" /* LOG_* (syslog.h) values */ +#ifndef LINK_LIST_THREADSAFE + #define LINK_LIST_THREADSAFE +#endif +#include "link_list.h" typedef struct { ulong max_bytes; /* max allocated bytes before garbage collection */ @@ -52,6 +56,7 @@ typedef struct { ulong branch_limit; /* maximum number of branches (for infinite loop detection) */ ulong gc_interval; /* number of branches between garbage collection attempts */ ulong yield_interval; /* number of branches between time-slice yields */ + char load_path[INI_MAX_VALUE_LEN]; /* additional (comma-separated) directories to search for load()ed scripts */ } js_startup_t; typedef struct { @@ -65,6 +70,10 @@ typedef struct { js_startup_t js; uint bind_retry_count; /* Number of times to retry bind() calls */ uint bind_retry_delay; /* Time to wait between each bind() retry */ + ulong login_attempt_delay; + ulong login_attempt_throttle; + ulong login_attempt_hack_threshold; + ulong login_attempt_filter_threshold; } global_startup_t; @@ -88,11 +97,13 @@ typedef struct { sem_t** node_spysem; /* Spy output semaphore (each node) */ void* cbdata; /* Private data passed to callbacks */ + void* event_cbdata; /* Private data passed to event_lputs callback */ /* Callbacks (NULL if unused) */ - int (*lputs)(void*, int, char*); /* Log - put string */ - int (*event_lputs)(int, char*); /* Event log - put string */ - void (*status)(void*, char*); + int (*lputs)(void*, int , const char*); /* Log - put string */ + int (*event_lputs)(void*, int, const char*); /* Event log - put string */ + void (*errormsg)(void*, int level, const char* msg); + void (*status)(void*, const char*); void (*started)(void*); void (*recycle)(void*); void (*terminated)(void*, int code); @@ -123,6 +134,13 @@ typedef struct { /* JavaScript operating parameters */ js_startup_t js; + /* Login Attempt parameters */ + ulong login_attempt_delay; + ulong login_attempt_throttle; + ulong login_attempt_hack_threshold; + ulong login_attempt_filter_threshold; + link_list_t* login_attempt_list; + } bbs_startup_t; /* startup options that requires re-initialization/recycle when changed */ @@ -160,12 +178,11 @@ static struct init_field { #define BBS_OPT_NO_RECYCLE (1<<27) /* Disable recycling of server */ #define BBS_OPT_GET_IDENT (1<<28) /* Get Identity (RFC 1413) */ #define BBS_OPT_NO_JAVASCRIPT (1<<29) /* JavaScript disabled */ -#define BBS_OPT_LOCAL_TIMEZONE (1<<30) /* Don't force UTC/GMT */ #define BBS_OPT_MUTE (1<<31) /* Mute sounds */ /* bbs_startup_t.options bits that require re-init/recycle when changed */ #define BBS_INIT_OPTS (BBS_OPT_ALLOW_RLOGIN|BBS_OPT_ALLOW_SSH|BBS_OPT_NO_EVENTS|BBS_OPT_NO_SPY_SOCKETS \ - |BBS_OPT_NO_JAVASCRIPT|BBS_OPT_LOCAL_TIMEZONE) + |BBS_OPT_NO_JAVASCRIPT) #if defined(STARTUP_INI_BITDESC_TABLES) static ini_bitdesc_t bbs_options[] = { @@ -185,7 +202,6 @@ static ini_bitdesc_t bbs_options[] = { { BBS_OPT_NO_RECYCLE ,"NO_RECYCLE" }, { BBS_OPT_GET_IDENT ,"GET_IDENT" }, { BBS_OPT_NO_JAVASCRIPT ,"NO_JAVASCRIPT" }, - { BBS_OPT_LOCAL_TIMEZONE ,"LOCAL_TIMEZONE" }, { BBS_OPT_MUTE ,"MUTE" }, /* terminator */ { 0 ,NULL }