3 * Copyright (C) 2007, Rus V. Brushkoff, All rights reserved.
10 #define _FILE_OFFSET_BITS 64
12 // sfinx_magic - 5 ÂÁÊÔ [sfinx]
13 // sfinx_packet_type 1 - 8 bytes
14 // sfinx_packet_size 1 - 8 bytes
16 // element id 1 - 8 bytes
17 // element body size 1 - 8 bytes
20 // all sizes and types are in big_endian format (first is the MSB)
22 #define SFINX_PACKET_MAGIC "sfinx"
24 // may be used for local sockets
25 #define SFINX_PACKET_PLAIN 0x10
26 // may be used for serial links
27 #define SFINX_PACKET_CRC32 0x11
28 // may be used for insecure transport
29 #define SFINX_PACKET_CRYPTED_AES 0x12
30 #define SFINX_PACKET_CRYPTED_RSA 0x13
32 // service id's - packet types
33 #define SFINX_DAEMON_VERSION 0x20
34 #define SFINX_AUTH_REQUEST 0x21
35 #define SFINX_ACCESS_GRANTED 0x22
36 #define SFINX_ACCESS_DENIED 0x23
39 #define SFINX_PACKET_CRYPT_TYPES 0x30
40 // min number of auth levels required to login
41 #define SFINX_MIN_AUTH_LEVELS 0x31
42 #define SFINX_AUTH_LEVEL 0x32
43 // supported server auth types
44 #define SFINX_AUTH_TYPES 0x33
47 #define SFINX_AUTH_USERPASS 0x40
49 #define SFINX_AUTH_RSA 0x41
51 #define SFINX_AUTH_STAGE 0x50
53 #define SFINX_CRC32_SUM 0x60
54 #define SFINX_MD5_SUM 0x61
55 #define SFINX_SHA1_SUM 0x62
56 #define SFINX_SHA256_SUM 0x63
57 #define SFINX_SHA512_SUM 0x64
65 #define SFINX_ELEMENT_8BIT 0x100
66 #define SFINX_ELEMENT_8BIT_VECTOR 0x101
67 #define SFINX_ELEMENT_16BIT 0x102
68 #define SFINX_ELEMENT_16BIT_VECTOR 0x103
69 #define SFINX_ELEMENT_32BIT 0x104
70 #define SFINX_ELEMENT_32BIT_VECTOR 0x105
71 #define SFINX_ELEMENT_64BIT 0x106
72 #define SFINX_ELEMENT_64BIT_VECTOR 0x107
73 #define SFINX_ELEMENT_128BIT 0x108
74 #define SFINX_ELEMENT_128BIT_VECTOR 0x109
75 #define SFINX_ELEMENT_256BIT 0x10a
76 #define SFINX_ELEMENT_256BIT_VECTOR 0x10b
77 #define SFINX_ELEMENT_FLOAT 0x10c
78 #define SFINX_ELEMENT_FLOAT_VECTOR 0x10d
79 #define SFINX_ELEMENT_DOUBLE 0x10e
80 #define SFINX_ELEMENT_DOUBLE_VECTOR 0x10f
81 #define SFINX_ELEMENT_STRING 0x110
82 #define SFINX_ELEMENT_STRING_VECTOR 0x111
83 #define SFINX_ELEMENT_DATE 0x112
84 #define SFINX_ELEMENT_DATE_VECTOR 0x113
85 #define SFINX_ELEMENT_BLOB 0x114
86 #define SFINX_ELEMENT_SLICE 0x115
87 #define SFINX_ELEMENT_SLICE_VECTOR 0x116
88 #define SFINX_ELEMENT_PAIR 0x117
89 #define SFINX_ELEMENT_PAIR_VECTOR 0x119
90 #define SFINX_ELEMENT_FILE 0x11a
91 #define SFINX_ELEMENT_FILE_VECTOR 0x11b
92 #define SFINX_ELEMENT_PROGRESS 0x11c
93 #define SFINX_ELEMENT_SEARCH_QUERY 0x11d
94 #define SFINX_ELEMENT_SEARCH_RESULT 0x11e
95 #define SFINX_ELEMENT_OBJECT 0x11f
98 #define SFINX_GET_SLICES_STAT 0x200
99 #define SFINX_SLICES_MODULE_TREE_REQUEST 0x201
100 #define SFINX_SLICES_MODULE_TREE 0x202
101 #define SFINX_SLICES_MODULE_TREE_REQUEST_EXCEPT 0x203
102 #define SFINX_SLICES_MODULE_TREE_EXCEPT 0x204
103 #define SFINX_NEW_SLICE 0x205
104 #define SFINX_EDIT_SLICE_REQUEST 0x206
105 #define SFINX_EDIT_SLICE 0x207
106 #define SFINX_DELETE_SLICE_RECURSIVLY 0x208
107 #define SFINX_DELETE_SLICE_WITH_REATTACH 0x209
108 #define SFINX_DELETE_SLICE_ASSOC_DATA 0x20a
109 #define SFINX_DELETE_SLICE_ASSOC_DATA_RECURSIVLY 0x20b
110 #define SFINX_DELETE_SLICE_MARK_DATA_UNSORTED 0x20c
111 #define SFINX_DELETE_SLICE_MARK_DATA_UNSORTED_RECURSIVLY 0x20d
112 #define SFINX_SLICE_RELINK 0x20e
113 #define SFINX_FILES_MODULE_CONF_REQUEST 0x20f
114 #define SFINX_FILES_MODULE_CONF 0x210
115 #define SFINX_FILES_MODULE_SORTED_TREE_REQUEST 0x211
116 #define SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST 0x212
117 #define SFINX_FILES_MODULE_SORTED_TREE 0x213
118 #define SFINX_FILES_MODULE_UNSORTED_TREE 0x214
119 #define SFINX_FILES_MODULE_CLASSIFY_REQUEST 0x215
120 #define SFINX_FILES_MODULE_CLASSIFY_REPLY 0x216
121 #define SFINX_FILES_MODULE_EDIT_FILE_REQUEST 0x217
122 #define SFINX_FILES_MODULE_EDIT_FILE 0x218
123 #define SFINX_FILES_MODULE_EDIT_REPLY 0x219
124 #define SFINX_FILES_MODULE_UNLINK 0x220
125 #define SFINX_FILES_MODULE_SORTED_UNLINK 0x221
126 #define SFINX_FILES_MODULE_UNSORT 0x222
127 #define SFINX_ALERT 0x223
128 #define SFINX_SEARCH_QUERY 0x224
129 #define SFINX_SEARCH_RESULT 0x225
132 #define SFINX_SLICE_OBJECT 1
133 #define SFINX_FILE_OBJECT 2
134 #define SFINX_NOTE_OBJECT 3
135 #define SFINX_EVENT_OBJECT 4
136 #define SFINX_CONTACT_OBJECT 5
137 #define SFINX_TASK_OBJECT 6
138 #define SFINX_MESSAGE_OBJECT 7
139 #define SFINX_KNOWLEDGE_OBJECT 8
141 #define SFINX_KEY_UNASSIGNED 0
142 // files module conf keys
143 #define FILES_MODULE_UNSORTED_PATH 1
144 #define FILES_MODULE_SORTED_TREE_PATH 2
145 #define FILES_MODULE_DESC_FILE_ENABLE 3
146 #define FILES_MODULE_DESC_FILE_NAME 4
148 // may be move to class namespace ?
149 #define SFINX_PROGRESS_NONE 0
150 #define SFINX_PROGRESS_START 1
151 #define SFINX_PROGRESS_END 2
152 #define SFINX_PROGRESS_PERCENT 0
153 #define SFINX_PROGRESS_INTEGER 1
154 #define SFINX_PROGRESS_FLOAT 2
157 #define SFINX_SEARCH_UNIVERSE 0
158 #define SFINX_SEARCH_IN_FILES 1