summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/proto.h
blob: 9e6cab5050b9630a4dd3b9f48df3a1a4c306675c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
//***************************************************************************
// $Id: proto.h, v 1.141 2005/10/24 15:32:33 shingrus Exp $
//***************************************************************************

#ifndef MRIM_PROTO_H
#define MRIM_PROTO_H

#include <sys/types.h>

#include "version.h"

typedef struct mrim_packet_header_t
{
    u_long      magic;		// Magic
    u_long      proto;		// Âåðñèÿ ïðîòîêîëà
    u_long      seq;		// Sequence
    u_long      msg;		// Òèï ïàêåòà
    u_long      dlen; 		// Äëèíà äàííûõ
    u_char		reserved[24];	// Çàðåçåðâèðîâàíî
}
mrim_packet_header_t;

#define CS_MAGIC    0xDEADBEEF		// Êëèåíòñêèé Magic ( C <-> S )


// UNICODE = (UTF-16LE) ( >= 1.17)

/***************************************************************************

		ÏÐÎÒÎÊÎË ÑÂßÇÈ ÊËÈÅÍÒ-ÑÅÐÂÅÐ

 ***************************************************************************/

#define MRIM_CS_HELLO       	0x1001  // C -> S
// empty

#define MRIM_CS_HELLO_ACK   	0x1002  // S -> C
// mrim_connection_params_t


#define MRIM_CS_LOGIN_ACK   	0x1004  // S -> C
// empty

#define MRIM_CS_LOGIN_REJ   	0x1005  // S -> C
// LPS reason ???

#define MRIM_CS_PING        	0x1006  // C -> S
// empty

#define MRIM_CS_MESSAGE			0x1008  // C -> S
// UL flags
	#define MESSAGE_FLAG_OFFLINE		0x00000001
	#define MESSAGE_FLAG_NORECV			0x00000004
	#define MESSAGE_FLAG_AUTHORIZE		0x00000008 	// X-MRIM-Flags: 00000008
	#define MESSAGE_FLAG_SYSTEM			0x00000040
	#define MESSAGE_FLAG_RTF			0x00000080
	#define MESSAGE_FLAG_CONTACT		0x00000200
	#define MESSAGE_FLAG_NOTIFY			0x00000400
	#define MESSAGE_FLAG_SMS			0x00000800
	#define MESSAGE_FLAG_MULTICAST		0x00001000
	#define MESSAGE_SMS_DELIVERY_REPORT	0x00002000
	#define MESSAGE_FLAG_ALARM			0x00004000
	#define MESSAGE_FLAG_FLASH			0x00008000
	#define MESSAGE_FLAG_SPAMF_SPAM		0x00020000	// ÷òîáû ïîæàëîâàòñÿ íà ñïàì - âåðíóòü íàçàä ñ ýòèì ôëàãîì ;êëèåíòó èãíîðèðîâàòü, ñòàâèòñÿ â ìîìåíò îáðàáîòêè ñîîáùåíèÿ ïðè ïåðåäà÷å âíóòðè êëàñòåðà
	#define MESSAGE_FLAG_MULTICHAT		0x00400000	//
		#define MULTICHAT_MESSAGE		0	// received message (s->c)
		#define MULTICHAT_GET_MEMBERS	1	// request members list from server (c->s)
		#define MULTICHAT_MEMBERS		2	// members list from server (s->c)
		#define MULTICHAT_ADD_MEMBERS	3	//
		#define MULTICHAT_ATTACHED		4	// user joined to chat (s->c)
		#define MULTICHAT_DETACHED		5	// user leave chat (s->c)
		#define MULTICHAT_DESTROYED		6	//
		#define MULTICHAT_INVITE		7	//
	#define MESSAGE_FLAG_v1p16			0x00100000	// äëÿ ïåðåêîäèðîâêè þíèêîäà
	#define MESSAGE_FLAG_CP1251			0x00200000
