[cvslog] (2004-08-26 10:37:03 UTC) Module eggdrop1.7: Change committed!

cvslog cvs at tsss.org
Thu Aug 26 04:37:03 CST 2004


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2004-08-26 10:37:02 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     aclocal.m4 config.h.in configure src/botcmd.c src/botmsg.c
     src/botnet.c src/chanprog.c src/cmds.c src/dcc.c src/dcc.h
     src/dccutil.c src/dccutil.h src/dns.c src/eggdrop.h src/main.c
     src/main.h src/mem.c src/misc.c src/modules.c src/net.c
     src/patch.h src/proto.h src/tcl.c src/tcldcc.c src/tclmisc.c
     src/tcluser.c src/userent.c src/users.c src/mod/module.h
     src/mod/assoc.mod/assoc.c src/mod/filesys.mod/filedb3.h
     src/mod/irc.mod/chan.c src/mod/irc.mod/irc.c
     src/mod/irc.mod/irc.h src/mod/irc.mod/mode.c
     src/mod/irc.mod/tclirc.c src/mod/share.mod/share.c
     src/mod/transfer.mod/transfer.c

Added files:
     src/net.h src/tcldcc.h

Log message:

* More header stuff.
* Removed two unused functions... hostnamefromip() and flush_inbuf(). These peobably need to go in 1.6 too.
* Bot STAT_* flags -> BSTAT_*.
* Renamed BORGCUBES (NeXT Step OS hack) define to NEXT_HACKS.

---------------------- diff included ----------------------
Index: eggdrop1.7/aclocal.m4
diff -u eggdrop1.7/aclocal.m4:1.1.1.1 eggdrop1.7/aclocal.m4:1.2
--- eggdrop1.7/aclocal.m4:1.1.1.1	Tue Aug 24 20:01:51 2004
+++ eggdrop1.7/aclocal.m4	Thu Aug 26 05:36:50 2004
@@ -16,7 +16,7 @@
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 dnl
-dnl $Id: aclocal.m4,v 1.1.1.1 2004/08/25 01:01:51 wcc Exp $
+dnl $Id: aclocal.m4,v 1.2 2004/08/26 10:36:50 wcc Exp $
 dnl
 
 
@@ -724,7 +724,7 @@
     *)
       if test -r /mach; then
         # At this point, we're guessing this is NeXT Step.
-        AC_DEFINE(BORGCUBES, 1, [Define if running on NeXT Step.])
+        AC_DEFINE(NEXT_HACKS, 1, [Define if running on NeXT Step.])
       else
         if test -r /cmds; then
           # Probably QNX.
Index: eggdrop1.7/config.h.in
diff -u eggdrop1.7/config.h.in:1.1.1.1 eggdrop1.7/config.h.in:1.2
--- eggdrop1.7/config.h.in:1.1.1.1	Tue Aug 24 20:01:54 2004
+++ eggdrop1.7/config.h.in	Thu Aug 26 05:36:50 2004
@@ -3,9 +3,6 @@
 #ifndef _EGG_CONFIG_H
 #define _EGG_CONFIG_H
 
-/* Define if running on NeXT Step. */
-#undef BORGCUBES
-
 /* Define to use Eggdrop's snprintf functions regardless of HAVE_SNPRINTF. */
 #undef BROKEN_SNPRINTF
 
@@ -282,6 +279,9 @@
 /* Define if modules should be loaded using the shl_*() functions. */
 #undef MOD_USE_SHL
 
+/* Define if running on NeXT Step. */
+#undef NEXT_HACKS
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
Index: eggdrop1.7/configure
diff -u eggdrop1.7/configure:1.2 eggdrop1.7/configure:1.3
--- eggdrop1.7/configure:1.2	Tue Aug 24 20:51:39 2004
+++ eggdrop1.7/configure	Thu Aug 26 05:36:50 2004
@@ -5318,7 +5318,7 @@
         # At this point, we're guessing this is NeXT Step.
 
 cat >>confdefs.h <<\_ACEOF
-#define BORGCUBES 1
+#define NEXT_HACKS 1
 _ACEOF
 
       else
Index: eggdrop1.7/src/botcmd.c
diff -u eggdrop1.7/src/botcmd.c:1.4 eggdrop1.7/src/botcmd.c:1.5
--- eggdrop1.7/src/botcmd.c:1.4	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/botcmd.c	Thu Aug 26 05:36:50 2004
@@ -1,13 +1,7 @@
-/*
- * botcmd.c -- handles:
- *   commands that comes across the botnet
- *   userfile transfer and update commands from sharebots
+/* botcmd.c
  *
- * $Id: botcmd.c,v 1.4 2004/08/26 03:21:13 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -22,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: botcmd.c,v 1.5 2004/08/26 10:36:50 wcc Exp $
  */
 
 #include "main.h"
@@ -33,10 +29,12 @@
 #include "botcmd.h"
 #include "botnet.h"
 #include "botmsg.h"  /* add_note, simple_sprintf, base64_to_int */
-#include "dcc.h"     /* DCC_*, struct dcc_t */
+#include "dcc.h"     /* DCC_*, DCT_*, BSTAT_*, struct dcc_t */
 #include "dccutil.h" /* dprintf, chatout, sharein, chanout_but, lostdcc, do_boot */
+#include "net.h"     /* killsock */
 #include "userrec.h" /* change_handle, touch_laston */
 
+
 extern char botnetnick[], ver[], admin[], network[], motdfile[];
 extern int dcc_total, remote_boots, noshare;
 extern struct dcc_t *dcc;
@@ -47,6 +45,7 @@
 extern party_t *party;
 extern module_entry *module_list;
 
+
 static char TBUF[1024]; /* Static buffer for goofy bot stuff */
 
 /* Used for 1.0 compatibility: if a join message arrives with no sock#,
@@ -54,6 +53,8 @@
  */
 static int fakesock = 2300;
 
+
+
 static void fake_alert(int idx, char *item, char *extra)
 {
   static unsigned long lastfake; /* The last time fake_alert was used */
@@ -362,8 +363,8 @@
         botnet_send_priv(idx, botnetnick, nick, NULL, "%s:", BOT_BOTSCONNECTED);
       }
       sprintf(s, "  %s%c%-15s %s",
-              dcc[i].status & STAT_CALLED ? "<-" : "->",
-              dcc[i].status & STAT_SHARE ? '+' : ' ',
+              dcc[i].status & BSTAT_CALLED ? "<-" : "->",
+              dcc[i].status & BSTAT_SHARE ? '+' : ' ',
               dcc[i].nick, dcc[i].u.bot->version);
       botnet_send_priv(idx, botnetnick, nick, NULL, "%s", s);
     }
@@ -423,7 +424,7 @@
 
 static void bot_endlink(int idx, char *par)
 {
-  dcc[idx].status &= ~STAT_LINKING;
+  dcc[idx].status &= ~BSTAT_LINKING;
 }
 
 /* info? <from at bot>   -> send priv
@@ -492,7 +493,7 @@
 
 static void bot_pong(int idx, char *par)
 {
-  dcc[idx].status &= ~STAT_PINGED;
+  dcc[idx].status &= ~BSTAT_PINGED;
 }
 
 /* link <from at bot> <who> <to-whom>
@@ -901,7 +902,7 @@
     return;
   }
   if (bot_flags(dcc[idx].user) & BOT_LEAF)
-    dcc[idx].status |= STAT_LEAF;
+    dcc[idx].status |= BSTAT_LEAF;
   /* Set capitalization the way they want it */
   noshare = 1;
   change_handle(dcc[idx].user, par);
@@ -1185,7 +1186,7 @@
       linking = 1;
       bot++;
     }
-  if (b_status(idx) & STAT_LINKING) {
+  if (b_status(idx) & BSTAT_LINKING) {
     linking = 1;
   }
   nick = newsplit(&par);
@@ -1314,7 +1315,7 @@
       linking = 1;
       bot++;
     }
