Debian Codegraph @

src/StoryBoard.hpp

raw
1 // StoryBoard class
2
3 // For all support, instructions and copyright go to:
4 // http://e2guardian.org/
5 // Released under the GPL v2, with the OpenSSL exception described in the README file.
6
7 #ifndef __HPP_SB
8 #define __HPP_SB
9
10 // INLCUDES
11
12 #include <vector>
13 #include <deque>
14 #include <map>
15 #include <string>
16 #include "String.hpp"
17 #include "RegExp.hpp"
18 #include "SBFunction.hpp"
19 #include "ListMeta.hpp"
20 #include "UrlRec.hpp"
21
22 // #include "NaughtyFilter.hpp"
23
24 //#ifndef __HPP_SB
25
26 // Entry point codes for pre-auth.story
27 #define ENT_STORYA_PRE_AUTH 1
28 #define ENT_STORYA_PRE_AUTH_THTTPS 2
29 #define ENT_STORYA_PRE_AUTH_ICAP 3
30
31 // auth plugin entry point codes
32 #define ENT_STORYA_AUTH_IP 11
33 #define ENT_STORYA_AUTH_PORT 12
34 #define ENT_STORYA_AUTH_BASIC_PROXY 13
35 #define ENT_STORYA_AUTH_IDENT 14
36 #define ENT_STORYA_AUTH_HEADER 15
37 #define ENT_STORYA_AUTH_NTLM_PROXY 16
38 #define ENT_STORYA_AUTH_DIGEST_PROXY 17
39 #define ENT_STORYA_AUTH_ICAP 18
40 #define ENT_STORYA_AUTH_PF_BASIC 19
41
42 // Entry point codes for storyfn.story
43 #define ENT_STORYB_PROXY_REQUEST 1
44 #define ENT_STORYB_PROXY_RESPONSE 2
45 #define ENT_STORYB_THTTPS_REQUEST 3
46 #define ENT_STORYB_ICAP_REQMOD 4
47 #define ENT_STORYB_ICAP_RESMOD 5
48 #define ENT_STORYB_LOG_CHECK 6
49
50 // download manager plugin entry point codes
51 #define ENT_STORYB_DM_TRICKLE 11
52 #define ENT_STORYB_DM_FANCY 12
53
54
55 #define ENT_STORY_MAX_SIZE 20
56
57 class NaughtyFilter;
58
59 // DECLARATIONS
60
61 class StoryBoard
62 {
63 private:
64 unsigned int entrys[ENT_STORY_MAX_SIZE];
65 public:
66 int items;
67
68 int fnt_cnt;
69 ListMeta* LMeta;
70
71 std::vector<SBFunction> funct_vec;
72
73 StoryBoard();
74 ~StoryBoard();
75
76 void reset();
77
78 bool readFile(const char *filename, ListMeta & LMeta, bool is_top = true);
79 unsigned int getFunctID(String &fname);
80
81 bool runFunct(String &fname, NaughtyFilter &cm);
82 bool runFunct(unsigned int fID, NaughtyFilter &cm);
83 //bool runFunctEntry1(NaughtyFilter &cm);
84 //bool runFunctEntry2(NaughtyFilter &cm);
85 bool runFunctEntry(unsigned int index, NaughtyFilter &cm);
86 bool setEntry(unsigned int index, String fname);
87 //bool setEntry1(String fname);
88 //bool setEntry2(String fname);
89 std::deque<url_rec> deep_urls(String & url, NaughtyFilter &cm);
90 std::deque<url_rec> ipToHostname(NaughtyFilter &cm);
91 bool has_reverse_hosts(std::deque<url_rec> & urec, NaughtyFilter &cm);
92 void update_messages(NaughtyFilter &cm, ListMeta::list_result &res);
93 };
94
95 //#endif
96 #define __HPP_SB
97 #endif