// LPS to e-mail ANSI
// LPS message ANSI/UNICODE (see flags)
// LPS rtf-formatted message ( >= 1.1) ???
// LPS multichat_data ( >= 1.20) ???

#define MAX_MULTICAST_RECIPIENTS 50
	#define MESSAGE_USERFLAGS_MASK	0x000036A8	// Flags that user is allowed to set himself


#define MRIM_CS_MESSAGE_ACK		0x1009  // S -> C
// UL msg_id
// UL flags
// LPS from e-mail ANSI
// LPS message UNICODE
// LPS rtf-formatted message ( >= 1.1)	- MESSAGE_FLAG_RTF
//		//BASE64(						- MESSAGE_FLAG_AUTHORIZE
//				UL parts count = 2
//				LPS auth_sender_nick  UNICODE
//				LPS auth_request_text  UNICODE
//[ LPS multichat_data ] ( >=  1.20) - MESSAGE_FLAG_MULTICHAT
//				UL type
//				LPS multichat_name
//				switch (type) {
//					MULTICHAT_MESSAGE {
//						LPS sender ANSI
//					}
//					MULTICHAT_MEMBERS {
//						CLPS members
//						[ LPS owner ]
//					}
//					MULTICHAT_ADD_MEMBERS {
//						LPS sender ANSI
//						CLPS members
//					}
//					MULTICHAT_ATTACHED {
//						LPS member ANSI
//					}
//					MULTICHAT_DETACHED {
//						LPS member ANSI
//					}
//					MULTICHAT_INVITE {
//						LPS sender ANSI
//					}
//				}
//	)





#define MRIM_CS_MESSAGE_RECV	0x1011	// C -> S
// LPS from e-mail ANSI
// UL msg_id

#define MRIM_CS_MESSAGE_STATUS	0x1012	// S -> C
// UL status
	#define MESSAGE_DELIVERED				0x0000	// Message delivered directly to user
	#define MESSAGE_REJECTED_NOUSER			0x8001  // Message rejected - no such user
	#define MESSAGE_REJECTED_INTERR			0x8003	// Internal server error
	#define MESSAGE_REJECTED_LIMIT_EXCEEDED	0x8004	// Offline messages limit exceeded
	#define MESSAGE_REJECTED_TOO_LARGE		0x8005	// Message is too large
	#define	MESSAGE_REJECTED_DENY_OFFMSG	0x8006	// User does not accept offline messages
	#define	MESSAGE_REJECTED_DENY_OFFFLSH	0x8007	// User does not accept offline flash animation
	//#define	MESSAGE_REJECTED_DENY_OFFFLSH	0x8008	// User does not accept offline flash animation
	//#define	MESSAGE_REJECTED_DENY_OFFFLSH	0x8009	// User does not accept offline flash animation

#define MRIM_CS_USER_STATUS     0x100F  // S -> C
// UL status
	#define STATUS_OFFLINE          0x00000000
	#define STATUS_ONLINE           0x00000001
	#define STATUS_AWAY             0x00000002
	#define STATUS_UNDETERMINATED   0x00000003
	#define STATUS_USER_DEFINED     0x00000004
	#define STATUS_FLAG_INVISIBLE   0x80000000
// LPS spec_status_uri ANSI ( >= 1.14)
	#define SPEC_STATUS_URI_MAX 256
// LPS status_title UNICODE ( >= 1.14)
	#define STATUS_TITLE_MAX 16
// LPS status_desc UNICODE ( >= 1.14)
	#define STATUS_DESC_MAX 64
