Mercurial > pidgin.yaz
annotate src/proxy.h @ 14108:7a205b430d19
[gaim-migrate @ 16742]
Removing the "error_cb" parameter for gaim_proxy_connect(), changing it
back to how it was. As I started making changes to oscar to support
canceling connection attempts, I realized that having a separate callback
for errors would result in more code duplication than was needed.
Originally I thought the separate callback would make things cleaner.
Anyway, sorry for the noise.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 14 Aug 2006 04:43:38 +0000 |
parents | eec0c7fd8529 |
children | c3167a1dd817 |
rev | line source |
---|---|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4634
diff
changeset
|
1 /** |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
2 * @file proxy.h Proxy API |
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4634
diff
changeset
|
3 * @ingroup core |
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4634
diff
changeset
|
4 * |
1 | 5 * gaim |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
1 | 10 * |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
25 #ifndef _GAIM_PROXY_H_ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
26 #define _GAIM_PROXY_H_ |
1 | 27 |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1881
diff
changeset
|
28 #include <glib.h> |
8273
f24172f53650
[gaim-migrate @ 8997]
Christian Hammond <chipx86@chipx86.com>
parents:
8262
diff
changeset
|
29 #include "eventloop.h" |
1 | 30 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
31 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
32 * A type of proxy connection. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
33 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
34 typedef enum |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
35 { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
36 GAIM_PROXY_USE_GLOBAL = -1, /**< Use the global proxy information. */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
37 GAIM_PROXY_NONE = 0, /**< No proxy. */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
38 GAIM_PROXY_HTTP, /**< HTTP proxy. */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
39 GAIM_PROXY_SOCKS4, /**< SOCKS 4 proxy. */ |
6621 | 40 GAIM_PROXY_SOCKS5, /**< SOCKS 5 proxy. */ |
41 GAIM_PROXY_USE_ENVVAR /**< Use environmental settings. */ | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
42 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
43 } GaimProxyType; |
1 | 44 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
45 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
46 * Information on proxy settings. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
47 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
48 typedef struct |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
49 { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
50 GaimProxyType type; /**< The proxy type. */ |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1843
diff
changeset
|
51 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
52 char *host; /**< The host. */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
53 int port; /**< The port number. */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
54 char *username; /**< The username. */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
55 char *password; /**< The password. */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
56 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
57 } GaimProxyInfo; |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
58 |
14090 | 59 typedef struct _GaimProxyConnectInfo GaimProxyConnectInfo; |
14089 | 60 |
14108 | 61 typedef void (*GaimProxyConnectFunction)(gpointer data, gint source, const gchar *error_message); |
14089 | 62 |
63 /** | |
64 * The "hosts" parameter is a linked list containing pairs of | |
65 * one size_t addrlen and one struct sockaddr *addr. | |
66 */ | |
67 typedef void (*GaimProxyDnsConnectFunction)(GSList *hosts, gpointer data, const char *error_message); | |
68 | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
69 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
70 #include "account.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
71 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
72 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
73 extern "C" { |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
74 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
75 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
76 /**************************************************************************/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
77 /** @name Proxy structure API */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
78 /**************************************************************************/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
79 /*@{*/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
80 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
81 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
82 * Creates a proxy information structure. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
83 * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
84 * @return The proxy information structure. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
85 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
86 GaimProxyInfo *gaim_proxy_info_new(void); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
87 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
88 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
89 * Destroys a proxy information structure. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
90 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
91 * @param info The proxy information structure to destroy. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
92 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
93 void gaim_proxy_info_destroy(GaimProxyInfo *info); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
94 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
95 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
96 * Sets the type of proxy. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
97 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
98 * @param info The proxy information. |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
99 * @param type The proxy type. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
100 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
101 void gaim_proxy_info_set_type(GaimProxyInfo *info, GaimProxyType type); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
102 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
103 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
104 * Sets the proxy host. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
105 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
106 * @param info The proxy information. |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
107 * @param host The host. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
108 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
109 void gaim_proxy_info_set_host(GaimProxyInfo *info, const char *host); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
110 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
111 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
112 * Sets the proxy port. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
113 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
114 * @param info The proxy information. |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
115 * @param port The port. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
116 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
117 void gaim_proxy_info_set_port(GaimProxyInfo *info, int port); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
118 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
119 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
120 * Sets the proxy username. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
121 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
122 * @param info The proxy information. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
123 * @param username The username. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
124 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
125 void gaim_proxy_info_set_username(GaimProxyInfo *info, const char *username); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
126 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
127 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
128 * Sets the proxy password. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
129 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
130 * @param info The proxy information. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
131 * @param password The password. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
132 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
133 void gaim_proxy_info_set_password(GaimProxyInfo *info, const char *password); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
134 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
135 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
136 * Returns the proxy's type. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
137 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
138 * @param info The proxy information. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
139 * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
140 * @return The type. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
141 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
142 GaimProxyType gaim_proxy_info_get_type(const GaimProxyInfo *info); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
143 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
144 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
145 * Returns the proxy's host. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
146 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
147 * @param info The proxy information. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
148 * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
149 * @return The host. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
150 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
151 const char *gaim_proxy_info_get_host(const GaimProxyInfo *info); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
152 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
153 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
154 * Returns the proxy's port. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
155 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
156 * @param info The proxy information. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
157 * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
158 * @return The port. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
159 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
160 int gaim_proxy_info_get_port(const GaimProxyInfo *info); |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1881
diff
changeset
|
161 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
162 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
163 * Returns the proxy's username. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
164 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
165 * @param info The proxy information. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
166 * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
167 * @return The username. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
168 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
169 const char *gaim_proxy_info_get_username(const GaimProxyInfo *info); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
170 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
171 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
172 * Returns the proxy's password. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
173 * |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
174 * @param info The proxy information. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
175 * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
176 * @return The password. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
177 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
178 const char *gaim_proxy_info_get_password(const GaimProxyInfo *info); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
179 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
180 /*@}*/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
181 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
182 /**************************************************************************/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
183 /** @name Global Proxy API */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
184 /**************************************************************************/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
185 /*@{*/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
186 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
187 /** |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
188 * Returns gaim's global proxy information. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
189 * |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
190 * @return The global proxy information. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
191 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
192 GaimProxyInfo *gaim_global_proxy_get_info(void); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
193 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
194 /*@}*/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
195 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
196 /**************************************************************************/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
197 /** @name Proxy API */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
198 /**************************************************************************/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
199 /*@{*/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
200 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
201 /** |
14089 | 202 * Returns the proxy subsystem handle. |
203 * | |
204 * @return The proxy subsystem handle. | |
205 */ | |
206 void *gaim_proxy_get_handle(void); | |
207 | |
208 /** | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
209 * Initializes the proxy subsystem. |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
210 */ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
211 void gaim_proxy_init(void); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
212 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
213 /** |
14089 | 214 * Uninitializes the proxy subsystem. |
215 */ | |
216 void gaim_proxy_uninit(void); | |
217 | |
218 /** | |
13514 | 219 * Returns configuration of a proxy. |
220 * | |
221 * @param account The account for which the configuration is needed. | |
222 * | |
223 * @return The configuration of a proxy. | |
224 */ | |
225 GaimProxyInfo *gaim_proxy_get_setup(GaimAccount *account); | |
226 | |
227 /** | |
14089 | 228 * Makes a connection to the specified host and port. Note that this |
229 * function name can be misleading--although it is called "proxy | |
230 * connect," it is used for establishing any outgoing TCP connection, | |
231 * whether through a proxy or not. | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
232 * |
14089 | 233 * @param account The account making the connection. |
234 * @param host The destination host. | |
235 * @param port The destination port. | |
236 * @param connect_cb The function to call when the connection is | |
14108 | 237 * established. If the connection failed then |
238 * fd will be -1 and error message will be set | |
239 * to something descriptive (hopefully). | |
14089 | 240 * @param data User-defined data. |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
241 * |
14089 | 242 * @return NULL if there was an error, or a reference to a data |
243 * structure that can be used to cancel the pending | |
244 * connection, if needed. | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
245 */ |
14089 | 246 GaimProxyConnectInfo *gaim_proxy_connect(GaimAccount *account, |
247 const char *host, int port, | |
14108 | 248 GaimProxyConnectFunction connect_cb, gpointer data); |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
249 |
8262 | 250 /** |
251 * Makes a connection through a SOCKS5 proxy. | |
252 * | |
14089 | 253 * @param gpi The GaimProxyInfo specifying the proxy settings |
254 * @param host The destination host. | |
255 * @param port The destination port. | |
256 * @param connect_cb The function to call when the connection is | |
14108 | 257 * established. If the connection failed then |
258 * fd will be -1 and error message will be set | |
259 * to something descriptive (hopefully). | |
14089 | 260 * @param data User-defined data. |
8262 | 261 * |
14089 | 262 * @return NULL if there was an error, or a reference to a data |
263 * structure that can be used to cancel the pending | |
264 * connection, if needed. | |
8262 | 265 */ |
14089 | 266 GaimProxyConnectInfo *gaim_proxy_connect_socks5(GaimProxyInfo *gpi, |
267 const char *host, int port, | |
14108 | 268 GaimProxyConnectFunction connect_cb, gpointer data); |
8262 | 269 |
11428 | 270 /** |
14103 | 271 * Cancel an in-progress connection attempt. This should be called |
272 * by the PRPL if the user disables an account while it is still | |
273 * performing the initial sign on. Or when establishing a file | |
274 * transfer, if we attempt to connect to a remote user but they | |
275 * are behind a firewall then the PRPL can cancel the connection | |
276 * attempt early rather than just letting the OS's TCP/IP stack | |
277 * time-out the connection. | |
278 */ | |
279 void gaim_proxy_connect_cancel(GaimProxyConnectInfo *connect_info); | |
280 | |
281 /** | |
11428 | 282 * Do an async dns query |
283 * | |
284 * @param hostname The hostname to resolve | |
285 * @param port A portnumber which is stored in the struct sockaddr | |
286 * @param callback Callback to call after resolving | |
287 * @param data Extra data for the callback function | |
13313
403a97caf5c0
[gaim-migrate @ 15679]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
288 * |
403a97caf5c0
[gaim-migrate @ 15679]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
289 * @return Zero indicates the connection is pending. Any other value indicates failure. |
11428 | 290 */ |
14089 | 291 int gaim_gethostbyname_async(const char *hostname, int port, GaimProxyDnsConnectFunction callback, gpointer data); |
11428 | 292 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
293 /*@}*/ |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
294 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
295 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
296 } |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
297 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
298 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
299 #endif /* _GAIM_PROXY_H_ */ |