#define MAXTGEXTS 5
-#define MAXTRUSTEDFOR 50000
+#define MAXTRUSTEDFOR 5000
#define MAXDURATION 365 * 86400 * 20
#define MAXPERIDENT 1000
#define MAXPERNODE 1000
#define TABLES_MIGRATION 1
#define TABLES_REPLICATION 2
-#define CLEANUP_TH_INACTIVE 30
+#define CLEANUP_TH_INACTIVE 60
+
+#define POLICY_GLINE_DURATION 1800
+
+#define POLICY_SUCCESS 0
+#define POLICY_FAILURE_NODECOUNT 1
+#define POLICY_FAILURE_GROUPCOUNT 2
+#define POLICY_FAILURE_IDENTD 3
+#define POLICY_FAILURE_IDENTCOUNT 4
+
+#define DEFAULT_TRUSTPORT 5776
+
+#define TRUST_ENFORCE_IDENT 1 /* This must be 1 for compatibility with O. */
+#define TRUST_NO_CLEANUP 2
+#define TRUST_PROTECTED 4
+#define TRUST_RELIABLE_USERNAME 8
+#define TRUST_UNTHROTTLE 16
+
+#define TRUST_MIN_UNPRIVILEGED_BITS_IPV4 (96 + 20)
+#define TRUST_MIN_UNPRIVILEGED_BITS_IPV6 32
+
+#define TRUST_MIN_UNPRIVILEGED_NODEBITS_IPV4 (96 + 24)
+#define TRUST_MIN_UNPRIVILEGED_NODEBITS_IPV6 48
+
+#define TRUST_MIN_TIME_RETHROTTLE 120
struct trustmigration;
sstring *name;
unsigned int trustedfor;
- int mode;
+ int flags;
unsigned int maxperident;
unsigned int maxusage;
time_t expires;
/* formats.c */
char *trusts_timetostr(time_t);
-char *trusts_cidr2str(struct irc_in_addr *ip, unsigned char);
char *dumpth(trusthost *, int);
char *dumptg(trustgroup *, int);
int parseth(char *, trusthost *, unsigned int *, int);
unsigned int nextthmarker(void);
trusthost *th_getbyid(unsigned int);
int tg_modify(trustgroup *, trustgroup *);
+int th_modify(trusthost *, trusthost *);
/* migration.c */
typedef void (*TrustMigrationGroup)(void *, trustgroup *);
/* trusts_api.c */
int istrusted(nick *);
-int trustgline(trustgroup *tg, const char *ident, int duration, const char *reason);
-int trustungline(trustgroup *tg, const char *ident, int duration, const char *reason);
+unsigned char getnodebits(struct irc_in_addr *ip);
#endif