]> jfr.im git - irc/evilnet/x3.git/blame - src/gline.h
Couple of srvx updates.
[irc/evilnet/x3.git] / src / gline.h
CommitLineData
d76ed9a9 1/* gline.h - Gline database
2 * Copyright 2001-2004 srvx Development Team
3 *
83ff05c3 4 * This file is part of x3.
d76ed9a9 5 *
d0f04f71 6 * x3 is free software; you can redistribute it and/or modify
d76ed9a9 7 * it under the terms of the GNU General Public License as published by
348683aa 8 * the Free Software Foundation; either version 3 of the License, or
d76ed9a9 9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with srvx; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 */
20
21#ifndef GLINE_H
22#define GLINE_H
23
24#include "hash.h"
25
26struct gline {
27 time_t issued;
28 time_t expires;
29 char *issuer;
30 char *target;
31 char *reason;
32};
33
34struct gline_discrim {
35 unsigned int limit;
36 enum { SUBSET, EXACT, SUPERSET } target_mask_type;
37 char *issuer_mask;
38 char *target_mask;
39 char *alt_target_mask;
40 char *reason_mask;
41 time_t max_issued;
42 time_t min_expire;
43};
44
45void gline_init(void);
995043b4 46struct gline *gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, time_t issued, int announce, int silent);
d76ed9a9 47struct gline *gline_find(const char *target);
48int gline_remove(const char *target, int announce);
49void gline_refresh_server(struct server *srv);
50void gline_refresh_all(void);
51unsigned int gline_count(void);
52
53typedef void (*gline_search_func)(struct gline *gline, void *extra);
54struct gline_discrim *gline_discrim_create(struct userNode *user, struct userNode *src, unsigned int argc, char *argv[]);
55unsigned int gline_discrim_search(struct gline_discrim *discrim, gline_search_func gsf, void *data);
56
57#endif /* !defined(GLINE_H) */
995043b4 58