summaryrefslogtreecommitdiff
path: root/protocols/MRA/docs/proto.htm
blob: ec334ffb30e6d3f835218e053b7f8d9f1276775c (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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0028)http://agent.mail.ru/proto.h -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
<BODY>//*************************************************************************** 
// $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>#define 
PROTO_VERSION_MAJOR 1 #define PROTO_VERSION_MINOR 10 #define PROTO_VERSION 
((((u_long)(PROTO_VERSION_MAJOR))&lt;&lt;16)|(u_long)(PROTO_VERSION_MINOR)) 
#define PROTO_MAJOR(p) (((p)&amp;0xFFFF0000)&gt;&gt;16) #define PROTO_MINOR(p) 
((p)&amp;0x0000FFFF) typedef struct mrim_packet_header_t { u_long magic; // 
Magic u_long proto; // Âåðñèÿ ïðîòîêîëà u_long seq; // Sequence u_long msg; // 
Òèï ïàêåòà u_long dlen; // Äëèíà äàííûõ u_long from; // Àäðåñ îòïðàâèòåëÿ u_long 
fromport; // Ïîðò îòïðàâèòåëÿ u_char reserved[16]; // Çàðåçåðâèðîâàíî } 
mrim_packet_header_t; #define CS_MAGIC 0xDEADBEEF // Êëèåíòñêèé Magic ( C 
&lt;-&gt; S ) 
/*************************************************************************** 
ÏÐÎÒÎÊÎË ÑÂßÇÈ ÊËÈÅÍÒ-ÑÅÐÂÅÐ 
***************************************************************************/ 
#define MRIM_CS_HELLO 0x1001 // C -&gt; S // empty #define MRIM_CS_HELLO_ACK 
0x1002 // S -&gt; C // mrim_connection_params_t #define MRIM_CS_LOGIN_ACK 0x1004 
// S -&gt; C // empty #define MRIM_CS_LOGIN_REJ 0x1005 // S -&gt; C // LPS 
reason #define MRIM_CS_PING 0x1006 // C -&gt; S // empty #define MRIM_CS_MESSAGE 
0x1008 // C -&gt; S // UL flags // LPS to // LPS message // LPS rtf-formatted 
message (&gt;=1.1) #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_MULTICAST 0x00001000 #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 
-&gt; C // UL msg_id // UL flags // LPS from // LPS message // LPS rtf-formatted 
message (&gt;=1.1) #define MRIM_CS_MESSAGE_RECV 0x1011 // C -&gt; S // LPS from 
// UL msg_id #define MRIM_CS_MESSAGE_STATUS 0x1012 // S -&gt; 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 MRIM_CS_USER_STATUS 0x100F // S -&gt; C // UL status #define 
STATUS_OFFLINE 0x00000000 #define STATUS_ONLINE 0x00000001 #define STATUS_AWAY 
0x00000002 #define STATUS_UNDETERMINATED 0x00000003 #define 
STATUS_FLAG_INVISIBLE 0x80000000 // LPS user #define MRIM_CS_LOGOUT 0x1013 // S 
-&gt; C // UL reason #define LOGOUT_NO_RELOGIN_FLAG 0x0010 // Logout due to 
double login #define MRIM_CS_CONNECTION_PARAMS 0x1014 // S -&gt; C // 
mrim_connection_params_t #define MRIM_CS_USER_INFO 0x1015 // S -&gt; C // (LPS 
key, LPS value)* X #define MRIM_CS_ADD_CONTACT 0x1019 // C -&gt; S // UL flags 
(group(2) or usual(0) // UL group id (unused if contact is group) // LPS contact 
// LPS name #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 MRIM_CS_ADD_CONTACT_ACK 0x101A // S -&gt; 
C // UL status // UL contact_id or (u_long)-1 if status is not OK #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 #define MRIM_CS_MODIFY_CONTACT 0x101B // C -&gt; S 
// UL id // UL flags - same as for MRIM_CS_ADD_CONTACT // UL group id (unused if 
contact is group) // LPS contact // LPS name #define MRIM_CS_MODIFY_CONTACT_ACK 
0x101C // S -&gt; C // UL status, same as for MRIM_CS_ADD_CONTACT_ACK #define 
MRIM_CS_OFFLINE_MESSAGE_ACK 0x101D // S -&gt; C // UIDL // LPS offline message 
#define MRIM_CS_DELETE_OFFLINE_MESSAGE 0x101E // C -&gt; S // UIDL #define 
MRIM_CS_AUTHORIZE 0x1020 // C -&gt; S // LPS user #define MRIM_CS_AUTHORIZE_ACK 
0x1021 // S -&gt; C // LPS user #define MRIM_CS_CHANGE_STATUS 0x1022 // C -&gt; 
S // UL new status #define MRIM_CS_GET_MPOP_SESSION 0x1024 // C -&gt; S #define 
MRIM_CS_MPOP_SESSION 0x1025 // S -&gt; C #define MRIM_GET_SESSION_FAIL 0 #define 
MRIM_GET_SESSION_SUCCESS 1 //UL status // LPS mpop session //white pages! 
#define MRIM_CS_WP_REQUEST 0x1029 //C-&gt;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, MRIM_CS_WP_REQUEST_PARAM_DOMAIN, 
MRIM_CS_WP_REQUEST_PARAM_NICKNAME, MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME, 
MRIM_CS_WP_REQUEST_PARAM_LASTNAME, MRIM_CS_WP_REQUEST_PARAM_SEX , 
MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY, MRIM_CS_WP_REQUEST_PARAM_DATE1 , 
MRIM_CS_WP_REQUEST_PARAM_DATE2 , //!!!!!!!!!!!!!!!!!!!online request param must 
be at end of request!!!!!!!!!!!!!!! MRIM_CS_WP_REQUEST_PARAM_ONLINE , 
MRIM_CS_WP_REQUEST_PARAM_STATUS , // we do not used it, yet 
MRIM_CS_WP_REQUEST_PARAM_CITY_ID, MRIM_CS_WP_REQUEST_PARAM_ZODIAC, 
MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY, 
MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, MRIM_CS_WP_REQUEST_PARAM_MAX }; #define 
MRIM_CS_ANKETA_INFO 0x1028 //S-&gt;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_CONTACT_LIST2 0x1037 //S-&gt;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 //LPS contacts fields mask 
//group fields //contacts fields //groups mask 'us' == flags, name //contact 
mask 'uussuu' flags, flags, internal flags, status #define 
CONTACT_INTFLAG_NOT_AUTHORIZED 0x0001 //old packet cs_login with cs_statistic 
#define MRIM_CS_LOGIN2 0x1038 // C -&gt; S #define MAX_CLIENT_DESCRIPTION 256 // 
LPS login // LPS password // DWORD status //+ statistic packet data: // LPS 
client description //max 256 typedef struct mrim_connection_params_t { unsigned 
long ping_period; } mrim_connection_params_t; #endif // MRIM_PROTO_H 
</BODY></HTML>