#ifndef __class_include__
#define __class_include__
-#ifndef PROTO
-#if __STDC__
-# define PROTO(x) x
-#else
-# define PROTO(x) ()
-#endif
-#endif
-
typedef struct Class {
int class;
int conFreq;
#include <time.h>
#include "sys.h"
-#ifdef HAVE_PARAM_H
-#include <sys/param.h>
-#endif
-
-#ifndef PROTO
-#if __STDC__
-# define PROTO(x) x
-#else
-# define PROTO(x) ()
-#endif
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
+#define PROTO(x) x
#ifdef TRUE
#undef TRUE
extern int match PROTO((char *, char *));
extern int mycmp (char *, char *);
-#ifdef NEED_STRTOK
-extern char *strtok PROTO((char *, char *));
-#endif
#ifndef HAVE_STRTOKEN
extern char *strtoken PROTO((char **, char *, char *));
#endif
-#ifndef HAVE_INET_ADDR
-extern unsigned long inet_addr PROTO((char *));
-#endif
-
-#if !defined(HAVE_INET_NTOA) || !defined(HAVE_INET_NETOF)
-#include <netinet/in.h>
-#endif
-
-#ifndef HAVE_INET_NTOA
-extern char *inet_ntoa PROTO((struct in_addr));
-#endif
-
-#ifndef HAVE_INET_NETOF
-extern int inet_netof PROTO((struct in_addr));
-#endif
-int global_count, max_global_count;
+extern int global_count, max_global_count;
extern char *myctime PROTO((time_t));
extern char *strtoken PROTO((char **, char *, char *));
lu_clu, lu_mlu, lu_cglobalu, lu_mglobalu;
-time_t now;
+extern time_t now;
#endif /* __common_include__ */
#define MALLOC_FLAGS_EXTRA ""
-/* Many older Operating Systems are running with insecure TCP stacks.
- * This allows IP spoofing attacks, which are very difficult for
- * operators to track down and ban."
- *
- * If you have such an old OS you can enable it here but keep in mind that
- * this will be the least of your security problems.
- *
- * Enable this option for any windows version older than 2000
- */
-
#undef NOSPOOF
#undef COMMENT_IS_FILE
-/* Do these work? I dunno... */
-
-/* #undef PCS *//* PCS Cadmus MUNIX, use with BSD flag! */
-
-/*
- * NOTE: On some systems, valloc() causes many problems.
- */
-#undef VALLOC /* Define this if you have valloc(3) */
-
-/*
- * read/write are restarted after signals defining this 1, gets
- * siginterrupt call compiled, which attempts to remove this
- * behaviour (apollo sr10.1/bsd4.3 needs this)
- */
-#ifdef APOLLO
-#define RESTARTING_SYSTEMCALLS
-#endif
-
/* #undef DEBUGMODE *//* define DEBUGMODE to enable debugging mode.*/
//#define DEBUGMODE
* 1 server = 1 connection, 1 user = 1 connection.
* This should be at *least* 3: 1 listen port, 1 dns port + 1 client
*
- * Note: this figure will be too high for most systems. If you get an
+ * Note: this figure will be too high for most systems. If you get an
* fd-related error on compile, change this to 256.
- *
- * Windows users: This should be a fairly high number. Some operations
- * will slow down because of this, but it is _required_ because of the way
- * windows NT(and possibly 95) allocate fd handles. A good number is 16384.
*/
#ifndef MAXCONNECTIONS
#define MAXCONNECTIONS 1024
#ifndef __dbuf_include__
#define __dbuf_include__
-#ifndef PROTO
-#ifdef __STDC__
-# define PROTO(x) x
-#else
-# define PROTO(x) ()
-#endif /* __STDC__ */
-#endif /* ! PROTO */
-
/*
** dbuf is a collection of functions which can be used to
** maintain a dynamic buffering of a byte stream.
extern void add_temp_conf();
extern void inittoken PROTO(());
extern int do_channel_synch(char *);
-int synchmode;
-int SVSNOOP;
+extern int synchmode;
+extern int SVSNOOP;
extern void calc_mask(aClient *) ;
char *return_host(aClient *, aClient *) ;
char *return_oper_host(aClient *, aClient *) ;
extern void serv_info(aClient *, char *);
extern int str2array(char **, char *, char *);
extern void CheckBandwidth(void);
-int max_connection_count, max_client_count;
-long max_sendqs,max_recvqs;
+extern int max_connection_count, max_client_count;
+extern long max_sendqs,max_recvqs;
extern int find_services(void);
int id;
int sent; /* number of requests sent */
int srch;
-#ifdef __alpha
- u_int ttl; /* time to live */
-#else
- u_long ttl; /* time to live */
-#endif
+ unsigned int ttl; /* time to live */
char type;
char retries; /* retry counter */
char sends; /* number of sends (>1 means resent) */
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/*
- * Revision 1.1.1.1 1997/08/22 17:23:01 donwulff
- * Original import from the "deadlined" version.
- *
- * Revision 1.1.1.1 1996/11/18 07:53:41 explorer
- * ircd 4.3.3 -- about time
- *
- * Revision 1.1.1.1.4.1 1996/09/16 02:45:38 donwulff
- * *** empty log message ***
- *
- * Revision 6.1 1991/07/04 21:04:35 gruner
- * Revision 2.6.1 [released]
- *
- * Revision 6.0 1991/07/04 18:05:04 gruner
- * frozen beta revision 2.6.1
- *
- */
-
-#ifndef FD_ZERO
-#define FD_ZERO(set) (((set)->fds_bits[0]) = 0)
-#define FD_SET(s1, set) (((set)->fds_bits[0]) |= 1 << (s1))
-#define FD_ISSET(s1, set) (((set)->fds_bits[0]) & (1 << (s1)))
-#define FD_SETSIZE 30
-#endif
+#include <sys/select.h>
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifdef ISC202
-#include <net/errno.h>
-#else
-#include <sys/errno.h>
-#endif
+#include <errno.h>
#include "setup.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/param.h>
-
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
#include <strings.h>
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
-
-#ifndef HAVE_STRCASECMP
-#define strcasecmp mycmp
-#endif
-#ifndef HAVE_INDEX
-#define index strchr
-#define rindex strrchr
-#endif
-
-#ifndef HAVE_BZERO
-#define bzero(a,b) memset(a,0,b)
-#define bcopy(a,b,c) memcpy(b,a,c)
-#define bcmp memcmp
-#endif
-
-#ifdef HAVE_GETRUSAGE_2
-# define GETRUSAGE_2
-#else
-# ifdef HAVE_TIMES_2
-# define TIMES_2
-# endif /* HAVE_TIMES_2 */
-#endif /* GETRUSAGE_2 */
-
-#ifdef HAVE_POSIX_NBLOCK
-# define NBLOCK_POSIX
-#else /* HAVE_POSIX_NBLOCK */
-# ifdef HAVE_BSD_NBLOCK
-# define NBLOCK_BSD
-# else
-# define NBLOCK_SYSV
-# endif /* HAVE_BSD_NBLOCK */
-#endif /* HAVE_POSIX_NBLOCK */
-
-#ifdef HAVE_POSIX_SIGNALS
-# define POSIX_SIGNALS
-#else
-# ifdef HAVE_BSD_SIGNALS
-# define BSD_RELIABLE_SIGNALS
-# else
-# define SYSV_UNRELIABLE_SIGNALS
-# endif /* HAVE_BSD_SIGNALS */
-#endif /* HAVE_POSIX_SIGNALS */
-
+#include <string.h>
#include <sys/time.h>
+#include <stdarg.h>
+
+#define NBLOCK_POSIX
+#define POSIX_SIGNALS
#if !defined(DEBUGMODE)
# define MyFree(x) if ((x) != NULL) free(x)
#define free(x) MyFree(x)
#endif
-#define VOIDSIG void /* whether signal() returns int of void */
-
-#define OPT_TYPE void /* opt type for get/setsockopt */
-
-#ifdef __osf__
-# define OSF
-/* OSF defines BSD to be its version of BSD */
-# undef BSD
-# include <sys/param.h>
-# ifndef BSD
-# define BSD
-# endif
-#endif
-
-#define dn_skipname __dn_skipname
-
-extern VOIDSIG dummy();
+extern void dummy();
#ifndef u_char
typedef unsigned char u_char;
typedef unsigned int u_int;
#endif
-#ifdef USE_VARARGS
-#include <varargs.h>
-#endif
#define MOTD MPATH
#define LUSERS LUPATH
#define OMOTD OMPATH
*/
#define MAXCLIENTS (MAXCONNECTIONS-4)
-
+
#if defined(CLIENT_FLOOD)
# if (CLIENT_FLOOD > 8000)
# define CLIENT_FLOOD 8000
#ifndef __whowas_include__
#define __whowas_include__
-#ifndef PROTO
-#if __STDC__
-# define PROTO(x) x
-#else
-# define PROTO(x) ()
-#endif /* __STDC__ */
-#endif /* ! PROTO */
-
/*
** WHOWAS structure moved here from whowas.c
*/
#include <signal.h>
#include <sys/socket.h>
-extern int errno; /* ...seems that errno.h doesn't define this everywhere */
-#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__linux__) && !defined(__Darwin__)
-extern char *sys_errlist[];
-#endif
+extern int errno;
#ifdef DEBUGMODE
int writecalls = 0, writeb[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
#endif
-VOIDSIG dummy ()
+void dummy ()
{
-#ifndef HAVE_RELIABLE_SIGNALS
- (void) signal (SIGALRM, dummy);
- (void) signal (SIGPIPE, dummy);
-#ifdef SIGWINCH
- (void) signal (SIGWINCH, dummy);
-#endif
-#else
-#ifdef POSIX_SIGNALS
struct sigaction act;
act.sa_handler = dummy;
#ifdef SIGWINCH
(void) sigaction (SIGWINCH, &act, (struct sigaction *) NULL);
#endif
-#endif
-#endif
}
** all is Ok, if the 'write' just returns '0' instead of an
** error and errno=EWOULDBLOCK.
**
- ** ...now, would this work on VMS too? --msa
*/
if (retval < 0 && (errno == EWOULDBLOCK || errno == EAGAIN ||
errno == ENOBUFS)) {
#include "sys.h"
#include "h.h"
-#if !defined(VALLOC) && !defined(valloc)
-#define valloc malloc
-#endif
-
int dbufalloc = 0, dbufblocks = 0;
static dbufbuf *freelist = NULL;
*/
static dbufbuf *dbuf_alloc ()
{
-#if defined(VALLOC) && !defined(DEBUGMODE)
- dbufbuf *dbptr, *db2ptr;
- int num;
-#else
dbufbuf *dbptr;
-#endif
dbufalloc++;
if ((dbptr = freelist)) {
dbufalloc--;
return NULL;
}
-#if defined(VALLOC) && !defined(DEBUGMODE)
-#if defined(_SC_PAGESIZE)
- num = sysconf (_SC_PAGESIZE) / sizeof (dbufbuf);
-#else
- num = getpagesize () / sizeof (dbufbuf);
-#endif
- if (num < 0)
- num = 1;
-
- dbufblocks += num;
-
- dbptr = (dbufbuf *) valloc (num * sizeof (dbufbuf));
- if (!dbptr)
- return (dbufbuf *) NULL;
-
- num--;
- for (db2ptr = dbptr; num; num--) {
- db2ptr = (dbufbuf *) ((char *) db2ptr + sizeof (dbufbuf));
- db2ptr->next = freelist;
- freelist = db2ptr;
- }
- return dbptr;
-#else
dbufblocks++;
return (dbufbuf *) MyMalloc (sizeof (dbufbuf));
-#endif
}
/*
uint32_t NOSPOOF_SEED01, NOSPOOF_SEED02;
#endif /* NOSPOOF */
+int global_count, max_global_count;
+time_t now;
+int synchmode;
+int SVSNOOP;
+int max_connection_count, max_client_count;
+long max_sendqs, max_recvqs;
+
int R_do_dns, R_fin_dns, R_fin_dnsc, R_fail_dns, R_do_id, R_fin_id, R_fail_id;
char REPORT_DO_DNS[128], REPORT_FIN_DNS[128], REPORT_FIN_DNSC[128],
aClient *client = &me; /* Pointer to beginning of Client list */
void server_reboot (char *);
-void restart PROTO ((char *));
+void restart (char *);
static void open_debugfile (), setup_signals ();
void check_lusers (void);
int client_count = 0; /* I guess -SJW */
time_t NOW;
-#if defined(PROFIL)
-extern etext ();
-VOIDSIG s_monitor ()
-{
- static int mon = 0;
-#ifdef POSIX_SIGNALS
- struct sigaction act;
-#endif
-
- (void) moncontrol (mon);
- mon = 1 - mon;
-#ifdef POSIX_SIGNALS
- act.sa_handler = s_rehash;
- act.sa_flags = 0;
- (void) sigemptyset (&act.sa_mask);
- (void) sigaddset (&act.sa_mask, SIGUSR1);
- (void) sigaction (SIGUSR1, &act, NULL);
-#else
- (void) signal (SIGUSR1, s_monitor);
-#endif
-}
-
-#endif
-
-VOIDSIG s_die ()
+void s_die ()
{
int fd;
exit (-1);
}
-static VOIDSIG s_rehash ()
+static void s_rehash ()
{
-#ifdef POSIX_SIGNALS
struct sigaction act;
-#endif
+
dorehash = 1;
-#ifdef POSIX_SIGNALS
act.sa_handler = s_rehash;
act.sa_flags = 0;
(void) sigemptyset (&act.sa_mask);
(void) sigaddset (&act.sa_mask, SIGHUP);
(void) sigaction (SIGHUP, &act, NULL);
-#else
- (void) signal (SIGHUP, s_rehash); /* sysV -argv */
-#endif
}
void restart (mesg)
server_reboot (mesg);
}
-VOIDSIG s_restart ()
+void s_restart ()
{
static int restarting = 0;
sbrk0 = (char *) sbrk ((size_t) 0);
uid = getuid ();
euid = geteuid ();
-#ifdef PROFIL
- (void) monstartup (0, etext);
- (void) moncontrol (1);
- (void) signal (SIGUSR1, s_monitor);
-#endif /* PROFIL */
client_count = 0;
global_count = 0;
static void setup_signals ()
{
-#ifdef POSIX_SIGNALS
struct sigaction act;
act.sa_handler = SIG_IGN;
#ifdef SIGWINCH
(void) sigaddset (&act.sa_mask, SIGWINCH);
(void) sigaction (SIGWINCH, &act, NULL);
-#endif /* SIGWINCH */
+#endif
(void) sigaction (SIGPIPE, &act, NULL);
act.sa_handler = dummy;
(void) sigaction (SIGALRM, &act, NULL);
act.sa_handler = s_die;
(void) sigaddset (&act.sa_mask, SIGTERM);
(void) sigaction (SIGTERM, &act, NULL);
-
-#else /* POSIX_SIGNALS */
-#ifndef HAVE_RELIABLE_SIGNALS
- (void) signal (SIGPIPE, dummy);
-#ifdef SIGWINCH
- (void) signal (SIGWINCH, dummy);
-#endif
-#else
-#ifdef SIGWINCH
- (void) signal (SIGWINCH, SIG_IGN);
-#endif
- (void) signal (SIGPIPE, SIG_IGN);
-#endif
- (void) signal (SIGALRM, dummy);
- (void) signal (SIGHUP, s_rehash);
- (void) signal (SIGTERM, s_die);
- (void) signal (SIGINT, s_restart);
-#endif /* POSIX_SIGNALS */
-
-#ifdef RESTARTING_SYSTEMCALLS
- /*
- ** At least on Apollo sr10.1 it seems continuing system calls
- ** after signal is the default. The following 'siginterrupt'
- ** should change that default to interrupting calls.
- */
- (void) siginterrupt (SIGALRM, 1);
-#endif
}
{
int ret = 0;
-#ifdef HAVE_LRAND48
srand48 (time (NULL));
-#endif
if (op & RES_INITLIST) {
bzero ((char *) &reinfo, sizeof (reinfo));
first = last = NULL;
return r;
}
hptr = (HEADER *) buf;
-#ifdef HAVE_LRAND48
do {
hptr->id = htons (ntohs (hptr->id) + k + lrand48 () & 0xffff);
-#else
- (void) gettimeofday (&tv, NULL);
- do {
- /* htons/ntohs can be assembler macros, which cannot
- be nested. Thus two lines. -Vesa */
- u_short nstmp =
- ntohs (hptr->id) + k + (u_short) (tv.tv_usec & 0xffff);
- hptr->id = htons (nstmp);
-#endif /* HAVE_LRAND48 */
k++;
}
while (find_id (ntohs (hptr->id)));
#ifdef SO_ERROR
if (cptr && !IsMe (cptr) && cptr->fd >= 0)
if (!getsockopt
- (cptr->fd, SOL_SOCKET, SO_ERROR, (OPT_TYPE *) & err, &len))
+ (cptr->fd, SOL_SOCKET, SO_ERROR, (void *) & err, &len))
if (err)
errtmp = err;
#endif
#ifdef SO_REUSEADDR
opt = 1;
if (setsockopt
- (fd, SOL_SOCKET, SO_REUSEADDR, (OPT_TYPE *) & opt, sizeof (opt)) < 0)
+ (fd, SOL_SOCKET, SO_REUSEADDR, (void *) & opt, sizeof (opt)) < 0)
report_error ("setsockopt(SO_REUSEADDR) %s:%s", cptr);
#endif
#if defined(SO_USELOOPBACK)
opt = 1;
if (setsockopt
- (fd, SOL_SOCKET, SO_USELOOPBACK, (OPT_TYPE *) & opt,
+ (fd, SOL_SOCKET, SO_USELOOPBACK, (void *) & opt,
sizeof (opt)) < 0)
report_error ("setsockopt(SO_USELOOPBACK) %s:%s", cptr);
#endif
else
opt = 4096;
if (setsockopt
- (fd, SOL_SOCKET, SO_RCVBUF, (OPT_TYPE *) & opt, sizeof (opt))
+ (fd, SOL_SOCKET, SO_RCVBUF, (void *) & opt, sizeof (opt))
< 0)
report_error ("setsockopt(SO_RCVBUF) %s:%s", cptr);
#endif
#ifdef SO_SNDBUF
opt = 8192;
if (setsockopt
- (fd, SOL_SOCKET, SO_SNDBUF, (OPT_TYPE *) & opt, sizeof (opt))
+ (fd, SOL_SOCKET, SO_SNDBUF, (void *) & opt, sizeof (opt))
< 0)
report_error ("setsockopt(SO_SNDBUF) %s:%s", cptr);
#endif
char *s = readbuf, *t = readbuf + sizeof (readbuf) / 2;
opt = sizeof (readbuf) / 8;
- if (getsockopt (fd, IPPROTO_IP, IP_OPTIONS, (OPT_TYPE *) t, &opt) < 0)
+ if (getsockopt (fd, IPPROTO_IP, IP_OPTIONS, (void *) t, &opt) < 0)
report_error ("getsockopt(IP_OPTIONS) %s:%s", cptr);
else if (opt > 0 && opt != sizeof (readbuf) / 8) {
for (*readbuf = '\0'; opt > 0; opt--, s += 3)
sendto_ops ("Connection %s using IP opts: (%s)",
get_client_name (cptr, TRUE), readbuf);
}
- if (setsockopt (fd, IPPROTO_IP, IP_OPTIONS, (OPT_TYPE *) NULL, 0) < 0)
+ if (setsockopt (fd, IPPROTO_IP, IP_OPTIONS, (void *) NULL, 0) < 0)
report_error ("setsockopt(IP_OPTIONS) %s:%s", cptr);
}
#endif
#ifdef SO_ERROR
if (cptr->fd >= 0)
if (!getsockopt
- (cptr->fd, SOL_SOCKET, SO_ERROR, (OPT_TYPE *) & err, &len))
+ (cptr->fd, SOL_SOCKET, SO_ERROR, (void *) & err, &len))
if (err)
errtmp = err;
#endif
{
int res, nonb = 0;
- /*
- ** NOTE: consult ALL your relevant manual pages *BEFORE* changing
- ** these ioctl's. There are quite a few variations on them,
- ** as can be seen by the PCS one. They are *NOT* all the same.
- ** Heed this well. - Avalon.
- */
-#ifdef NBLOCK_POSIX
nonb |= O_NONBLOCK;
-#endif
-#ifdef NBLOCK_BSD
- nonb |= O_NDELAY;
-#endif
-#ifdef NBLOCK_SYSV
- /* This portion of code might also apply to NeXT. -LynX */
- res = 1;
- if (ioctl (fd, FIONBIO, &res) < 0)
- report_error ("ioctl(fd,FIONBIO) failed for %s:%s", cptr);
-#else
if ((res = fcntl (fd, F_GETFL, 0)) == -1)
report_error ("fcntl(fd, F_GETFL) failed for %s:%s", cptr);
else if (fcntl (fd, F_SETFL, res | nonb) == -1)
report_error ("fcntl(fd, F_SETL, nonb) failed for %s:%s", cptr);
-#endif
return;
}
return -1;
}
if (setsockopt (udpfd, SOL_SOCKET, SO_REUSEADDR,
- (OPT_TYPE *) & on, sizeof (on)) == -1) {
+ (void *) & on, sizeof (on)) == -1) {
#ifdef USE_SYSLOG
syslog (LOG_ERR, "setsockopt udp fd %d : %m", udpfd);
#endif
#ifdef NOSPOOF
'n',
#endif
-#ifdef VALLOC
- 'V',
-#endif
#ifdef USE_SYSLOG
'Y',
#endif
#include "hash.h"
#include <sys/file.h>
#include <sys/param.h>
-#ifdef GETRUSAGE_2
#include <sys/resource.h>
-#else
-#ifdef TIMES_2
-#include <sys/times.h>
-#endif
-#endif
#include "h.h"
#ifndef ssize_t
aClient *cptr;
char *nick;
{
-
-#ifdef GETRUSAGE_2
struct rusage rus;
time_t secs, rup;
#ifdef hz
#endif
if (getrusage (RUSAGE_SELF, &rus) == -1) {
-#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__linux__) && !defined(__Darwin__)
- extern char *sys_errlist[];
-#endif
- sendto_one (cptr, ":%s NOTICE %s :Getruseage error: %s.",
- me.name, nick, sys_errlist[errno]);
+ sendto_one (cptr, ":%s NOTICE %s :Getrusage error: %s.",
+ me.name, nick, strerror (errno));
return;
}
secs = rus.ru_utime.tv_sec + rus.ru_stime.tv_sec;
sendto_one (cptr, ":%s %d %s :Signals %d Context Vol. %d Invol %d",
me.name, RPL_STATSDEBUG, nick, rus.ru_nsignals, rus.ru_nvcsw,
rus.ru_nivcsw);
-#else
-#ifdef TIMES_2
- struct tms tmsbuf;
- time_t secs, mins;
- int hzz = 1, ticpermin;
- int umin, smin, usec, ssec;
-
- ticpermin = hzz * 60;
-
- umin = tmsbuf.tms_utime / ticpermin;
- usec = (tmsbuf.tms_utime % ticpermin) / (float) hzz;
- smin = tmsbuf.tms_stime / ticpermin;
- ssec = (tmsbuf.tms_stime % ticpermin) / (float) hzz;
- secs = usec + ssec;
- mins = (secs / 60) + umin + smin;
- secs %= hzz;
-
- if (times (&tmsbuf) == -1) {
- sendto_one (cptr, ":%s %d %s :times(2) error: %s.",
- me.name, RPL_STATSDEBUG, nick, strerror (errno));
- return;
- }
- secs = tmsbuf.tms_utime + tmsbuf.tms_stime;
-
- sendto_one (cptr,
- ":%s %d %s :CPU Secs %d:%d User %d:%d System %d:%d",
- me.name, RPL_STATSDEBUG, nick, mins, secs, umin, usec,
- smin, ssec);
-#endif
-#endif
sendto_one (cptr, ":%s %d %s :Reads %d Writes %d",
me.name, RPL_STATSDEBUG, nick, readcalls, writecalls);
sendto_one (cptr, ":%s %d %s :DBUF alloc %d blocks %d",
*/
opt = 2048;
if (setsockopt
- (fd, SOL_SOCKET, SO_SNDBUF, (OPT_TYPE *) & opt, sizeof (opt))
+ (fd, SOL_SOCKET, SO_SNDBUF, (void *) & opt, sizeof (opt))
< 0
- || setsockopt (fd, SOL_SOCKET, SO_RCVBUF, (OPT_TYPE *) & opt,
+ || setsockopt (fd, SOL_SOCKET, SO_RCVBUF, (void *) & opt,
sizeof (opt)) < 0) {
int err = errno;
sendto_ops ("m_uping: setsockopt SO_SNDBUF|SO_RCVBUF: %s",
static void report_jinx (aClient * sptr);
static char buf[BUFSIZE];
-VOIDSIG s_die ();
+void s_die ();
/* I guess we can move this to somewhere else ... */
/*
}
#endif /* HAVE_STRTOKEN */
-#ifdef NEED_STRTOK
-/*
- ** NOT encouraged to use!
- */
-
-char *strtok (str, fs)
- char *str, *fs;
-{
- static char *pos;
-
- return strtoken (&pos, str, fs);
-}
-
-#endif /* NEED_STRTOK */
-
-#ifdef NEED_STRERROR
-/*
- ** strerror - return an appropriate system error string to a given errno
- **
- ** argv 11/90
- */
-
-char *strerror (err_no)
- int err_no;
-{
- extern char *sys_errlist[]; /* Sigh... hopefully on all systems */
- extern int sys_nerr;
-
- static char buff[40];
- char *errp;
-
- errp = (err_no > sys_nerr ? (char *) NULL : sys_errlist[err_no]);
-
- if (errp == (char *) NULL) {
- errp = buff;
- (void) sprintf (errp, "Unknown Error %d", err_no);
- }
- return errp;
-}
-
-#endif /* NEED_STRERROR */
-
/*
** inetntoa -- changed name to remove collision possibility and
** so behaviour is guaranteed to take a pointer arg.
return buf;
}
-#ifndef HAVE_INET_NETOF
-/*
- ** inet_netof -- return the net portion of an internet number
- ** argv 11/90
- */
-
-int inet_netof (in)
- struct in_addr in;
-{
- int addr = in.s_net;
-
- if (addr & 0x80 == 0)
- return ((int) in.s_net);
-
- if (addr & 0x40 == 0)
- return ((int) in.s_net * 256 + in.s_host);
-
- return ((int) in.s_net * 256 + in.s_host * 256 + in.s_lh);
-}
-
-#endif /* HAVE_INET_NETOF */
#ifdef DEBUGMODE