-  if (b_status(idx) & STAT_LINKING) {
+  if (b_status(idx) & BSTAT_LINKING) {
     linking = 1;
   }
   etc = newsplit(&par);
@@ -1385,9 +1386,9 @@
 static void bot_ufno(int idx, char *par)
 {
   putlog(LOG_BOTS, "*", "%s %s: %s", USERF_REJECTED, dcc[idx].nick, par);
-  dcc[idx].status &= ~STAT_OFFERED;
-  if (!(dcc[idx].status & STAT_GETTING))
-    dcc[idx].status &= ~STAT_SHARE;
+  dcc[idx].status &= ~BSTAT_OFFERED;
+  if (!(dcc[idx].status & BSTAT_GETTING))
+    dcc[idx].status &= ~BSTAT_SHARE;
 }
 
 static void bot_old_userfile(int idx, char *par)
Index: eggdrop1.7/src/botmsg.c
diff -u eggdrop1.7/src/botmsg.c:1.4 eggdrop1.7/src/botmsg.c:1.5
--- eggdrop1.7/src/botmsg.c:1.4	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/botmsg.c	Thu Aug 26 05:36:50 2004
@@ -1,15 +1,9 @@
-/*
- * botmsg.c -- handles:
- *   formatting of messages to be sent on the botnet
- *   sending differnet messages to different versioned bots
+/* botmsg.c
  *
- * by Darrin Smith (beldin at light.iinet.net.au)
+ * Originally by Darrin Smith (beldin at light.iinet.net.au)
  *
- * $Id: botmsg.c,v 1.4 2004/08/26 03:21:13 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -24,6 +18,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: botmsg.c,v 1.5 2004/08/26 10:36:50 wcc Exp $
  */
 
 #include "main.h"
@@ -31,8 +27,10 @@
 
 #include "botmsg.h"
 #include "botnet.h"  /* lastbot, nextbot, getparty */
-#include "dcc.h"     /* DCC_*, struct dcc_t */
+#include "dcc.h"     /* DCC_*, DCT_*, struct dcc_t */
 #include "dccutil.h" /* dprintf */
+#include "net.h"     /* tputs */
+
 
 extern struct dcc_t *dcc;
 extern int dcc_total, tands;
@@ -41,6 +39,7 @@
 extern Tcl_Interp *interp;
 extern struct userrec *userlist;
 
+
 static char OBUF[1024];
 
 
Index: eggdrop1.7/src/botnet.c
diff -u eggdrop1.7/src/botnet.c:1.4 eggdrop1.7/src/botnet.c:1.5
--- eggdrop1.7/src/botnet.c:1.4	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/botnet.c	Thu Aug 26 05:36:50 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: botnet.c,v 1.4 2004/08/26 03:21:13 wcc Exp $
+ * $Id: botnet.c,v 1.5 2004/08/26 10:36:50 wcc Exp $
  */
 
 #include "main.h"
@@ -25,11 +25,13 @@
 
 #include "botnet.h"
 #include "botmsg.h"  /* simple_sprintf, tandout_but */
-#include "dcc.h"     /* failed_link, dupwait_notify, struct bot_info, struct relay_info,
-                      * struct chat_info,  DCC_*, struct dcc_t, struct dns_info */
+#include "dcc.h"     /* DCC_*, STAT_*, BSTAT_*, struct bot_info, struct relay_info,
+                      * struct chat_info, struct dcc_t, struct dns_info, failed_link,
+                      * dupwait_notify */
 #include "dccutil.h" /* get_data_ptr, dprintf, chatout, chanout_but, lostdcc,
                       * new_dcc, changeover_dcc */
 #include "dns.h"     /* RES_* */
+#include "net.h"     /* SOCK_*, getsock, killsock, open_telnet_raw, tputs, iptostr */
 #include "userrec.h" /* correct_handle, touch_laston */
 
 
@@ -39,13 +41,14 @@
 extern time_t now;
 extern Tcl_Interp *interp;
 
-tand_t *tandbot;                   /* Keep track of tandem bots on the botnet */
-party_t *party;                    /* Keep track of people on the botnet */
-static int maxparty = 50;          /* Maximum space for party line members */
-int tands = 0;                     /* Number of bots on the botnet */
-int parties = 0;                   /* Number of people on the botnet */
-char botnetnick[HANDLEN + 1] = ""; /* Botnet nickname */
-int share_unlinks = 0;             /* Allow remote unlinks of my sharebots? */
+
+tand_t *tandbot;                   /* Keep track of tandem bots on the botnet. */
+party_t *party;                    /* Keep track of people on the botnet.      */
+static int maxparty = 50;          /* Maximum space for party line members.    */
+int tands = 0;                     /* Number of bots on the botnet.            */
+int parties = 0;                   /* Number of people on the botnet.          */
+char botnetnick[HANDLEN + 1] = ""; /* Botnet nickname.                         */
+int share_unlinks = 0;             /* Allow remote unlinks of my sharebots?    */
 
 
 int expmem_botnet()
@@ -896,7 +899,7 @@
 
         if (idx >= 0)
           dprintf(idx, "%s %s.\n", BOT_BREAKLINK, dcc[i].nick);
-        else if ((idx == -3) && (b_status(i) & STAT_SHARE) && !share_unlinks)
+        else if ((idx == -3) && (b_status(i) & BSTAT_SHARE) && !share_unlinks)
           return -1;
         bot = findbot(dcc[i].nick);
         bots = bots_in_subtree(bot);
@@ -1595,7 +1598,7 @@
 
   for (i = 0; i < dcc_total; i++)
     if (dcc[i].type == &DCC_BOT)
-      if (dcc[i].status & STAT_PINGED) {
+      if (dcc[i].status & BSTAT_PINGED) {
         char s[1024];
 
         putlog(LOG_BOTS, "*", "%s: %s", BOT_PINGTIMEOUT, dcc[i].nick);
@@ -1613,16 +1616,16 @@
   for (i = 0; i < dcc_total; i++)
     if (dcc[i].type == &DCC_BOT) {
       botnet_send_ping(i);
-      dcc[i].status |= STAT_PINGED;
+      dcc[i].status |= BSTAT_PINGED;
     }
   for (i = 0; i < dcc_total; i++)
-    if ((dcc[i].type == &DCC_BOT) && (dcc[i].status & STAT_LEAF)) {
+    if ((dcc[i].type == &DCC_BOT) && (dcc[i].status & BSTAT_LEAF)) {
       tand_t *bot, *via = findbot(dcc[i].nick);
 
       for (bot = tandbot; bot; bot = bot->next) {
         if ((via == bot->via) && (bot != via)) {
           /* Not leaflike behavior */
-          if (dcc[i].status & STAT_WARNED) {
+          if (dcc[i].status & BSTAT_WARNED) {
             char s[1024];
 
             putlog(LOG_BOTS, "*", "%s %s (%s).", BOT_DISCONNECTED,
@@ -1641,10 +1644,10 @@
             lostdcc(i);
           } else {
             botnet_send_reject(i, botnetnick, NULL, bot->bot, NULL, NULL);
-            dcc[i].status |= STAT_WARNED;
+            dcc[i].status |= BSTAT_WARNED;
           }
         } else
-          dcc[i].status &= ~STAT_WARNED;
+          dcc[i].status &= ~BSTAT_WARNED;
       }
     }
 }
Index: eggdrop1.7/src/chanprog.c
diff -u eggdrop1.7/src/chanprog.c:1.3 eggdrop1.7/src/chanprog.c:1.4
--- eggdrop1.7/src/chanprog.c:1.3	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/chanprog.c	Thu Aug 26 05:36:51 2004
@@ -7,7 +7,7 @@
  *   telling the current programmed settings
  *   initializing a lot of stuff and loading the tcl scripts
  *
- * $Id: chanprog.c,v 1.3 2004/08/26 03:21:13 wcc Exp $
+ * $Id: chanprog.c,v 1.4 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -47,6 +47,7 @@
 #include "rfc1459.h" /* rfc_casecmp */
 #include "userrec.h" /* clear_userlist, count_users */
 
+
 extern struct userrec *userlist;
 extern log_t *logs;
 extern Tcl_Interp *interp;
@@ -57,14 +58,14 @@
            default_flags, max_logs, conmask, protect_readonly, make_userfile,
            noshare, ignore_time;
 
-tcl_timer_t *timer = NULL;         /* Minutely timer               */
-tcl_timer_t *utimer = NULL;        /* Secondly timer               */
-unsigned long timer_id = 1;        /* Next timer of any sort will
-                                    * have this number             */
-struct chanset_t *chanset = NULL;  /* Channel list                 */
-char admin[121] = "";              /* Admin info                   */
-char origbotname[NICKLEN + 1];
-char botname[NICKLEN + 1];         /* Primary botname              */
+
+tcl_timer_t *timer = NULL;        /* Minutely timer               */
+tcl_timer_t *utimer = NULL;       /* Secondly timer               */
+unsigned long timer_id = 1;       /* Next timer will have this ID */
+struct chanset_t *chanset = NULL; /* Channel list                 */
+char admin[121] = "";             /* Admin info                   */
+char origbotname[NICKLEN + 1];    /* Bot's nick                   */
+char botname[NICKLEN + 1];        /* Primary botname              */
 
 
 /* Remove leading and trailing whitespaces.
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.4 eggdrop1.7/src/cmds.c:1.5
--- eggdrop1.7/src/cmds.c:1.4	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/cmds.c	Thu Aug 26 05:36:51 2004
@@ -1,13 +1,7 @@
-/*
- * cmds.c -- handles:
- *   commands from a user via dcc
- *   (split in 2, this portion contains no-irc commands)
+/* cmds.c: core partyline commands
  *
- * $Id: cmds.c,v 1.4 2004/08/26 03:21:13 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -22,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: cmds.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -33,9 +29,11 @@
 #include "botmsg.h"  /* simple_sprintf */
 #include "botnet.h"  /* answer_local_whom, lastbot, nextbot, tell_bots,
                       * tell_bottree, botlink, botunlink, tandem_relay */
-#include "dcc.h"     /* struct chat_info, DCC_*, STRIP_*, struct dcc_t */
+#include "dcc.h"     /* DCC_*, DCT_*, STRIP_*, STAT_*, BSTAT_*, struct chat_info,
+                      * struct dcc_t */
 #include "dccutil.h" /* get_data_ptr, dprintf, chanout_but, dcc_chatter, lostdcc,
                       * tell_dcc, not_away, set_away, do_boot, flush_lines */
+#include "net.h"     /* killsock */
 #include "userrec.h" /* adduser, addhost_by_handle, u_pass_match, delhost_by_handle,
                       * deluser, change_handle, correct_handle, write_userfile */
 
@@ -174,14 +172,14 @@
         egg_snprintf(format, sizeof format,
                      "  [%%.2lu]  %%s%%c%%-%us (%%s) %%s\n", nicklen);
         dprintf(idx, format, dcc[i].sock,
-                dcc[i].status & STAT_CALLED ? "<-" : "->",
-                dcc[i].status & STAT_SHARE ? '+' : ' ', dcc[i].nick, s,
+                dcc[i].status & BSTAT_CALLED ? "<-" : "->",
+                dcc[i].status & BSTAT_SHARE ? '+' : ' ', dcc[i].nick, s,
                 dcc[i].u.bot->version);
       } else {
         egg_snprintf(format, sizeof format, "  %%s%%c%%-%us (%%s) %%s\n",
                      nicklen);
-        dprintf(idx, format, dcc[i].status & STAT_CALLED ? "<-" : "->",
-                dcc[i].status & STAT_SHARE ? '+' : ' ', dcc[i].nick, s,
+        dprintf(idx, format, dcc[i].status & BSTAT_CALLED ? "<-" : "->",
+                dcc[i].status & BSTAT_SHARE ? '+' : ' ', dcc[i].nick, s,
                 dcc[i].u.bot->version);
       }
     }
@@ -1387,10 +1385,10 @@
     }
 
     if (dcc[i].type == &DCC_BOT && !egg_strcasecmp(u->handle, dcc[i].nick)) {
-      if ((dcc[i].status & STAT_LEAF) && !(bot_flags(u) & BOT_LEAF))
-        dcc[i].status &= ~(STAT_LEAF | STAT_WARNED);
-      if (!(dcc[i].status & STAT_LEAF) && (bot_flags(u) & BOT_LEAF))
-        dcc[i].status |= STAT_LEAF;
+      if ((dcc[i].status & BSTAT_LEAF) && !(bot_flags(u) & BOT_LEAF))
+        dcc[i].status &= ~(BSTAT_LEAF | BSTAT_WARNED);
+      if (!(dcc[i].status & BSTAT_LEAF) && (bot_flags(u) & BOT_LEAF))
+        dcc[i].status |= BSTAT_LEAF;
     }
   }
 
Index: eggdrop1.7/src/dcc.c
diff -u eggdrop1.7/src/dcc.c:1.4 eggdrop1.7/src/dcc.c:1.5
--- eggdrop1.7/src/dcc.c:1.4	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/dcc.c	Thu Aug 26 05:36:51 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: dcc.c,v 1.4 2004/08/26 03:21:13 wcc Exp $
+ * $Id: dcc.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -36,6 +36,8 @@
                       * lostdcc, makepass, not_away, do_boot, detect_dcc_flood,
                       * flush_lines, new_dcc, add_cr, changeover_dcc */
 #include "dns.h"     /* RES_* */
+#include "net.h"     /* SOCK_*, EGG_OPTION_*, neterror, getsock, killsock, answer,
+                      * open_telnet, tputs, open_telnet_raw, iptostr, sockoptions */
 #include "userrec.h" /* adduser, u_pass_match, deluser, correct_handle, write_userfile,
                       * touch_laston */
 
@@ -45,31 +47,26 @@
 extern Tcl_Interp *interp;
 extern time_t now;
 extern char botnetnick[], ver[], origbotname[], notify_new[];
-extern int egg_numver, connect_timeout, conmask, backgrd, max_dcc,
-           make_userfile, default_flags, raw_log, ignore_time,
-           par_telnet_flood;
-
-
-struct dcc_t *dcc = NULL;       /* DCC list                                */
-int dcc_total = 0;              /* Total dcc's                             */
-char tempdir[121] = "";         /* Temporary directory
-                                 * (default: current directory)            */
-int require_p = 0;              /* Require 'p' access to get on the
-                                 * party line?                             */
-int allow_new_telnets = 0;      /* Allow people to introduce themselves
-                                 * via telnet                              */
-int stealth_telnets = 0;        /* Be paranoid? <cybah>                    */
-int use_telnet_banner = 0;      /* Display telnet banner?                  */
-char network[41] = "unknown-net";       /* Name of the IRC network you're on  */
-int password_timeout = 180;     /* Time to wait for a password from a user */
-int bot_timeout = 60;           /* Bot timeout value                       */
-int identtimeout = 5;           /* Timeout value for ident lookups         */
-int dupwait_timeout = 5;        /* Timeout for rejecting duplicate entries */
-int protect_telnet = 1;         /* Even bother with ident lookups :)       */
-int flood_telnet_thr = 5;       /* Number of telnet connections to be
-                                 * considered a flood                      */
-int flood_telnet_time = 60;     /* In how many seconds?                    */
-char bannerfile[121] = "text/banner";   /* File displayed on telnet login */
+extern int egg_numver, connect_timeout, conmask, backgrd, max_dcc, raw_log,
+           make_userfile, default_flags, ignore_time, par_telnet_flood;
+
+
+struct dcc_t *dcc = NULL;   /* DCC list                                      */
+int dcc_total = 0;          /* Total dcc's                                   */
+char tempdir[121] = "";     /* Temp directory (default: CWD)                 */
+int require_p = 0;          /* Require +p flag to access party line?         */
+int allow_new_telnets = 0;  /* Allow new users to add themselves via telnet? */
+int stealth_telnets = 0;    /* Just display 'Nickname' prompt for telnets.   */
+int use_telnet_banner = 0;  /* Display telnet banner?                        */
+int password_timeout = 180; /* Time to wait for a password from a user.      */
+int bot_timeout = 60;       /* Bot timeout value.                            */
+int identtimeout = 5;       /* Timeout value for ident lookups.              */
+int dupwait_timeout = 5;    /* Timeout for rejecting duplicate entries.      */
+int protect_telnet = 1;     /* Only accept telnet from known hosts?          */
+int flood_telnet_thr = 5;   /* Telnet flood threshold.                       */
+int flood_telnet_time = 60; /* In how many seconds?                          */
+char bannerfile[121] = "text/banner"; /* File displayed on telnet login.     */
+char network[41] = "unknown-net";     /* Name of the IRC network you're on.  */
 
 
 static void dcc_telnet_hostresolved(int);
@@ -140,8 +137,8 @@
     return;
   }
   if (bfl & BOT_LEAF)
-    dcc[idx].status |= STAT_LEAF;
-  dcc[idx].status |= STAT_LINKING;
+    dcc[idx].status |= BSTAT_LEAF;
+  dcc[idx].status |= BSTAT_LINKING;
 #ifndef NO_OLD_BOTNET
   dprintf(idx, "version %d %d %s <%s>\n", egg_numver, HANDLEN, ver, network);
 #else
@@ -456,16 +453,16 @@
 {
   int i = simple_sprintf(buf, "bot   flags: ");
 
-  buf[i++] = b_status(idx) & STAT_PINGED ? 'P' : 'p';
-  buf[i++] = b_status(idx) & STAT_SHARE ? 'U' : 'u';
-  buf[i++] = b_status(idx) & STAT_CALLED ? 'C' : 'c';
-  buf[i++] = b_status(idx) & STAT_OFFERED ? 'O' : 'o';
-  buf[i++] = b_status(idx) & STAT_SENDING ? 'S' : 's';
-  buf[i++] = b_status(idx) & STAT_GETTING ? 'G' : 'g';
-  buf[i++] = b_status(idx) & STAT_WARNED ? 'W' : 'w';
-  buf[i++] = b_status(idx) & STAT_LEAF ? 'L' : 'l';
-  buf[i++] = b_status(idx) & STAT_LINKING ? 'I' : 'i';
-  buf[i++] = b_status(idx) & STAT_AGGRESSIVE ? 'a' : 'A';
+  buf[i++] = b_status(idx) & BSTAT_PINGED ? 'P' : 'p';
+  buf[i++] = b_status(idx) & BSTAT_SHARE ? 'U' : 'u';
+  buf[i++] = b_status(idx) & BSTAT_CALLED ? 'C' : 'c';
+  buf[i++] = b_status(idx) & BSTAT_OFFERED ? 'O' : 'o';
+  buf[i++] = b_status(idx) & BSTAT_SENDING ? 'S' : 's';
+  buf[i++] = b_status(idx) & BSTAT_GETTING ? 'G' : 'g';
+  buf[i++] = b_status(idx) & BSTAT_WARNED ? 'W' : 'w';
+  buf[i++] = b_status(idx) & BSTAT_LEAF ? 'L' : 'l';
+  buf[i++] = b_status(idx) & BSTAT_LINKING ? 'I' : 'i';
+  buf[i++] = b_status(idx) & BSTAT_AGGRESSIVE ? 'a' : 'A';
   buf[i++] = 0;
 }
 
@@ -554,7 +551,7 @@
       nfree(dcc[idx].u.chat);
       dcc[idx].type = &DCC_BOT_NEW;
       dcc[idx].u.bot = get_data_ptr(sizeof(struct bot_info));
-      dcc[idx].status = STAT_CALLED;
+      dcc[idx].status = BSTAT_CALLED;
       dprintf(idx, "*hello!\n");
       greet_new_bot(idx);
       return;
@@ -575,7 +572,7 @@
       dcc[idx].type = &DCC_BOT_NEW;
       dcc[idx].u.bot = get_data_ptr(sizeof(struct bot_info));
 
-      dcc[idx].status = STAT_CALLED;
+      dcc[idx].status = BSTAT_CALLED;
       dprintf(idx, "*hello!\n");
       greet_new_bot(idx);
     } else {
@@ -1417,7 +1414,7 @@
       set_user(&USERENTRY_PASS, dcc[idx].user, ps);
       changeover_dcc(idx, &DCC_BOT_NEW, sizeof(struct bot_info));
 
-      dcc[idx].status = STAT_CALLED;
+      dcc[idx].status = BSTAT_CALLED;
       dprintf(idx, "*hello!\n");
       greet_new_bot(idx);
 #ifdef NO_OLD_BOTNET
Index: eggdrop1.7/src/dcc.h
diff -u eggdrop1.7/src/dcc.h:1.2 eggdrop1.7/src/dcc.h:1.3
--- eggdrop1.7/src/dcc.h:1.2	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/dcc.h	Thu Aug 26 05:36:51 2004
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: dcc.h,v 1.2 2004/08/26 03:21:13 wcc Exp $
+ * $Id: dcc.h,v 1.3 2004/08/26 10:36:51 wcc Exp $
  */
 
 #ifndef _EGG_DCC_H
@@ -25,28 +25,70 @@
 #include "types.h" /* u_8bit_t */
 
 /* Telnet codes. See RFC 854 RFC 875 for details. */
-#define TLN_AYT     246     /* Are You There        */
-#define TLN_WILL    251     /* Will                 */
-#define TLN_WILL_C  "\373"
-#define TLN_WONT    252     /* Won't                */
-#define TLN_WONT_C  "\374"
-#define TLN_DO      253     /* Do                   */
-#define TLN_DO_C    "\375"
-#define TLN_DONT    254     /* Don't                */
-#define TLN_DONT_C  "\376"
-#define TLN_IAC     255     /* Interpret As Command */
-#define TLN_IAC_C   "\377"
-#define TLN_ECHO    1       /* Echo                 */
-#define TLN_ECHO_C  "\001"
-
-/* For stripping out mIRC codes. */
-#define STRIP_COLOR 0x00001  /* remove all color codes         */
-#define STRIP_BOLD  0x00002  /* remove all boldface codes      */
-#define STRIP_REV   0x00004  /* remove all reverse video codes */
-#define STRIP_UNDER 0x00008  /* remove underline codes         */
-#define STRIP_ANSI  0x00010  /* remove all ANSI codes          */
-#define STRIP_BELLS 0x00020  /* remove all ctrl-g (bell) codes */
-#define STRIP_ALL   0x00040  /* remove all of the above        */
+#define TLN_AYT  246  /* Are You There        */
+#define TLN_WILL 251  /* Will                 */
+#define TLN_WONT 252  /* Won't                */
+#define TLN_DO   253  /* Do                   */
+#define TLN_DONT 254  /* Don't                */
+#define TLN_IAC  255  /* Interpret As Command */
+#define TLN_ECHO 1    /* Echo                 */
+
+#define TLN_WILL_C "\373"
+#define TLN_WONT_C "\374"
+#define TLN_DO_C   "\375"
+#define TLN_DONT_C "\376"
+#define TLN_IAC_C  "\377"
+#define TLN_ECHO_C "\001"
+
+/* For stripping mIRC/ANSI codes. */
+#define STRIP_COLOR 0x00001  /* Remove all color codes.         */
+#define STRIP_BOLD  0x00002  /* Remove all boldface codes.      */
+#define STRIP_REV   0x00004  /* Remove all reverse video codes. */
+#define STRIP_UNDER 0x00008  /* Remove underline codes.         */
+#define STRIP_ANSI  0x00010  /* Remove all ANSI codes.          */
+#define STRIP_BELLS 0x00020  /* Remove all ctrl-g (bell) codes. */
+#define STRIP_ALL   0x00040  /* Remove all of the above.        */
+
+/* Flags for DCC types. */
+#define DCT_CHAT      0x00000001  /* Can receive chat?                       */
+#define DCT_MASTER    0x00000002  /* Can receive master-only chat?           */
+#define DCT_SHOWWHO   0x00000004  /* Show in who?                            */
+#define DCT_REMOTEWHO 0x00000008  /* Show in remote who?                     */
+#define DCT_VALIDIDX  0x00000010  /* Report IDX as valid to tcl_valididx?    */
+#define DCT_SIMUL     0x00000020  /* Can be tcl_simul/.simul'd?              */
+#define DCT_CANBOOT   0x00000040  /* Can be booted?                          */
+#define DCT_FILES     0x00000080  /* In the file ares?                       */
+#define DCT_BOT       0x00000100  /* Bot connection?                         */
+#define DCT_FORKTYPE  0x00000200  /* DCT_FILESEND from outside transfer.mod. */
+#define DCT_FILETRAN  0x00000400  /* A file transfer of some sort.           */
+#define DCT_FILESEND  0x00000800  /* A send *TO* the bot (FIXME!).           */
+#define DCT_LISTEN    0x00001000  /* A listening port of some sort.          */
+#define DCT_GETNOTES  DCT_CHAT    /* Can receive notes?                      */
+
+/* Flags for listening sockets. */
+#define LSTN_PUBLIC 0x000001  /* No access restrictions. */
+
+/* Status flags for DCC/file area connections. */
+#define STAT_ECHO    0x00001 /* Echo commands back?                           */
+#define STAT_DENY    0x00002 /* Bad username (ignore pass & deny access)      */
+#define STAT_CHAT    0x00004 /* Can return to partyline if in file area.      */
+#define STAT_TELNET  0x00008 /* Connected via telnet (or CTCP chat (FIXME!)). */
+#define STAT_PARTY   0x00010 /* Has the 'p' flag but isn't an op.             */
+#define STAT_BOTONLY 0x00020 /* Bot-only listen port.                         */
+#define STAT_USRONLY 0x00040 /* User-only port.                               */
+#define STAT_PAGE    0x00080 /* Page output to the user.                      */
+
+/* Status flags for bot links. */
+#define BSTAT_PINGED      0x00001 /* Sent a pink, waiting for a pong.         */
+#define BSTAT_SHARE       0x00002 /* This is a share-bot.                     */
+#define BSTAT_CALLED      0x00004 /* This remote bot initiated the link.      */
+#define BSTAT_OFFERED     0x00008 /* A userfile transfer has been offered.    */
+#define BSTAT_SENDING     0x00010 /* In the process of sending a user list.   */
+#define BSTAT_GETTING     0x00020 /* In the process of getting a user list.   */
+#define BSTAT_WARNED      0x00040 /* Warned about unleaflike behavior.        */
+#define BSTAT_LEAF        0x00080 /* This bot cannot act as a hub; leaf only. */
+#define BSTAT_LINKING     0x00100 /* Bot is in the process of linking.        */
+#define BSTAT_AGGRESSIVE  0x00200 /* Aggressively sharing with this bot.      */
 
 struct dcc_table {
   char *name;
Index: eggdrop1.7/src/dccutil.c
diff -u eggdrop1.7/src/dccutil.c:1.3 eggdrop1.7/src/dccutil.c:1.4
--- eggdrop1.7/src/dccutil.c:1.3	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/dccutil.c	Thu Aug 26 05:36:51 2004
@@ -1,16 +1,7 @@
-/*
- * dccutil.c -- handles:
- *   lots of little functions to send formatted text to
- *   varying types of connections
- *   '.who', '.whom', and '.dccstat' code
- *   memory management for dcc structures
- *   timeout checking for dcc connections
+/* dccutil.c
  *
- * $Id: dccutil.c,v 1.3 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -25,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: dccutil.c,v 1.4 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include <sys/stat.h>
@@ -35,22 +28,23 @@
 #include "tandem.h"
 
 #include "dccutil.h"
-#include "dcc.h" /* DCC_* */
+#include "dcc.h" /* DCC_*, DCT_*, STAT_* */
+#include "net.h" /* SOCK_* , killsock, tputs, sock_list */
+
 
 extern struct dcc_t *dcc;
 extern int dcc_total, max_dcc, dcc_flood_thr, backgrd, copy_to_tmp, MAXSOCKS;
 extern char botnetnick[], version[];
 extern time_t now;
 extern sock_list *socklist;
-extern Tcl_Interp *interp;
 
-char motdfile[121] = "text/motd";       /* File where the motd is stored */
-int connect_timeout = 15;       /* How long to wait before a telnet
-                                 * connection times out */
 
+char motdfile[121] = "text/motd"; /* File where the MOTD is stored.         */
+int connect_timeout = 15;         /* Timeout value for a telnet connection. */
 int reserved_port_min = 0;
 int reserved_port_max = 0;
 
+
 void init_dcc_max()
 {
   int osock = MAXSOCKS;
Index: eggdrop1.7/src/dccutil.h
diff -u eggdrop1.7/src/dccutil.h:1.2 eggdrop1.7/src/dccutil.h:1.3
--- eggdrop1.7/src/dccutil.h:1.2	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/dccutil.h	Thu Aug 26 05:36:51 2004
@@ -16,20 +16,38 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: dccutil.h,v 1.2 2004/08/26 03:21:14 wcc Exp $
+ * $Id: dccutil.h,v 1.3 2004/08/26 10:36:51 wcc Exp $
  */
 
 #ifndef _EGG_DCCUTIL_H
 #define _EGG_DCCUTIL_H
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include "dcc.h" /* struct dcc_table, struct chat_info */
 
 #ifdef HAVE_DPRINTF
-#  undef dprintf
+#  define dprintf eggdrop_dprintf
 #endif
 
-#define get_data_ptr(x) _get_data_ptr(x,__FILE__,__LINE__)
+/* Fake idx's for dprintf - these should be ridiculously large +ve nums. */
+#define DP_STDOUT       0x7FF1
+#define DP_LOG          0x7FF2
+#define DP_SERVER       0x7FF3
+#define DP_HELP         0x7FF4
+#define DP_STDERR       0x7FF5
+#define DP_MODE         0x7FF6
+#define DP_MODE_NEXT    0x7FF7
+#define DP_SERVER_NEXT  0x7FF8
+#define DP_HELP_NEXT    0x7FF9
 
+#ifndef MAKING_MODS
+#  define get_data_ptr(x) _get_data_ptr(x,__FILE__,__LINE__)
+#endif
+
+#ifndef MAKING_MODS
 void dprintf EGG_VARARGS(int, arg1);
 void chatout EGG_VARARGS(char *, arg1);
 extern void (*shareout) ();
@@ -51,5 +69,6 @@
 int new_dcc(struct dcc_table *, int);
 char *add_cr(char *);
 void changeover_dcc(int, struct dcc_table *, int);
+#endif
 
 #endif /* !_EGG_DCCUTIL_H */
Index: eggdrop1.7/src/dns.c
diff -u eggdrop1.7/src/dns.c:1.3 eggdrop1.7/src/dns.c:1.4
--- eggdrop1.7/src/dns.c:1.3	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/dns.c	Thu Aug 26 05:36:51 2004
@@ -1,15 +1,8 @@
-/*
- * dns.c -- handles:
- *   DNS resolve calls and events
- *   provides the code used by the bot if the DNS module is not loaded
- *   DNS Tcl commands
+/* dns.c
  *
- * $Id: dns.c,v 1.3 2004/08/26 03:21:14 wcc Exp $
- */
-/*
- * Written by Fabian Knittel <fknittel at gmx.de>
+ * Originally by Fabian Knittel <fknittel at gmx.de>
  *
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -24,6 +17,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: dns.c,v 1.4 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -34,8 +29,9 @@
 #include <arpa/inet.h>
 
 #include "dns.h"
-#include "dcc.h"     /* struct dcc_table, struct dcc_t, struct dns_info */
+#include "dcc.h"     /* DCT_*, struct dcc_table, struct dcc_t, struct dns_info */
 #include "dccutil.h" /* get_data_ptr, lostdcc */
+#include "net.h"     /* killsock, iptostr */
 
 extern struct dcc_t *dcc;
 extern int dcc_total;
Index: eggdrop1.7/src/eggdrop.h
diff -u eggdrop1.7/src/eggdrop.h:1.2 eggdrop1.7/src/eggdrop.h:1.3
--- eggdrop1.7/src/eggdrop.h:1.2	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/eggdrop.h	Thu Aug 26 05:36:51 2004
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.2 2004/08/26 03:21:14 wcc Exp $
+ * $Id: eggdrop.h,v 1.3 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -205,19 +205,6 @@
 #  define random() (rand()/16)
 #endif
 
-#ifndef HAVE_SIGACTION /* old "weird signals" */
-#  define sigaction sigvec
-#  ifndef sa_handler
-#    define sa_handler sv_handler
-#    define sa_mask sv_mask
-#    define sa_flags sv_flags
-#  endif
-#endif
-
-#ifndef HAVE_SIGEMPTYSET
-#  define sigemptyset(x) ((*(int *)(x))=0)
-#endif
-
 #ifndef HAVE_SOCKLEN_T
 typedef int socklen_t;
 #endif
@@ -270,63 +257,6 @@
 
 /***********************************************************************/
 
-/* Public structure for the listening port map */
-struct portmap {
-  int realport;
-  int mappedto;
-  struct portmap *next;
-};
-
-
-
-
-
-/* Flags for dcc types. */
-#define DCT_CHAT      0x00000001        /* this dcc type receives botnet
-                                         * chatter                          */
-#define DCT_MASTER    0x00000002        /* received master chatter          */
-#define DCT_SHOWWHO   0x00000004        /* show the user in .who            */
-#define DCT_REMOTEWHO 0x00000008        /* show in remote who               */
-#define DCT_VALIDIDX  0x00000010        /* valid idx for outputting to
-                                         * in tcl                           */
-#define DCT_SIMUL     0x00000020        /* can be tcl_simul'd               */
-#define DCT_CANBOOT   0x00000040        /* can be booted                    */
-#define DCT_GETNOTES  DCT_CHAT          /* can receive notes                */
-#define DCT_FILES     0x00000080        /* gratuitous hack ;)               */
-#define DCT_FORKTYPE  0x00000100        /* a forking type                   */
-#define DCT_BOT       0x00000200        /* a bot connection of some sort... */
-#define DCT_FILETRAN  0x00000400        /* a file transfer of some sort     */
-#define DCT_FILESEND  0x00000800        /* a sending file transfer,
-                                         * getting = !this                  */
-#define DCT_LISTEN    0x00001000        /* a listening port of some sort    */
-
-/* For dcc chat & files. */
-#define STAT_ECHO    0x00001    /* echo commands back?                  */
-#define STAT_DENY    0x00002    /* bad username (ignore password & deny
-                                 * access)                              */
-#define STAT_CHAT    0x00004    /* in file-system but may return        */
-#define STAT_TELNET  0x00008    /* connected via telnet                 */
-#define STAT_PARTY   0x00010    /* only on party line via 'p' flag      */
-#define STAT_BOTONLY 0x00020    /* telnet on bots-only connect          */
-#define STAT_USRONLY 0x00040    /* telnet on users-only connect         */
-#define STAT_PAGE    0x00080    /* page output to the user              */
-
-/* For dcc bot links. */
-#define STAT_PINGED  0x00001    /* waiting for ping to return            */
-#define STAT_SHARE   0x00002    /* sharing user data with the bot        */
-#define STAT_CALLED  0x00004    /* this bot called me                    */
-#define STAT_OFFERED 0x00008    /* offered her the user file             */
-#define STAT_SENDING 0x00010    /* in the process of sending a user list */
-#define STAT_GETTING 0x00020    /* in the process of getting a user list */
-#define STAT_WARNED  0x00040    /* warned him about unleaflike behavior  */
-#define STAT_LEAF    0x00080    /* this bot is a leaf only               */
-#define STAT_LINKING 0x00100    /* the bot is currently going through
-                                 * the linking stage                     */
-#define STAT_AGGRESSIVE   0x200 /* aggressively sharing with this bot    */
-
-/* Flags for listening sockets */
-#define LSTN_PUBLIC  0x000001   /* No access restrictions               */
-
 /* chan & global */
 #define FLOOD_PRIVMSG    0
 #define FLOOD_NOTICE     1
@@ -382,49 +312,6 @@
  */
 #define LF_EXPIRING 0x000001    /* Logfile will be closed soon          */
 
-#define FILEDB_HIDE     1
-#define FILEDB_UNHIDE   2
-#define FILEDB_SHARE    3
-#define FILEDB_UNSHARE  4
-
-/* Socket flags:
- */
-#define SOCK_UNUSED     0x0001  /* empty socket                         */
-#define SOCK_BINARY     0x0002  /* do not buffer input                  */
-#define SOCK_LISTEN     0x0004  /* listening port                       */
-#define SOCK_CONNECT    0x0008  /* connection attempt                   */
-#define SOCK_NONSOCK    0x0010  /* used for file i/o on debug           */
-#define SOCK_STRONGCONN 0x0020  /* don't report success until sure      */
-#define SOCK_EOFD       0x0040  /* it EOF'd recently during a write     */
-#define SOCK_PROXYWAIT  0x0080  /* waiting for SOCKS traversal          */
-#define SOCK_PASS       0x0100  /* passed on; only notify in case
-                                 * of traffic                           */
-#define SOCK_VIRTUAL    0x0200  /* not-connected socket (dont read it!) */
-#define SOCK_BUFFER     0x0400  /* buffer data; don't notify dcc funcs  */
-
-/* Flags to sock_has_data
- */
-enum {
-  SOCK_DATA_OUTGOING,           /* Data in out-queue?                   */
-  SOCK_DATA_INCOMING            /* Data in in-queue?                    */
-};
-
-/* Fake idx's for dprintf - these should be ridiculously large +ve nums
- */
-#define DP_STDOUT       0x7FF1
-#define DP_LOG          0x7FF2
-#define DP_SERVER       0x7FF3
-#define DP_HELP         0x7FF4
-#define DP_STDERR       0x7FF5
-#define DP_MODE         0x7FF6
-#define DP_MODE_NEXT    0x7FF7
-#define DP_SERVER_NEXT  0x7FF8
-#define DP_HELP_NEXT    0x7FF9
-
-#define NORMAL          0
-#define QUICK           1
-
-
 
 /* For local console */
 #define STDIN  0
@@ -449,21 +336,4 @@
 #define HELP_TEXT       2
 #define HELP_IRC        16
 
-/* This is used by the net module to keep track of sockets and what's
- * queued on them
- */
-typedef struct {
-  int sock;
-  short flags;
-  char *inbuf;
-  char *outbuf;
-  unsigned long outbuflen;      /* Outbuf could be binary data  */
-  unsigned long inbuflen;       /* Inbuf could be binary data   */
-} sock_list;
-
-enum {
-  EGG_OPTION_SET = 1,           /* Set option(s).               */
-  EGG_OPTION_UNSET = 2          /* Unset option(s).             */
-};
-
 #endif /* _EGG_EGGDROP_H */
Index: eggdrop1.7/src/main.c
diff -u eggdrop1.7/src/main.c:1.5 eggdrop1.7/src/main.c:1.6
--- eggdrop1.7/src/main.c:1.5	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/main.c	Thu Aug 26 05:36:51 2004
@@ -1,15 +1,9 @@
-/*
- * main.c -- handles:
- *   core event handling
- *   signal handling
- *   command line arguments
- *   context and assert debugging
+/* main.c
  *
- * $Id: main.c,v 1.5 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
+ *
+ * http://www.eggheads.org
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -24,11 +18,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-/*
- * The author (Robey Pointer) can be reached at:  robey at netcom.com
- * NOTE: Robey is no long working on this code, there is a discussion
- * list available at eggheads at eggheads.org.
+ *
+ * $Id: main.c,v 1.6 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -61,9 +52,10 @@
 #include "bg.h"
 
 #include "botnet.h"  /* check_botnet_pings */
-#include "dcc.h"     /* struct chat_info, DCC_*, STRIP_*, struct dcc_t */
+#include "dcc.h"     /* DCC_*, STRIP_*, STAT_*, struct chat_info, struct dcc_t */
 #include "dccutil.h" /* dprintf, dcc_chatter, lostdcc, tell_dcc, new_dcc,
                       * dcc_remove_lost */
+#include "net.h"     /* SOCK_*, getmyip, setsock, killsock, dequeue_sockets, sockgets */
 #include "userrec.h" /* adduser, count_users, write_userfile */
 
 #ifndef ENABLE_STRIP
Index: eggdrop1.7/src/main.h
diff -u eggdrop1.7/src/main.h:1.3 eggdrop1.7/src/main.h:1.4
--- eggdrop1.7/src/main.h:1.3	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/main.h	Thu Aug 26 05:36:51 2004
@@ -1,12 +1,7 @@
-/*
- * main.h
- *   include file to include most other include files
+/* main.h
  *
- * $Id: main.h,v 1.3 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -21,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: main.h,v 1.4 2004/08/26 10:36:51 wcc Exp $
  */
 
 #ifndef _EGG_MAIN_H
@@ -115,7 +112,6 @@
 #  define TCL_PATCH_LEVEL Tcl_GetVar(interp, "tcl_patchLevel", TCL_GLOBAL_ONLY)
 #endif
 
-#define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
 #define fixcolon(x) do {                                                \
         if ((x)[0] == ':')                                              \
           (x)++;                                                        \
@@ -131,9 +127,18 @@
         (_target)[(_len) - 1] = 0;                                      \
 } while (0)
 
-#ifdef BORGCUBES
-#  define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
-#endif /* BORGUBES */
+#ifndef HAVE_SIGACTION
+#  define sigaction sigvec
+#  ifndef sa_handler
+#    define sa_handler sv_handler
+#    define sa_mask sv_mask
+#    define sa_flags sv_flags
+#  endif
+#endif
+
+#ifndef HAVE_SIGEMPTYSET
+#  define sigemptyset(x) ((*(int *)(x))=0)
+#endif
 
 /* Use high-order bits for getting the random integer. With random()
  * modulo would probably be sufficient but on systems lacking random(),
Index: eggdrop1.7/src/mem.c
diff -u eggdrop1.7/src/mem.c:1.3 eggdrop1.7/src/mem.c:1.4
--- eggdrop1.7/src/mem.c:1.3	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/mem.c	Thu Aug 26 05:36:51 2004
@@ -3,7 +3,7 @@
  *   memory allocation and deallocation
  *   keeping track of what memory is being used by whom
  *
- * $Id: mem.c,v 1.3 2004/08/26 03:21:14 wcc Exp $
+ * $Id: mem.c,v 1.4 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -37,6 +37,7 @@
 #include "mod/modvals.h"
 
 #include "dccutil.h" /* dprintf */
+#include "net.h"     /* tell_netdebug */
 
 extern module_entry *module_list;
 
Index: eggdrop1.7/src/misc.c
diff -u eggdrop1.7/src/misc.c:1.4 eggdrop1.7/src/misc.c:1.5
--- eggdrop1.7/src/misc.c:1.4	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/misc.c	Thu Aug 26 05:36:51 2004
@@ -1,17 +1,7 @@
-/*
- * misc.c -- handles:
- *   split() maskhost() dumplots() daysago() days() daysdur()
- *   logging things
- *   queueing output for the bot (msg and help)
- *   resync buffers for sharebots
- *   help system
- *   motd display and %var substitution
+/* misc.c
  *
- * $Id: misc.c,v 1.4 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -26,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: misc.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -44,7 +36,7 @@
 #include "stat.h"
 
 #include "botmsg.h"  /* simple_sprintf */
-#include "dcc.h"     /* DCC_*, struct dcc_t */
+#include "dcc.h"     /* DCC_*, STAT_*, struct dcc_t */
 #include "dccutil.h" /* dprintf, chatout */
 #include "rfc1459.h" /* rfc_casecmp */
 #include "userrec.h" /* write_userfile */
@@ -52,14 +44,12 @@
 extern struct dcc_t *dcc;
 extern struct chanset_t *chanset;
 
-extern char helpdir[], version[], origbotname[], botname[], admin[], network[],
-            motdfile[], ver[], botnetnick[], bannerfile[], logfile_suffix[],
-            textdir[];
+extern char helpdir[], version[], botname[], admin[], network[], motdfile[],
+            ver[], botnetnick[], bannerfile[], logfile_suffix[], textdir[];
 extern int  backgrd, con_chan, term_z, use_stderr, dcc_total, keep_all_logs,
             quick_logs, strict_host;
 
 extern time_t now;
-extern Tcl_Interp *interp;
 
 
 int shtime = 1;                 /* Display the time with console output */
Index: eggdrop1.7/src/mod/assoc.mod/assoc.c
diff -u eggdrop1.7/src/mod/assoc.mod/assoc.c:1.2 eggdrop1.7/src/mod/assoc.mod/assoc.c:1.3
--- eggdrop1.7/src/mod/assoc.mod/assoc.c:1.2	Tue Aug 24 20:51:04 2004
+++ eggdrop1.7/src/mod/assoc.mod/assoc.c	Thu Aug 26 05:36:51 2004
@@ -2,7 +2,7 @@
  * assoc.c -- part of assoc.mod
  *   the assoc code, moved here mainly from botnet.c for module work
  *
- * $Id: assoc.c,v 1.2 2004/08/25 01:51:04 wcc Exp $
+ * $Id: assoc.c,v 1.3 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -319,7 +319,7 @@
 
   if ((idx >= 0) && !(bot_flags(dcc[idx].user) & BOT_ISOLATE)) {
     if (!egg_strcasecmp(dcc[idx].nick, botnick))
-      linking = b_status(idx) & STAT_LINKING;
+      linking = b_status(idx) & BSTAT_LINKING;
     s = newsplit(&par);
     chan = base64_to_int(s);
     if ((chan > 0) || (chan < GLOBAL_CHANS)) {
Index: eggdrop1.7/src/mod/filesys.mod/filedb3.h
diff -u eggdrop1.7/src/mod/filesys.mod/filedb3.h:1.1.1.1 eggdrop1.7/src/mod/filesys.mod/filedb3.h:1.2
--- eggdrop1.7/src/mod/filesys.mod/filedb3.h:1.1.1.1	Tue Aug 24 20:02:09 2004
+++ eggdrop1.7/src/mod/filesys.mod/filedb3.h	Thu Aug 26 05:36:51 2004
@@ -4,7 +4,7 @@
  *
  * Written by Fabian Knittel <fknittel at gmx.de>
  *
- * $Id: filedb3.h,v 1.1.1.1 2004/08/25 01:02:09 wcc Exp $
+ * $Id: filedb3.h,v 1.2 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
@@ -27,6 +27,11 @@
 #ifndef _EGG_MOD_FILESYS_FILEDB3_H
 #define _EGG_MOD_FILESYS_FILEDB3_H
 
+#define FILEDB_HIDE     1
+#define FILEDB_UNHIDE   2
+#define FILEDB_SHARE    3
+#define FILEDB_UNSHARE  4
+
 /* Top of each DB */
 typedef struct {
   char version;                 /* DB version                   */
Index: eggdrop1.7/src/mod/irc.mod/chan.c
diff -u eggdrop1.7/src/mod/irc.mod/chan.c:1.1.1.1 eggdrop1.7/src/mod/irc.mod/chan.c:1.2
--- eggdrop1.7/src/mod/irc.mod/chan.c:1.1.1.1	Tue Aug 24 20:02:15 2004
+++ eggdrop1.7/src/mod/irc.mod/chan.c	Thu Aug 26 05:36:52 2004
@@ -6,7 +6,7 @@
  *   user kickban, kick, op, deop
  *   idle kicking
  *
- * $Id: chan.c,v 1.1.1.1 2004/08/25 01:02:15 wcc Exp $
+ * $Id: chan.c,v 1.2 2004/08/26 10:36:52 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -137,7 +137,7 @@
       ok = 1;
     }
   if (prevent_mixing && ok)
-    flush_mode(chan, QUICK);
+    flush_mode(chan, IRC_QUICK);
 }
 
 /* Check a channel and clean-out any more-specific matching masks.
@@ -151,7 +151,7 @@
     if (wild_match(mask, m->mask) && rfc_casecmp(mask, m->mask))
       add_mode(chan, '-', mode, m->mask);
   add_mode(chan, '+', mode, mask);
-  flush_mode(chan, QUICK);
+  flush_mode(chan, IRC_QUICK);
 }
 
 /* This is a clone of detect_flood, but works for channel specificity now
@@ -381,7 +381,7 @@
         (chan_op(fr) || (glob_op(fr) && !chan_deop(fr))))) {
       if (!flushed) {
         /* We need to kick someone, flush eventual bans first */
-        flush_mode(chan, QUICK);
+        flush_mode(chan, IRC_QUICK);
         flushed += 1;
       }
       m->flags |= SENTKICK;     /* Mark as pending kick */
@@ -963,8 +963,8 @@
           !strcmp("*", chan->channel.key)))
         /* Undernet use to show a blank channel key if one was set when
          * you first joined a channel; however, this has been replaced by
-         * an asterisk and this has been agreed upon by other major IRC 
-         * networks so we'll check for an asterisk here as well 
+         * an asterisk and this has been agreed upon by other major IRC
+         * networks so we'll check for an asterisk here as well
          * (guppy 22Dec2001) */
         chan->status |= CHAN_ASKEDMODES;
     }
