2000-04-16 Kevin L. Mitchell <klmitch@mit.edu>
+ * ircd/gline.c: add flags argument to gline_activate and
+ gline_deactivate for future expansion
+
+ * ircd/m_gline.c: pass flags to gline_activate and
+ gline_deactivate
+
+ * include/gline.h: add flags argument to gline_activate and
+ gline_deactivate
+
+ * ircd/jupe.c: add flags argument to jupe_activate and
+ jupe_deactivate for future expansion
+
+ * include/jupe.h: add flags argument to jupe_activate and
+ jupe_deactivate
+
+ * ircd/m_jupe.c: pass a flags argument to jupe_add instead of
+ local, active; pass flags to jupe_activate and jupe_deactivate
+
+ * include/gline.h: remove dead code
+
* ircd/gline.c: make gline expire times relative to CurrentTime,
since that should be monotonically increasing, instead of
TStime(), which can be set backwards, and which can therefore
#
# ChangeLog for ircu2.10.11
#
-# $Id: ChangeLog,v 1.90 2000-04-16 04:30:42 kev Exp $
+# $Id: ChangeLog,v 1.91 2000-04-16 05:12:01 kev Exp $
#
# Insert new changes at beginning of the change list.
#
char *reason, time_t expire, time_t lastmod,
unsigned int flags);
extern int gline_activate(struct Client *cptr, struct Client *sptr,
- struct Gline *gline, time_t lastmod);
+ struct Gline *gline, time_t lastmod,
+ unsigned int flags);
extern int gline_deactivate(struct Client *cptr, struct Client *sptr,
- struct Gline *gline, time_t lastmod);
+ struct Gline *gline, time_t lastmod,
+ unsigned int flags);
extern struct Gline *gline_find(char *userhost, unsigned int flags);
extern struct Gline *gline_lookup(struct Client *cptr);
extern void gline_free(struct Gline *gline);
extern int gline_list(struct Client *sptr, char *userhost);
extern void gline_stats(struct Client *sptr);
-#if 0 /* forget it! */
-#define SetActive(g) ((g)->gl_flags |= GLINE_ACTIVE)
-#define ClearActive(g) ((g)->gl_flags &= ~GLINE_ACTIVE)
-#define SetGlineIsIpMask(g) ((g)->gl_flags |= GLINE_IPMASK)
-#define SetGlineIsLocal(g) ((g)->gl_flags |= GLINE_LOCAL)
-
-extern struct Gline* GlobalGlineList;
-extern struct Gline* BadChanGlineList;
-
-extern void gline_remove_expired(time_t now);
-
-extern void add_gline(struct Client *sptr, int ip_mask,
- char *host, char *comment, char *user,
- time_t expire, int local);
-extern struct Gline* make_gline(int is_ipmask, char *host, char *reason,
- char *name, time_t expire);
-extern struct Gline* find_gline(struct Client *cptr, struct Gline **pgline);
-extern void free_gline(struct Gline *gline, struct Gline *prev);
-
-#ifdef BADCHAN
-extern int bad_channel(const char* name);
-extern void bad_channel_remove_expired(time_t now);
-#endif
-#endif /* 0 */
-
#endif /* INCLUDED_gline_h */
#define JupeLastMod(j) ((j)->ju_lastmod)
extern int jupe_add(struct Client *cptr, struct Client *sptr, char *server,
- char *reason, time_t expire, time_t lastmod, int local,
- int active);
+ char *reason, time_t expire, time_t lastmod,
+ unsigned int flags);
extern int jupe_activate(struct Client *cptr, struct Client *sptr,
- struct Jupe *jupe, time_t lastmod);
+ struct Jupe *jupe, time_t lastmod,
+ unsigned int flags);
extern int jupe_deactivate(struct Client *cptr, struct Client *sptr,
- struct Jupe *jupe, time_t lastmod);
+ struct Jupe *jupe, time_t lastmod,
+ unsigned int flags);
extern struct Jupe* jupe_find(char *server);
extern void jupe_free(struct Jupe *jupe);
extern void jupe_burst(struct Client *cptr);
int
gline_activate(struct Client *cptr, struct Client *sptr, struct Gline *gline,
- time_t lastmod)
+ time_t lastmod, unsigned int flags)
{
assert(0 != gline);
assert(!GlineIsLocal(gline));
int
gline_deactivate(struct Client *cptr, struct Client *sptr, struct Gline *gline,
- time_t lastmod)
+ time_t lastmod, unsigned int flags)
{
assert(0 != gline);
int
jupe_add(struct Client *cptr, struct Client *sptr, char *server, char *reason,
- time_t expire, time_t lastmod, int local, int active)
+ time_t expire, time_t lastmod, unsigned int flags)
{
struct Jupe *ajupe;
- unsigned int flags = 0;
assert(0 != server);
assert(0 != reason);
sendto_op_mask(SNO_NETWORK, "%s adding %sJUPE for %s, expiring at "
TIME_T_FMT ": %s",
IsServer(sptr) ? sptr->name : sptr->user->server->name,
- local ? "local " : "", server, expire + TSoffset, reason);
+ flags & JUPE_LOCAL ? "local " : "", server,
+ expire + TSoffset, reason);
#ifdef JPATH
if (IsServer(sptr))
write_log(JPATH, TIME_T_FMT " %s adding %sJUPE for %s, expiring at "
TIME_T_FMT ": %s\n", TStime(), sptr->name,
- local ? "local " : "", server, expire + TSoffset, reason);
+ flags & JUPE_LOCAL ? "local " : "", server, expire + TSoffset,
+ reason);
else
write_log(JPATH, TIME_T_FMT, " %s!%s@%s adding %sJUPE for %s, expiring at "
TIME_T_FMT ": %s\n", TStime(), sptr->name, sptr->user->username,
- sptr->user->host, local ? "local " : "", server,
+ sptr->user->host, flags & JUPE_LOCAL ? "local " : "", server,
expire + TSoffset, reason);
#endif /* JPATH */
- if (active) /* compute initial flags */
- flags |= JUPE_ACTIVE;
- if (local)
- flags |= JUPE_LOCAL;
-
/* make the jupe */
ajupe = make_jupe(server, reason, expire, lastmod, flags);
int
jupe_activate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe,
- time_t lastmod)
+ time_t lastmod, unsigned int flags)
{
assert(0 != jupe);
assert(!JupeIsLocal(jupe));
int
jupe_deactivate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe,
- time_t lastmod)
+ time_t lastmod, unsigned int flags)
{
assert(0 != jupe);
gline_free(agline);
else if (!lastmod || GlineLastMod(agline) < lastmod) { /* new mod */
if (flags & GLINE_ACTIVE)
- return gline_activate(cptr, sptr, agline, lastmod);
+ return gline_activate(cptr, sptr, agline, lastmod, flags);
else
- return gline_deactivate(cptr, sptr, agline, lastmod);
+ return gline_deactivate(cptr, sptr, agline, lastmod, flags);
} else if (GlineLastMod(agline) == lastmod)
return 0;
else
else {
if (flags & GLINE_ACTIVE)
return gline_activate(cptr, sptr, agline,
- GlineLastMod(agline) ? TStime() : 0);
+ GlineLastMod(agline) ? TStime() : 0, flags);
else
return gline_deactivate(cptr, sptr, agline,
- GlineLastMod(agline) ? TStime() : 0);
+ GlineLastMod(agline) ? TStime() : 0, flags);
}
}
{
struct Client *acptr = 0;
struct Jupe *ajupe;
- int local = 0, active = 1;
+ unsigned int flags = 0;
time_t expire_off, lastmod;
char *server = parv[2], *target = parv[1], *reason = parv[5];
return 0;
}
- local = 1;
+ flags |= JUPE_LOCAL;
}
- if (*server == '-') {
- active = 0;
+ if (*server == '-')
server++;
- } else if (*server == '+') {
- active = 1;
+ else if (*server == '+') {
+ flags |= JUPE_ACTIVE;
server++;
}
ajupe = jupe_find(server);
if (ajupe) {
- if (JupeIsLocal(ajupe) && !local) /* global jupes override local ones */
+ if (JupeIsLocal(ajupe) && !(flags & JUPE_LOCAL)) /* global over local */
jupe_free(ajupe);
else if (JupeLastMod(ajupe) < lastmod) { /* new modification */
- if (active)
- return jupe_activate(cptr, sptr, ajupe, lastmod);
+ if (flags & JUPE_ACTIVE)
+ return jupe_activate(cptr, sptr, ajupe, lastmod, flags);
else
- return jupe_deactivate(cptr, sptr, ajupe, lastmod);
+ return jupe_deactivate(cptr, sptr, ajupe, lastmod, flags);
} else if (JupeLastMod(ajupe) == lastmod) /* no changes */
return 0;
else
return jupe_resend(cptr, ajupe); /* other server desynched WRT jupes */
}
- return jupe_add(cptr, sptr, server, reason, expire_off, lastmod, local,
- active);
+ return jupe_add(cptr, sptr, server, reason, expire_off, lastmod, flags);
}
/*
{
struct Client *acptr = 0;
struct Jupe *ajupe;
- int local = 0, active = 1;
+ unsigned int flags = 0;
time_t expire_off;
char *server = parv[1], *target = parv[2], *reason = parv[4];
return jupe_list(sptr, 0);
if (*server == '+') {
- active = 1;
+ flags |= JUPE_ACTIVE;
server++;
- } else if (*server == '-') {
- active = 0;
+ } else if (*server == '-')
server++;
- } else
+ else
return jupe_list(sptr, server);
if (parc < 5)
return send_error_to_client(sptr, ERR_NOPRIVILEGES);
sendcmdto_one(acptr, CMD_JUPE, sptr, "%C %c%s %s %Tu :%s", acptr,
- active ? '+' : '-', server, parv[3], TStime(), reason);
+ flags & JUPE_ACTIVE ? '+' : '-', server, parv[3],
+ TStime(), reason);
return 0;
}
- local = 1;
+ flags |= JUPE_LOCAL;
} else if (!IsOper(sptr))
return send_error_to_client(sptr, ERR_NOPRIVILEGES);
ajupe = jupe_find(server);
if (ajupe) {
- if (JupeIsLocal(ajupe) && !local) /* global jupes override local ones */
+ if (JupeIsLocal(ajupe) && !(flags & JUPE_LOCAL)) /* global over local */
jupe_free(ajupe);
else {
- if (active)
- return jupe_activate(cptr, sptr, ajupe, TStime());
+ if (flags & JUPE_ACTIVE)
+ return jupe_activate(cptr, sptr, ajupe, TStime(), flags);
else
- return jupe_deactivate(cptr, sptr, ajupe, TStime());
+ return jupe_deactivate(cptr, sptr, ajupe, TStime(), flags);
}
}
- return jupe_add(cptr, sptr, server, reason, expire_off, TStime(), local,
- active);
+ return jupe_add(cptr, sptr, server, reason, expire_off, TStime(), flags);
}
#endif /* CONFIG_OPERCMDS */