1 /* gline.h - Gline database
2 * Copyright 2001-2004 srvx Development Team
4 * This file is part of srvx.
6 * srvx is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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.
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.
28 unsigned long lastmod;
29 unsigned long expires;
35 struct gline_discrim {
37 enum { SUBSET, EXACT, SUPERSET } target_mask_type;
40 char *alt_target_mask;
42 unsigned long max_issued;
43 unsigned long min_expire;
44 unsigned long min_lastmod;
45 unsigned long max_lastmod;
48 void gline_init(void);
49 struct gline *gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, unsigned long issued, unsigned long lastmod, int announce);
50 struct gline *gline_find(const char *target);
51 int gline_remove(const char *target, int announce);
52 void gline_refresh_server(struct server *srv);
53 void gline_refresh_all(void);
54 unsigned int gline_count(void);
56 typedef void (*gline_search_func)(struct gline *gline, void *extra);
57 struct gline_discrim *gline_discrim_create(struct userNode *user, struct userNode *src, unsigned int argc, char *argv[]);
58 unsigned int gline_discrim_search(struct gline_discrim *discrim, gline_search_func gsf, void *data);
60 #endif /* !defined(GLINE_H) */