Mercurial > pidgin.yaz
annotate libpurple/protocols/msn/p2p.h @ 31206:f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
author | masca@cpw.pidgin.im |
---|---|
date | Thu, 03 Jun 2010 22:55:52 +0000 |
parents | e5e712cf9f7e |
children | 1059e5d29cd9 |
rev | line source |
---|---|
31201 | 1 #ifndef MSN_P2P_H |
2 #define MSN_P2P_H | |
3 | |
4 #include "msg.h" | |
5 | |
6 #pragma pack(push,1) | |
7 typedef struct { | |
8 guint32 session_id; | |
31202
d4869cd86680
Chang member name so it is compatible with MsnSlpHeader struct names.
masca@cpw.pidgin.im
parents:
31201
diff
changeset
|
9 guint32 id; |
31201 | 10 guint64 offset; |
11 guint64 total_size; | |
12 guint32 length; | |
13 guint32 flags; | |
14 guint32 ack_id; | |
31202
d4869cd86680
Chang member name so it is compatible with MsnSlpHeader struct names.
masca@cpw.pidgin.im
parents:
31201
diff
changeset
|
15 guint32 ack_sub_id; |
31201 | 16 guint64 ack_size; |
17 /* guint8 body[1]; */ | |
31205 | 18 } MsnP2PHeader; |
31201 | 19 #pragma pack(pop) |
20 | |
31204
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
31202
diff
changeset
|
21 typedef struct |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
31202
diff
changeset
|
22 { |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
31202
diff
changeset
|
23 guint32 value; |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
31202
diff
changeset
|
24 } MsnP2PFooter; |
c2e911eeffc9
Drop MsnSlpFooter in favor of MsnP2pFooter.
masca@cpw.pidgin.im
parents:
31202
diff
changeset
|
25 |
31201 | 26 typedef enum |
27 { | |
28 P2P_NO_FLAG = 0x0, /**< No flags specified */ | |
29 P2P_OUT_OF_ORDER = 0x1, /**< Chunk out-of-order */ | |
30 P2P_ACK = 0x2, /**< Acknowledgement */ | |
31 P2P_PENDING_INVITE = 0x4, /**< There is a pending invite */ | |
32 P2P_BINARY_ERROR = 0x8, /**< Error on the binary level */ | |
33 P2P_MSN_OBJ_DATA = 0x20, /**< MsnObject data */ | |
34 P2P_WML2009_COMP = 0x1000000, /**< Compatibility with WLM 2009 */ | |
35 P2P_FILE_DATA = 0x1000030 /**< File transfer data */ | |
36 } MsnP2PHeaderFlag; | |
37 /* Info From: | |
38 * http://msnpiki.msnfanatic.com/index.php/MSNC:P2Pv1_Headers#Flags | |
39 * http://trac.kmess.org/changeset/ba04d0c825769d23370511031c47f6be75fe9b86 | |
40 * #7180 | |
41 */ | |
42 | |
31205 | 43 #define P2P_PACKET_HEADER_SIZE sizeof(MsnP2PHeader) |
31201 | 44 |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
31205
diff
changeset
|
45 MsnP2PHeader * |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
31205
diff
changeset
|
46 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:
31205
diff
changeset
|
47 |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
31205
diff
changeset
|
48 MsnP2PHeader * |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
31205
diff
changeset
|
49 msn_p2p_header_to_wire(MsnP2PHeader *header); |
31201 | 50 |
51 #endif /* MSN_P2P_H */ |