// LPS user e-mail ANSI
// UL com_support ( >= 1.14)
	#define FEATURE_FLAG_RTF_MESSAGE       0x00000001
	#define FEATURE_FLAG_BASE_SMILES       0x00000002
	#define FEATURE_FLAG_ADVANCED_SMILES   0x00000004
	#define FEATURE_FLAG_CONTACTS_EXCH     0x00000008
	#define FEATURE_FLAG_WAKEUP            0x00000010
	#define FEATURE_FLAG_MULTS             0x00000020
	#define FEATURE_FLAG_FILE_TRANSFER     0x00000040
	#define FEATURE_FLAG_VOICE             0x00000080
	#define FEATURE_FLAG_VIDEO             0x00000100
	#define FEATURE_FLAG_GAMES             0x00000200
	#define FEATURE_FLAG_LAST              0x00000200
	#define FEATURE_UA_FLAG_MASK           ((FEATURE_FLAG_LAST << 1) - 1)
// LPS user_agent ( >= 1.14) ANSI
	#define USER_AGENT_MAX 255
	// Format:
	//  user_agent       = param *(param )
	//  param            = pname "=" pvalue
	//  pname            = token
	//  pvalue           = token / quoted-string
	//
	// Params:
	//  "client" - magent/jagent/???
	//  "name" - sys-name.
	//  "title" - display-name.
	//  "version" - product internal numeration. Examples: "1.2", "1.3 pre".
	//  "build" - product internal numeration (may be positive number or time).
	//  "protocol" - MMP protocol number by format "<major>.<minor>".


#define MRIM_CS_LOGOUT			0x1013	// S -> C
// UL reason
	#define LOGOUT_NO_RELOGIN_FLAG	0x0010		// Logout due to double login

#define MRIM_CS_CONNECTION_PARAMS	0x1014	// S -> C (>1.16 depricated ?)
// mrim_connection_params_t

#define MRIM_CS_USER_INFO			0x1015	// S -> C
// (LPS key, LPS value)* X ???
// MESSAGES.TOTAL - num UNICODE
// MESSAGES.UNREAD - num UNICODE
// MRIM.NICKNAME - nick UNICODE
// client.endpoint - ip:port UNICODE


#define MRIM_CS_ADD_CONTACT			0x1019	// C -> S
// UL flags (group(2) or usual(0)
	#define CONTACT_FLAG_REMOVED		0x00000001
	#define CONTACT_FLAG_GROUP			0x00000002
	#define CONTACT_FLAG_INVISIBLE		0x00000004
	#define CONTACT_FLAG_VISIBLE		0x00000008
	#define CONTACT_FLAG_IGNORE			0x00000010
	#define CONTACT_FLAG_SHADOW			0x00000020
	#define CONTACT_FLAG_AUTHORIZED		0x00000040 // ( >= 1.15)
	#define CONTACT_FLAG_MULTICHAT		0x00000080 // ( >= 1.20)  = 128
	#define CONTACT_FLAG_UNICODE_NAME	0x00000200 //  = 512
	#define CONTACT_FLAG_PHONE			0x00100000

// UL group id (unused if contact is group)
// LPS contact e-mail ANSI
// LPS name UNICODE
// LPS custom phones ANSI
// LPS BASE64(
//				UL parts count = 2
//				LPS auth_sender_nick ???
//				LPS auth_request_text ???
//	)
// UL actions ( >= 1.15)
// [LPS multichat_data]
//		CLPS members ( >=  1.20)
//		[ LPS owner ]
    #define ADD_CONTACT_FLAG_MYMAIL_INVITE		0x00000001
    #define ADD_CONTACT_FLAG_MULTICHAT_ATTACHE	0x00000002
	//used internal in win32 agent
	#define CONTACT_AWAITING_AUTHORIZATION_USER	0x00000100
	#define CONTACT_FLAG_TEMPORARY				0x00010000


#define MRIM_CS_ADD_CONTACT_ACK			0x101A	// S -> C
// UL status
	#define CONTACT_OPER_SUCCESS		0x0000
	#define CONTACT_OPER_ERROR			0x0001
	#define CONTACT_OPER_INTERR			0x0002
	#define CONTACT_OPER_NO_SUCH_USER	0x0003
	#define CONTACT_OPER_INVALID_INFO	0x0004
	#define CONTACT_OPER_USER_EXISTS	0x0005
	#define CONTACT_OPER_GROUP_LIMIT	0x6
