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