annotate libpurple/protocols/msn/p2p.c @ 31717:9562a7baa9e4

Add P2Pv2 header information to the P2P info struct. Of course, all the v2 stuff does nothing right now.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 28 Feb 2011 00:19:29 +0000
parents 34da321b60f1
children 8cf9270acf4c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"
31491
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31417
diff changeset
29 #include "msnutils.h"
31206
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
30
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
31 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
32 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
33 {
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
34 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
35 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
36
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 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
38 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
39 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
40 /* 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
41 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
42
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 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
44 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
45 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
46 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
47 }
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 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
50 }
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 MsnP2PInfo *
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
53 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
54 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
55 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
56
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 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
58
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 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
60 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
61 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
62 *new_info = *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
63 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
64
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 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
66 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
67 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
68 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
69 }
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
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
71 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
72 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
73
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
74 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
75 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
76 {
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
77 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
78 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
79 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
80 /* 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
81 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
82
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 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
84 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
85 }
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
86
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
87 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
88 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
89
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
90 size_t
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
91 msn_p2p_header_from_wire(MsnP2PInfo *info, const char *wire)
31206
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
92 {
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
93 size_t len;
31206
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
94
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
95 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
96 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
97 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
98
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
99 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
100 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
101 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
102 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
103 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
104 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
105 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
106 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
107 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
108
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
109 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
110 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
111 }
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
112
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
113 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
114 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
115
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 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
117 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
118 }
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
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 return len;
31206
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
121 }
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
122
31491
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31417
diff changeset
123 char *
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
124 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
125 {
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
126 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
127 char *tmp;
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 31491
diff changeset
128
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
129 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
130 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
131 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
132 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
133
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
134 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
135 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
136 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
137 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
138 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
139 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
140 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
141 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
142 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
143
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
144 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
145 *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
146
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
147 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
148 }
31206
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
149
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
150 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
151 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
152 *len = 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
153
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
154 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
155
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
156 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
157 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
158 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
159
31209
198d5bf82e09 Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents: 31206
diff changeset
160 return wire;
198d5bf82e09 Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents: 31206
diff changeset
161
31206
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
162 }
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
163
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
164 size_t
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
165 msn_p2p_footer_from_wire(MsnP2PInfo *info, const char *wire)
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
166 {
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
167 MsnP2PFooter *footer;
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
168
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
169 footer = &info->footer;
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
170
31491
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31417
diff changeset
171 footer->value = msn_pop32be(wire);
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
172
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
173 return P2P_PACKET_FOOTER_SIZE;
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
174 }
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
175
31491
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31417
diff changeset
176 char *
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
177 msn_p2p_footer_to_wire(MsnP2PInfo *info, size_t *len)
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
178 {
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
179 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
180 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
181 char *tmp;
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
182
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
183 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
184 tmp = wire = g_new(char, P2P_PACKET_FOOTER_SIZE);
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
185
31491
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31417
diff changeset
186 msn_push32be(tmp, footer->value);
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
187
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
188 if (len)
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
189 *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
190
31220
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
191 return wire;
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
192 }
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 31209
diff changeset
193
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
194 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
195 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
196 {
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
197 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
198 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
199 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
200 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
201 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
202 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
203 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
204 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
205 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
206 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
207 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
208 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
209
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
210 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
211 }
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
212
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
213 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
214 /* 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
215 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
216
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
217 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
218 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
219 }
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
220
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
221 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
222 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
223
31306
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 31220
diff changeset
224 gboolean
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 31220
diff changeset
225 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
226 {
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 31220
diff changeset
227 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
228 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
229 flags == P2P_FILE_DATA);
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 31220
diff changeset
230 }
31491
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31417
diff changeset
231
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
232 gboolean
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
233 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
234 {
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
235 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
236
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
237 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
238 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
239 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
240 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
241
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 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
243 /* 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
244 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
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 }
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
249
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
250 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
251 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
252
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
253 gboolean
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
254 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
255 {
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
256 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
257
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
258 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
259 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
260 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
261 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
262
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
263 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
264 /* 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
265 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
266
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
267 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
268 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
269 }
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
270
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
271 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
272 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
273
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
274 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
275 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
276 {
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
277 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
278
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
279 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
280 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
281 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
282 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
283
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
284 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
285 /* 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
286 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
287
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 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
289 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
290 }
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
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 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
293 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
294
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
295 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
296 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
297 {
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
298 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
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 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
301 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
302 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
303 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
304
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 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
306 /* 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
307 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
308
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 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
310 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
311 }
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
312
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
313 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
314 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
315
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
316 guint64
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
317 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
318 {
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
319 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
320
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
321 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
322 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
323 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
324 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
325
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 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
327 /* 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
328 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
329
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 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
331 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
332 }
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
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 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
335 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
336
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
337 guint64
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
338 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
339 {
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
340 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
341
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
342 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
343 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
344 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
345 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
346
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 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
348 /* 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
349 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
350
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 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
352 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
353 }
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
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 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
356 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
357
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
358 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
359 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
360 {
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
361 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
362
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
363 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
364 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
365 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
366 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
367
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 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
369 /* 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
370 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
371
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 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
373 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
374 }
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
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 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
377 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
378
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
379 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
380 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
381 {
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
382 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
383
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
384 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
385 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
386 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
387 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
388
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 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
390 /* 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
391 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
392
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 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
394 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
395 }
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
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 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
398 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
399
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
400 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
401 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
402 {
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
403 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
404
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
405 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
406 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
407 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
408 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
409
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 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
411 /* 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
412 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
413
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 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
415 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
416 }
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
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 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
419 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
420
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
421 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
422 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
423 {
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
424 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
425
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
426 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
427 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
428 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
429 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
430
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 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
432 /* 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
433 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
434
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 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
436 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
437 }
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
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 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
440 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
441
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
442 guint64
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
443 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
444 {
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
445 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
446
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
447 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
448 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
449 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
450 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
451
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 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
453 /* 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
454 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
455
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 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
457 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
458 }
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
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 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
461 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
462
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
463 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
464 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
465 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
466 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
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 void
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_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
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 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
473 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
474 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
475 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
476
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 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
478 /* 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
479 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
480
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 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
482 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
483 }
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
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
485 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
486
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
487 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
488 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
489 {
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
490 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
491 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
492 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
493 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
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 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
496 /* 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
497 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
498
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 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
500 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
501 }
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
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
503 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
504
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
505 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
506 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
507 {
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
508 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
509 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
510 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
511 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
512
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
513 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
514 /* 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
515 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
516
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 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
518 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
519 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
520 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
521
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
522 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
523 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
524 {
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
525 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
526 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
527 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
528 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
529
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
530 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
531 /* 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
532 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
533
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
534 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
535 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
536 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
537 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
538
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
539 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
540 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
541 {
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
542 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
543 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
544 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
545 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
546
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 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
548 /* 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
549 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
550
9562a7baa9e4 Add P2Pv2 header information to the P2P info struct. Of course, all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31599
diff changeset
551 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
552 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
553 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
554 }
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 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
557 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
558 {
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
559 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
560 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
561 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
562 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
563
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 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
565 /* 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
566 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
567
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 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
569 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
570 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
571 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
572
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
573 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
574 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
575 {
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
576 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
577 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
578 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
579 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
580
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_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
582 /* 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
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 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
586 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
587 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
588 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
589
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
590 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
591 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
592 {
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
593 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
594 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
595 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
596 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
597
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 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
599 /* 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
600 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
601
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 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
603 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
604 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
605 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
606
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
607 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
608 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
609 {
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
610 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
611 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
612 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
613 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
614
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 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
616 /* 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
617 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
618
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 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
620 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
621 }
31599
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
622 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
623
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
624 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
625 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
626 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
627 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
628 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
629