]>
Commit | Line | Data |
---|---|---|
1 | #include "../nick/nick.h" | |
2 | #include "../localuser/localuserchannel.h" | |
3 | #include "../core/hooks.h" | |
4 | #include "../core/schedule.h" | |
5 | #include "../lib/array.h" | |
6 | #include "../lib/base64.h" | |
7 | #include "../lib/irc_string.h" | |
8 | #include "../lib/splitline.h" | |
9 | ||
10 | #include <stdarg.h> | |
11 | #include <stdio.h> | |
12 | #include <string.h> | |
13 | #include <strings.h> | |
14 | ||
15 | #define VS_NICK "V" | |
16 | #define VS_IDENT "TheVBot" | |
17 | #define VS_HOST "versionscan.quakenet.org" | |
18 | #define VS_RNDESC "VersionScan" | |
19 | #define VS_AUTHNAME "V" | |
20 | ||
21 | #define VS_VERSION "1.14" | |
22 | ||
23 | #define OPER_CHAN "#twilightzone" | |
24 | ||
25 | #define VSPATTERNLEN 200 | |
26 | #define VSDATALEN 200 | |
27 | ||
28 | /* modes of operation */ | |
29 | #define VS_IDLE 0 | |
30 | #define VS_SCAN 1 | |
31 | #define VS_STAT 2 | |
32 | ||
33 | /* action types */ | |
34 | #define VS_WARN 1 | |
35 | #define VS_KILL 2 | |
36 | #define VS_GLUSER 3 | |
37 | #define VS_GLHOST 4 | |
38 | ||
39 | /* user flags */ | |
40 | #define VS_AUTHED 1 | |
41 | #define VS_STAFF 2 | |
42 | #define VS_OPER 4 | |
43 | #define VS_GLINE 8 | |
44 | #define VS_ADMIN 16 | |
45 | ||
46 | typedef struct vsstatistic vsstatistic; | |
47 | struct vsstatistic { | |
48 | char* reply; | |
49 | unsigned int replylen; | |
50 | unsigned long replycrc, count; | |
51 | vsstatistic* next; | |
52 | }; | |
53 | ||
54 | typedef struct vspattern vspattern; | |
55 | struct vspattern { | |
56 | char pattern[VSPATTERNLEN+1]; | |
57 | char data[VSDATALEN+1]; | |
58 | unsigned char action; | |
59 | unsigned long hitcount; | |
60 | vspattern* next; | |
61 | }; | |
62 | ||
63 | typedef struct vsauthdata vsauthdata; | |
64 | struct vsauthdata { | |
65 | char account[ACCOUNTLEN+1]; | |
66 | unsigned char flags; | |
67 | vsauthdata* next; | |
68 | }; | |
69 | ||
70 | unsigned char versionscan_getlevelbyauth(char* auth); | |
71 | vsauthdata* versionscan_getauthbyauth(char* auth); | |
72 | int IsVersionscanStaff(nick* np); | |
73 | int IsVersionscanGlineAccess(nick* np); | |
74 | int IsVersionscanAdmin(nick* np); | |
75 | const char* versionscan_flagstochar(unsigned char flags); | |
76 | void versionscan_addpattern(char* pattern, char* data, unsigned char action); | |
77 | void versionscan_delpattern(char* pattern); | |
78 | vspattern* versionscan_getpattern(char* pattern); | |
79 | void versionscan_newnick(int hooknum, void* arg); | |
80 | void versionscan_handler(nick* me, int type, void** args); | |
81 | void versionscan_createfakeuser(void* arg); |