annotate libpurple/protocols/msn/p2p.c @ 32657:bf292bb5657e

Remove unused variable.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 13 Feb 2011 07:39:13 +0000
parents 34da321b60f1
children 9562a7baa9e4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30969
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
diff changeset
1 /**
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
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: 30868
diff changeset
3 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
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: 30868
diff changeset
5 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
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: 30868
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: 30868
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: 30868
diff changeset
9 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
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: 30868
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: 30868
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: 30868
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: 30868
diff changeset
14 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
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: 30868
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: 30868
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: 30868
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: 30868
diff changeset
19 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
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: 30868
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: 30868
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: 30868
diff changeset
23 */
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30868
diff changeset
24
30771
198d5bf82e09 Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents: 30768
diff changeset
25 #include "internal.h"
198d5bf82e09 Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents: 30768
diff changeset
26
198d5bf82e09 Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents: 30768
diff changeset
27 #include "p2p.h"
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
28 #include "msnutils.h"
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
29
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
30 MsnP2PInfo *
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
31 msn_p2p_info_new(void)
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
32 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
33 return g_new0(MsnP2PInfo, 1);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
34 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
35
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
36 MsnP2PInfo *
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
37 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: 31086
diff changeset
38 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
39 MsnP2PInfo *new_info = g_new0(MsnP2PInfo, 1);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
40 *new_info = *info;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
41 return new_info;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
42 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
43
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
44 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
45 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: 31086
diff changeset
46 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
47 g_free(info);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
48 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
49
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
50 size_t
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
51 msn_p2p_header_from_wire(MsnP2PInfo *info, const char *wire)
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
52 {
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
53 MsnP2PHeader *header;
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
54
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
55 header = &info->header;
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
56
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
57 header->session_id = msn_pop32le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
58 header->id = msn_pop32le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
59 header->offset = msn_pop64le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
60 header->total_size = msn_pop64le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
61 header->length = msn_pop32le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
62 header->flags = msn_pop32le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
63 header->ack_id = msn_pop32le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
64 header->ack_sub_id = msn_pop32le(wire);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
65 header->ack_size = msn_pop64le(wire);
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
66
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
67 return P2P_PACKET_HEADER_SIZE;
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
68 }
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
69
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
70 char *
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
71 msn_p2p_header_to_wire(MsnP2PInfo *info, size_t *len)
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
72 {
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
73 MsnP2PHeader *header;
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
74 char *wire;
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
75 char *tmp;
31086
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 31044
diff changeset
76
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
77 header = &info->header;
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
78 tmp = wire = g_new(char, P2P_PACKET_HEADER_SIZE);
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
79
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
80 msn_push32le(tmp, header->session_id);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
81 msn_push32le(tmp, header->id);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
82 msn_push64le(tmp, header->offset);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
83 msn_push64le(tmp, header->total_size);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
84 msn_push32le(tmp, header->length);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
85 msn_push32le(tmp, header->flags);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
86 msn_push32le(tmp, header->ack_id);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
87 msn_push32le(tmp, header->ack_sub_id);
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
88 msn_push64le(tmp, header->ack_size);
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
89
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
90 if (len)
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
91 *len = P2P_PACKET_HEADER_SIZE;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
92
30771
198d5bf82e09 Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents: 30768
diff changeset
93 return wire;
198d5bf82e09 Oops, forgot to save before commiting.
masca@cpw.pidgin.im
parents: 30768
diff changeset
94
30768
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
95 }
f66e289bebc6 Move parsing of the p2p header to p2p to avoid duplicated code.
masca@cpw.pidgin.im
parents:
diff changeset
96
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
97 size_t
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
98 msn_p2p_footer_from_wire(MsnP2PInfo *info, const char *wire)
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
99 {
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
100 MsnP2PFooter *footer;
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
101
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
102 footer = &info->footer;
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
103
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
104 footer->value = msn_pop32be(wire);
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
105
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
106 return P2P_PACKET_FOOTER_SIZE;
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
107 }
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
108
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
109 char *
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
110 msn_p2p_footer_to_wire(MsnP2PInfo *info, size_t *len)
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
111 {
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
112 MsnP2PFooter *footer;
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
113 char *wire;
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
114 char *tmp;
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
115
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
116 footer = &info->footer;
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
117 tmp = wire = g_new(char, P2P_PACKET_FOOTER_SIZE);
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
118
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
119 msn_push32be(tmp, footer->value);
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
120
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
121 if (len)
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
122 *len = P2P_PACKET_FOOTER_SIZE;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
123
30782
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
124 return wire;
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
125 }
3ccddae82532 Add P2PFooter helper functions.
masca@cpw.pidgin.im
parents: 30771
diff changeset
126
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
127 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
128 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: 31086
diff changeset
129 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
130 g_string_append_printf(str, "Session ID: %u\r\n", info->header.session_id);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
131 g_string_append_printf(str, "ID: %u\r\n", info->header.id);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
132 g_string_append_printf(str, "Offset: %" G_GUINT64_FORMAT "\r\n", info->header.offset);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
133 g_string_append_printf(str, "Total size: %" G_GUINT64_FORMAT "\r\n", info->header.total_size);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
134 g_string_append_printf(str, "Length: %u\r\n", info->header.length);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
135 g_string_append_printf(str, "Flags: 0x%x\r\n", info->header.flags);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
136 g_string_append_printf(str, "ACK ID: %u\r\n", info->header.ack_id);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
137 g_string_append_printf(str, "SUB ID: %u\r\n", info->header.ack_sub_id);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
138 g_string_append_printf(str, "ACK Size: %" G_GUINT64_FORMAT "\r\n", info->header.ack_size);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
139 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: 31086
diff changeset
140 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
141
30868
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 30782
diff changeset
142 gboolean
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 30782
diff changeset
143 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: 30782
diff changeset
144 {
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 30782
diff changeset
145 return (flags == P2P_MSN_OBJ_DATA ||
30974
f26e961e1274 Fix the name of this flag.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
146 flags == (P2P_WLM2009_COMP | P2P_MSN_OBJ_DATA) ||
30868
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 30782
diff changeset
147 flags == P2P_FILE_DATA);
5964f65c17ed Avoid duplicated code using a util function to check the flags.
masca@cpw.pidgin.im
parents: 30782
diff changeset
148 }
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30974
diff changeset
149
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
150 gboolean
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
151 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: 31086
diff changeset
152 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
153 return info->header.total_size >= info->header.length;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
154 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
155
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
156 gboolean
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
157 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: 31086
diff changeset
158 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
159 return info->header.offset + info->header.length >= info->header.total_size;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
160 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
161
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
162 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
163 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: 31086
diff changeset
164 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
165 return info->header.session_id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
166 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
167
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
168 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
169 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: 31086
diff changeset
170 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
171 return info->header.id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
172 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
173
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
174 guint64
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
175 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: 31086
diff changeset
176 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
177 return info->header.offset;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
178 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
179
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
180 guint64
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
181 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: 31086
diff changeset
182 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
183 return info->header.total_size;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
184 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
185
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
186 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
187 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: 31086
diff changeset
188 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
189 return info->header.length;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
190 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
191
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
192 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
193 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: 31086
diff changeset
194 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
195 return info->header.flags;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
196 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
197
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
198 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
199 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: 31086
diff changeset
200 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
201 return info->header.ack_id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
202 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
203
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
204 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
205 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: 31086
diff changeset
206 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
207 return info->header.ack_sub_id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
208 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
209
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
210 guint64
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
211 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: 31086
diff changeset
212 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
213 return info->header.ack_size;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
214 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
215
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
216 guint32
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
217 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: 31086
diff changeset
218 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
219 return info->footer.value;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
220 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
221
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
222 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
223 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: 31086
diff changeset
224 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
225 info->header.session_id = session_id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
226 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
227
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
228 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
229 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: 31086
diff changeset
230 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
231 info->header.id = id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
232 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
233
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
234 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
235 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: 31086
diff changeset
236 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
237 info->header.offset = offset;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
238 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
239
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
240 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
241 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: 31086
diff changeset
242 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
243 info->header.total_size = total_size;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
244 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
245
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
246 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
247 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: 31086
diff changeset
248 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
249 info->header.length = length;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
250 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
251
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
252 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
253 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: 31086
diff changeset
254 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
255 info->header.flags = flags;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
256 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
257
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
258 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
259 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: 31086
diff changeset
260 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
261 info->header.ack_id = ack_id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
262 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
263
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
264 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
265 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: 31086
diff changeset
266 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
267 info->header.ack_sub_id = ack_sub_id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
268 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
269
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
270 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
271 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: 31086
diff changeset
272 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
273 info->header.ack_size = ack_size;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
274 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
275
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
276 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
277 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: 31086
diff changeset
278 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
279 info->footer.value = app_id;
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
280 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
281