*
*/
-/* $Id: config.h,v 1.1 2005/01/12 07:44:57 mmondor Exp $ */
+/* $Id: config.h,v 1.2 2005/01/13 06:20:44 mmondor Exp $ */
#ifndef __config_include__
#define __config_include__
#define EXEMPT_LISTS
#define INVITE_LISTS
+/* DCCALLOW
+ * Enable the DCCALLOW system. Has been included, but now you can
+ * disable it! :)
+ */
+#undef DCCALLOW
+
/******************************************************************
* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP
*
*
*/
-/* $Id: msg.h,v 1.1 2005/01/12 07:44:58 mmondor Exp $ */
+/* $Id: msg.h,v 1.2 2005/01/13 06:20:44 mmondor Exp $ */
#ifndef __msg_include__
#define __msg_include__
#define MSG_SQLINE "SQLINE" /* SQLINE */
#define MSG_UNSQLINE "UNSQLINE" /* UNSQLINE */
#define MSG_BURST "BURST" /* BURST */
+#ifdef DCCALLOW
#define MSG_DCCALLOW "DCCALLOW" /* dccallow */
+#endif
#define MSG_SGLINE "SGLINE" /* sgline */
#define MSG_UNSGLINE "UNSGLINE" /* unsgline */
#define MSG_DKEY "DKEY" /* diffie-hellman negotiation */
extern int m_sqline(aClient *, aClient *, int, char **);
extern int m_unsqline(aClient *, aClient *, int, char **);
extern int m_burst(aClient *, aClient *, int, char **);
+#ifdef DCCALLOW
extern int m_dccallow(aClient *, aClient *, int, char **);
+#endif
extern int m_sgline(aClient *, aClient *, int, char **);
extern int m_unsgline(aClient *, aClient *, int, char **);
extern int m_dkey(aClient *, aClient *, int, char **);
{MSG_RAKILL, m_rakill, 0, MAXPARA, 1, 0, 0, 0L},
{MSG_SILENCE, m_silence, 0, MAXPARA, 1, 0, 0, 0L },
{MSG_WATCH, m_watch, 0, 1, 1, 0, 0, 0L },
+#ifdef DCCALLOW
{MSG_DCCALLOW, m_dccallow, 0, 1, 1, 0, 0, 0L },
+#endif
{MSG_SQLINE, m_sqline, 0, MAXPARA, 1, 0, 0, 0L},
{MSG_UNSQLINE, m_unsqline, 0, MAXPARA, 1, 0, 0, 0L },
{MSG_CAPAB, m_capab, 0, MAXPARA, 1, 1, 0, 0L},
*
*/
-/* $Id: struct.h,v 1.2 2005/01/13 06:19:56 mmondor Exp $ */
+/* $Id: struct.h,v 1.3 2005/01/13 06:20:44 mmondor Exp $ */
#ifndef __struct_include__
#define __struct_include__
#define MAXSILES 10
#define MAXSILELENGTH 128
+#ifdef DCCALLOW
#define MAXDCCALLOW 5
#define DCC_LINK_ME 0x01 /* This is my dcc allow */
#define DCC_LINK_REMOTE 0x02 /* I need to remove these dcc allows from
* these clients when I die
*/
+#endif
#define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5)
#define UMODE_h 0x20000 /* umode +h - Helper */
#define UMODE_m 0x40000 /* umode +m - spambot notices */
#define UMODE_R 0x80000 /* unmode +R - No non registered msgs */
+#ifdef DCCALLOW
#define UMODE_e 0x100000 /* umode +e - oper notices for the above +D */
+#endif
#define UMODE_x 0x200000 /* umode +x - Squelch with notice */
#define UMODE_X 0x400000 /* umode +X - Squelch without notice */
+#ifdef DCCALLOW
#define UMODE_D 0x800000 /* umode +D - Hidden dccallow umode */
+#endif
#define UMODE_F 0x1000000 /* umode +F - no cptr->since message rate throttle */
#define UMODE_j 0x2000000 /* umode +j - client rejection notices */
#define UMODE_K 0x4000000 /* umode +K - U: lined server kill messages */
#define DEBUG_LEV 5
#define FLOOD_LEV 6
#define SPAM_LEV 7
+#ifdef DCCALLOW
#define DCCSEND_LEV 8
+#endif
#define USKILL_LEV 9
/* SEND_UMODES:
*/
#define SEND_UMODES (UMODE_a|UMODE_i|UMODE_o|UMODE_r|UMODE_A|UMODE_I|UMODE_R)
+#ifdef DCCALLOW
#define ALL_UMODES (SEND_UMODES|UMODE_b|UMODE_c|UMODE_d|UMODE_e|UMODE_f|\
UMODE_g|UMODE_h|UMODE_j|UMODE_k|UMODE_m|UMODE_n|UMODE_s|\
UMODE_w|UMODE_y|UMODE_F|UMODE_K|UMODE_O)
+#else
+#define ALL_UMODES (SEND_UMODES|UMODE_b|UMODE_c|UMODE_d|UMODE_f|\
+ UMODE_g|UMODE_h|UMODE_j|UMODE_k|UMODE_m|UMODE_n|UMODE_s|\
+ UMODE_w|UMODE_y|UMODE_F|UMODE_K|UMODE_O)
+#endif
+
/* modes users can set themselves */
#define USER_UMODES (UMODE_i|UMODE_k|UMODE_w|UMODE_s|UMODE_R)
/* modes only opers can have */
+#ifdef DCCALLOW
#define OPER_UMODES (UMODE_a|UMODE_b|UMODE_c|UMODE_d|UMODE_e|UMODE_f|UMODE_g|\
UMODE_h|UMODE_j|UMODE_m|UMODE_n|UMODE_y|UMODE_A|UMODE_F|\
UMODE_K)
+#else
+#define OPER_UMODES (UMODE_a|UMODE_b|UMODE_c|UMODE_d|UMODE_f|UMODE_g|\
+ UMODE_h|UMODE_j|UMODE_m|UMODE_n|UMODE_y|UMODE_A|UMODE_F|\
+ UMODE_K)
+#endif
#define FLAGS_ID (FLAGS_DOID|FLAGS_GOTID)
#define IsUmoden(x) ((x)->umode & UMODE_n)
#define IsUmodem(x) ((x)->umode & UMODE_m)
#define IsUmodeh(x) ((x)->umode & UMODE_h)
+#ifdef DCCALLOW
#define IsUmodee(x) ((x)->umode & UMODE_e)
+#endif
#define IsUmodej(x) ((x)->umode & UMODE_j)
#define IsUmodeK(x) ((x)->umode & UMODE_K)
#define IsUmodek(x) ((x)->umode & UMODE_k)
#define SendSkillNotice(x) ((x)->umode & UMODE_k)
#define SendSUkillNotice(x) ((x)->umode & UMODE_K)
#define SendSpyNotice(x) ((x)->umode & UMODE_y)
+#ifdef DCCALLOW
#define SendDCCNotice(x) ((x)->umode & UMODE_e)
+#endif
#define SendFloodNotice(x) ((x)->umode & UMODE_f)
#define SendSpamNotice(x) ((x)->umode & UMODE_m)
#define SendDebugNotice(x) ((x)->umode & UMODE_d)
#define DoingDNS(x) ((x)->flags & FLAGS_DOINGDNS)
#define DoingAuth(x) ((x)->flags & FLAGS_AUTH)
#define NoNewLine(x) ((x)->flags & FLAGS_NONL)
+#ifdef DCCALLOW
#define SeenDCCNotice(x) ((x)->umode & UMODE_D)
#define SetDCCNotice(x) ((x)->umode |= UMODE_D)
+#endif
#define SetNegoServer(x) ((x)->flags |= FLAGS_SERV_NEGO)
#define IsNegoServer(x) ((x)->flags & FLAGS_SERV_NEGO)
#define ClearUmodeb(x) ((x)->umode &= ~UMODE_b)
#define ClearUmoden(x) ((x)->umode &= ~UMODE_n)
#define ClearUmodeh(x) ((x)->umode &= ~UMODE_h)
+#ifdef DCCALLOW
#define ClearUmodee(x) ((x)->umode &= ~UMODE_e)
+#endif
#define ClearUmodej(x) ((x)->umode &= ~UMODE_j)
#define ClearUmodeK(x) ((x)->umode &= ~UMODE_K)
#define ClearUmodek(x) ((x)->umode &= ~UMODE_k)
*/
Link *silence; /* chain of silenced users */
LOpts *lopt; /* Saved /list options */
+#ifdef DCCALLOW
Link *dccallow; /* chain of dcc send allowed users */
+#endif
#if (RIDICULOUS_PARANOIA_LEVEL>=1)
char *real_oper_host;
char *real_oper_username;
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: m_stats.c,v 1.1 2005/01/12 07:44:56 mmondor Exp $ */
+/* $Id: m_stats.c,v 1.2 2005/01/13 06:20:45 mmondor Exp $ */
#include "struct.h"
#include "common.h"
int ch = 0;
int usi = 0; /* users invited */
int usc = 0; /* users in channels */
+#ifdef DCCALLOW
int usdm = 0; /* dccallow local */
int usdr = 0; /* dccallow remote */
+#endif
int uss = 0; /* silenced users */
int aw = 0; /* aways set */
int number_servers_cached; /* number of servers cached by
for (link = acptr->user->channel; link;
link = link->next)
usc++;
+#ifdef DCCALLOW
for (link = acptr->user->dccallow; link;
link = link->next)
{
else
usdr++;
}
+#endif
for (link = acptr->user->silence; link;
link = link->next)
uss++;
* free_cloneents->elemsPerBlock;
cloneallocsz = clonealloc * free_cloneents->elemSize;
+#ifdef DCCALLOW
totallinks = lcc + usi + uss + usc + chi + wle + fludlink + usdm + usdr;
+#else
+ totallinks = lcc + usi + uss + usc + chi + wle + fludlink;
+#endif
sendto_one(cptr, ":%s %d %s :Memory Use Summary",
me.name, RPL_STATSDEBUG, nick);
chi * sizeof(Link));
sendto_one(cptr, ":%s %d %s : UserChannels %d(%d)",
me.name, RPL_STATSDEBUG, nick, usc, usc * sizeof(Link));
+#ifdef DCCALLOW
sendto_one(cptr, ":%s %d %s : DCCAllow Local %d(%d) Remote %d(%d)",
me.name, RPL_STATSDEBUG, nick, usdm, usdm * sizeof(Link),
usdr, usdr * sizeof(Link));
+#endif
sendto_one(cptr, ":%s %d %s : WATCH entries %d(%d)",
me.name, RPL_STATSDEBUG, nick, wle, wle*sizeof(Link));
sendto_one(cptr, ":%s %d %s : Fludees %d(%d)",
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: s_misc.c,v 1.1 2005/01/12 07:44:57 mmondor Exp $ */
+/* $Id: s_misc.c,v 1.2 2005/01/13 06:20:45 mmondor Exp $ */
#include <sys/time.h>
#include "struct.h"
return namebuf;
}
+#ifdef DCCALLOW
int remove_dcc_references(aClient *sptr)
{
aClient *acptr;
}
return 0;
}
+#endif
/*
* NOQUIT
if (cptr->ip.s_addr)
clones_remove(cptr);
+#ifdef DCCALLOW
remove_dcc_references(cptr);
+#endif
del_from_client_hash_table(cptr->name, cptr);
/* Clean up silences */
while ((lp = sptr->user->silence))
del_silence(sptr, lp->value.cp);
+#ifdef DCCALLOW
remove_dcc_references(sptr);
+#endif
/* again, this is all that is needed */
}
}
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: s_user.c,v 1.2 2005/01/13 06:19:56 mmondor Exp $ */
+/* $Id: s_user.c,v 1.3 2005/01/13 06:20:45 mmondor Exp $ */
#include "struct.h"
#include "common.h"
UMODE_k, 'k',
UMODE_y, 'y',
UMODE_d, 'd',
+#ifdef DCCALLOW
UMODE_e, 'e',
+#endif
UMODE_g, 'g',
UMODE_b, 'b',
UMODE_a, 'a',
#define CTCP_NONE 0
#define CTCP_YES 1
#define CTCP_DCC 2
+#ifdef DCCALLOW
#define CTCP_DCCSEND 3
-
+#endif
/*
* cptr:
return 0;
}
+#ifdef DCCALLOW
char *exploits_2char[] =
{
"js",
}
return 0;
}
+#endif /* DCCALLOW */
/*
* check target limit: message target rate limiting
{
if(dccptr)
*dccptr = p;
+#ifdef DCCALLOW
if(myncmp(p+3, " SEND", 5) == 0)
return CTCP_DCCSEND;
else
+#endif
return CTCP_DCC;
}
if (myncmp(++p, "ACTION", 6) != 0)
case CTCP_NONE:
break;
+#ifdef DCCALLOW
case CTCP_DCCSEND:
+#endif
case CTCP_DCC:
sendto_one(sptr, ":%s NOTICE %s :You may not send a"
" DCC command to a channel (%s)",
case CTCP_NONE:
break;
+#ifdef DCCALLOW
case CTCP_DCCSEND:
#ifdef FLUD
if (check_for_flud(sptr, acptr, NULL, 1))
if(check_dccsend(sptr, acptr, dccmsg))
continue;
break;
+#endif
default:
#ifdef FLUD
return 0;
}
+#ifdef DCCALLOW
static int
add_dccallow(aClient *sptr, aClient *optr)
{
return 0;
}
+#endif /* DCCALLOW */
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: send.c,v 1.1 2005/01/12 07:44:57 mmondor Exp $ */
+/* $Id: send.c,v 1.2 2005/01/13 06:20:45 mmondor Exp $ */
#include "struct.h"
#include "common.h"
tmsg = "Flood";
break;
+#ifdef DCCALLOW
case DCCSEND_LEV:
tmsg = "DCCAllow";
break;
+#endif
default:
tmsg = "Notice";
if (!SendSpyNotice(cptr) || !IsAnOper(cptr))
continue;
break;
+#ifdef DCCALLOW
case DCCSEND_LEV:
if (!SendDCCNotice(cptr) || !IsAnOper(cptr))
continue;
break;
+#endif
case FLOOD_LEV:
if (!SendFloodNotice(cptr) || !IsAnOper(cptr))
continue;
tmsg = "Flood";
break;
+#ifdef DCCALLOW
case DCCSEND_LEV:
tmsg = "DCCAllow";
break;
+#endif
default:
tmsg = "Notice";
if (!SendSpyNotice(cptr))
continue;
break;
+#ifdef DCCALLOW
case DCCSEND_LEV:
if (!SendDCCNotice(cptr))
continue;
break;
+#endif
case FLOOD_LEV:
if (!SendFloodNotice(cptr))
continue;