Mercurial > pidgin
annotate libpurple/protocols/msn/p2p.h @ 30858:2d00d29a45fd
Process SlpMessageParts, a sequence of parts will generate a SlpMessage.
author | masca@cpw.pidgin.im |
---|---|
date | Thu, 29 Jul 2010 00:12:54 +0000 |
parents | 544221aadf6e |
children | 16ab805406d1 |
rev | line source |
---|---|
30763 | 1 #ifndef MSN_P2P_H |
2 #define MSN_P2P_H | |
3 | |
4 | |
5 #pragma pack(push,1) | |
6 typedef struct { | |
7 guint32 session_id; | |
30764
d4869cd86680
Chang member name so it is compatible with MsnSlpHeader struct names.
masca@cpw.pidgin.im
parents:
30763
diff
changeset
|
8 guint32 id; |
30763 | 9 guint64 offset; |
10 guint64 total_size; | |
11 guint32 length; | |
12 guint32 flags; | |
13 guint32 ack_id; | |
30764
d4869cd86680
Chang member name so it is compatible with MsnSlpHeader struct names.
masca@cpw.pidgin.im
parents:
30763
diff
changeset
|
14 guint32 ack_sub_id; |
30763 | 15 guint64 ack_size; |
16 /* guint8 body[1]; */ | |
30767 | 17 } MsnP2PHeader; |
30763 | 18 #pragma pack(pop) |
19 | |
30839 | 20 #pragma pack(push,1) |
21 typedef struct { | |
22 guint8 header_len; | |
23 guint8 opcode; | |
30848
544221aadf6e
Fix some field sizes in P2Pv2 header.
masca@cpw.pidgin.im
parents:
30844
diff
changeset
|
24 guint16 message_len; |
544221aadf6e
Fix some field sizes in P2Pv2 header.
masca@cpw.pidgin.im
parents:
30844
diff
changeset
|
25 guint32 base_id; |
30839 | 26 } MsnP2Pv2Header; |
27 #pragma pack(pop) | |
28 | |
30766
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
30764
diff
changeset
|
29 typedef struct |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
30764
diff
changeset
|
30 { |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
30764
diff
changeset
|
31 guint32 value; |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
30764
diff
changeset
|
32 } MsnP2PFooter; |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
30764
diff
changeset
|
33 |
30763 | 34 typedef enum |
35 { | |
36 P2P_NO_FLAG = 0x0, /**< No flags specified */ | |
37 P2P_OUT_OF_ORDER = 0x1, /**< Chunk out-of-order */ | |
38 P2P_ACK = 0x2, /**< Acknowledgement */ | |
39 P2P_PENDING_INVITE = 0x4, /**< There is a pending invite */ | |
40 P2P_BINARY_ERROR = 0x8, /**< Error on the binary level */ | |
30841
01dea46bbb42
Add some more flag definitions to the p2p flags.
masca@cpw.pidgin.im
parents:
30839
diff
changeset
|
41 P2P_FILE = 0x10, /**< File */ |
30763 | 42 P2P_MSN_OBJ_DATA = 0x20, /**< MsnObject data */ |
30841
01dea46bbb42
Add some more flag definitions to the p2p flags.
masca@cpw.pidgin.im
parents:
30839
diff
changeset
|
43 P2P_CLOSE = 0x40, /**< Close session */ |
01dea46bbb42
Add some more flag definitions to the p2p flags.
masca@cpw.pidgin.im
parents:
30839
diff
changeset
|
44 P2P_TLP_ERROR = 0x80, /**< Error at transport layer protocol */ |
01dea46bbb42
Add some more flag definitions to the p2p flags.
masca@cpw.pidgin.im
parents:
30839
diff
changeset
|
45 P2P_DC_HANDSHAKE = 0x100, /**< Direct Handshake */ |
30763 | 46 P2P_WML2009_COMP = 0x1000000, /**< Compatibility with WLM 2009 */ |
47 P2P_FILE_DATA = 0x1000030 /**< File transfer data */ | |
48 } MsnP2PHeaderFlag; | |
49 /* Info From: | |
50 * http://msnpiki.msnfanatic.com/index.php/MSNC:P2Pv1_Headers#Flags | |
51 * http://trac.kmess.org/changeset/ba04d0c825769d23370511031c47f6be75fe9b86 | |
52 * #7180 | |
53 */ | |
54 | |
30844
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
55 typedef enum |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
56 { |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
57 P2P_APPID_SESION = 0x0, /**< Negotiating session */ |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
58 P2P_APPID_OBJ = 0x1, /**< MsnObject (Display or Emoticon) */ |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
59 P2P_APPID_FILE = 0x2, /**< File transfer */ |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
60 P2P_APPID_EMOTE = 0xB, /**< CustomEmoticon */ |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
61 P2P_APPID_DISPLAY = 0xC /**< Display Image */ |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
62 } MsnP2PAppId; |
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
30841
diff
changeset
|
63 |
30767 | 64 #define P2P_PACKET_HEADER_SIZE sizeof(MsnP2PHeader) |
30799 | 65 #define P2P_PACKET_FOOTER_SIZE sizeof(MsnP2PFooter) |
30763 | 66 |
30768
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
30767
diff
changeset
|
67 MsnP2PHeader * |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
30767
diff
changeset
|
68 msn_p2p_header_from_wire(MsnP2PHeader *wire); |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
30767
diff
changeset
|
69 |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
30767
diff
changeset
|
70 MsnP2PHeader * |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
30767
diff
changeset
|
71 msn_p2p_header_to_wire(MsnP2PHeader *header); |
30763 | 72 |
30782 | 73 MsnP2PFooter * |
74 msn_p2p_footer_from_wire(MsnP2PFooter *wire); | |
75 | |
76 MsnP2PFooter * | |
77 msn_p2p_footer_to_wire(MsnP2PFooter *footer); | |
78 | |
30763 | 79 #endif /* MSN_P2P_H */ |