@@ -2141,7 +2141,7 @@
         /* If you remove this, the bot will crash when the user record in
          * question is removed/modified during the tcl binds below, and the
          * users was on more than one monitored channel */
-        set_handle_laston(chan->dname, u, now); 
+        set_handle_laston(chan->dname, u, now);
       if (split) {
         m->split = now;
         check_tcl_splt(nick, from, u, chan->dname);
Index: eggdrop1.7/src/mod/irc.mod/irc.c
diff -u eggdrop1.7/src/mod/irc.mod/irc.c:1.2 eggdrop1.7/src/mod/irc.mod/irc.c:1.3
--- eggdrop1.7/src/mod/irc.mod/irc.c:1.2	Tue Aug 24 20:51:04 2004
+++ eggdrop1.7/src/mod/irc.mod/irc.c	Thu Aug 26 05:36:52 2004
@@ -2,7 +2,7 @@
  * irc.c -- part of irc.mod
  *   support for channels within the bot
  *
- * $Id: irc.c,v 1.2 2004/08/25 01:51:04 wcc Exp $
+ * $Id: irc.c,v 1.3 2004/08/26 10:36:52 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -214,7 +214,7 @@
     u_addban(chan, s1, botnetnick, s, now + (60 * chan->ban_time), 0);
     if (!mevictim && HALFOP_CANDOMODE('b')) {
       add_mode(chan, '+', 'b', s1);
-      flush_mode(chan, QUICK);
+      flush_mode(chan, IRC_QUICK);
     }
   }
   /* Kick the offender */
