1 /* gline.h - Gline database
2 * Copyright 2001-2004 srvx Development Team
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. Important limitations are
8 * listed in the COPYING file that accompanies this software.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, email srvx-maintainers@srvx.net.
32 struct gline_discrim {
34 enum { SUBSET, EXACT, SUPERSET } target_mask_type;
37 char *alt_target_mask;
43 void gline_init(void);
44 struct gline *gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, time_t issued, int announce);
45 struct gline *gline_find(const char *target);
46 int gline_remove(const char *target, int announce);
47 void gline_refresh_server(struct server *srv);
48 void gline_refresh_all(void);
49 unsigned int gline_count(void);
51 typedef void (*gline_search_func)(struct gline *gline, void *extra);
52 struct gline_discrim *gline_discrim_create(struct userNode *user, struct userNode *src, unsigned int argc, char *argv[]);
53 unsigned int gline_discrim_search(struct gline_discrim *discrim, gline_search_func gsf, void *data);
55 #endif /* !defined(GLINE_H) */