1 /*
2  * The internal definitions
3  *
4  * Copyright (C) 2009-2021, Joachim Metz <joachim.metz@gmail.com>
5  *
6  * Refer to AUTHORS for acknowledgements.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #if !defined( _LIBMSIECF_INTERNAL_DEFINITIONS_H )
23 #define _LIBMSIECF_INTERNAL_DEFINITIONS_H
24 
25 #include <common.h>
26 #include <byte_stream.h>
27 
28 #define LIBMSIECF_ENDIAN_BIG				_BYTE_STREAM_ENDIAN_BIG
29 #define LIBMSIECF_ENDIAN_LITTLE				_BYTE_STREAM_ENDIAN_LITTLE
30 
31 /* Define HAVE_LOCAL_LIBMSIECF for local use of libmsiecf
32  */
33 #if !defined( HAVE_LOCAL_LIBMSIECF )
34 #include <libmsiecf/definitions.h>
35 
36 /* The definitions in <libmsiecf/definitions.h> are copied here
37  * for local use of libmsiecf
38  */
39 #else
40 
41 #define LIBMSIECF_VERSION				20210420
42 
43 /* The version string
44  */
45 #define LIBMSIECF_VERSION_STRING			"20210420"
46 
47 /* The file access flags
48  * bit 1        set to 1 for read access
49  * bit 2        set to 1 for write access
50  * bit 3-8      not used
51  */
52 enum LIBMSIECF_ACCESS_FLAGS
53 {
54 	LIBMSIECF_ACCESS_FLAG_READ			= 0x01,
55 /* Reserved: not supported yet */
56 	LIBMSIECF_ACCESS_FLAG_WRITE			= 0x02
57 };
58 
59 /* The file access macros
60  */
61 #define LIBMSIECF_OPEN_READ				( LIBMSIECF_ACCESS_FLAG_READ )
62 /* Reserved: not supported yet */
63 #define LIBMSIECF_OPEN_WRITE				( LIBMSIECF_ACCESS_FLAG_WRITE )
64 /* Reserved: not supported yet */
65 #define LIBMSIECF_OPEN_READ_WRITE			( LIBMSIECF_ACCESS_FLAG_READ | LIBMSIECF_ACCESS_FLAG_WRITE )
66 
67 /* The item type definitions
68  */
69 enum LIBMSIECF_ITEM_TYPES
70 {
71 	LIBMSIECF_ITEM_TYPE_UNDEFINED,
72 	LIBMSIECF_ITEM_TYPE_URL,
73 	LIBMSIECF_ITEM_TYPE_REDIRECTED,
74 	LIBMSIECF_ITEM_TYPE_LEAK,
75 	LIBMSIECF_ITEM_TYPE_UNKNOWN
76 };
77 
78 /* The item flags
79  */
80 enum LIBMSIECF_ITEM_FLAGS
81 {
82 	LIBMSIECF_ITEM_FLAG_RECOVERED			= 0x01,
83 	LIBMSIECF_ITEM_FLAG_PARTIAL			= 0x02,
84 	LIBMSIECF_ITEM_FLAG_HASHED			= 0x04,
85 	LIBMSIECF_ITEM_FLAG_TAINTED			= 0x08
86 };
87 
88 /* The URL item type definitions
89  */
90 enum LIBMSIECF_URL_ITEM_TYPES
91 {
92 	LIBMSIECF_URL_ITEM_TYPE_UNDEFINED,
93 	LIBMSIECF_URL_ITEM_TYPE_CACHE,
94 	LIBMSIECF_URL_ITEM_TYPE_COMPATIBILITY,
95 	LIBMSIECF_URL_ITEM_TYPE_COOKIE,
96 	LIBMSIECF_URL_ITEM_TYPE_DOM_STORE,
97 	LIBMSIECF_URL_ITEM_TYPE_DOWNLOAD,
98 	LIBMSIECF_URL_ITEM_TYPE_HISTORY,
99 	LIBMSIECF_URL_ITEM_TYPE_HISTORY_DAILY,
100 	LIBMSIECF_URL_ITEM_TYPE_HISTORY_WEEKLY,
101 	LIBMSIECF_URL_ITEM_TYPE_INPRIVATE_FILTERING,
102 	LIBMSIECF_URL_ITEM_TYPE_RSS_FEED,
103 	LIBMSIECF_URL_ITEM_TYPE_TLD,
104 	LIBMSIECF_URL_ITEM_TYPE_USER_DATA,
105 	LIBMSIECF_URL_ITEM_TYPE_UNKNOWN
106 };
107 
108 #endif /* !defined( HAVE_LOCAL_LIBMSIECF ) */
109 
110 /* The cache entry flags
111  */
112 enum LIBMSIECF_CACHE_ENTRY_FLAGS
113 {
114 	LIBMSIECF_CACHE_ENTRY_FLAG_NORMAL		= 0x00000001,
115 	LIBMSIECF_CACHE_ENTRY_FLAG_STABLE		= 0x00000002,
116 	LIBMSIECF_CACHE_ENTRY_FLAG_STICKY		= 0x00000004,
117 	LIBMSIECF_CACHE_ENTRY_FLAG_EDITED		= 0x00000008,
118 	LIBMSIECF_CACHE_ENTRY_FLAG_TRACK_OFFLINE	= 0x00000010,
119 	LIBMSIECF_CACHE_ENTRY_FLAG_TRACK_ONLINE		= 0x00000020,
120 
121 	LIBMSIECF_CACHE_ENTRY_FLAG_SPARSE		= 0x00010000,
122 	LIBMSIECF_CACHE_ENTRY_FLAG_OCX			= 0x00020000,
123 
124 	LIBMSIECF_CACHE_ENTRY_FLAG_COOKIE		= 0x00100000,
125 	LIBMSIECF_CACHE_ENTRY_FLAG_URLHISTORY		= 0x00200000,
126 };
127 
128 #define LIBMSIECF_DEFAULT_BLOCK_SIZE			128
129 
130 #define LIBMSIECF_MAXIMUM_BTREE_NODE_RECURSION_DEPTH	256
131 
132 #endif /* !defined( _LIBMSIECF_INTERNAL_DEFINITIONS_H ) */
133 
134