@@ -926,7 +926,7 @@
         }
       }
     }
-    flush_mode(chan, NORMAL);
+    flush_mode(chan, IRC_NORMAL);
   }
 }
 
Index: eggdrop1.7/src/mod/irc.mod/irc.h
diff -u eggdrop1.7/src/mod/irc.mod/irc.h:1.2 eggdrop1.7/src/mod/irc.mod/irc.h:1.3
--- eggdrop1.7/src/mod/irc.mod/irc.h:1.2	Wed Aug 25 00:26:38 2004
+++ eggdrop1.7/src/mod/irc.mod/irc.h	Thu Aug 26 05:36:52 2004
@@ -1,7 +1,7 @@
 /*
  * irc.h -- part of irc.mod
  *
- * $Id: irc.h,v 1.2 2004/08/25 05:26:38 wcc Exp $
+ * $Id: irc.h,v 1.3 2004/08/26 10:36:52 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -34,6 +34,9 @@
 #define check_tcl_mode(a,b,c,d,e,f) check_tcl_kickmode(a,b,c,d,e,f,H_mode)
 #define check_tcl_kick(a,b,c,d,e,f) check_tcl_kickmode(a,b,c,d,e,f,H_kick)
 
+#define IRC_NORMAL          0
+#define IRC_QUICK           1
+
 #define REVENGE_KICK 1          /* Kicked victim        */
 #define REVENGE_DEOP 2          /* Took op              */
 