// UL contact_id or (u_long)-1 if status is not OK
// [LPS multichat_contact ( >=  1.20)]


#define MRIM_CS_MODIFY_CONTACT			0x101B	// C -> S
// UL id
// UL flags - same as for MRIM_CS_ADD_CONTACT
// UL group id (unused if contact is group)
// LPS contact e-mail ANSI
// LPS name UNICODE
// LPS custom phones ANSI

#define MRIM_CS_MODIFY_CONTACT_ACK		0x101C	// S -> C
// UL status, same as for MRIM_CS_ADD_CONTACT_ACK

#define MRIM_CS_OFFLINE_MESSAGE_ACK		0x101D	// S -> C
// UIDL
// LPS offline message ???

#define MRIM_CS_DELETE_OFFLINE_MESSAGE	0x101E	// C -> S
// UIDL


#define MRIM_CS_AUTHORIZE				0x1020	// C -> S
// LPS user e-mail ANSI

#define MRIM_CS_AUTHORIZE_ACK			0x1021	// S -> C
// LPS user e-mail ANSI

#define MRIM_CS_CHANGE_STATUS			0x1022	// C -> S
// UL new status
// LPS spec_status_uri ANSI ( >= 1.14)
// LPS status_title UNICODE ( >= 1.14)
// LPS status_desc UNICODE ( >= 1.14)
// UL com_support ( >= 1.14) (see MRIM_CS_USER_STATUS)


#define MRIM_CS_GET_MPOP_SESSION		0x1024	// C -> S


#define MRIM_CS_MPOP_SESSION			0x1025	// S -> C
// UL status
	#define MRIM_GET_SESSION_FAIL		0
	#define MRIM_GET_SESSION_SUCCESS	1
// LPS mpop session ???


#define MRIM_CS_FILE_TRANSFER			0x1026  // C->S
// LPS TO/FROM e-mail ANSI
// DWORD id_request - uniq per connect
// DWORD FILESIZE
// LPS:	// LPS Files (FileName;FileSize;FileName;FileSize;) ANSI
		// LPS DESCRIPTION:
							// UL ?
							// Files (FileName;FileSize;FileName;FileSize;) UNICODE
		// LPS Conn (IP:Port;IP:Port;) ANSI

#define MRIM_CS_FILE_TRANSFER_ACK		0x1027 // S->C
// DWORD status
	#define FILE_TRANSFER_STATUS_OK                 1
	#define FILE_TRANSFER_STATUS_DECLINE            0
	#define FILE_TRANSFER_STATUS_ERROR              2
	#define FILE_TRANSFER_STATUS_INCOMPATIBLE_VERS  3
	#define FILE_TRANSFER_MIRROR                    4
// LPS TO/FROM e-mail ANSI
// DWORD id_request
// LPS DESCRIPTION [Conn (IP:Port;IP:Port;) ANSI]



//white pages!
#define MRIM_CS_WP_REQUEST			0x1029 //C->S
// DWORD field
// LPS value ???
#define PARAMS_NUMBER_LIMIT			50
#define PARAM_VALUE_LENGTH_LIMIT	64

