Mercurial > pidgin.yaz
annotate libpurple/protocols/msn/p2p.c @ 31771:b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
They aren't enabled yet, so we should still be doing v1 right now.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Thu, 10 Mar 2011 06:29:00 +0000 |
parents | eeca86db288b |
children | 506b77a27a53 |
rev | line source |
---|---|
31412
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
1 /** |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
2 * @file p2p.c MSN P2P functions |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
3 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
4 * purple |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
5 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
6 * Purple is the legal property of its developers, whose names are too numerous |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
8 * source distribution. |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
9 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
13 * (at your option) any later version. |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
14 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
18 * GNU General Public License for more details. |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
19 * |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
23 */ |
72e6fa6caecc
These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31306
diff
changeset
|
24 |
31209
198d5bf82e09
Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents:
31206
diff
changeset
|
25 #include "internal.h" |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
26 #include "debug.h" |
31209
198d5bf82e09
Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents:
31206
diff
changeset
|
27 |
198d5bf82e09
Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents:
31206
diff
changeset
|
28 #include "p2p.h" |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
29 #include "tlv.h" |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
30 #include "msnutils.h" |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
31 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
32 MsnP2PInfo * |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
33 msn_p2p_info_new(MsnP2PVersion version) |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
34 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
35 MsnP2PInfo *info = g_new0(MsnP2PInfo, 1); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
36 info->version = version; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
37 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
38 switch (version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
39 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
40 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
41 /* Nothing to do */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
42 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
43 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
44 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
45 purple_debug_error("msn", "Invalid P2P Info version: %d\n", version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
46 g_free(info); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
47 info = NULL; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
48 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
49 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
50 return info; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
51 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
52 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
53 MsnP2PInfo * |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
54 msn_p2p_info_dup(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
55 { |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
56 MsnP2PInfo *new_info = g_new0(MsnP2PInfo, 1); |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
57 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
58 new_info->version = info->version; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
59 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
60 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
61 case MSN_P2P_VERSION_ONE: |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
62 *new_info = *info; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
63 break; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
64 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
65 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
66 *new_info = *info; |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
67 new_info->header.v2.header_tlv = msn_tlvlist_copy(info->header.v2.header_tlv); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
68 new_info->header.v2.data_tlv = msn_tlvlist_copy(info->header.v2.data_tlv); |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
69 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
70 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
71 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
72 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
73 g_free(new_info); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
74 new_info = NULL; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
75 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
76 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
77 return new_info; |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
78 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
79 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
80 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
81 msn_p2p_info_free(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
82 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
83 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
84 case MSN_P2P_VERSION_ONE: |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
85 /* Nothing to do! */ |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
86 break; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
87 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
88 case MSN_P2P_VERSION_TWO: |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
89 msn_tlvlist_free(info->header.v2.header_tlv); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
90 msn_tlvlist_free(info->header.v2.data_tlv); |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
91 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
92 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
93 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
94 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
95 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
96 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
97 g_free(info); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
98 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
99 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
100 size_t |
31768
8cf9270acf4c
Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31717
diff
changeset
|
101 msn_p2p_header_from_wire(MsnP2PInfo *info, const char *wire, size_t max_len) |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
102 { |
31769
eeca86db288b
Oops, I forgot to move the size check to the new location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31768
diff
changeset
|
103 size_t len = 0; |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
104 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
105 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
106 case MSN_P2P_VERSION_ONE: { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
107 MsnP2PHeader *header = &info->header.v1; |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
108 |
31769
eeca86db288b
Oops, I forgot to move the size check to the new location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31768
diff
changeset
|
109 if (max_len < P2P_PACKET_HEADER_SIZE) { |
eeca86db288b
Oops, I forgot to move the size check to the new location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31768
diff
changeset
|
110 /* Invalid packet length */ |
eeca86db288b
Oops, I forgot to move the size check to the new location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31768
diff
changeset
|
111 len = 0; |
eeca86db288b
Oops, I forgot to move the size check to the new location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31768
diff
changeset
|
112 break; |
eeca86db288b
Oops, I forgot to move the size check to the new location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31768
diff
changeset
|
113 } |
eeca86db288b
Oops, I forgot to move the size check to the new location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31768
diff
changeset
|
114 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
115 header->session_id = msn_pop32le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
116 header->id = msn_pop32le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
117 header->offset = msn_pop64le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
118 header->total_size = msn_pop64le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
119 header->length = msn_pop32le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
120 header->flags = msn_pop32le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
121 header->ack_id = msn_pop32le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
122 header->ack_sub_id = msn_pop32le(wire); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
123 header->ack_size = msn_pop64le(wire); |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
124 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
125 len = P2P_PACKET_HEADER_SIZE; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
126 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
127 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
128 |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
129 case MSN_P2P_VERSION_TWO: { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
130 MsnP2Pv2Header *header = &info->header.v2; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
131 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
132 header->header_len = msn_pop8(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
133 header->opcode = msn_pop8(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
134 header->message_len = msn_pop16be(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
135 header->base_id = msn_pop32be(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
136 if (header->header_len + header->message_len + P2P_PACKET_FOOTER_SIZE > max_len) { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
137 /* Invalid header and data length */ |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
138 len = 0; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
139 break; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
140 } |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
141 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
142 if (header->header_len > 8) { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
143 header->header_tlv = msn_tlvlist_read(wire, header->header_len - 8); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
144 wire += header->header_len - 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
145 } |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
146 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
147 if (header->message_len > 0) { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
148 /* Parse Data packet */ |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
149 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
150 header->data_header_len = msn_pop8(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
151 if (header->data_header_len > header->message_len) { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
152 /* Invalid data header length */ |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
153 len = 0; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
154 break; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
155 } |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
156 header->data_tf = msn_pop8(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
157 header->package_number = msn_pop16be(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
158 header->session_id = msn_pop32be(wire); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
159 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
160 if (header->data_header_len > 8) { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
161 header->data_tlv = msn_tlvlist_read(wire, header->data_header_len - 8); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
162 wire += header->data_header_len - 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
163 } |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
164 } |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
165 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
166 len = header->header_len + header->message_len; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
167 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
168 break; |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
169 } |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
170 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
171 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
172 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
173 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
174 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
175 return len; |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
176 } |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
177 |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
178 char * |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
179 msn_p2p_header_to_wire(MsnP2PInfo *info, size_t *len) |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
180 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
181 char *wire = NULL; |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
182 char *tmp; |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31491
diff
changeset
|
183 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
184 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
185 case MSN_P2P_VERSION_ONE: { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
186 MsnP2PHeader *header = &info->header.v1; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
187 tmp = wire = g_new(char, P2P_PACKET_HEADER_SIZE); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
188 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
189 msn_push32le(tmp, header->session_id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
190 msn_push32le(tmp, header->id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
191 msn_push64le(tmp, header->offset); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
192 msn_push64le(tmp, header->total_size); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
193 msn_push32le(tmp, header->length); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
194 msn_push32le(tmp, header->flags); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
195 msn_push32le(tmp, header->ack_id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
196 msn_push32le(tmp, header->ack_sub_id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
197 msn_push64le(tmp, header->ack_size); |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
198 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
199 if (len) |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
200 *len = P2P_PACKET_HEADER_SIZE; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
201 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
202 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
203 } |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
204 |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
205 case MSN_P2P_VERSION_TWO: { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
206 MsnP2Pv2Header *header = &info->header.v2; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
207 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
208 if (header->header_tlv != NULL) |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
209 header->header_len = msn_tlvlist_size(header->header_tlv) + 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
210 else |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
211 header->header_len = 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
212 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
213 if (header->data_tlv != NULL) |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
214 header->data_header_len = msn_tlvlist_size(header->data_tlv) + 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
215 else |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
216 header->data_header_len = 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
217 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
218 tmp = wire = g_new(char, header->header_len + header->data_header_len); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
219 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
220 msn_push8(tmp, header->header_len); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
221 msn_push8(tmp, header->opcode); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
222 msn_push16be(tmp, header->data_header_len + header->message_len); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
223 msn_push32be(tmp, header->base_id); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
224 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
225 if (header->header_tlv != NULL) { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
226 msn_tlvlist_write(tmp, header->header_len - 8, header->header_tlv); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
227 tmp += header->header_len - 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
228 } |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
229 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
230 msn_push8(tmp, header->data_header_len); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
231 msn_push8(tmp, header->data_tf); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
232 msn_push16be(tmp, header->package_number); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
233 msn_push32be(tmp, header->session_id); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
234 |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
235 if (header->data_tlv != NULL) { |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
236 msn_tlvlist_write(tmp, header->data_header_len - 8, header->data_tlv); |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
237 tmp += header->data_header_len - 8; |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
238 } |
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
239 |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
240 if (len) |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
241 *len = header->header_len + header->data_header_len; |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
242 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
243 break; |
31771
b8e076d51817
Add P2Pv2 parsing and saving functions. Tested by compiling them!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31769
diff
changeset
|
244 } |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
245 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
246 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
247 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
248 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
249 |
31209
198d5bf82e09
Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents:
31206
diff
changeset
|
250 return wire; |
198d5bf82e09
Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents:
31206
diff
changeset
|
251 |
31206
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
252 } |
f66e289bebc6
Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff
changeset
|
253 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
254 size_t |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
255 msn_p2p_footer_from_wire(MsnP2PInfo *info, const char *wire) |
31220 | 256 { |
257 MsnP2PFooter *footer; | |
258 | |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
259 footer = &info->footer; |
31220 | 260 |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
261 footer->value = msn_pop32be(wire); |
31220 | 262 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
263 return P2P_PACKET_FOOTER_SIZE; |
31220 | 264 } |
265 | |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
266 char * |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
267 msn_p2p_footer_to_wire(MsnP2PInfo *info, size_t *len) |
31220 | 268 { |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
269 MsnP2PFooter *footer; |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
270 char *wire; |
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
271 char *tmp; |
31220 | 272 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
273 footer = &info->footer; |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
274 tmp = wire = g_new(char, P2P_PACKET_FOOTER_SIZE); |
31220 | 275 |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
276 msn_push32be(tmp, footer->value); |
31220 | 277 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
278 if (len) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
279 *len = P2P_PACKET_FOOTER_SIZE; |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
280 |
31220 | 281 return wire; |
282 } | |
283 | |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
284 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
285 msn_p2p_info_to_string(MsnP2PInfo *info, GString *str) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
286 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
287 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
288 case MSN_P2P_VERSION_ONE: { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
289 MsnP2PHeader *header = &info->header.v1; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
290 g_string_append_printf(str, "Session ID: %u\r\n", header->session_id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
291 g_string_append_printf(str, "ID: %u\r\n", header->id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
292 g_string_append_printf(str, "Offset: %" G_GUINT64_FORMAT "\r\n", header->offset); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
293 g_string_append_printf(str, "Total size: %" G_GUINT64_FORMAT "\r\n", header->total_size); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
294 g_string_append_printf(str, "Length: %u\r\n", header->length); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
295 g_string_append_printf(str, "Flags: 0x%x\r\n", header->flags); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
296 g_string_append_printf(str, "ACK ID: %u\r\n", header->ack_id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
297 g_string_append_printf(str, "SUB ID: %u\r\n", header->ack_sub_id); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
298 g_string_append_printf(str, "ACK Size: %" G_GUINT64_FORMAT "\r\n", header->ack_size); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
299 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
300 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
301 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
302 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
303 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
304 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
305 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
306 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
307 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
308 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
309 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
310 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
311 g_string_append_printf(str, "Footer: 0x%08X\r\n", info->footer.value); |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
312 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
313 |
31306
5964f65c17ed
Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents:
31220
diff
changeset
|
314 gboolean |
5964f65c17ed
Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents:
31220
diff
changeset
|
315 msn_p2p_msg_is_data(const MsnP2PHeaderFlag flags) |
5964f65c17ed
Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents:
31220
diff
changeset
|
316 { |
5964f65c17ed
Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents:
31220
diff
changeset
|
317 return (flags == P2P_MSN_OBJ_DATA || |
31417
f26e961e1274
Fix the name of this flag.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31412
diff
changeset
|
318 flags == (P2P_WLM2009_COMP | P2P_MSN_OBJ_DATA) || |
31306
5964f65c17ed
Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents:
31220
diff
changeset
|
319 flags == P2P_FILE_DATA); |
5964f65c17ed
Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents:
31220
diff
changeset
|
320 } |
31491
7b771e6f1142
Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31417
diff
changeset
|
321 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
322 gboolean |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
323 msn_p2p_info_is_valid(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
324 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
325 gboolean valid = FALSE; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
326 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
327 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
328 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
329 valid = info->header.v1.total_size >= info->header.v1.length; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
330 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
331 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
332 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
333 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
334 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
335 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
336 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
337 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
338 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
339 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
340 return valid; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
341 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
342 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
343 gboolean |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
344 msn_p2p_info_is_final(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
345 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
346 gboolean final = FALSE; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
347 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
348 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
349 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
350 final = info->header.v1.offset + info->header.v1.length >= info->header.v1.total_size; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
351 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
352 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
353 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
354 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
355 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
356 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
357 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
358 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
359 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
360 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
361 return final; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
362 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
363 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
364 guint32 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
365 msn_p2p_info_get_session_id(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
366 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
367 guint32 session_id = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
368 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
369 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
370 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
371 session_id = info->header.v1.session_id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
372 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
373 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
374 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
375 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
376 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
377 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
378 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
379 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
380 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
381 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
382 return session_id; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
383 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
384 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
385 guint32 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
386 msn_p2p_info_get_id(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
387 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
388 guint32 id = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
389 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
390 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
391 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
392 id = info->header.v1.id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
393 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
394 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
395 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
396 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
397 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
398 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
399 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
400 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
401 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
402 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
403 return id; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
404 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
405 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
406 guint64 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
407 msn_p2p_info_get_offset(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
408 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
409 guint64 offset = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
410 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
411 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
412 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
413 offset = info->header.v1.offset; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
414 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
415 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
416 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
417 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
418 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
419 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
420 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
421 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
422 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
423 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
424 return offset; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
425 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
426 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
427 guint64 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
428 msn_p2p_info_get_total_size(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
429 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
430 guint64 total_size = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
431 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
432 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
433 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
434 total_size = info->header.v1.total_size; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
435 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
436 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
437 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
438 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
439 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
440 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
441 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
442 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
443 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
444 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
445 return total_size; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
446 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
447 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
448 guint32 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
449 msn_p2p_info_get_length(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
450 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
451 guint32 length = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
452 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
453 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
454 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
455 length = info->header.v1.length; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
456 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
457 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
458 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
459 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
460 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
461 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
462 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
463 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
464 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
465 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
466 return length; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
467 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
468 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
469 guint32 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
470 msn_p2p_info_get_flags(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
471 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
472 guint32 flags = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
473 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
474 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
475 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
476 flags = info->header.v1.flags; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
477 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
478 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
479 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
480 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
481 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
482 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
483 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
484 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
485 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
486 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
487 return flags; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
488 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
489 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
490 guint32 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
491 msn_p2p_info_get_ack_id(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
492 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
493 guint32 ack_id = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
494 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
495 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
496 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
497 ack_id = info->header.v1.ack_id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
498 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
499 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
500 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
501 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
502 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
503 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
504 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
505 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
506 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
507 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
508 return ack_id; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
509 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
510 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
511 guint32 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
512 msn_p2p_info_get_ack_sub_id(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
513 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
514 guint32 ack_sub_id = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
515 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
516 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
517 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
518 ack_sub_id = info->header.v1.ack_sub_id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
519 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
520 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
521 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
522 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
523 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
524 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
525 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
526 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
527 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
528 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
529 return ack_sub_id; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
530 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
531 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
532 guint64 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
533 msn_p2p_info_get_ack_size(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
534 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
535 guint64 ack_size = 0; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
536 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
537 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
538 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
539 ack_size = info->header.v1.ack_size; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
540 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
541 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
542 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
543 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
544 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
545 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
546 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
547 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
548 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
549 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
550 return ack_size; |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
551 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
552 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
553 guint32 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
554 msn_p2p_info_get_app_id(MsnP2PInfo *info) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
555 { |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
556 return info->footer.value; |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
557 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
558 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
559 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
560 msn_p2p_info_set_session_id(MsnP2PInfo *info, guint32 session_id) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
561 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
562 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
563 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
564 info->header.v1.session_id = session_id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
565 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
566 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
567 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
568 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
569 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
570 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
571 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
572 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
573 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
574 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
575 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
576 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
577 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
578 msn_p2p_info_set_id(MsnP2PInfo *info, guint32 id) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
579 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
580 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
581 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
582 info->header.v1.id = id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
583 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
584 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
585 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
586 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
587 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
588 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
589 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
590 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
591 } |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
592 |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
593 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
594 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
595 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
596 msn_p2p_info_set_offset(MsnP2PInfo *info, guint64 offset) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
597 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
598 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
599 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
600 info->header.v1.offset = offset; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
601 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
602 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
603 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
604 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
605 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
606 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
607 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
608 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
609 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
610 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
611 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
612 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
613 msn_p2p_info_set_total_size(MsnP2PInfo *info, guint64 total_size) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
614 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
615 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
616 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
617 info->header.v1.total_size = total_size; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
618 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
619 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
620 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
621 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
622 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
623 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
624 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
625 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
626 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
627 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
628 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
629 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
630 msn_p2p_info_set_length(MsnP2PInfo *info, guint32 length) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
631 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
632 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
633 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
634 info->header.v1.length = length; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
635 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
636 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
637 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
638 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
639 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
640 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
641 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
642 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
643 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
644 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
645 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
646 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
647 msn_p2p_info_set_flags(MsnP2PInfo *info, guint32 flags) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
648 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
649 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
650 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
651 info->header.v1.flags = flags; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
652 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
653 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
654 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
655 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
656 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
657 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
658 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
659 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
660 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
661 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
662 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
663 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
664 msn_p2p_info_set_ack_id(MsnP2PInfo *info, guint32 ack_id) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
665 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
666 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
667 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
668 info->header.v1.ack_id = ack_id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
669 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
670 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
671 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
672 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
673 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
674 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
675 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
676 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
677 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
678 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
679 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
680 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
681 msn_p2p_info_set_ack_sub_id(MsnP2PInfo *info, guint32 ack_sub_id) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
682 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
683 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
684 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
685 info->header.v1.ack_sub_id = ack_sub_id; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
686 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
687 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
688 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
689 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
690 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
691 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
692 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
693 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
694 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
695 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
696 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
697 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
698 msn_p2p_info_set_ack_size(MsnP2PInfo *info, guint64 ack_size) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
699 { |
31717
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
700 switch (info->version) { |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
701 case MSN_P2P_VERSION_ONE: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
702 info->header.v1.ack_size = ack_size; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
703 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
704 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
705 case MSN_P2P_VERSION_TWO: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
706 /* Nothing to do! */ |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
707 break; |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
708 |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
709 default: |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
710 purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); |
9562a7baa9e4
Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31599
diff
changeset
|
711 } |
31599
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
712 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
713 |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
714 void |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
715 msn_p2p_info_set_app_id(MsnP2PInfo *info, guint32 app_id) |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
716 { |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
717 info->footer.value = app_id; |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
718 } |
34da321b60f1
Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31534
diff
changeset
|
719 |