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