1
<html xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0">
3
3
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4
4
<title>soup-dns</title>
5
<meta name="generator" content="DocBook XSL Stylesheets V1.69.0">
5
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
6
6
<link rel="start" href="index.html" title="libsoup Reference Manual">
7
<link rel="up" href="ch01.html" title="libsoup">
8
<link rel="prev" href="SoupConnectionNTLM.html" title="SoupConnectionNTLM">
9
<link rel="next" href="SoupMessage.html" title="SoupMessage">
7
<link rel="up" href="ch03.html" title="libsoup internals">
8
<link rel="prev" href="ch03.html" title="libsoup internals">
9
<link rel="next" href="libsoup-soup-ssl.html" title="soup-ssl">
10
10
<meta name="generator" content="GTK-Doc V1.4 (XML mode)">
11
11
<link rel="stylesheet" href="style.css" type="text/css">
12
<link rel="chapter" href="ch01.html" title="libsoup">
12
<link rel="chapter" href="ch01.html" title="libsoup Tutorial">
13
<link rel="chapter" href="ch02.html" title="libsoup API Reference">
14
<link rel="chapter" href="ch03.html" title="libsoup internals">
13
15
<link rel="index" href="ix01.html" title="Index">
15
17
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
16
18
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
17
<td><a accesskey="p" href="SoupConnectionNTLM.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="p" href="ch03.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
20
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
21
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
22
<th width="100%" align="center">libsoup Reference Manual</th>
21
<td><a accesskey="n" href="SoupMessage.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<td><a accesskey="n" href="libsoup-soup-ssl.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
25
<div class="refentry" lang="en">
24
26
<a name="libsoup-soup-dns"></a><div class="titlepage"></div>
40
42
typedef <a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>;
41
43
<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* <a href="libsoup-soup-dns.html#soup-dns-lookup-name">soup_dns_lookup_name</a> (const char *name);
42
44
<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* <a href="libsoup-soup-dns.html#soup-dns-lookup-address">soup_dns_lookup_address</a> (struct sockaddr *sockaddr);
43
gboolean <a href="libsoup-soup-dns.html#soup-dns-lookup-resolve">soup_dns_lookup_resolve</a> (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);
46
href="../glib/glib-Basic-Types.html#gboolean"
47
>gboolean</a> <a href="libsoup-soup-dns.html#soup-dns-lookup-resolve">soup_dns_lookup_resolve</a> (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);
44
48
void (<a href="libsoup-soup-dns.html#SoupDNSCallback">*SoupDNSCallback</a>) (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
50
href="../glib/glib-Basic-Types.html#gboolean"
51
>gboolean</a> success,
53
href="../glib/glib-Basic-Types.html#gpointer"
54
>gpointer</a> user_data);
47
55
void <a href="libsoup-soup-dns.html#soup-dns-lookup-resolve-async">soup_dns_lookup_resolve_async</a> (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
57
href="../glib/glib-The-Main-Event-Loop.html#GMainContext"
58
>GMainContext</a> *async_context,
48
59
<a href="libsoup-soup-dns.html#SoupDNSCallback">SoupDNSCallback</a> callback,
61
href="../glib/glib-Basic-Types.html#gpointer"
62
>gpointer</a> user_data);
50
63
void <a href="libsoup-soup-dns.html#soup-dns-lookup-cancel">soup_dns_lookup_cancel</a> (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);
51
64
char* <a href="libsoup-soup-dns.html#soup-dns-lookup-get-hostname">soup_dns_lookup_get_hostname</a> (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);
52
65
struct sockaddr* <a href="libsoup-soup-dns.html#soup-dns-lookup-get-address">soup_dns_lookup_get_address</a>
57
70
<div class="refsect1" lang="en">
58
<a name="id2531204"></a><h2>Description</h2>
71
<a name="id347496"></a><h2>Description</h2>
63
76
<div class="refsect1" lang="en">
64
<a name="id2531215"></a><h2>Details</h2>
77
<a name="id347507"></a><h2>Details</h2>
65
78
<div class="refsect2" lang="en">
66
<a name="id2531221"></a><h3>
79
<a name="id347513"></a><h3>
67
80
<a name="soup-dns-init"></a>soup_dns_init ()</h3>
68
<a class="indexterm" name="id2531231"></a><pre class="programlisting">void soup_dns_init (void);</pre>
81
<a class="indexterm" name="id347523"></a><pre class="programlisting">void soup_dns_init (void);</pre>
70
83
Initializes the libsoup DNS system. Must be called before any other
71
84
soup_dns method is called. Normally this gets called automatically
78
91
<div class="refsect2" lang="en">
79
<a name="id2531265"></a><h3>
92
<a name="id347554"></a><h3>
80
93
<a name="soup-dns-ntop"></a>soup_dns_ntop ()</h3>
81
<a class="indexterm" name="id2531275"></a><pre class="programlisting">char* soup_dns_ntop (struct sockaddr *sa);</pre>
94
<a class="indexterm" name="id347564"></a><pre class="programlisting">char* soup_dns_ntop (struct sockaddr *sa);</pre>
83
96
Converts <em class="parameter"><code>sa</code></em>'s address into textual form (eg, "141.213.8.59"), like
84
97
the standard library function <code class="function">inet_ntop()</code>, except that the returned
108
121
<div class="refsect2" lang="en">
109
<a name="id2567939"></a><h3>
122
<a name="id368245"></a><h3>
110
123
<a name="SoupDNSLookup"></a>SoupDNSLookup</h3>
111
<a class="indexterm" name="id2567949"></a><pre class="programlisting">typedef struct SoupDNSLookup SoupDNSLookup;
124
<a class="indexterm" name="id368255"></a><pre class="programlisting">typedef struct SoupDNSLookup SoupDNSLookup;
114
127
An opaque type that represents a DNS lookup operation.</p>
120
133
<div class="refsect2" lang="en">
121
<a name="id2567970"></a><h3>
134
<a name="id368273"></a><h3>
122
135
<a name="soup-dns-lookup-name"></a>soup_dns_lookup_name ()</h3>
123
<a class="indexterm" name="id2567979"></a><pre class="programlisting"><a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* soup_dns_lookup_name (const char *name);</pre>
136
<a class="indexterm" name="id368283"></a><pre class="programlisting"><a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* soup_dns_lookup_name (const char *name);</pre>
125
138
Creates a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a> for <em class="parameter"><code>name</code></em>. This should be passed to
126
139
<a href="libsoup-soup-dns.html#soup-dns-lookup-resolve"><code class="function">soup_dns_lookup_resolve()</code></a> or <a href="libsoup-soup-dns.html#soup-dns-lookup-resolve-async"><code class="function">soup_dns_lookup_resolve_async()</code></a>.</p>
151
164
<div class="refsect2" lang="en">
152
<a name="id2568086"></a><h3>
165
<a name="id368389"></a><h3>
153
166
<a name="soup-dns-lookup-address"></a>soup_dns_lookup_address ()</h3>
154
<a class="indexterm" name="id2568095"></a><pre class="programlisting"><a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* soup_dns_lookup_address (struct sockaddr *sockaddr);</pre>
167
<a class="indexterm" name="id368398"></a><pre class="programlisting"><a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* soup_dns_lookup_address (struct sockaddr *sockaddr);</pre>
156
169
Creates a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a> for <em class="parameter"><code>sockaddr</code></em>. This should be passed to
157
170
<a href="libsoup-soup-dns.html#soup-dns-lookup-resolve"><code class="function">soup_dns_lookup_resolve()</code></a> or <a href="libsoup-soup-dns.html#soup-dns-lookup-resolve-async"><code class="function">soup_dns_lookup_resolve_async()</code></a>.</p>
181
194
<div class="refsect2" lang="en">
182
<a name="id2536979"></a><h3>
195
<a name="id368755"></a><h3>
183
196
<a name="soup-dns-lookup-resolve"></a>soup_dns_lookup_resolve ()</h3>
184
<a class="indexterm" name="id2536988"></a><pre class="programlisting">gboolean soup_dns_lookup_resolve (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
197
<a class="indexterm" name="id368765"></a><pre class="programlisting"><a
198
href="../glib/glib-Basic-Types.html#gboolean"
199
>gboolean</a> soup_dns_lookup_resolve (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
186
201
Synchronously resolves <em class="parameter"><code>lookup</code></em>. You can cancel a pending resolution
187
202
using <a href="libsoup-soup-dns.html#soup-dns-lookup-cancel"><code class="function">soup_dns_lookup_cancel()</code></a>.</p>
210
225
<div class="refsect2" lang="en">
211
<a name="id2537070"></a><h3>
226
<a name="id368846"></a><h3>
212
227
<a name="SoupDNSCallback"></a>SoupDNSCallback ()</h3>
213
<a class="indexterm" name="id2537080"></a><pre class="programlisting">void (*SoupDNSCallback) (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
215
gpointer user_data);</pre>
228
<a class="indexterm" name="id368855"></a><pre class="programlisting">void (*SoupDNSCallback) (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
230
href="../glib/glib-Basic-Types.html#gboolean"
231
>gboolean</a> success,
233
href="../glib/glib-Basic-Types.html#gpointer"
234
>gpointer</a> user_data);</pre>
217
236
The callback function passed to <a href="libsoup-soup-dns.html#soup-dns-lookup-resolve-async"><code class="function">soup_dns_lookup_resolve_async()</code></a>.</p>
246
265
<div class="refsect2" lang="en">
247
<a name="id2570220"></a><h3>
266
<a name="id366470"></a><h3>
248
267
<a name="soup-dns-lookup-resolve-async"></a>soup_dns_lookup_resolve_async ()</h3>
249
<a class="indexterm" name="id2570231"></a><pre class="programlisting">void soup_dns_lookup_resolve_async (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
268
<a class="indexterm" name="id366480"></a><pre class="programlisting">void soup_dns_lookup_resolve_async (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
270
href="../glib/glib-The-Main-Event-Loop.html#GMainContext"
271
>GMainContext</a> *async_context,
250
272
<a href="libsoup-soup-dns.html#SoupDNSCallback">SoupDNSCallback</a> callback,
251
gpointer user_data);</pre>
274
href="../glib/glib-Basic-Types.html#gpointer"
275
>gpointer</a> user_data);</pre>
253
277
Tries to asynchronously resolve <em class="parameter"><code>lookup</code></em>. Invokes <em class="parameter"><code>callback</code></em> when it
254
278
has succeeded or failed. You can cancel a pending resolution using
294
<span class="term"><em class="parameter"><code>async_context</code></em> :</span></td>
296
href="../glib/glib-The-Main-Event-Loop.html#GMainContext"
297
><span class="type">GMainContext</span></a> to call <em class="parameter"><code>callback</code></em> in
270
302
<span class="term"><em class="parameter"><code>callback</code></em> :</span></td>
271
303
<td> callback to call when <em class="parameter"><code>lookup</code></em> is resolved
284
316
<div class="refsect2" lang="en">
285
<a name="id2570365"></a><h3>
317
<a name="id366642"></a><h3>
286
318
<a name="soup-dns-lookup-cancel"></a>soup_dns_lookup_cancel ()</h3>
287
<a class="indexterm" name="id2570374"></a><pre class="programlisting">void soup_dns_lookup_cancel (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
319
<a class="indexterm" name="id366652"></a><pre class="programlisting">void soup_dns_lookup_cancel (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
289
321
Cancels <em class="parameter"><code>lookup</code></em>. If <em class="parameter"><code>lookup</code></em> was running synchronously in another
290
322
thread, it will immediately return <code class="literal">FALSE</code>. If <em class="parameter"><code>lookup</code></em> was running
306
338
<div class="refsect2" lang="en">
307
<a name="id2570457"></a><h3>
339
<a name="id366731"></a><h3>
308
340
<a name="soup-dns-lookup-get-hostname"></a>soup_dns_lookup_get_hostname ()</h3>
309
<a class="indexterm" name="id2570468"></a><pre class="programlisting">char* soup_dns_lookup_get_hostname (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
341
<a class="indexterm" name="id366741"></a><pre class="programlisting">char* soup_dns_lookup_get_hostname (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
311
343
Gets the hostname of <em class="parameter"><code>lookup</code></em>.</p>
335
367
<div class="refsect2" lang="en">
336
<a name="id2570555"></a><h3>
368
<a name="id366825"></a><h3>
337
369
<a name="soup-dns-lookup-get-address"></a>soup_dns_lookup_get_address ()</h3>
338
<a class="indexterm" name="id2570565"></a><pre class="programlisting">struct sockaddr* soup_dns_lookup_get_address
370
<a class="indexterm" name="id366835"></a><pre class="programlisting">struct sockaddr* soup_dns_lookup_get_address
339
371
(<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
341
373
Gets the address of <em class="parameter"><code>lookup</code></em>.</p>
365
397
<div class="refsect2" lang="en">
366
<a name="id2572701"></a><h3>
398
<a name="id361769"></a><h3>
367
399
<a name="soup-dns-lookup-free"></a>soup_dns_lookup_free ()</h3>
368
<a class="indexterm" name="id2572710"></a><pre class="programlisting">void soup_dns_lookup_free (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
400
<a class="indexterm" name="id361779"></a><pre class="programlisting">void soup_dns_lookup_free (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
370
402
Frees <em class="parameter"><code>lookup</code></em>. If <em class="parameter"><code>lookup</code></em> is still running, it will be canceled
387
419
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
388
<td align="left"><a accesskey="p" href="SoupConnectionNTLM.html"><b><< SoupConnectionNTLM</b></a></td>
389
<td align="right"><a accesskey="n" href="SoupMessage.html"><b>SoupMessage >></b></a></td>
420
<td align="left"><a accesskey="p" href="ch03.html"><b><< libsoup internals</b></a></td>
421
<td align="right"><a accesskey="n" href="libsoup-soup-ssl.html"><b>soup-ssl >></b></a></td>