annotate libpurple/protocols/msn/directconn.h @ 30037:4e532eedcab4

Save remote nonce, and verify we get the same data when initiating the direct connection. Refs #247.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 23 Apr 2010 22:38:13 +0000
parents bcb5e6c2e5a3
children a97d60c15e25
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file directconn.h MSN direct connection functions
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
4 * purple
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
19681
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 15822
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 */
28983
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 20514
diff changeset
24 #ifndef MSN_DIRECTCONN_H
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 20514
diff changeset
25 #define MSN_DIRECTCONN_H
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 typedef struct _MsnDirectConn MsnDirectConn;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
29 #include "network.h"
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
30 #include "proxy.h"
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
31 #include "circbuffer.h"
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
32
28983
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 20514
diff changeset
33 #include "msg.h"
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 #include "slp.h"
28983
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 20514
diff changeset
35 #include "slplink.h"
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
36 #include "slpmsg.h"
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
37
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
38 typedef enum
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
39 {
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
40 DC_STATE_CLOSED, /*< No socket opened yet */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
41 DC_STATE_FOO, /*< Waiting for FOO message */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
42 DC_STATE_HANDSHAKE, /*< Waiting for handshake message */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
43 DC_STATE_HANDSHAKE_REPLY, /*< Waiting for handshake reply message */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
44 DC_STATE_ESTABLISHED /*< Handshake complete */
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
45 } MsnDirectConnState;
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
46
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
47 typedef enum
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
48 {
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
49 DC_PROCESS_OK = 0,
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
50 DC_PROCESS_ERROR,
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
51 DC_PROCESS_FALLBACK,
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
52 DC_PROCESS_CLOSE
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
53
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
54 } MsnDirectConnProcessResult;
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
55
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
56 typedef struct _MsnDirectConnPacket MsnDirectConnPacket;
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
57
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
58 struct _MsnDirectConnPacket {
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
59 guint32 length;
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
60 guchar *data;
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
61
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
62 void (*sent_cb)(struct _MsnDirectConnPacket*);
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
63 MsnMessage *msg;
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
64 };
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 struct _MsnDirectConn
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 {
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
68 MsnDirectConnState state; /**< Direct connection status */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
69 MsnSlpLink *slplink; /**< The slplink using this direct connection */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
70 MsnSlpCall *slpcall; /**< The slpcall which initiated the direct connection */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
71 char *msg_body; /**< The body of message sent by send_connection_info_msg_cb */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
72 MsnSlpMessage *prev_ack; /**< The saved SLP ACK message */
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
73
30037
4e532eedcab4 Save remote nonce, and verify we get the same data when initiating the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30015
diff changeset
74 guchar nonce[16]; /**< The nonce used for direct connection handshake */
4e532eedcab4 Save remote nonce, and verify we get the same data when initiating the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30015
diff changeset
75 gchar nonce_hash[37]; /**< The hash of nonce */
4e532eedcab4 Save remote nonce, and verify we get the same data when initiating the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30015
diff changeset
76 gchar remote_nonce[37]; /**< The remote side's nonce */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
78 PurpleNetworkListenData *listen_data; /**< The pending socket creation request */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
79 PurpleProxyConnectData *connect_data; /**< The pending connection attempt */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
80 int listenfd; /**< The socket we're listening for incoming connections */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
81 guint listenfd_handle; /**< The timeout handle for incoming connection */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
82 guint connect_timeout_handle; /**< The timeout handle for outgoing connection */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
84 int fd; /**< The direct connection socket */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
85 guint recv_handle; /**< The incoming data callback handle */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
86 guint send_handle; /**< The outgoing data callback handle */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
88 gchar *in_buffer; /**< The receive buffer */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
89 int in_size; /**< The receive buffer size */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
90 int in_pos; /**< The first free position in receive buffer */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
91 GQueue *out_queue; /**< The outgoing packet queue */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
92 int msg_pos; /**< The position of next byte to be sent in the actual packet */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
94 MsnSlpHeader header; /**< SLP header for parsing / serializing */
30014
b1cda3f8fdc9 De-spacify.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30013
diff changeset
95
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
96 /** The callback used for sending information to the peer about the opened socket */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
97 void (*send_connection_info_msg_cb)(MsnDirectConn *);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
99 gchar *ext_ip; /**< Our external IP address */
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
100 int ext_port; /**< Our external port */
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
101
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
102 guint timeout_handle;
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
103 gboolean progress;
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
104
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
105 //int num_calls; /**< The number of slpcalls using this direct connection */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
108 #define DC_CONNECT_TIMEOUT 5
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
109 #define DC_TIMEOUT 60
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
110
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
111 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
112 * Queues an MSN message to be sent via direct connection.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
113 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
114 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
115 msn_dc_enqueue_msg(MsnDirectConn *dc, MsnMessage *msg);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
116
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
117 /*
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
118 * Creates, initializes, and returns a new MsnDirectConn structure.
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
119 */
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
120 MsnDirectConn *
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
121 msn_dc_new(MsnSlpCall *slplink);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
122
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
123 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
124 * Destroys an MsnDirectConn structure. Frees every buffer allocated earlier
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
125 * restores saved callbacks, etc.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
126 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
127 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
128 msn_dc_destroy(MsnDirectConn *dc);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
129
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
130 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
131 * Increases the slpcall counter in DC. The direct connection remains open
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
132 * until all slpcalls using it are destroyed.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
133 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
134 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
135 msn_dc_ref(MsnDirectConn *dc);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
136
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
137 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
138 * Decrease the slpcall counter in DC. The direct connection remains open
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
139 * until all slpcalls using it are destroyed.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
140 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
141 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
142 msn_dc_unref(MsnDirectConn *dc);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
143
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
144 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
145 * Sends a direct connect INVITE message on the associated slplink
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
146 * with the corresponding connection type and information.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
147 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
148 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
149 msn_dc_send_invite(MsnDirectConn *dc);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
150
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
151 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
152 * Sends a direct connect OK message as a response to an INVITE received earliaer
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
153 * on the corresponding slplink.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
154 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
155 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
156 msn_dc_send_ok(MsnDirectConn *dc);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
157
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
158 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
159 * This callback will be called when we're successfully connected to
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
160 * the remote host.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
161 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
162 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
163 msn_dc_connected_to_peer_cb(gpointer data, gint fd, const gchar *error_msg);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
164
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
165 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
166 * This callback will be called when we're unable to connect to
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
167 * the remote host in DC_CONNECT_TIMEOUT seconds.
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
168 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
169 gboolean
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
170 msn_dc_outgoing_connection_timeout_cb(gpointer data);
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
171
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
172 /*
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
173 * This callback will be called when the listening socket is successfully
30015
bcb5e6c2e5a3 Re-indent directconn.h, and fix a typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30014
diff changeset
174 * created and its parameters (IP/port) are available.
30013
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
175 */
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
176 void
119bd7b072eb Initial support for direct connections. Preliminary patch from ticket #247
kukkerman@gmail.com
parents: 28983
diff changeset
177 msn_dc_listen_socket_created_cb(int listenfd, gpointer data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
178
28983
462cb893521b Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <mark@kingant.net>
parents: 20514
diff changeset
179 #endif /* MSN_DIRECTCONN_H */