Index: eggdrop1.7/src/mod/irc.mod/mode.c
diff -u eggdrop1.7/src/mod/irc.mod/mode.c:1.1.1.1 eggdrop1.7/src/mod/irc.mod/mode.c:1.2
--- eggdrop1.7/src/mod/irc.mod/mode.c:1.1.1.1	Tue Aug 24 20:02:15 2004
+++ eggdrop1.7/src/mod/irc.mod/mode.c	Thu Aug 26 05:36:52 2004
@@ -4,7 +4,7 @@
  *   channel mode changes and the bot's reaction to them
  *   setting and getting the current wanted channel modes
  *
- * $Id: mode.c,v 1.1.1.1 2004/08/25 01:02:15 wcc Exp $
+ * $Id: mode.c,v 1.2 2004/08/26 10:36:52 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -165,7 +165,7 @@
     egg_strcatn(out, post, sizeof(out));
   }
   if (out[0]) {
-    if (pri == QUICK)
+    if (pri == IRC_QUICK)
       dprintf(DP_MODE, "MODE %s %s\n", chan->name, out);
     else
       dprintf(DP_SERVER, "MODE %s %s\n", chan->name, out);
@@ -234,9 +234,9 @@
       chan->compat = 1;
   } else if (mode == 'e' || mode == 'I') {
     if (prevent_mixing && chan->compat == 1)
-      flush_mode(chan, NORMAL);
+      flush_mode(chan, IRC_NORMAL);
   } else if (prevent_mixing && chan->compat == 2)