//if last symbol in value eq '*' it will be replaced by LIKE '%'
// params define
// must be  in consecutive order (0..N) to quick check in check_anketa_info_request
	enum {
	MRIM_CS_WP_REQUEST_PARAM_USER		 =  0, // ANSI
	MRIM_CS_WP_REQUEST_PARAM_DOMAIN, 		// ANSI
	MRIM_CS_WP_REQUEST_PARAM_NICKNAME, 		// UNICODE
	MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME, 		// UNICODE
	MRIM_CS_WP_REQUEST_PARAM_LASTNAME, 		// UNICODE
	MRIM_CS_WP_REQUEST_PARAM_SEX	, 		// ANSI
	MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY, 		// not used for search
	MRIM_CS_WP_REQUEST_PARAM_DATE1	, 		// ANSI
	MRIM_CS_WP_REQUEST_PARAM_DATE2	, 		// ANSI
	//!!!!!!!!!!!!!!!!!!!online request param must be at end of request!!!!!!!!!!!!!!!
	MRIM_CS_WP_REQUEST_PARAM_ONLINE	, 		// ANSI
	MRIM_CS_WP_REQUEST_PARAM_STATUS	, 		// we do not used it, yet
	MRIM_CS_WP_REQUEST_PARAM_CITY_ID, 		// ANSI
	MRIM_CS_WP_REQUEST_PARAM_ZODIAC, 		// ANSI
	MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH, // ANSI
	MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY, 	// ANSI
	MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, 	// ANSI
	MRIM_CS_WP_REQUEST_PARAM_MAX
	};

#define MRIM_CS_ANKETA_INFO			0x1028 //S->C
// DWORD status
	#define MRIM_ANKETA_INFO_STATUS_OK			1
	#define MRIM_ANKETA_INFO_STATUS_NOUSER		0
	#define MRIM_ANKETA_INFO_STATUS_DBERR		2
	#define MRIM_ANKETA_INFO_STATUS_RATELIMERR	3
// DWORD fields_num
// DWORD max_rows
// DWORD server_time sec since 1970 (unixtime)
	// fields set 				//%fields_num == 0
	// values set 				//%fields_num == 0
// LPS value (numbers too) ???


#define MRIM_CS_MAILBOX_STATUS			0x1033
// DWORD new messages in mailbox


#define MRIM_CS_GAME                    0x1035
// LPS to/from e-mail ANSI
// DWORD session unique per game
// DWORD msg internal game message
	enum {
	GAME_BASE,
	GAME_CONNECTION_INVITE,
	GAME_CONNECTION_ACCEPT,
	GAME_DECLINE,
	GAME_INC_VERSION,
	GAME_NO_SUCH_GAME,
	GAME_JOIN,
	GAME_CLOSE,
	GAME_SPEED,
	GAME_SYNCHRONIZATION,
	GAME_USER_NOT_FOUND,
	GAME_ACCEPT_ACK,
	GAME_PING,
	GAME_RESULT,
	GAME_MESSAGES_NUMBER
	};
// DWORD msg_id id for ack
// DWORD time_send time of client
// LPS data ???



#define MRIM_CS_CONTACT_LIST2		0x1037 //S->C
// UL status
	#define GET_CONTACTS_OK		0x0000
	#define GET_CONTACTS_ERROR	0x0001
	#define GET_CONTACTS_INTERR	0x0002
// DWORD status  - if ...OK than this staff:
// DWORD groups number
	// mask symbols table:
	// 's' - lps
	// 'u' - unsigned long
	// 'z' - zero terminated string
	// LPS groups fields mask ANSI
	// LPS contacts fields mask ANSI
	// group fields
	// contacts fields
	// groups mask 'us' == flags, name UNICODE
	// contact mask 'uussuussssus' flags, group id, e-mail ANSI, nick UNICODE, server flags, status, custom phone numbers ANSI, spec_status_uri ANSI, status_title UNICODE, status_desc UNICODE, com_support (future flags), user_agent (formated string) ANSI, ul blog status id, ul blog status id, ul BlogStatusTime, blog status UNICODE, blog status music UNICODE, blog status sender, ?????
	//               uussuussssusuuusssss
	#define CONTACT_INTFLAG_NOT_AUTHORIZED	0x0001


//old packet cs_login with cs_statistic
#define MRIM_CS_LOGIN2		0x1038  // C -> S
// LPS login e-mail ANSI
// LPS password ANSI
// DWORD status
// LPS spec_status_uri ANSI ( >= 1.14)
// LPS status_title UNICODE ( >= 1.14)
// LPS status_desc UNICODE ( >= 1.14)
// UL com_support ( >= 1.14) (see MRIM_CS_USER_STATUS)
// LPS user_agent ANSI ( >= 1.14) (see MRIM_CS_USER_STATUS)
	// + statistic packet data:
