5
5
<title>SoupAddress</title>
6
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
7
7
<link rel="home" href="index.html" title="libsoup Reference Manual">
8
<link rel="up" href="ch02.html" title="API Reference">
9
<link rel="prev" href="ch02.html" title="API Reference">
10
<link rel="next" href="SoupAuth.html" title="SoupAuth">
11
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
8
<link rel="up" href="ch05.html" title="Low-level Networking API">
9
<link rel="prev" href="ch05.html" title="Low-level Networking API">
10
<link rel="next" href="SoupSocket.html" title="SoupSocket">
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="ch01.html" title="Tutorial">
14
<link rel="chapter" href="ch02.html" title="API Reference">
14
<link rel="chapter" href="ch02.html" title="Core API">
15
<link rel="chapter" href="ch03.html" title="Web Services APIs">
16
<link rel="chapter" href="ch04.html" title="GNOME integration">
17
<link rel="chapter" href="ch05.html" title="Low-level Networking API">
15
18
<link rel="index" href="ix01.html" title="Index">
17
20
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
18
21
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
19
22
<tr valign="middle">
20
<td><a accesskey="p" href="ch02.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
21
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
23
<td><a accesskey="p" href="ch05.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
24
<td><a accesskey="u" href="ch05.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
22
25
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
23
26
<th width="100%" align="center">libsoup Reference Manual</th>
24
<td><a accesskey="n" href="SoupAuth.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
27
<td><a accesskey="n" href="SoupSocket.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
26
<tr><td colspan="5" class="shortcuts"><nobr><a href="#SoupAddress.synopsis" class="shortcut">Top</a>
28
<a href="#SoupAddress.description" class="shortcut">Description</a>
30
<a href="#SoupAddress.object-hierarchy" class="shortcut">Object Hierarchy</a>
32
<a href="#SoupAddress.properties" class="shortcut">Properties</a></nobr></td></tr>
29
<tr><td colspan="5" class="shortcuts">
30
<a href="#SoupAddress.synopsis" class="shortcut">Top</a>
32
<a href="#SoupAddress.description" class="shortcut">Description</a>
34
<a href="#SoupAddress.object-hierarchy" class="shortcut">Object Hierarchy</a>
36
<a href="#SoupAddress.properties" class="shortcut">Properties</a>
34
39
<div class="refentry" lang="en">
35
40
<a name="SoupAddress"></a><div class="titlepage"></div>
82
87
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
83
88
>GCancellable</a> *cancellable);
90
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
91
>gboolean</a> <a class="link" href="SoupAddress.html#soup-address-is-resolved" title="soup_address_is_resolved ()">soup_address_is_resolved</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
85
const char* <a class="link" href="SoupAddress.html#soup-address-get-name" title="soup_address_get_name ()">soup_address_get_name</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
86
struct sockaddr* <a class="link" href="SoupAddress.html#soup-address-get-sockaddr" title="soup_address_get_sockaddr ()">soup_address_get_sockaddr</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
93
const char * <a class="link" href="SoupAddress.html#soup-address-get-name" title="soup_address_get_name ()">soup_address_get_name</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
94
struct sockaddr * <a class="link" href="SoupAddress.html#soup-address-get-sockaddr" title="soup_address_get_sockaddr ()">soup_address_get_sockaddr</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
88
const char* <a class="link" href="SoupAddress.html#soup-address-get-physical" title="soup_address_get_physical ()">soup_address_get_physical</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
96
const char * <a class="link" href="SoupAddress.html#soup-address-get-physical" title="soup_address_get_physical ()">soup_address_get_physical</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
90
98
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
91
99
>guint</a> <a class="link" href="SoupAddress.html#soup-address-get-port" title="soup_address_get_port ()">soup_address_get_port</a> (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
93
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-FAMILY:CAPS" title="SOUP_ADDRESS_FAMILY">SOUP_ADDRESS_FAMILY</a>
94
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-NAME:CAPS" title="SOUP_ADDRESS_NAME">SOUP_ADDRESS_NAME</a>
95
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-PHYSICAL:CAPS" title="SOUP_ADDRESS_PHYSICAL">SOUP_ADDRESS_PHYSICAL</a>
96
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-PORT:CAPS" title="SOUP_ADDRESS_PORT">SOUP_ADDRESS_PORT</a>
97
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-SOCKADDR:CAPS" title="SOUP_ADDRESS_SOCKADDR">SOUP_ADDRESS_SOCKADDR</a>
102
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
103
>gboolean</a> <a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()">soup_address_equal_by_name</a> (<a
104
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
105
>gconstpointer</a> addr1,
107
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
108
>gconstpointer</a> addr2);
110
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
111
>guint</a> <a class="link" href="SoupAddress.html#soup-address-hash-by-name" title="soup_address_hash_by_name ()">soup_address_hash_by_name</a> (<a
112
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
113
>gconstpointer</a> addr);
115
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
116
>gboolean</a> <a class="link" href="SoupAddress.html#soup-address-equal-by-ip" title="soup_address_equal_by_ip ()">soup_address_equal_by_ip</a> (<a
117
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
118
>gconstpointer</a> addr1,
120
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
121
>gconstpointer</a> addr2);
123
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
124
>guint</a> <a class="link" href="SoupAddress.html#soup-address-hash-by-ip" title="soup_address_hash_by_ip ()">soup_address_hash_by_ip</a> (<a
125
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
126
>gconstpointer</a> addr);
128
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-FAMILY--CAPS" title="SOUP_ADDRESS_FAMILY">SOUP_ADDRESS_FAMILY</a>
129
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-NAME--CAPS" title="SOUP_ADDRESS_NAME">SOUP_ADDRESS_NAME</a>
130
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-PHYSICAL--CAPS" title="SOUP_ADDRESS_PHYSICAL">SOUP_ADDRESS_PHYSICAL</a>
131
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-PORT--CAPS" title="SOUP_ADDRESS_PORT">SOUP_ADDRESS_PORT</a>
132
#define <a class="link" href="SoupAddress.html#SOUP-ADDRESS-SOCKADDR--CAPS" title="SOUP_ADDRESS_SOCKADDR">SOUP_ADDRESS_SOCKADDR</a>
100
135
<div class="refsect1" lang="en">
445
470
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
446
471
><span class="type">GCancellable</span></a> object, or <a
447
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
472
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
448
473
><code class="literal">NULL</code></a>
452
477
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
453
<td> <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-OK:CAPS"><code class="literal">SOUP_STATUS_OK</code></a>, <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANT-RESOLVE:CAPS"><code class="literal">SOUP_STATUS_CANT_RESOLVE</code></a>, or
454
<a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANCELLED:CAPS"><code class="literal">SOUP_STATUS_CANCELLED</code></a>.
478
<td> <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-OK--CAPS"><code class="literal">SOUP_STATUS_OK</code></a>, <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANT-RESOLVE--CAPS"><code class="literal">SOUP_STATUS_CANT_RESOLVE</code></a>, or
479
<a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANCELLED--CAPS"><code class="literal">SOUP_STATUS_CANCELLED</code></a>.
486
<div class="refsect2" lang="en">
487
<a name="soup-address-is-resolved"></a><h3>soup_address_is_resolved ()</h3>
488
<pre class="programlisting"><a
489
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
490
>gboolean</a> soup_address_is_resolved (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);</pre>
492
Tests if <em class="parameter"><code>addr</code></em> has already been resolved.</p>
495
<div class="variablelist"><table border="0">
496
<col align="left" valign="top">
499
<td><p><span class="term"><em class="parameter"><code>addr</code></em> :</span></p></td>
500
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
504
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
506
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
507
><code class="literal">TRUE</code></a> if <em class="parameter"><code>addr</code></em> has been resolved.
581
630
<div class="refsect2" lang="en">
582
<a name="SOUP-ADDRESS-FAMILY:CAPS"></a><h3>SOUP_ADDRESS_FAMILY</h3>
631
<a name="soup-address-equal-by-name"></a><h3>soup_address_equal_by_name ()</h3>
632
<pre class="programlisting"><a
633
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
634
>gboolean</a> soup_address_equal_by_name (<a
635
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
636
>gconstpointer</a> addr1,
638
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
639
>gconstpointer</a> addr2);</pre>
641
Tests if <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same "name". This method can be
642
used with <a class="link" href="SoupAddress.html#soup-address-hash-by-name" title="soup_address_hash_by_name ()"><code class="function">soup_address_hash_by_name()</code></a> to create a <a
643
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
644
><span class="type">GHashTable</span></a> that
645
hashes on address "names".
648
Comparing by name normally means comparing the addresses by their
649
hostnames. But if the address was originally created using an IP
650
address literal, then it will be compared by that instead.
653
In particular, if "www.example.com" has the IP address 10.0.0.1,
654
and <em class="parameter"><code>addr1</code></em> was created with the name "www.example.com" and <em class="parameter"><code>addr2</code></em>
655
was created with the name "10.0.0.1", then they will compare as
656
unequal for purposes of <a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()"><code class="function">soup_address_equal_by_name()</code></a>.
659
This would be used to distinguish hosts in situations where
660
different virtual hosts on the same IP address should be considered
661
different. Eg, for purposes of HTTP authentication or cookies, two
662
hosts with the same IP address but different names are considered
663
to be different hosts.
666
See also <a class="link" href="SoupAddress.html#soup-address-equal-by-ip" title="soup_address_equal_by_ip ()"><code class="function">soup_address_equal_by_ip()</code></a>, which compares by IP address
667
rather than by name.</p>
670
<div class="variablelist"><table border="0">
671
<col align="left" valign="top">
674
<td><p><span class="term"><em class="parameter"><code>addr1</code></em> :</span></p></td>
675
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved name
679
<td><p><span class="term"><em class="parameter"><code>addr2</code></em> :</span></p></td>
680
<td> another <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved name
684
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
685
<td> whether or not <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same name
692
<div class="refsect2" lang="en">
693
<a name="soup-address-hash-by-name"></a><h3>soup_address_hash_by_name ()</h3>
694
<pre class="programlisting"><a
695
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
696
>guint</a> soup_address_hash_by_name (<a
697
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
698
>gconstpointer</a> addr);</pre>
700
A hash function (for <a
701
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
702
><span class="type">GHashTable</span></a>) that corresponds to
703
<a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()"><code class="function">soup_address_equal_by_name()</code></a>, qv</p>
706
<div class="variablelist"><table border="0">
707
<col align="left" valign="top">
710
<td><p><span class="term"><em class="parameter"><code>addr</code></em> :</span></p></td>
711
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
715
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
716
<td> the named-based hash value for <em class="parameter"><code>addr</code></em>.
723
<div class="refsect2" lang="en">
724
<a name="soup-address-equal-by-ip"></a><h3>soup_address_equal_by_ip ()</h3>
725
<pre class="programlisting"><a
726
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
727
>gboolean</a> soup_address_equal_by_ip (<a
728
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
729
>gconstpointer</a> addr1,
731
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
732
>gconstpointer</a> addr2);</pre>
734
Tests if <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same IP address. This method
735
can be used with <a class="link" href="SoupAddress.html#soup-address-hash-by-ip" title="soup_address_hash_by_ip ()"><code class="function">soup_address_hash_by_ip()</code></a> to create a
737
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
738
><span class="type">GHashTable</span></a> that hashes on IP address.
741
This would be used to distinguish hosts in situations where
742
different virtual hosts on the same IP address should be considered
743
the same. Eg, if "www.example.com" and "www.example.net" have the
744
same IP address, then a single <span class="type">SoupConnection</span> can be used to talk
748
See also <a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()"><code class="function">soup_address_equal_by_name()</code></a>, which compares by name
749
rather than by IP address.</p>
752
<div class="variablelist"><table border="0">
753
<col align="left" valign="top">
756
<td><p><span class="term"><em class="parameter"><code>addr1</code></em> :</span></p></td>
757
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved IP address
761
<td><p><span class="term"><em class="parameter"><code>addr2</code></em> :</span></p></td>
762
<td> another <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved IP address
766
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
767
<td> whether or not <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same IP
775
<div class="refsect2" lang="en">
776
<a name="soup-address-hash-by-ip"></a><h3>soup_address_hash_by_ip ()</h3>
777
<pre class="programlisting"><a
778
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
779
>guint</a> soup_address_hash_by_ip (<a
780
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
781
>gconstpointer</a> addr);</pre>
783
A hash function (for <a
784
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
785
><span class="type">GHashTable</span></a>) that corresponds to
786
<a class="link" href="SoupAddress.html#soup-address-equal-by-ip" title="soup_address_equal_by_ip ()"><code class="function">soup_address_equal_by_ip()</code></a>, qv</p>
789
<div class="variablelist"><table border="0">
790
<col align="left" valign="top">
793
<td><p><span class="term"><em class="parameter"><code>addr</code></em> :</span></p></td>
794
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
798
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
799
<td> the IP-based hash value for <em class="parameter"><code>addr</code></em>.
806
<div class="refsect2" lang="en">
807
<a name="SOUP-ADDRESS-FAMILY--CAPS"></a><h3>SOUP_ADDRESS_FAMILY</h3>
583
808
<pre class="programlisting">#define SOUP_ADDRESS_FAMILY "family"
590
814
<div class="refsect2" lang="en">
591
<a name="SOUP-ADDRESS-NAME:CAPS"></a><h3>SOUP_ADDRESS_NAME</h3>
815
<a name="SOUP-ADDRESS-NAME--CAPS"></a><h3>SOUP_ADDRESS_NAME</h3>
592
816
<pre class="programlisting">#define SOUP_ADDRESS_NAME "name"
599
822
<div class="refsect2" lang="en">
600
<a name="SOUP-ADDRESS-PHYSICAL:CAPS"></a><h3>SOUP_ADDRESS_PHYSICAL</h3>
823
<a name="SOUP-ADDRESS-PHYSICAL--CAPS"></a><h3>SOUP_ADDRESS_PHYSICAL</h3>
601
824
<pre class="programlisting">#define SOUP_ADDRESS_PHYSICAL "physical"
608
830
<div class="refsect2" lang="en">
609
<a name="SOUP-ADDRESS-PORT:CAPS"></a><h3>SOUP_ADDRESS_PORT</h3>
831
<a name="SOUP-ADDRESS-PORT--CAPS"></a><h3>SOUP_ADDRESS_PORT</h3>
610
832
<pre class="programlisting">#define SOUP_ADDRESS_PORT "port"
617
838
<div class="refsect2" lang="en">
618
<a name="SOUP-ADDRESS-SOCKADDR:CAPS"></a><h3>SOUP_ADDRESS_SOCKADDR</h3>
839
<a name="SOUP-ADDRESS-SOCKADDR--CAPS"></a><h3>SOUP_ADDRESS_SOCKADDR</h3>
619
840
<pre class="programlisting">#define SOUP_ADDRESS_SOCKADDR "sockaddr"