-    flush_mode(chan, NORMAL);
+    flush_mode(chan, IRC_NORMAL);
 
   if (mode == 'o' || mode == 'h' || mode == 'b' || mode == 'v' || mode == 'e' ||
       mode == 'I') {
@@ -290,7 +290,7 @@
         return;                 /* Already in there :- duplicate */
     l = strlen(op) + 1;
     if (chan->bytes + l > mode_buf_len)
-      flush_mode(chan, NORMAL);
+      flush_mode(chan, IRC_NORMAL);
     for (i = 0; i < modesperline; i++)
       if (chan->cmode[i].type == 0) {
         chan->cmode[i].type = type;
@@ -347,7 +347,7 @@
   if (include_lk && chan->key)
     modes--;
   if (modes < 1)
-    flush_mode(chan, NORMAL);   /* Full buffer! Flush modes. */
+    flush_mode(chan, IRC_NORMAL);   /* Full buffer! Flush modes. */
 }
 
 
Index: eggdrop1.7/src/mod/irc.mod/tclirc.c
diff -u eggdrop1.7/src/mod/irc.mod/tclirc.c:1.2 eggdrop1.7/src/mod/irc.mod/tclirc.c:1.3
--- eggdrop1.7/src/mod/irc.mod/tclirc.c:1.2	Wed Aug 25 01:39:38 2004
+++ eggdrop1.7/src/mod/irc.mod/tclirc.c	Thu Aug 26 05:36:52 2004
@@ -1,7 +1,7 @@
 /*
  * tclirc.c -- part of irc.mod
  *
- * $Id: tclirc.c,v 1.2 2004/08/25 06:39:38 wcc Exp $
+ * $Id: tclirc.c,v 1.3 2004/08/26 10:36:52 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -670,7 +670,7 @@
     Tcl_AppendResult(irp, "invalid channel: ", argv[1], NULL);
     return TCL_ERROR;
   }
-  flush_mode(chan, NORMAL);
+  flush_mode(chan, IRC_NORMAL);
   return TCL_OK;
 }
 
Index: eggdrop1.7/src/mod/module.h
diff -u eggdrop1.7/src/mod/module.h:1.2 eggdrop1.7/src/mod/module.h:1.3
--- eggdrop1.7/src/mod/module.h:1.2	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/mod/module.h	Thu Aug 26 05:36:51 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: module.h,v 1.2 2004/08/26 03:21:14 wcc Exp $
+ * $Id: module.h,v 1.3 2004/08/26 10:36:51 wcc Exp $
  */
 
 #ifndef _EGG_MOD_MODULE_H
@@ -29,7 +29,9 @@
 
 #include "src/types.h"
 #include "src/dcc.h"
+#include "src/dccutil.h"
 #include "src/dns.h"
+#include "src/net.h"
 
 /*
  * This file contains all the horrible stuff required to do the lookup
@@ -449,7 +451,7 @@
  */
 #define socklist (*(struct sock_list **)global[268])
 #define sockoptions ((int (*)(int, int, int))global[269])
-#define flush_inbuf ((int (*)(int))global[270])
+/* Was unused function flush_inbuf() - Wcc (270) */
 #define kill_bot ((void (*)(char *, char *))global[271])
 /* 272 - 275 */
 #define quit_msg ((char *)(global[272]))
Index: eggdrop1.7/src/mod/share.mod/share.c
diff -u eggdrop1.7/src/mod/share.mod/share.c:1.3 eggdrop1.7/src/mod/share.mod/share.c:1.4
--- eggdrop1.7/src/mod/share.mod/share.c:1.3	Wed Aug 25 22:21:15 2004
+++ eggdrop1.7/src/mod/share.mod/share.c	Thu Aug 26 05:36:52 2004
@@ -1,7 +1,7 @@
 /*
  * share.c -- part of share.mod
  *
- * $Id: share.c,v 1.3 2004/08/26 03:21:15 wcc Exp $
+ * $Id: share.c,v 1.4 2004/08/26 10:36:52 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -198,7 +198,7 @@
   char *host, *val;
   int yn;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     host = newsplit(&par);
     val = newsplit(&par);
     yn = atoi(val);
@@ -238,7 +238,7 @@
   char *host, *val;
   int yn;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     host = newsplit(&par);
     val = newsplit(&par);
     yn = atoi(val);
@@ -278,7 +278,7 @@
   char *host, *val;
   int yn;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     host = newsplit(&par);
     val = newsplit(&par);
     yn = atoi(val);
@@ -316,7 +316,7 @@
   char *hand;
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     hand = newsplit(&par);
     u = get_user_by_handle(userlist, hand);
     if (u && !(u->flags & USER_UNSHARED)) {
@@ -338,14 +338,14 @@
   int bfl, ofl;
   module_entry *me;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     hand = newsplit(&par);
     u = get_user_by_handle(userlist, hand);
     if (u && !(u->flags & USER_UNSHARED)) {
       atr = newsplit(&par);
       cst = findchan_by_dname(par);
       if (!par[0] || (cst && channel_shared(cst))) {
-        if (!(dcc[idx].status & STAT_GETTING) && (cst || !private_global))
+        if (!(dcc[idx].status & BSTAT_GETTING) && (cst || !private_global))
           shareout_but(cst, idx, "a %s %s %s\n", hand, atr, par);
         noshare = 1;
         if (par[0] && cst) {
@@ -362,7 +362,7 @@
             check_dcc_chanattrs(u, par, fr.chan, fr2.chan);
             noshare = 0;
             build_flags(s, &fr, 0);
-            if (!(dcc[idx].status & STAT_GETTING))
+            if (!(dcc[idx].status & BSTAT_GETTING))
               putlog(LOG_CMDS, "*", "%s: chattr %s %s %s",
                      dcc[idx].nick, hand, s, par);
             if ((me = module_find("irc", 0, 0))) {
@@ -390,7 +390,7 @@
           noshare = 0;
           build_flags(s, &fr, 0);
           fr.match = FR_CHAN;
-          if (!(dcc[idx].status & STAT_GETTING))
+          if (!(dcc[idx].status & BSTAT_GETTING))
             putlog(LOG_CMDS, "*", "%s: chattr %s %s", dcc[idx].nick, hand, s);
           if ((me = module_find("irc", 0, 0))) {
             Function *func = me->funcs;
@@ -413,7 +413,7 @@
   struct chanset_t *chan;
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     user = newsplit(&par);
     if ((u = get_user_by_handle(userlist, user))) {
       chan = findchan_by_dname(par);
@@ -442,7 +442,7 @@
   struct chanset_t *chan;
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     user = newsplit(&par);
     if ((u = get_user_by_handle(userlist, user))) {
       chan = findchan_by_dname(par);
@@ -468,7 +468,7 @@
   char *nick, *host, *pass, s[100];
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     nick = newsplit(&par);
     host = newsplit(&par);
     pass = newsplit(&par);
@@ -519,7 +519,7 @@
   struct userrec *u;
 
   /* If user is a share bot, ignore command */
-  if ((dcc[idx].status & STAT_SHARE) && !private_user &&
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user &&
       (u = get_user_by_handle(userlist, par)) &&
       !(u->flags & USER_UNSHARED) &&
       !((u->flags & USER_BOT) && (bot_flags(u) & BOT_SHARE))) {
@@ -537,7 +537,7 @@
   char *hand;
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     hand = newsplit(&par);
     if ((u = get_user_by_handle(userlist, hand)) &&
         !(u->flags & USER_UNSHARED)) {
@@ -553,11 +553,11 @@
   char *hand, p[32];
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     hand = newsplit(&par);
     if (!(u = get_user_by_handle(userlist, hand)) ||
         !(u->flags & USER_UNSHARED)) {
-      if (!(dcc[idx].status & STAT_GETTING))
+      if (!(dcc[idx].status & BSTAT_GETTING))
         shareout_but(NULL, idx, "+bh %s %s\n", hand, par);
       /* Add bot to userlist if not there */
       if (u) {
@@ -568,7 +568,7 @@
         makepass(p);
         userlist = adduser(userlist, hand, par, p, USER_BOT);
       }
-      if (!(dcc[idx].status & STAT_GETTING))
+      if (!(dcc[idx].status & BSTAT_GETTING))
         putlog(LOG_CMDS, "*", "%s: +host %s %s", dcc[idx].nick, hand, par);
     }
   }
@@ -579,7 +579,7 @@
   char *hand;
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     hand = newsplit(&par);
     if ((u = get_user_by_handle(userlist, hand)) &&
         !(u->flags & USER_UNSHARED)) {
@@ -599,7 +599,7 @@
   struct user_entry_type *uet;
   struct user_entry *e;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     key = newsplit(&par);
     hand = newsplit(&par);
     if (!(u = get_user_by_handle(userlist, hand)) ||
@@ -608,7 +608,7 @@
         /* If it's not a supported type, forget it */
         debug2("Ignore ch %s from %s (unknown type)", key, dcc[idx].nick);
       else {
-        if (!(dcc[idx].status & STAT_GETTING))
+        if (!(dcc[idx].status & BSTAT_GETTING))
           shareout_but(NULL, idx, "c %s %s %s\n", key, hand, par);
         noshare = 1;
         if (!u && (uet == &USERENTRY_BOTADDR)) {
@@ -647,7 +647,7 @@
   struct chanset_t *cst;
   struct userrec *u;
 
-  if ((dcc[idx].status & STAT_SHARE) && !private_user) {
+  if ((dcc[idx].status & BSTAT_SHARE) && !private_user) {
     hand = newsplit(&par);
     if ((u = get_user_by_handle(userlist, hand)) &&
         !(u->flags & USER_UNSHARED) && share_greet) {
@@ -675,7 +675,7 @@
 {
   struct chanset_t *chan = NULL;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "-b %s\n", par);
     putlog(LOG_CMDS, "*", "%s: cancel ban %s", dcc[idx].nick, par);
     str_unescape(par, '\\');
@@ -692,7 +692,7 @@
 {
   struct chanset_t *chan = NULL;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "-e %s\n", par);
     putlog(LOG_CMDS, "*", "%s: cancel exempt %s", dcc[idx].nick, par);
     str_unescape(par, '\\');
@@ -709,7 +709,7 @@
 {
   struct chanset_t *chan = NULL;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "-inv %s\n", par);
     putlog(LOG_CMDS, "*", "%s: cancel invite %s", dcc[idx].nick, par);
     str_unescape(par, '\\');
@@ -727,7 +727,7 @@
   char *chname;
   struct chanset_t *chan;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     chname = newsplit(&par);
     chan = findchan_by_dname(chname);
     fr.match = (FR_CHAN | FR_BOT);
@@ -754,7 +754,7 @@
   char *chname;
   struct chanset_t *chan;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     chname = newsplit(&par);
     chan = findchan_by_dname(chname);
     fr.match = (FR_CHAN | FR_BOT);
@@ -781,7 +781,7 @@
   char *chname;
   struct chanset_t *chan;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     chname = newsplit(&par);
     chan = findchan_by_dname(chname);
     fr.match = (FR_CHAN | FR_BOT);
@@ -805,7 +805,7 @@
 
 static void share_mns_ignore(int idx, char *par)
 {
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "-i %s\n", par);
     putlog(LOG_CMDS, "*", "%s: cancel ignore %s", dcc[idx].nick, par);
     str_unescape(par, '\\');
@@ -821,7 +821,7 @@
   char *ban, *tm, *from;
   int flags = 0;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "+b %s\n", par);
     noshare = 1;
     ban = newsplit(&par);
@@ -850,7 +850,7 @@
   struct chanset_t *chan;
   char *ban, *tm, *chname, *from;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     ban = newsplit(&par);
     tm = newsplit(&par);
     chname = newsplit(&par);
@@ -890,7 +890,7 @@
   char *exempt, *tm, *from;
   int flags = 0;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "+e %s\n", par);
     noshare = 1;
     exempt = newsplit(&par);
@@ -921,7 +921,7 @@
   struct chanset_t *chan;
   char *exempt, *tm, *chname, *from;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     exempt = newsplit(&par);
     tm = newsplit(&par);
     chname = newsplit(&par);
@@ -961,7 +961,7 @@
   char *invite, *tm, *from;
   int flags = 0;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "+inv %s\n", par);
     noshare = 1;
     invite = newsplit(&par);
@@ -992,7 +992,7 @@
   struct chanset_t *chan;
   char *invite, *tm, *chname, *from;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     invite = newsplit(&par);
     tm = newsplit(&par);
     chname = newsplit(&par);
@@ -1031,7 +1031,7 @@
   time_t expire_time;
   char *ign, *from, *ts;
 
-  if (dcc[idx].status & STAT_SHARE) {
+  if (dcc[idx].status & BSTAT_SHARE) {
     shareout_but(NULL, idx, "+i %s\n", par);
     noshare = 1;
     ign = newsplit(&par);
@@ -1058,17 +1058,17 @@
 static void share_ufno(int idx, char *par)
 {
   putlog(LOG_BOTS, "*", "User file rejected by %s: %s", dcc[idx].nick, par);
-  dcc[idx].status &= ~STAT_OFFERED;
-  if (!(dcc[idx].status & STAT_GETTING))
-    dcc[idx].status &= ~(STAT_SHARE | STAT_AGGRESSIVE);
+  dcc[idx].status &= ~BSTAT_OFFERED;
+  if (!(dcc[idx].status & BSTAT_GETTING))
+    dcc[idx].status &= ~(BSTAT_SHARE | BSTAT_AGGRESSIVE);
 }
 
 static void share_ufyes(int idx, char *par)
 {
-  if (dcc[idx].status & STAT_OFFERED) {
-    dcc[idx].status &= ~STAT_OFFERED;
-    dcc[idx].status |= STAT_SHARE;
-    dcc[idx].status |= STAT_SENDING;
+  if (dcc[idx].status & BSTAT_OFFERED) {
+    dcc[idx].status &= ~BSTAT_OFFERED;
+    dcc[idx].status |= BSTAT_SHARE;
+    dcc[idx].status |= BSTAT_SENDING;
     uf_features_parse(idx, par);
     start_sending_users(idx);
     putlog(LOG_BOTS, "*", "Sending user file send request to %s",
@@ -1093,8 +1093,8 @@
   else {
     for (i = 0; i < dcc_total; i++)
       if (dcc[i].type->flags & DCT_BOT) {
-        if ((dcc[i].status & STAT_SHARE) &&
-            (dcc[i].status & STAT_AGGRESSIVE) && (i != idx)) {
+        if ((dcc[i].status & BSTAT_SHARE) &&
+            (dcc[i].status & BSTAT_AGGRESSIVE) && (i != idx)) {
           ok = 0;
           break;
         }
@@ -1107,7 +1107,7 @@
       else
         dprintf(idx, "s uy\n");
       /* Set stat-getting to astatic void race condition (robey 23jun1996) */
-      dcc[idx].status |= STAT_SHARE | STAT_GETTING | STAT_AGGRESSIVE;
+      dcc[idx].status |= BSTAT_SHARE | BSTAT_GETTING | BSTAT_AGGRESSIVE;
       putlog(LOG_BOTS, "*", "Downloading user file from %s", dcc[idx].nick);
     }
   }
@@ -1123,7 +1123,7 @@
   FILE *f;
 
   egg_snprintf(s, sizeof s, ".share.%s.%li.users", botnetnick, now);
-  if (!(b_status(idx) & STAT_SHARE)) {
+  if (!(b_status(idx) & BSTAT_SHARE)) {
     dprintf(idx, "s e You didn't ask; you just started sending.\n");
     dprintf(idx, "s e Ask before sending the userfile.\n");
     zapfbot(idx);
@@ -1156,7 +1156,7 @@
       dcc[i].sock = sock;
       strcpy(dcc[i].host, dcc[idx].nick);
 
-      dcc[idx].status |= STAT_GETTING;
+      dcc[idx].status |= BSTAT_GETTING;
     }
   }
 }
@@ -1173,8 +1173,8 @@
     else if (can_resync(dcc[idx].nick)) {
       dprintf(idx, "s r!\n");
       dump_resync(idx);
-      dcc[idx].status &= ~STAT_OFFERED;
-      dcc[idx].status |= STAT_SHARE;
+      dcc[idx].status &= ~BSTAT_OFFERED;
+      dcc[idx].status |= BSTAT_SHARE;
       putlog(LOG_BOTS, "*", "Resync'd user file with %s", dcc[idx].nick);
       updatebot(-1, dcc[idx].nick, '+', 0);
     } else
@@ -1184,10 +1184,10 @@
 
 static void share_resync(int idx, char *par)
 {
-  if ((dcc[idx].status & STAT_OFFERED) && can_resync(dcc[idx].nick)) {
+  if ((dcc[idx].status & BSTAT_OFFERED) && can_resync(dcc[idx].nick)) {
     dump_resync(idx);
-    dcc[idx].status &= ~STAT_OFFERED;
-    dcc[idx].status |= STAT_SHARE;
+    dcc[idx].status &= ~BSTAT_OFFERED;
+    dcc[idx].status |= BSTAT_SHARE;
     updatebot(-1, dcc[idx].nick, '+', 0);
     putlog(LOG_BOTS, "*", "Resync'd user file with %s", dcc[idx].nick);
   }
@@ -1203,8 +1203,8 @@
 static void share_version(int idx, char *par)
 {
   /* Cleanup any share flags */
-  dcc[idx].status &= ~(STAT_SHARE | STAT_GETTING | STAT_SENDING |
-                       STAT_OFFERED | STAT_AGGRESSIVE);
+  dcc[idx].status &= ~(BSTAT_SHARE | BSTAT_GETTING | BSTAT_SENDING |
+                       BSTAT_OFFERED | BSTAT_AGGRESSIVE);
   dcc[idx].u.bot->uff_flags = 0;
   if ((dcc[idx].u.bot->numver >= min_share) &&
       (bot_flags(dcc[idx].user) & BOT_AGGRESSIVE)) {
@@ -1212,7 +1212,7 @@
       dprintf(idx, "s r?\n");
     else
       dprintf(idx, "s u?\n");
-    dcc[idx].status |= STAT_OFFERED;
+    dcc[idx].status |= BSTAT_OFFERED;
   }
 }
 
@@ -1222,20 +1222,20 @@
 
   if (!noshare) {
     for (i = 0; i < dcc_total; i++)
-      if ((dcc[i].type->flags & DCT_BOT) && (dcc[i].status & STAT_SHARE) &&
-          !(dcc[i].status & STAT_AGGRESSIVE)) {
+      if ((dcc[i].type->flags & DCT_BOT) && (dcc[i].status & BSTAT_SHARE) &&
+          !(dcc[i].status & BSTAT_AGGRESSIVE)) {
         /* Cancel any existing transfers */
-        if (dcc[i].status & STAT_SENDING)
+        if (dcc[i].status & BSTAT_SENDING)
           cancel_user_xfer(-i, 0);
         dprintf(i, "s u?\n");
-        dcc[i].status |= STAT_OFFERED;
+        dcc[i].status |= BSTAT_OFFERED;
       }
   }
 }
 
 static void share_endstartup(int idx, char *par)
 {
-  dcc[idx].status &= ~STAT_GETTING;
+  dcc[idx].status &= ~BSTAT_GETTING;
   /* Send to any other sharebots */
   hook_read_userfile();
 }
@@ -1244,8 +1244,8 @@
 {
   putlog(LOG_BOTS, "*", "Ending sharing with %s (%s).", dcc[idx].nick, par);
   cancel_user_xfer(-idx, 0);
-  dcc[idx].status &= ~(STAT_SHARE | STAT_GETTING | STAT_SENDING |
-                       STAT_OFFERED | STAT_AGGRESSIVE);
+  dcc[idx].status &= ~(BSTAT_SHARE | BSTAT_GETTING | BSTAT_SENDING |
+                       BSTAT_OFFERED | BSTAT_AGGRESSIVE);
   dcc[idx].u.bot->uff_flags = 0;
 }
 
@@ -1335,8 +1335,8 @@
       s[2 + (l = 509)] = 0;
     for (i = 0; i < dcc_total; i++)
       if ((dcc[i].type->flags & DCT_BOT) &&
-          (dcc[i].status & STAT_SHARE) &&
-          !(dcc[i].status & (STAT_GETTING | STAT_SENDING))) {
+          (dcc[i].status & BSTAT_SHARE) &&
+          !(dcc[i].status & (BSTAT_GETTING | BSTAT_SENDING))) {
         if (chan) {
           fr.match = (FR_CHAN | FR_BOT);
           get_user_flagrec(dcc[i].user, &fr, chan->dname);
@@ -1366,9 +1366,9 @@
     s[2 + (l = 509)] = 0;
   for (i = 0; i < dcc_total; i++)
     if ((dcc[i].type->flags & DCT_BOT) && (i != x) &&
-        (dcc[i].status & STAT_SHARE) &&
-        (!(dcc[i].status & STAT_GETTING)) &&
-        (!(dcc[i].status & STAT_SENDING))) {
+        (dcc[i].status & BSTAT_SHARE) &&
+        (!(dcc[i].status & BSTAT_GETTING)) &&
+        (!(dcc[i].status & BSTAT_SENDING))) {
       if (chan) {
         fr.match = (FR_CHAN | FR_BOT);
         get_user_flagrec(dcc[i].user, &fr, chan->dname);
@@ -1455,17 +1455,17 @@
   /* Resend userfile requests */
   for (i = 0; i < dcc_total; i++)
     if (dcc[i].type->flags & DCT_BOT) {
-      if (dcc[i].status & STAT_OFFERED) {
+      if (dcc[i].status & BSTAT_OFFERED) {
         if ((now - dcc[i].timeval > 120) && (dcc[i].user &&
             (bot_flags(dcc[i].user) & BOT_AGGRESSIVE)))
           dprintf(i, "s u?\n");
           /* ^ send it again in case they missed it */
         /* If it's a share bot that hasnt been sharing, ask again */
-      } else if (!(dcc[i].status & STAT_SHARE)) {
+      } else if (!(dcc[i].status & BSTAT_SHARE)) {
         /* Patched from original source by giusc at gbss.it <20040207> */
         if (dcc[i].user && (bot_flags(dcc[i].user) & BOT_AGGRESSIVE))  {
           dprintf(i, "s u?\n");
-          dcc[i].status |= STAT_OFFERED;
+          dcc[i].status |= BSTAT_OFFERED;
         }
       }
     }
@@ -1906,7 +1906,7 @@
     unlink(share_file);
     dprintf(idx, "s e %s\n", "uff parsing failed");
     putlog(LOG_BOTS, "*", "uff parsing failed");
-    dcc[idx].status &= ~(STAT_SHARE | STAT_SENDING | STAT_AGGRESSIVE);
+    dcc[idx].status &= ~(BSTAT_SHARE | BSTAT_SENDING | BSTAT_AGGRESSIVE);
     return;
   }
 
@@ -1918,10 +1918,10 @@
            i == DCCSEND_NOSOCK ? "CAN'T OPEN A LISTENING SOCKET" :
            i == DCCSEND_BADFN ? "BAD FILE" :
            i == DCCSEND_FEMPTY ? "EMPTY FILE" : "UNKNOWN REASON!");
-    dcc[idx].status &= ~(STAT_SHARE | STAT_SENDING | STAT_AGGRESSIVE);
+    dcc[idx].status &= ~(BSTAT_SHARE | BSTAT_SENDING | BSTAT_AGGRESSIVE);
   } else {
     updatebot(-1, dcc[idx].nick, '+', 0);
-    dcc[idx].status |= STAT_SENDING;
+    dcc[idx].status |= BSTAT_SENDING;
     i = dcc_total - 1;
     strcpy(dcc[i].host, dcc[idx].nick); /* Store bot's nick */
     dprintf(idx, "s us %lu %d %lu\n",
@@ -1998,8 +1998,8 @@
     updatebot(-1, dcc[idx].nick, '-', 0);
   }
   flush_tbuf(dcc[idx].nick);
-  if (dcc[idx].status & STAT_SHARE) {
-    if (dcc[idx].status & STAT_GETTING) {
+  if (dcc[idx].status & BSTAT_SHARE) {
+    if (dcc[idx].status & BSTAT_GETTING) {
       j = 0;
       for (i = 0; i < dcc_total; i++)
         if (!egg_strcasecmp(dcc[i].host, dcc[idx].nick) &&
@@ -2013,7 +2013,7 @@
       }
       putlog(LOG_BOTS, "*", "(Userlist download aborted.)");
     }
-    if (dcc[idx].status & STAT_SENDING) {
+    if (dcc[idx].status & BSTAT_SENDING) {
       j = 0;
       for (i = 0; i < dcc_total; i++)
         if ((!egg_strcasecmp(dcc[i].host, dcc[idx].nick)) &&
@@ -2027,8 +2027,8 @@
       }
       putlog(LOG_BOTS, "*", "(Userlist transmit aborted.)");
     }
-    if (allow_resync && (!(dcc[idx].status & STAT_GETTING)) &&
-        (!(dcc[idx].status & STAT_SENDING)))
+    if (allow_resync && (!(dcc[idx].status & BSTAT_GETTING)) &&
+        (!(dcc[idx].status & BSTAT_SENDING)))
       new_tbuf(dcc[idx].nick);
   }
   if (!k)
@@ -2072,12 +2072,12 @@
   module_undepend(MODULE_NAME);
   putlog(LOG_MISC | LOG_BOTS, "*", "Sending 'share end' to all sharebots...");
   for (i = 0; i < dcc_total; i++)
-    if ((dcc[i].type->flags & DCT_BOT) && (dcc[i].status & STAT_SHARE)) {
+    if ((dcc[i].type->flags & DCT_BOT) && (dcc[i].status & BSTAT_SHARE)) {
       dprintf(i, "s e Unload module\n");
       cancel_user_xfer(-i, 0);
       updatebot(-1, dcc[i].nick, '-', 0);
-      dcc[i].status &= ~(STAT_SHARE | STAT_GETTING | STAT_SENDING |
-                         STAT_OFFERED | STAT_AGGRESSIVE);
+      dcc[i].status &= ~(BSTAT_SHARE | BSTAT_GETTING | BSTAT_SENDING |
+                         BSTAT_OFFERED | BSTAT_AGGRESSIVE);
       dcc[i].u.bot->uff_flags = 0;
     }
   putlog(LOG_MISC | LOG_BOTS, "*",
@@ -2130,7 +2130,7 @@
 
     for (i = 0; i < dcc_total; i++) {
       if (dcc[i].type == &DCC_BOT) {
-        if (dcc[i].status & STAT_GETTING) {
+        if (dcc[i].status & BSTAT_GETTING) {
           int ok = 0;
 
           for (j = 0; j < dcc_total; j++)
@@ -2146,7 +2146,7 @@
           if (!ok)
             dprintf(idx, "    Download userlist from %s (negotiating "
                     "botentries)\n", dcc[i].nick);
-        } else if (dcc[i].status & STAT_SENDING) {
+        } else if (dcc[i].status & BSTAT_SENDING) {
           for (j = 0; j < dcc_total; j++) {
             if (((dcc[j].type->flags & (DCT_FILETRAN | DCT_FILESEND)) ==
                 DCT_FILETRAN) && !egg_strcasecmp(dcc[j].host, dcc[i].nick)) {
@@ -2159,9 +2159,9 @@
                         dcc[i].nick);
             }
           }
-        } else if (dcc[i].status & STAT_AGGRESSIVE) {
+        } else if (dcc[i].status & BSTAT_AGGRESSIVE) {
           dprintf(idx, "    Passively sharing with %s.\n", dcc[i].nick);
-        } else if (dcc[i].status & STAT_SHARE) {
+        } else if (dcc[i].status & BSTAT_SHARE) {
           dprintf(idx, "    Aggressively sharing with %s.\n", dcc[i].nick);
         }
       }
Index: eggdrop1.7/src/mod/transfer.mod/transfer.c
diff -u eggdrop1.7/src/mod/transfer.mod/transfer.c:1.3 eggdrop1.7/src/mod/transfer.mod/transfer.c:1.4
--- eggdrop1.7/src/mod/transfer.mod/transfer.c:1.3	Wed Aug 25 00:26:38 2004
+++ eggdrop1.7/src/mod/transfer.mod/transfer.c	Thu Aug 26 05:36:52 2004
@@ -1,7 +1,7 @@
 /*
  * transfer.c -- part of transfer.mod
  *
- * $Id: transfer.c,v 1.3 2004/08/25 05:26:38 wcc Exp $
+ * $Id: transfer.c,v 1.4 2004/08/26 10:36:52 wcc Exp $
  *
  * Copyright (C) 1997 Robey Pointer
  * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
@@ -271,8 +271,8 @@
         break;
       }
     if (y != 0) {
-      dcc[y].status &= ~STAT_GETTING;
-      dcc[y].status &= ~STAT_SHARE;
+      dcc[y].status &= ~BSTAT_GETTING;
+      dcc[y].status &= ~BSTAT_SHARE;
     }
     putlog(LOG_BOTS, "*", USERF_FAILEDXFER);
     unlink(dcc[idx].u.xfer->filename);
@@ -543,7 +543,7 @@
             (dcc[x].type->flags & DCT_BOT))
           y = x;
       if (y != 0)
-        dcc[y].status &= ~STAT_SENDING;
+        dcc[y].status &= ~BSTAT_SENDING;
       putlog(LOG_BOTS, "*", TRANSFER_COMPLETED_USERFILE, dcc[y].nick);
       unlink(dcc[idx].u.xfer->filename);
       /* Any sharebot things that were queued: */
@@ -677,8 +677,8 @@
           (dcc[x].type->flags & DCT_BOT))
         y = x;
     if (y != 0) {
-      dcc[y].status &= ~STAT_SENDING;
-      dcc[y].status &= ~STAT_SHARE;
+      dcc[y].status &= ~BSTAT_SENDING;
+      dcc[y].status &= ~BSTAT_SHARE;
     }
     unlink(dcc[i].u.xfer->filename);
     putlog(LOG_BOTS, "*", TRANSFER_USERFILE_TIMEOUT);
@@ -732,8 +732,8 @@
           (dcc[x].type->flags & DCT_BOT))
         y = x;
     if (y != 0) {
-      dcc[y].status &= ~STAT_GETTING;
-      dcc[y].status &= ~STAT_SHARE;
+      dcc[y].status &= ~BSTAT_GETTING;
+      dcc[y].status &= ~BSTAT_SHARE;
     }
     unlink(dcc[idx].u.xfer->filename);
     putlog(LOG_BOTS, "*", TRANSFER_USERFILE_TIMEOUT);
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.4 eggdrop1.7/src/modules.c:1.5
--- eggdrop1.7/src/modules.c:1.4	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/modules.c	Thu Aug 26 05:36:51 2004
@@ -1,14 +1,9 @@
-/*
- * modules.c -- handles:
- *   support for modules in eggdrop
+/* modules.c
  *
- * by Darrin Smith (beldin at light.iinet.net.au)
+ * Originally by Darrin Smith (beldin at light.iinet.net.au)
  *
- * $Id: modules.c,v 1.4 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -23,6 +18,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: modules.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include <ctype.h>
@@ -39,6 +36,7 @@
 #include "dcc.h"
 #include "dccutil.h"
 #include "language.h"
+#include "net.h"
 #include "rfc1459.h"
 #include "userent.h"
 #include "userrec.h"
@@ -169,9 +167,9 @@
 {
   if ((x[0] == 'u') && (x[1] == 'n')) {
     putlog(LOG_BOTS, "*", "User file rejected by %s: %s", dcc[idx].nick, x + 3);
-    dcc[idx].status &= ~STAT_OFFERED;
-    if (!(dcc[idx].status & STAT_GETTING)) {
-      dcc[idx].status &= ~STAT_SHARE;
+    dcc[idx].status &= ~BSTAT_OFFERED;
+    if (!(dcc[idx].status & BSTAT_GETTING)) {
+      dcc[idx].status &= ~BSTAT_SHARE;
     }
   } else if ((x[0] != 'v') && (x[0] != 'e')) {
     dprintf(idx, "s un Not sharing userfile.\n");
@@ -552,7 +550,7 @@
   /* 268 - 271 */
   (Function) & socklist,          /* sock_list *                         */
   (Function) sockoptions,
-  (Function) flush_inbuf,
+  (Function) 0,                   /* Unused function flush_inbuf() - Wcc (270) */
   (Function) kill_bot,
   /* 272 - 275 */
   (Function) quit_msg,            /* char *                              */
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.3 eggdrop1.7/src/net.c:1.4
--- eggdrop1.7/src/net.c:1.3	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/net.c	Thu Aug 26 05:36:51 2004
@@ -1,12 +1,9 @@
-/*
- * net.c -- handles:
- *   all raw network i/o
+/* net.c
  *
- * $Id: net.c,v 1.3 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * This is hereby released into the public domain.
  * Robey Pointer, robey at netcom.com
+ *
+ * $Id: net.c,v 1.4 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include <fcntl.h>
@@ -26,17 +23,12 @@
 #endif
 #include <setjmp.h>
 
-#ifndef HAVE_GETDTABLESIZE
-#  ifdef FD_SETSIZE
-#    define getdtablesize() FD_SETSIZE
-#  else
-#    define getdtablesize() 200
-#  endif
-#endif
 
+#include "net.h"
 #include "dcc.h"     /* struct dcc_t */
 #include "dccutil.h" /* dprintf */
 
+
 extern struct dcc_t *dcc;
 extern int backgrd, use_stderr, resolve_timeout, dcc_total;
 extern unsigned long otraffic_irc_today, otraffic_bn_today, otraffic_dcc_today,
@@ -50,7 +42,7 @@
 char botuser[21] = "eggdrop"; /* Username of the user running the bot.        */
 int dcc_sanitycheck = 0;      /* Do some sanity checking on dcc connections.  */
 
-sock_list *socklist = NULL;   /* Enough to be safe.                           */
+sock_list *socklist = NULL;
 int MAXSOCKS = 0;
 jmp_buf alarmret;             /* Env buffer for alarm() returns.              */
 
@@ -58,9 +50,30 @@
 #define PROXY_SOCKS   1
 #define PROXY_SUN     2
 
+#ifndef HAVE_GETDTABLESIZE
+#  ifdef FD_SETSIZE
+#    define getdtablesize() FD_SETSIZE
+#  else
+#    define getdtablesize() 200
+#  endif
+#endif
+
+
+int expmem_net()
+{
+  int i, tot = 0;
+
+  for (i = 0; i < MAXSOCKS; i++) {
+    if (!(socklist[i].flags & SOCK_UNUSED)) {
+      if (socklist[i].inbuf != NULL)
+        tot += strlen(socklist[i].inbuf) + 1;
+      if (socklist[i].outbuf != NULL)
+        tot += socklist[i].outbuflen;
+    }
+  }
+  return tot;
+}
 
-/* I need an UNSIGNED long for dcc type stuff
- */
 IP my_atoul(char *s)
 {
   IP ret = 0;
@@ -73,8 +86,7 @@
   return ret;
 }
 
-/* Initialize the socklist
- */
+/* Initialize the socklist */
 void init_net()
 {
   int i;
@@ -84,23 +96,7 @@
   }
 }
 
-int expmem_net()
-{
-  int i, tot = 0;
-
-  for (i = 0; i < MAXSOCKS; i++) {
-    if (!(socklist[i].flags & SOCK_UNUSED)) {
-      if (socklist[i].inbuf != NULL)
-        tot += strlen(socklist[i].inbuf) + 1;
-      if (socklist[i].outbuf != NULL)
-        tot += socklist[i].outbuflen;
-    }
-  }
-  return tot;
-}
-
-/* Get my ip number
- */
+/* Get my ip number */
 IP getmyip()
 {
   struct hostent *hp;
@@ -492,35 +488,6 @@
   return open_address_listen(myip[0] ? getmyip() : INADDR_ANY, port);
 }
 
-/* Given a network-style IP address, returns the hostname. The hostname
- * will be in the "##.##.##.##" format if there was an error.
- *
- * NOTE: This function is depreciated. Try using the async dns approach
- *       instead.
- */
-char *hostnamefromip(unsigned long ip)
-{
-  struct hostent *hp;
-  unsigned long addr = ip;
-  unsigned char *p;
-  static char s[UHOSTLEN];
-
-  if (!setjmp(alarmret)) {
-    alarm(resolve_timeout);
-    hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET);
-    alarm(0);
-  } else {
-    hp = NULL;
-  }
-  if (hp == NULL) {
-    p = (unsigned char *) &addr;
-    sprintf(s, "%u.%u.%u.%u", p[0], p[1], p[2], p[3]);
-    return s;
-  }
-  strncpyz(s, hp->h_name, sizeof s);
-  return s;
-}
-
 /* Returns the given network byte order IP address in the
  * dotted format - "##.##.##.##"
  */
@@ -548,18 +515,16 @@
 
   if (new_sock < 0)
     return -1;
+
   if (ip != NULL) {
     *ip = from.sin_addr.s_addr;
-    /* This is now done asynchronously. We now only provide the IP address.
-     *
-     * strncpy(caller, hostnamefromip(*ip), 120);
-     */
     strncpyz(caller, iptostr(*ip), 121);
     *ip = ntohl(*ip);
   }
+
   if (port != NULL)
     *port = ntohs(from.sin_port);
-  /* Set up all the normal socket crap */
+
   setsock(new_sock, (binary ? SOCK_BINARY : 0));
   return new_sock;
 }
@@ -1199,39 +1164,3 @@
     debug1("sock_has_data: could not find socket #%d, returning false.", sock);
   return ret;
 }
-
-/* flush_inbuf():
- * checks if there's data in the incoming buffer of an connection
- * and flushs the buffer if possible
- *
- * returns: -1 if the dcc entry wasn't found
- *          -2 if dcc[idx].type->activity doesn't exist and the data couldn't
- *             be handled
- *          0 if buffer was empty
- *          otherwise length of flushed buffer
- */
-int flush_inbuf(int idx)
-{
-  int i, len;
-  char *inbuf;
-
-  Assert((idx >= 0) && (idx < dcc_total));
-  for (i = 0; i < MAXSOCKS; i++) {
-    if ((dcc[idx].sock == socklist[i].sock) &&
-        !(socklist[i].flags & SOCK_UNUSED)) {
-      len = socklist[i].inbuflen;
-      if ((len > 0) && socklist[i].inbuf) {
-        if (dcc[idx].type && dcc[idx].type->activity) {
-          inbuf = socklist[i].inbuf;
-          socklist[i].inbuf = NULL;
-          dcc[idx].type->activity(idx, inbuf, len);
-          nfree(inbuf);
-          return len;
-        } else
-          return -2;
-      } else
-        return 0;
-    }
-  }
-  return -1;
-}
Index: eggdrop1.7/src/net.h
diff -u /dev/null eggdrop1.7/src/net.h:1.1
--- /dev/null	Thu Aug 26 05:37:03 2004
+++ eggdrop1.7/src/net.h	Thu Aug 26 05:36:51 2004
@@ -0,0 +1,95 @@
+/* net.h
+ *
+ * Copyright (C) 2004 Eggheads Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: net.h,v 1.1 2004/08/26 10:36:51 wcc Exp $
+ */
+
+#ifndef _EGG_NET_H
+#define _EGG_NET_H
+
+#include "types.h" /* IP */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef NEXT_HACKS
+#  define O_NONBLOCK 00000004 /* POSIX non-blocking I/O. */
+#endif /* NEXT_HACKS */
+
+#define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
+
+#define SOCK_UNUSED     0x0001  /* empty/unused socket                         */
+#define SOCK_BINARY     0x0002  /* do not buffer input                  */
+#define SOCK_LISTEN     0x0004  /* listening port                       */
+#define SOCK_CONNECT    0x0008  /* connection attempt                   */
+#define SOCK_NONSOCK    0x0010  /* used for file i/o on debug           */
+#define SOCK_STRONGCONN 0x0020  /* don't report success until sure      */
+#define SOCK_EOFD       0x0040  /* it EOF'd recently during a write     */
+#define SOCK_PROXYWAIT  0x0080  /* waiting for SOCKS traversal          */
+#define SOCK_PASS       0x0100  /* passed on; only notify in case of traffic                           */
+#define SOCK_VIRTUAL    0x0200  /* not-connected socket (dont read it!) */
+#define SOCK_BUFFER     0x0400  /* buffer data; don't notify dcc funcs  */
+
+/* Flags for sock_has_data. */
+enum {
+  SOCK_DATA_OUTGOING, /* Data in out-queue? */
+  SOCK_DATA_INCOMING  /* Data in in-queue?  */
+};
+
+/* Flags for sockoptions(). */
+enum {
+  EGG_OPTION_SET   = 1, /* Set option(s).  */
+  EGG_OPTION_UNSET = 2  /* Unset option(s). */
+};
+
+typedef struct {
+  int sock;
+  short flags;
+  char *inbuf;
+  char *outbuf;
+  unsigned long outbuflen; /* Outbuf could be binary data */
+  unsigned long inbuflen;  /* Inbuf could be binary data  */
+} sock_list;
+
+#ifndef MAKING_MODS
+IP my_atoul(char *);
+IP getmyip();
+void neterror(char *);
+void setsock(int, int);
+int allocsock(int, int);
+int getsock(int);
+void killsock(int);
+int answer(int, char *, unsigned long *, unsigned short *, int);
+inline int open_listen(int *);
+int open_address_listen(IP, int *);
+int open_telnet(char *, int);
+int open_telnet_dcc(int, char *, char *);
+int open_telnet_raw(int, char *, int);
+void tputs(int, char *, unsigned int);
+void dequeue_sockets();
+int sockgets(char *, int *);
+void tell_netdebug(int);
+int sanitycheck_dcc(char *, char *, char *, char *);
+int hostsanitycheck_dcc(char *, char *, IP, char *, char *);
+char *iptostr(IP);
+int sock_has_data(int, int);
+int sockoptions(int, int, int);
+#endif
+
+#endif /* !_EGG_NET_H */
Index: eggdrop1.7/src/patch.h
diff -u eggdrop1.7/src/patch.h:1.6 eggdrop1.7/src/patch.h:1.7
--- eggdrop1.7/src/patch.h:1.6	Wed Aug 25 02:41:36 2004
+++ eggdrop1.7/src/patch.h	Thu Aug 26 05:36:51 2004
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.6 2004/08/25 07:41:36 wcc Exp $
+ * $Id: patch.h,v 1.7 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1093419545");            /* current unixtime */
+patch("1093516613");            /* current unixtime */
 /*
  *
  *
  */
-patch("proto_h-2");
+patch("proto_h-3");
 /*
  *
  *
Index: eggdrop1.7/src/proto.h
diff -u eggdrop1.7/src/proto.h:1.4 eggdrop1.7/src/proto.h:1.5
--- eggdrop1.7/src/proto.h:1.4	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/proto.h	Thu Aug 26 05:36:51 2004
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.4 2004/08/26 03:21:14 wcc Exp $
+ * $Id: proto.h,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -147,33 +147,6 @@
 #define maskhost(a,b) _maskhost((a),(b),1)
 #define maskban(a,b)  _maskhost((a),(b),0)
 
-/* net.c */
-IP my_atoul(char *);
-unsigned long iptolong(IP);
-IP getmyip();
-void neterror(char *);
-void setsock(int, int);
-int allocsock(int, int);
-int getsock(int);
-char *hostnamefromip(unsigned long);
-void killsock(int);
-int answer(int, char *, unsigned long *, unsigned short *, int);
-inline int open_listen(int *);
-int open_address_listen(IP addr, int *);
-int open_telnet(char *, int);
-int open_telnet_dcc(int, char *, char *);
-int open_telnet_raw(int, char *, int);
-void tputs(int, char *, unsigned int);
-void dequeue_sockets();
-int sockgets(char *, int *);
-void tell_netdebug(int);
-int sanitycheck_dcc(char *, char *, char *, char *);
-int hostsanitycheck_dcc(char *, char *, IP, char *, char *);
-char *iptostr(IP);
-int sock_has_data(int, int);
-int sockoptions(int sock, int operation, int sock_options);
-int flush_inbuf(int idx);
-
 /* tcl.c */
 void protect_tcl();
 void unprotect_tcl();
Index: eggdrop1.7/src/tcl.c
diff -u eggdrop1.7/src/tcl.c:1.2 eggdrop1.7/src/tcl.c:1.3
--- eggdrop1.7/src/tcl.c:1.2	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/tcl.c	Thu Aug 26 05:36:51 2004
@@ -1,14 +1,7 @@
-/*
- * tcl.c -- handles:
- *   the code for every command eggdrop adds to Tcl
- *   Tcl initialization
- *   getting and setting Tcl/eggdrop variables
+/* tcl.c
  *
- * $Id: tcl.c,v 1.2 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -23,13 +16,15 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: tcl.c,v 1.3 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include <stdlib.h>             /* getenv()                             */
 #include <locale.h>             /* setlocale()                          */
 
 #include "main.h"
-#include "dcc.h"  /* struct dcc_t */
+#include "dcc.h"  /* DCT_*, struct dcc_t */
 
 /* Used for read/write to internal strings */
 typedef struct {
@@ -46,31 +41,27 @@
 
 
 extern time_t online_since;
-
 extern char origbotname[], botuser[], motdfile[], admin[], userfile[],
             firewall[], helpdir[], notify_new[], hostname[], myip[], moddir[],
             tempdir[], owner[], network[], botnetnick[], bannerfile[],
             egg_version[], natip[], configfile[], logfile_suffix[], textdir[],
             pid_file[];
-
-extern int backgrd, flood_telnet_thr, flood_telnet_time, shtime, share_greet,
-           require_p, keep_all_logs, allow_new_telnets, stealth_telnets,
-           use_telnet_banner, default_flags, conmask, switch_logfiles_at,
-           connect_timeout, firewallport, notify_users_at, flood_thr, tands,
-           ignore_time, reserved_port_min, reserved_port_max, die_on_sighup,
-           die_on_sigterm, max_logs, max_logsize, dcc_total, raw_log,
-           identtimeout, dcc_sanitycheck, dupwait_timeout, egg_numver,
-           share_unlinks, protect_telnet, sort_users, strict_host,
-           resolve_timeout, default_uflags, userfile_perm;
-
+extern int flood_telnet_thr, flood_telnet_time, shtime, require_p, conmask,
+           keep_all_logs, allow_new_telnets, stealth_telnets, default_flags,
+           use_telnet_banner, switch_logfiles_at, connect_timeout, strict_host,
+           firewallport, notify_users_at, flood_thr, ignore_time, raw_log,
+           reserved_port_min, reserved_port_max, die_on_sighup, die_on_sigterm,
+           max_logs, max_logsize, dcc_total, identtimeout, dcc_sanitycheck,
+           dupwait_timeout, egg_numver, share_unlinks, protect_telnet,
+           sort_users, resolve_timeout, default_uflags, userfile_perm, tands;
 extern struct dcc_t *dcc;
 extern tcl_timer_t *timer, *utimer;
-
 Tcl_Interp *interp;
 
+
 int protect_readonly = 0; /* Enable read-only protection? */
-char whois_fields[1025] = "";
 
+char whois_fields[1025] = "";
 int dcc_flood_thr = 3;
 int use_invites = 0;
 int use_exempts = 0;
@@ -90,8 +81,7 @@
 int clientdata_stuff = 0;
 
 /* Compatability for removed settings.*/
-int strict_servernames = 0, enable_simul = 1, use_console_r = 0,
-    debug_output = 0;
+int strict_servernames = 0, enable_simul = 1, use_console_r = 0, debug_output = 0;
 
 
 /* Prototypes for Tcl */
Index: eggdrop1.7/src/tcldcc.c
diff -u eggdrop1.7/src/tcldcc.c:1.4 eggdrop1.7/src/tcldcc.c:1.5
--- eggdrop1.7/src/tcldcc.c:1.4	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/tcldcc.c	Thu Aug 26 05:36:51 2004
@@ -1,12 +1,7 @@
-/*
- * tcldcc.c -- handles:
- *   Tcl stubs for the dcc commands
+/* tcldcc.c
  *
- * $Id: tcldcc.c,v 1.4 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -21,18 +16,24 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: tcldcc.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
 #include "tandem.h"
 #include "modules.h"
 
+#include "tcldcc.h"
 #include "botmsg.h"  /* int_to_base10 */
 #include "botnet.h"  /* lastbot, nextbot, botlink, butunlink */
 #include "cmds.h"    /* stripmodes, stripmasktype */
-#include "dcc.h"     /* struct script_info, DCC_*, struct dcc_t */
-#include "dccutil.h" /* get_data_ptr, chatout, chanout_but, lostdcc,
-                      * killtransfer, not_away, set_away, do_boot, new_dcc */
+#include "dcc.h"     /* DCC_*, DCT_*, LSTN_*, STAT_*, EGG_OPTION_*, struct script_info,
+                      * struct dcc_t */
+#include "dccutil.h" /* get_data_ptr, chatout, chanout_but, lostdcc, killtransfer,
+                      * not_away, set_away, do_boot, new_dcc */
+#include "net.h"     /* SOCK_*, getmyip, neterror, getsock, killsock, open_listen,
+                      * tputs, open_telnet_raw, sockoptions */
 #include "userrec.h" /* write_userfile */
 
 
Index: eggdrop1.7/src/tcldcc.h
diff -u /dev/null eggdrop1.7/src/tcldcc.h:1.1
--- /dev/null	Thu Aug 26 05:37:03 2004
+++ eggdrop1.7/src/tcldcc.h	Thu Aug 26 05:36:51 2004
@@ -0,0 +1,31 @@
+/* tcldcc.h
+ *
+ * Copyright (C) 2004 Eggheads Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: tcldcc.h,v 1.1 2004/08/26 10:36:51 wcc Exp $
+ */
+
+#ifndef _EGG_TCLDCC_H
+#define _EGG_TCLDCC_H
+
+struct portmap {
+  int realport;
+  int mappedto;
+  struct portmap *next;
+};
+
+#endif /* !_EGG_TCLDCC_H */
Index: eggdrop1.7/src/tclmisc.c
diff -u eggdrop1.7/src/tclmisc.c:1.4 eggdrop1.7/src/tclmisc.c:1.5
--- eggdrop1.7/src/tclmisc.c:1.4	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/tclmisc.c	Thu Aug 26 05:36:51 2004
@@ -1,12 +1,7 @@
-/*
- * tclmisc.c -- handles:
- *   Tcl stubs for everything else
+/* tclmisc.c
  *
- * $Id: tclmisc.c,v 1.4 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -21,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: tclmisc.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -47,11 +44,13 @@
 #include "md5/md5.h"
 #include "botmsg.h" /* add_note */
 #include "dcc.h"    /* STRIP_*, strip_mirc_codes, struct dcc_t */
+#include "net.h"    /* getmyip */
+
 
 extern p_tcl_bind_list bind_table_list;
 extern tcl_timer_t *timer, *utimer;
 extern struct dcc_t *dcc;
-extern char origbotname[], botnetnick[], quit_msg[];
+extern char botnetnick[], quit_msg[];
 extern struct userrec *userlist;
 extern time_t now;
 extern module_entry *module_list;
@@ -59,6 +58,7 @@
 extern log_t *logs;
 extern Tcl_Interp *interp;
 
+
 int expmem_tclmisc()
 {
   int i, tot = 0;
Index: eggdrop1.7/src/tcluser.c
diff -u eggdrop1.7/src/tcluser.c:1.3 eggdrop1.7/src/tcluser.c:1.4
--- eggdrop1.7/src/tcluser.c:1.3	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/tcluser.c	Thu Aug 26 05:36:51 2004
@@ -1,12 +1,7 @@
-/*
- * tcluser.c -- handles:
- *   Tcl stubs for the user-record-oriented commands
+/* tcluser.c
  *
- * $Id: tcluser.c,v 1.3 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -21,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: tcluser.c,v 1.4 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -31,7 +28,7 @@
 
 #include "botmsg.h"  /* int_to_base10 */
 #include "botnet.h"  /* nextbot */
-#include "dcc.h"     /* DCC_*, struct dcc_t */
+#include "dcc.h"     /* DCC_*, BSTAT_*, struct dcc_t */
 #include "userrec.h" /* adduser, u_pass_match, delhost_by_handle, count_users,
                       * deluser, change_handle, write_userfile */
 
@@ -39,7 +36,7 @@
 extern struct userrec *userlist;
 extern int default_flags, dcc_total, ignore_time;
 extern struct dcc_t *dcc;
-extern char origbotname[], botnetnick[];
+extern char botnetnick[];
 extern time_t now;
 
 
@@ -428,7 +425,7 @@
   BADARGS(1, 1, "");
 
   for (i = 0; i < dcc_total; i++) {
-    if (dcc[i].type == &DCC_BOT && dcc[i].status & STAT_GETTING) {
+    if (dcc[i].type == &DCC_BOT && dcc[i].status & BSTAT_GETTING) {
       Tcl_AppendResult(irp, "1", NULL);
       return TCL_OK;
     }
Index: eggdrop1.7/src/userent.c
diff -u eggdrop1.7/src/userent.c:1.4 eggdrop1.7/src/userent.c:1.5
--- eggdrop1.7/src/userent.c:1.4	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/userent.c	Thu Aug 26 05:36:51 2004
@@ -2,7 +2,7 @@
  * userent.c -- handles:
  *   user-entry handling, new stylem more versatile.
  *
- * $Id: userent.c,v 1.4 2004/08/26 03:21:14 wcc Exp $
+ * $Id: userent.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -28,7 +28,7 @@
 
 #include "userent.h"
 #include "botmsg.h"  /* simple_sprintf, int_to_base10 */
-#include "dcc.h"     /* struct dcc_t */
+#include "dcc.h"     /* BSTAT_*, struct dcc_t */
 #include "dccutil.h" /* dprintf, shareout */
 #include "rfc1459.h" /* rfc_casecmp */
 #include "userrec.h" /* addhost_by_handle */
@@ -618,7 +618,7 @@
     bi->telnet_port = 3333;
   if (!bi->relay_port)
     bi->relay_port = bi->telnet_port;
-  if (!(dcc[idx].status & STAT_GETTING))
+  if (!(dcc[idx].status & BSTAT_GETTING))
     putlog(LOG_CMDS, "*", "%s: change botaddr %s", dcc[idx].nick, u->handle);
   return botaddr_set(u, e, bi);
 }
Index: eggdrop1.7/src/users.c
diff -u eggdrop1.7/src/users.c:1.4 eggdrop1.7/src/users.c:1.5
--- eggdrop1.7/src/users.c:1.4	Wed Aug 25 22:21:14 2004
+++ eggdrop1.7/src/users.c	Thu Aug 26 05:36:51 2004
@@ -1,20 +1,7 @@
-/*
- * users.c -- handles:
- *   testing and enforcing ignores
- *   adding and removing ignores
- *   listing ignores
- *   auto-linking bots
- *   sending and receiving a userfile from a bot
- *   listing users ('.whois' and '.match')
- *   reading the user file
- *
- * dprintf'ized, 9nov1995
+/* users.c: userfile mask handling, userfile reading
  *
- * $Id: users.c,v 1.4 2004/08/26 03:21:14 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -29,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: users.c,v 1.5 2004/08/26 10:36:51 wcc Exp $
  */
 
 #include "main.h"
@@ -45,6 +34,7 @@
 #include "dcc.h"     /* DCC_*, struct dcc_t */
 #include "dccutil.h" /* dprintf, chatout, shareout, lostdcc */
 #include "rfc1459.h" /* rfc_casecmp */
+#include "net.h"     /* killsock */
 #include "userrec.h" /* adduser, clear_masks */
 
 #include "users.h"
----------------------- End of diff -----------------------



More information about the Changes mailing list