1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>soup-dns</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.0">
<link rel="start" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch03.html" title="libsoup internals">
<link rel="prev" href="ch03.html" title="libsoup internals">
<link rel="next" href="libsoup-soup-ssl.html" title="soup-ssl">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="libsoup Tutorial">
<link rel="chapter" href="ch02.html" title="libsoup API Reference">
<link rel="chapter" href="ch03.html" title="libsoup internals">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch03.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libsoup Reference Manual</th>
<td><a accesskey="n" href="libsoup-soup-ssl.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id366182" class="shortcut">Top</a>
 | 
<a href="#id417279" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libsoup-soup-dns"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id366182"></a><span class="refentrytitle">soup-dns</span>
</h2>
<p>soup-dns — Low-level DNS routines</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
void <a href="libsoup-soup-dns.html#soup-dns-init">soup_dns_init</a> (void);
char* <a href="libsoup-soup-dns.html#soup-dns-ntop">soup_dns_ntop</a> (struct sockaddr *sa);
typedef <a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>;
<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);
<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);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>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);
void (<a href="libsoup-soup-dns.html#SoupDNSCallback">*SoupDNSCallback</a>) (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> success,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
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,
<a
href="../glib/glib-The-Main-Event-Loop.html#GMainContext"
>GMainContext</a> *async_context,
<a href="libsoup-soup-dns.html#SoupDNSCallback">SoupDNSCallback</a> callback,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
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);
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);
struct sockaddr* <a href="libsoup-soup-dns.html#soup-dns-lookup-get-address">soup_dns_lookup_get_address</a>
(<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);
void <a href="libsoup-soup-dns.html#soup-dns-lookup-free">soup_dns_lookup_free</a> (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id417279"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id417296"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id417308"></a><h3>
<a name="soup-dns-init"></a>soup_dns_init ()</h3>
<a class="indexterm" name="id417321"></a><pre class="programlisting">void soup_dns_init (void);</pre>
<p>
Initializes the libsoup DNS system. Must be called before any other
soup_dns method is called. Normally this gets called automatically
by <a href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>'s class_init function.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id413064"></a><h3>
<a name="soup-dns-ntop"></a>soup_dns_ntop ()</h3>
<a class="indexterm" name="id413077"></a><pre class="programlisting">char* soup_dns_ntop (struct sockaddr *sa);</pre>
<p>
Converts <em class="parameter"><code>sa</code></em>'s address into textual form (eg, "141.213.8.59"), like
the standard library function <code class="function">inet_ntop()</code>, except that the returned
string must be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>sa</code></em> :</span></td>
<td> pointer to a <span class="type">sockaddr</span>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the text form or <em class="parameter"><code>sa</code></em>, which must be freed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id413172"></a><h3>
<a name="SoupDNSLookup"></a>SoupDNSLookup</h3>
<a class="indexterm" name="id413185"></a><pre class="programlisting">typedef struct SoupDNSLookup SoupDNSLookup;
</pre>
<p>
An opaque type that represents a DNS lookup operation.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id413206"></a><h3>
<a name="soup-dns-lookup-name"></a>soup_dns_lookup_name ()</h3>
<a class="indexterm" name="id413219"></a><pre class="programlisting"><a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* soup_dns_lookup_name (const char *name);</pre>
<p>
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
<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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
<td> a hostname (eg, "www.gnome.org") or physical address
(eg, "12.107.209.247").
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>, which should eventually be freed with
<a href="libsoup-soup-dns.html#soup-dns-lookup-free"><code class="function">soup_dns_lookup_free()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id403640"></a><h3>
<a name="soup-dns-lookup-address"></a>soup_dns_lookup_address ()</h3>
<a class="indexterm" name="id403653"></a><pre class="programlisting"><a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a>* soup_dns_lookup_address (struct sockaddr *sockaddr);</pre>
<p>
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
<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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>sockaddr</code></em> :</span></td>
<td> pointer to a <span class="type">sockaddr</span>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>, which should eventually be freed with
<a href="libsoup-soup-dns.html#soup-dns-lookup-free"><code class="function">soup_dns_lookup_free()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id403779"></a><h3>
<a name="soup-dns-lookup-resolve"></a>soup_dns_lookup_resolve ()</h3>
<a class="indexterm" name="id403793"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> soup_dns_lookup_resolve (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
<p>
Synchronously resolves <em class="parameter"><code>lookup</code></em>. You can cancel a pending resolution
using <a href="libsoup-soup-dns.html#soup-dns-lookup-cancel"><code class="function">soup_dns_lookup_cancel()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>lookup</code></em> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> success or failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id403883"></a><h3>
<a name="SoupDNSCallback"></a>SoupDNSCallback ()</h3>
<a class="indexterm" name="id403896"></a><pre class="programlisting">void (*SoupDNSCallback) (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> success,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>lookup</code></em> :</span></td>
<td> the completed lookup
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>success</code></em> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if <em class="parameter"><code>lookup</code></em> completed successfully, <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> if it failed
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td> the data passed to <a href="libsoup-soup-dns.html#soup-dns-lookup-resolve-async"><code class="function">soup_dns_lookup_resolve_async()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id404041"></a><h3>
<a name="soup-dns-lookup-resolve-async"></a>soup_dns_lookup_resolve_async ()</h3>
<a class="indexterm" name="id404054"></a><pre class="programlisting">void soup_dns_lookup_resolve_async (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup,
<a
href="../glib/glib-The-Main-Event-Loop.html#GMainContext"
>GMainContext</a> *async_context,
<a href="libsoup-soup-dns.html#SoupDNSCallback">SoupDNSCallback</a> callback,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
Tries to asynchronously resolve <em class="parameter"><code>lookup</code></em>. Invokes <em class="parameter"><code>callback</code></em> when it
has succeeded or failed. You can cancel a pending resolution using
<a href="libsoup-soup-dns.html#soup-dns-lookup-cancel"><code class="function">soup_dns_lookup_cancel()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>lookup</code></em> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>async_context</code></em> :</span></td>
<td> <a
href="../glib/glib-The-Main-Event-Loop.html#GMainContext"
><span class="type">GMainContext</span></a> to call <em class="parameter"><code>callback</code></em> in
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>callback</code></em> :</span></td>
<td> callback to call when <em class="parameter"><code>lookup</code></em> is resolved
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td> data to pass to <em class="parameter"><code>callback</code></em>;
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id417835"></a><h3>
<a name="soup-dns-lookup-cancel"></a>soup_dns_lookup_cancel ()</h3>
<a class="indexterm" name="id417848"></a><pre class="programlisting">void soup_dns_lookup_cancel (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
<p>
Cancels <em class="parameter"><code>lookup</code></em>. If <em class="parameter"><code>lookup</code></em> was running synchronously in another
thread, it will immediately return <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>. If <em class="parameter"><code>lookup</code></em> was running
asynchronously, its callback function will not be called.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>lookup</code></em> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id417938"></a><h3>
<a name="soup-dns-lookup-get-hostname"></a>soup_dns_lookup_get_hostname ()</h3>
<a class="indexterm" name="id417952"></a><pre class="programlisting">char* soup_dns_lookup_get_hostname (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
<p>
Gets the hostname of <em class="parameter"><code>lookup</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>lookup</code></em> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the hostname, which the caller owns and must free, or
<a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if <em class="parameter"><code>lookup</code></em> has not been completely resolved.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id418048"></a><h3>
<a name="soup-dns-lookup-get-address"></a>soup_dns_lookup_get_address ()</h3>
<a class="indexterm" name="id418061"></a><pre class="programlisting">struct sockaddr* soup_dns_lookup_get_address
(<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
<p>
Gets the address of <em class="parameter"><code>lookup</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>lookup</code></em> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the address, which the caller owns and must free, or
<a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if <em class="parameter"><code>lookup</code></em> has not been completely resolved.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id418159"></a><h3>
<a name="soup-dns-lookup-free"></a>soup_dns_lookup_free ()</h3>
<a class="indexterm" name="id418173"></a><pre class="programlisting">void soup_dns_lookup_free (<a href="libsoup-soup-dns.html#SoupDNSLookup">SoupDNSLookup</a> *lookup);</pre>
<p>
Frees <em class="parameter"><code>lookup</code></em>. If <em class="parameter"><code>lookup</code></em> is still running, it will be canceled
first.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>lookup</code></em> :</span></td>
<td> a <a href="libsoup-soup-dns.html#SoupDNSLookup"><span class="type">SoupDNSLookup</span></a>
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>
|