]> jfr.im git - irc/quakenet/newserv.git/blame - trusts/trusts.h
Fix up migration to use transactions, also start a commands module.
[irc/quakenet/newserv.git] / trusts / trusts.h
CommitLineData
2b6e02e2
CP
1#ifndef __TRUSTS_H
2#define __TRUSTS_H
3
4#include <time.h>
5#include "../lib/sstring.h"
6
7#define MIGRATION_STOPPED -1
8
9#define CONTACTLEN 100
10#define COMMENTLEN 300
be2823bc
CP
11#define TRUSTNAMELEN 100
12#define TRUSTHOSTLEN 100
2b6e02e2
CP
13
14struct trustmigration;
15
16typedef void (*TrustMigrationGroup)(void *, unsigned int, char *, unsigned int, unsigned int, unsigned int, unsigned int, time_t, time_t, time_t, char *, char *, char *);
17typedef void (*TrustMigrationHost)(void *, unsigned int, char *, unsigned int, time_t);
18typedef void (*TrustMigrationFini)(void *, int);
19
20typedef struct trustmigration {
21 int count, cur;
22 void *schedule;
23 void *tag;
24
25 TrustMigrationGroup group;
26 TrustMigrationHost host;
27 TrustMigrationFini fini;
28} trustmigration;
29
30typedef void (*TrustDBMigrationCallback)(int, void *);
31
be2823bc
CP
32typedef struct trusthost {
33 sstring *host;
34 unsigned int maxseen;
35 time_t lastseen;
36
37 struct trusthost *next;
38} trusthost;
39
2b6e02e2
CP
40typedef struct trustgroup {
41 unsigned int id;
42
43 sstring *name;
44 unsigned int trustedfor;
45 int mode;
46 unsigned int maxperident;
be2823bc 47 unsigned int maxseen;
2b6e02e2 48 time_t expires;
be2823bc 49 time_t lastseen;
2b6e02e2 50 time_t lastmaxuserreset;
2b6e02e2
CP
51 sstring *createdby, *contact, *comment;
52
be2823bc
CP
53 trusthost *hosts;
54
2b6e02e2
CP
55 struct trustgroup *next;
56} trustgroup;
57
be2823bc 58void trusts_reloaddb(void);
2b6e02e2 59
be2823bc
CP
60extern int trustsdbloaded;
61extern trustgroup *tglist;
2b6e02e2
CP
62
63#endif