// LPS lang ( >= 1.16)
// LPS ua session ( >= 1.20) - øëè ïóñòîé
// LPS replaced ua session ( >= 1.20) - øëè ïóñòîé
// LPS client description ANSI
	#define MAX_CLIENT_DESCRIPTION 256
// unknown data
// LPS unknown id (len = 32)
/*		SetUL(&lpbDataCurrent, 0);//00 00 00 00
		SetUL(&lpbDataCurrent, 0);//02 BA 0A 00
		SetUL(&lpbDataCurrent, 0);//00 00 00 03
		SetUL(&lpbDataCurrent, 0);//00 00 00 02

		SetUL(&lpbDataCurrent, 0);//E2 FD 1E 22
		SetUL(&lpbDataCurrent, 0);//04 00 00 00
		SetUL(&lpbDataCurrent, 0);//02 FF FF FF
		SetUL(&lpbDataCurrent, 0);//FF 05 00 00

		SetUL(&lpbDataCurrent, 0);//00 02 FF FF
		SetUL(&lpbDataCurrent, 0);//FF FF 06 00
		SetUL(&lpbDataCurrent, 0);//00 00 02 FF
		SetUL(&lpbDataCurrent, 0);//FF FF FF 07

		SetUL(&lpbDataCurrent, 0);//00 00 00 02
		SetUL(&lpbDataCurrent, 0);//FF FF FF FF
		SetUL(&lpbDataCurrent, 0);//14 00 00 00
		SetUL(&lpbDataCurrent, 0);//02 00 00 00

		SetUL(&lpbDataCurrent, 0);//00 16 00 00
		SetUL(&lpbDataCurrent, 0);//00 02 00 00
		SetUL(&lpbDataCurrent, 0);//00 00 17 00
		SetUL(&lpbDataCurrent, 0);//00 00 02 00

		SetUL(&lpbDataCurrent, 0);//00 00 00 18
		SetUL(&lpbDataCurrent, 0);//00 00 00 02
		SetUL(&lpbDataCurrent, 0);//00 00 00 00
		SetUL(&lpbDataCurrent, 0);//19 00 00 00

		SetUL(&lpbDataCurrent, 0);//02 00 00 00
		SetUL(&lpbDataCurrent, 0);//00 1A 00 00
		SetUL(&lpbDataCurrent, 0);//00 02 00 00
		SetUL(&lpbDataCurrent, 0);//00 00 1C 00

		SetUL(&lpbDataCurrent, 0);//00 00 02 00
		SetUL(&lpbDataCurrent, 0);//00 00 00 1D
		SetUL(&lpbDataCurrent, 0);//00 00 00 02
		SetUL(&lpbDataCurrent, 0);//00 00 00 00

		SetUL(&lpbDataCurrent, 0);//23 00 00 00
		SetUL(&lpbDataCurrent, 0);//02 01 00 00
		SetUL(&lpbDataCurrent, 0);//00 24 00 00
		SetUL(&lpbDataCurrent, 0);//00 02 01 00

		SetUL(&lpbDataCurrent, 0);//00 00 25 00
		SetUL(&lpbDataCurrent, 0);//00 00 02 01
		SetUL(&lpbDataCurrent, 0);//00 00 00 26
		SetUL(&lpbDataCurrent, 0);//00 00 00 02

		SetUL(&lpbDataCurrent, 0);//00 00 00 00
		SetUL(&lpbDataCurrent, 0);//27 00 00 00
		SetUL(&lpbDataCurrent, 0);//02 00 00 00
		SetUL(&lpbDataCurrent, 0);//00 28 00 00

		SetUL(&lpbDataCurrent, 0);//00 02 00 00
		SetUL(&lpbDataCurrent, 0);//00 00 29 00
		SetUL(&lpbDataCurrent, 0);//00 00 02 01
		SetUL(&lpbDataCurrent, 0);//00 00 00 2A

		SetUL(&lpbDataCurrent, 0);//00 00 00 02
		SetUL(&lpbDataCurrent, 0);//00 00 00 00
		SetUL(&lpbDataCurrent, 0);//2B 00 00 00
		SetUL(&lpbDataCurrent, 0);//02 00 00 00

		SetUL(&lpbDataCurrent, 0);//00 2C 00 00
		SetUL(&lpbDataCurrent, 0);//00 01

		SetLPS(&lpbDataCurrent, "d3a4a3d0c95e5ba24f160a499ec8b4ea", 32);
*/


#define MRIM_CS_SMS       	0x1039  // C -> S
// UL flags
// LPS to Phone ???
// LPS message ???

#define MRIM_CS_SMS_ACK		0x1040 // S->C
// UL status



#define MRIM_CS_PROXY		0x1044
// LPS          to e-mail ANSI
// DWORD        id_request
// DWORD        data_type
	#define MRIM_PROXY_TYPE_VOICE	1
	#define MRIM_PROXY_TYPE_FILES	2
	#define MRIM_PROXY_TYPE_CALLOUT	3
// LPS          user_data ???
// LPS          lps_ip_port ???
// DWORD        session_id[4]

#define MRIM_CS_PROXY_ACK	0x1045
//DWORD         status
	#define PROXY_STATUS_OK					1
	#define PROXY_STATUS_DECLINE			0
	#define PROXY_STATUS_ERROR				2
	#define PROXY_STATUS_INCOMPATIBLE_VERS	3
	#define PROXY_STATUS_NOHARDWARE			4
	#define PROXY_STATUS_MIRROR				5
	#define PROXY_STATUS_CLOSED				6
// LPS           to e-mail ANSI
// DWORD         id_request
// DWORD         data_type
// LPS           user_data ???
// LPS:          lps_ip_port ???
// DWORD[4]      Session_id

#define MRIM_CS_PROXY_HELLO			0x1046
// DWORD[4]      Session_id

#define MRIM_CS_PROXY_HELLO_ACK		0x1047



#define MRIM_CS_NEW_MAIL	0x1048 // S->C
// UL unread count
// LPS from e-mail ANSI
// LPS subject ???
// UL date
// UL uidl




#define MRIM_CS_USER_BLOG_STATUS	0x1063
// DWORD flags
	#define MRIM_BLOG_STATUS_UPDATE		0x00000001
	#define MRIM_BLOG_STATUS_MUSIC		0x00000002 // add music to status
	#define MRIM_BLOG_STATUS_REPLY		0x00000004
	#define MRIM_BLOG_STATUS_NOTIFY		0x00000010 // not set self status, alert only
// LPS user
// UINT64 id
// DWORD time
// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
// LPS reply_user_nick

#define MRIM_CS_CHANGE_USER_BLOG_STATUS	0x1064
// DWORD flags
// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
	#define MICBLOG_STATUS_MAX 500
// switch (flags) {
// MRIM_BLOG_STATUS_REPLY:
//      UINT64 orig_id
// }


#define MRIM_CS_UNKNOWN	0x1073
// DWORD ???
// DWORD ???


#define MRIM_CS_USER_GEO	0x1077
// LPS user
// LPS:	// DWORD flags?
		// LPS: "geo-point":
							// LPS dolgota
							// LPS shirota
							// LPS "MAPOBJECT"
							// LPS some data?
							// LPS/DWORD
							// LPS/DWORD
							// LPS some data?
							// LPS some data?


#define MRIM_CS_SERVER_SETTINGS	0x1079





typedef struct mrim_connection_params_t
{
	unsigned long	ping_period;
}
mrim_connection_params_t;



#endif // MRIM_PROTO_H