Imported Upstream version 0.1.16
[platform/upstream/libnice.git] / docs / reference / libnice / html / libnice-NiceAddress.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>NiceAddress: libnice Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
7 <link rel="home" href="index.html" title="libnice Reference Manual">
8 <link rel="up" href="ch01.html" title="">
9 <link rel="prev" href="NiceAgent.html" title="NiceAgent">
10 <link rel="next" href="NiceCandidate.html" title="NiceCandidate">
11 <meta name="generator" content="GTK-Doc V1.29 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18                   <a href="#libnice-NiceAddress.description" class="shortcut">Description</a></span>
19 </td>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="NiceAgent.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="NiceCandidate.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
24 </tr></table>
25 <div class="refentry">
26 <a name="libnice-NiceAddress"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
29 <h2><span class="refentrytitle"><a name="libnice-NiceAddress.top_of_page"></a>NiceAddress</span></h2>
30 <p>NiceAddress — IP address convenience library</p>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
34 <div class="refsect1">
35 <a name="libnice-NiceAddress.stability-level"></a><h2>Stability Level</h2>
36 <acronym title="The intention of a Stable interface is to enable arbitrary third parties to
37 develop applications to these interfaces, release them, and have confidence that
38 they will run on all minor releases of the product (after the one in which the
39 interface was introduced, and within the same major release). Even at a major
40 release, incompatible changes are expected to be rare, and to have strong
41 justifications.
42 "><span class="acronym">Stable</span></acronym>, unless otherwise indicated
43 </div>
44 <div class="refsect1">
45 <a name="libnice-NiceAddress.functions"></a><h2>Functions</h2>
46 <div class="informaltable"><table class="informaltable" width="100%" border="0">
47 <colgroup>
48 <col width="150px" class="functions_return">
49 <col class="functions_name">
50 </colgroup>
51 <tbody>
52 <tr>
53 <td class="function_type">
54 <span class="returnvalue">void</span>
55 </td>
56 <td class="function_name">
57 <a class="link" href="libnice-NiceAddress.html#nice-address-init" title="nice_address_init ()">nice_address_init</a> <span class="c_punctuation">()</span>
58 </td>
59 </tr>
60 <tr>
61 <td class="function_type">
62 <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="returnvalue">NiceAddress</span></a> *
63 </td>
64 <td class="function_name">
65 <a class="link" href="libnice-NiceAddress.html#nice-address-new" title="nice_address_new ()">nice_address_new</a> <span class="c_punctuation">()</span>
66 </td>
67 </tr>
68 <tr>
69 <td class="function_type">
70 <span class="returnvalue">void</span>
71 </td>
72 <td class="function_name">
73 <a class="link" href="libnice-NiceAddress.html#nice-address-free" title="nice_address_free ()">nice_address_free</a> <span class="c_punctuation">()</span>
74 </td>
75 </tr>
76 <tr>
77 <td class="function_type">
78 <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="returnvalue">NiceAddress</span></a> *
79 </td>
80 <td class="function_name">
81 <a class="link" href="libnice-NiceAddress.html#nice-address-dup" title="nice_address_dup ()">nice_address_dup</a> <span class="c_punctuation">()</span>
82 </td>
83 </tr>
84 <tr>
85 <td class="function_type">
86 <span class="returnvalue">void</span>
87 </td>
88 <td class="function_name">
89 <a class="link" href="libnice-NiceAddress.html#nice-address-set-ipv4" title="nice_address_set_ipv4 ()">nice_address_set_ipv4</a> <span class="c_punctuation">()</span>
90 </td>
91 </tr>
92 <tr>
93 <td class="function_type">
94 <span class="returnvalue">void</span>
95 </td>
96 <td class="function_name">
97 <a class="link" href="libnice-NiceAddress.html#nice-address-set-ipv6" title="nice_address_set_ipv6 ()">nice_address_set_ipv6</a> <span class="c_punctuation">()</span>
98 </td>
99 </tr>
100 <tr>
101 <td class="function_type">
102 <span class="returnvalue">void</span>
103 </td>
104 <td class="function_name">
105 <a class="link" href="libnice-NiceAddress.html#nice-address-set-port" title="nice_address_set_port ()">nice_address_set_port</a> <span class="c_punctuation">()</span>
106 </td>
107 </tr>
108 <tr>
109 <td class="function_type">
110 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
111 </td>
112 <td class="function_name">
113 <a class="link" href="libnice-NiceAddress.html#nice-address-get-port" title="nice_address_get_port ()">nice_address_get_port</a> <span class="c_punctuation">()</span>
114 </td>
115 </tr>
116 <tr>
117 <td class="function_type">
118 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
119 </td>
120 <td class="function_name">
121 <a class="link" href="libnice-NiceAddress.html#nice-address-set-from-string" title="nice_address_set_from_string ()">nice_address_set_from_string</a> <span class="c_punctuation">()</span>
122 </td>
123 </tr>
124 <tr>
125 <td class="function_type">
126 <span class="returnvalue">void</span>
127 </td>
128 <td class="function_name">
129 <a class="link" href="libnice-NiceAddress.html#nice-address-set-from-sockaddr" title="nice_address_set_from_sockaddr ()">nice_address_set_from_sockaddr</a> <span class="c_punctuation">()</span>
130 </td>
131 </tr>
132 <tr>
133 <td class="function_type">
134 <span class="returnvalue">void</span>
135 </td>
136 <td class="function_name">
137 <a class="link" href="libnice-NiceAddress.html#nice-address-copy-to-sockaddr" title="nice_address_copy_to_sockaddr ()">nice_address_copy_to_sockaddr</a> <span class="c_punctuation">()</span>
138 </td>
139 </tr>
140 <tr>
141 <td class="function_type">
142 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
143 </td>
144 <td class="function_name">
145 <a class="link" href="libnice-NiceAddress.html#nice-address-equal" title="nice_address_equal ()">nice_address_equal</a> <span class="c_punctuation">()</span>
146 </td>
147 </tr>
148 <tr>
149 <td class="function_type">
150 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
151 </td>
152 <td class="function_name">
153 <a class="link" href="libnice-NiceAddress.html#nice-address-equal-no-port" title="nice_address_equal_no_port ()">nice_address_equal_no_port</a> <span class="c_punctuation">()</span>
154 </td>
155 </tr>
156 <tr>
157 <td class="function_type">
158 <span class="returnvalue">void</span>
159 </td>
160 <td class="function_name">
161 <a class="link" href="libnice-NiceAddress.html#nice-address-to-string" title="nice_address_to_string ()">nice_address_to_string</a> <span class="c_punctuation">()</span>
162 </td>
163 </tr>
164 <tr>
165 <td class="function_type">
166 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
167 </td>
168 <td class="function_name">
169 <a class="link" href="libnice-NiceAddress.html#nice-address-is-private" title="nice_address_is_private ()">nice_address_is_private</a> <span class="c_punctuation">()</span>
170 </td>
171 </tr>
172 <tr>
173 <td class="function_type">
174 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
175 </td>
176 <td class="function_name">
177 <a class="link" href="libnice-NiceAddress.html#nice-address-is-valid" title="nice_address_is_valid ()">nice_address_is_valid</a> <span class="c_punctuation">()</span>
178 </td>
179 </tr>
180 <tr>
181 <td class="function_type">
182 <span class="returnvalue">int</span>
183 </td>
184 <td class="function_name">
185 <a class="link" href="libnice-NiceAddress.html#nice-address-ip-version" title="nice_address_ip_version ()">nice_address_ip_version</a> <span class="c_punctuation">()</span>
186 </td>
187 </tr>
188 </tbody>
189 </table></div>
190 </div>
191 <div class="refsect1">
192 <a name="libnice-NiceAddress.other"></a><h2>Types and Values</h2>
193 <div class="informaltable"><table class="informaltable" width="100%" border="0">
194 <colgroup>
195 <col width="150px" class="name">
196 <col class="description">
197 </colgroup>
198 <tbody>
199 <tr>
200 <td class="datatype_keyword"> </td>
201 <td class="function_name"><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress">NiceAddress</a></td>
202 </tr>
203 <tr>
204 <td class="define_keyword">#define</td>
205 <td class="function_name"><a class="link" href="libnice-NiceAddress.html#NICE-ADDRESS-STRING-LEN:CAPS" title="NICE_ADDRESS_STRING_LEN">NICE_ADDRESS_STRING_LEN</a></td>
206 </tr>
207 </tbody>
208 </table></div>
209 </div>
210 <div class="refsect1">
211 <a name="libnice-NiceAddress.description"></a><h2>Description</h2>
212 <p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> structure will allow you to easily set/get and modify an IPv4
213 or IPv6 address in order to communicate with the <a class="link" href="NiceAgent.html" title="NiceAgent"><span class="type">NiceAgent</span></a>.</p>
214 </div>
215 <div class="refsect1">
216 <a name="libnice-NiceAddress.functions_details"></a><h2>Functions</h2>
217 <div class="refsect2">
218 <a name="nice-address-init"></a><h3>nice_address_init ()</h3>
219 <pre class="programlisting"><span class="returnvalue">void</span>
220 nice_address_init (<em class="parameter"><code><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>);</pre>
221 <p>Initialize a <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> into an undefined address</p>
222 <div class="refsect3">
223 <a name="nice-address-init.parameters"></a><h4>Parameters</h4>
224 <div class="informaltable"><table class="informaltable" width="100%" border="0">
225 <colgroup>
226 <col width="150px" class="parameters_name">
227 <col class="parameters_description">
228 <col width="200px" class="parameters_annotations">
229 </colgroup>
230 <tbody><tr>
231 <td class="parameter_name"><p>addr</p></td>
232 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to init</p></td>
233 <td class="parameter_annotations"> </td>
234 </tr></tbody>
235 </table></div>
236 </div>
237 </div>
238 <hr>
239 <div class="refsect2">
240 <a name="nice-address-new"></a><h3>nice_address_new ()</h3>
241 <pre class="programlisting"><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="returnvalue">NiceAddress</span></a> *
242 nice_address_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
243 <p>Create a new <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> with undefined address
244 You must free it with <a class="link" href="libnice-NiceAddress.html#nice-address-free" title="nice_address_free ()"><code class="function">nice_address_free()</code></a></p>
245 <div class="refsect3">
246 <a name="nice-address-new.returns"></a><h4>Returns</h4>
247 <p> The new <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a></p>
248 </div>
249 </div>
250 <hr>
251 <div class="refsect2">
252 <a name="nice-address-free"></a><h3>nice_address_free ()</h3>
253 <pre class="programlisting"><span class="returnvalue">void</span>
254 nice_address_free (<em class="parameter"><code><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>);</pre>
255 <p>Frees a <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> created with <a class="link" href="libnice-NiceAddress.html#nice-address-new" title="nice_address_new ()"><code class="function">nice_address_new()</code></a> or <a class="link" href="libnice-NiceAddress.html#nice-address-dup" title="nice_address_dup ()"><code class="function">nice_address_dup()</code></a></p>
256 <div class="refsect3">
257 <a name="nice-address-free.parameters"></a><h4>Parameters</h4>
258 <div class="informaltable"><table class="informaltable" width="100%" border="0">
259 <colgroup>
260 <col width="150px" class="parameters_name">
261 <col class="parameters_description">
262 <col width="200px" class="parameters_annotations">
263 </colgroup>
264 <tbody><tr>
265 <td class="parameter_name"><p>addr</p></td>
266 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to free</p></td>
267 <td class="parameter_annotations"> </td>
268 </tr></tbody>
269 </table></div>
270 </div>
271 </div>
272 <hr>
273 <div class="refsect2">
274 <a name="nice-address-dup"></a><h3>nice_address_dup ()</h3>
275 <pre class="programlisting"><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="returnvalue">NiceAddress</span></a> *
276 nice_address_dup (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>);</pre>
277 <p>Creates a new <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> with the same address as <em class="parameter"><code>addr</code></em>
278 </p>
279 <div class="refsect3">
280 <a name="nice-address-dup.parameters"></a><h4>Parameters</h4>
281 <div class="informaltable"><table class="informaltable" width="100%" border="0">
282 <colgroup>
283 <col width="150px" class="parameters_name">
284 <col class="parameters_description">
285 <col width="200px" class="parameters_annotations">
286 </colgroup>
287 <tbody><tr>
288 <td class="parameter_name"><p>addr</p></td>
289 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to dup</p></td>
290 <td class="parameter_annotations"> </td>
291 </tr></tbody>
292 </table></div>
293 </div>
294 <div class="refsect3">
295 <a name="nice-address-dup.returns"></a><h4>Returns</h4>
296 <p> The new <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a></p>
297 </div>
298 </div>
299 <hr>
300 <div class="refsect2">
301 <a name="nice-address-set-ipv4"></a><h3>nice_address_set_ipv4 ()</h3>
302 <pre class="programlisting"><span class="returnvalue">void</span>
303 nice_address_set_ipv4 (<em class="parameter"><code><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>,
304                        <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> addr_ipv4</code></em>);</pre>
305 <p>Set <em class="parameter"><code>addr</code></em>
306  to an IPv4 address using the data from <em class="parameter"><code>addr_ipv4</code></em>
307 </p>
308 <div class="note"><p>
309    This function will reset the port to 0, so make sure you call it before
310    <a class="link" href="libnice-NiceAddress.html#nice-address-set-port" title="nice_address_set_port ()"><code class="function">nice_address_set_port()</code></a>
311   </p></div>
312 <div class="refsect3">
313 <a name="nice-address-set-ipv4.parameters"></a><h4>Parameters</h4>
314 <div class="informaltable"><table class="informaltable" width="100%" border="0">
315 <colgroup>
316 <col width="150px" class="parameters_name">
317 <col class="parameters_description">
318 <col width="200px" class="parameters_annotations">
319 </colgroup>
320 <tbody>
321 <tr>
322 <td class="parameter_name"><p>addr</p></td>
323 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to modify</p></td>
324 <td class="parameter_annotations"> </td>
325 </tr>
326 <tr>
327 <td class="parameter_name"><p>addr_ipv4</p></td>
328 <td class="parameter_description"><p>The IPv4 address</p></td>
329 <td class="parameter_annotations"> </td>
330 </tr>
331 </tbody>
332 </table></div>
333 </div>
334 </div>
335 <hr>
336 <div class="refsect2">
337 <a name="nice-address-set-ipv6"></a><h3>nice_address_set_ipv6 ()</h3>
338 <pre class="programlisting"><span class="returnvalue">void</span>
339 nice_address_set_ipv6 (<em class="parameter"><code><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>,
340                        <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *addr_ipv6</code></em>);</pre>
341 <p>Set <em class="parameter"><code>addr</code></em>
342  to an IPv6 address using the data from <em class="parameter"><code>addr_ipv6</code></em>
343 </p>
344 <div class="note"><p>
345    This function will reset the port to 0, so make sure you call it before
346    <a class="link" href="libnice-NiceAddress.html#nice-address-set-port" title="nice_address_set_port ()"><code class="function">nice_address_set_port()</code></a>
347   </p></div>
348 <div class="refsect3">
349 <a name="nice-address-set-ipv6.parameters"></a><h4>Parameters</h4>
350 <div class="informaltable"><table class="informaltable" width="100%" border="0">
351 <colgroup>
352 <col width="150px" class="parameters_name">
353 <col class="parameters_description">
354 <col width="200px" class="parameters_annotations">
355 </colgroup>
356 <tbody>
357 <tr>
358 <td class="parameter_name"><p>addr</p></td>
359 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to modify</p></td>
360 <td class="parameter_annotations"> </td>
361 </tr>
362 <tr>
363 <td class="parameter_name"><p>addr_ipv6</p></td>
364 <td class="parameter_description"><p>The IPv6 address</p></td>
365 <td class="parameter_annotations"> </td>
366 </tr>
367 </tbody>
368 </table></div>
369 </div>
370 </div>
371 <hr>
372 <div class="refsect2">
373 <a name="nice-address-set-port"></a><h3>nice_address_set_port ()</h3>
374 <pre class="programlisting"><span class="returnvalue">void</span>
375 nice_address_set_port (<em class="parameter"><code><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>,
376                        <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> port</code></em>);</pre>
377 <p>Set the port of <em class="parameter"><code>addr</code></em>
378  to <em class="parameter"><code>port</code></em>
379 </p>
380 <div class="refsect3">
381 <a name="nice-address-set-port.parameters"></a><h4>Parameters</h4>
382 <div class="informaltable"><table class="informaltable" width="100%" border="0">
383 <colgroup>
384 <col width="150px" class="parameters_name">
385 <col class="parameters_description">
386 <col width="200px" class="parameters_annotations">
387 </colgroup>
388 <tbody>
389 <tr>
390 <td class="parameter_name"><p>addr</p></td>
391 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to modify</p></td>
392 <td class="parameter_annotations"> </td>
393 </tr>
394 <tr>
395 <td class="parameter_name"><p>port</p></td>
396 <td class="parameter_description"><p>The port to set</p></td>
397 <td class="parameter_annotations"> </td>
398 </tr>
399 </tbody>
400 </table></div>
401 </div>
402 </div>
403 <hr>
404 <div class="refsect2">
405 <a name="nice-address-get-port"></a><h3>nice_address_get_port ()</h3>
406 <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
407 nice_address_get_port (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>);</pre>
408 <p>Retreive the port of <em class="parameter"><code>addr</code></em>
409 </p>
410 <div class="refsect3">
411 <a name="nice-address-get-port.parameters"></a><h4>Parameters</h4>
412 <div class="informaltable"><table class="informaltable" width="100%" border="0">
413 <colgroup>
414 <col width="150px" class="parameters_name">
415 <col class="parameters_description">
416 <col width="200px" class="parameters_annotations">
417 </colgroup>
418 <tbody><tr>
419 <td class="parameter_name"><p>addr</p></td>
420 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to query</p></td>
421 <td class="parameter_annotations"> </td>
422 </tr></tbody>
423 </table></div>
424 </div>
425 <div class="refsect3">
426 <a name="nice-address-get-port.returns"></a><h4>Returns</h4>
427 <p> The port of <em class="parameter"><code>addr</code></em>
428 </p>
429 </div>
430 </div>
431 <hr>
432 <div class="refsect2">
433 <a name="nice-address-set-from-string"></a><h3>nice_address_set_from_string ()</h3>
434 <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
435 nice_address_set_from_string (<em class="parameter"><code><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>,
436                               <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>);</pre>
437 <p>Sets an IPv4 or IPv6 address from the string <em class="parameter"><code>str</code></em>
438 </p>
439 <div class="refsect3">
440 <a name="nice-address-set-from-string.parameters"></a><h4>Parameters</h4>
441 <div class="informaltable"><table class="informaltable" width="100%" border="0">
442 <colgroup>
443 <col width="150px" class="parameters_name">
444 <col class="parameters_description">
445 <col width="200px" class="parameters_annotations">
446 </colgroup>
447 <tbody>
448 <tr>
449 <td class="parameter_name"><p>addr</p></td>
450 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to modify</p></td>
451 <td class="parameter_annotations"> </td>
452 </tr>
453 <tr>
454 <td class="parameter_name"><p>str</p></td>
455 <td class="parameter_description"><p>The string to set</p></td>
456 <td class="parameter_annotations"> </td>
457 </tr>
458 </tbody>
459 </table></div>
460 </div>
461 <div class="refsect3">
462 <a name="nice-address-set-from-string.returns"></a><h4>Returns</h4>
463 <p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if success, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on error</p>
464 </div>
465 </div>
466 <hr>
467 <div class="refsect2">
468 <a name="nice-address-set-from-sockaddr"></a><h3>nice_address_set_from_sockaddr ()</h3>
469 <pre class="programlisting"><span class="returnvalue">void</span>
470 nice_address_set_from_sockaddr (<em class="parameter"><code><a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>,
471                                 <em class="parameter"><code>const <span class="type">struct sockaddr</span> *sin</code></em>);</pre>
472 <p>Sets an IPv4 or IPv6 address from the sockaddr structure <em class="parameter"><code>sin</code></em>
473 </p>
474 <div class="refsect3">
475 <a name="nice-address-set-from-sockaddr.parameters"></a><h4>Parameters</h4>
476 <div class="informaltable"><table class="informaltable" width="100%" border="0">
477 <colgroup>
478 <col width="150px" class="parameters_name">
479 <col class="parameters_description">
480 <col width="200px" class="parameters_annotations">
481 </colgroup>
482 <tbody>
483 <tr>
484 <td class="parameter_name"><p>addr</p></td>
485 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to modify</p></td>
486 <td class="parameter_annotations"> </td>
487 </tr>
488 <tr>
489 <td class="parameter_name"><p>sin</p></td>
490 <td class="parameter_description"><p>The sockaddr to set</p></td>
491 <td class="parameter_annotations"> </td>
492 </tr>
493 </tbody>
494 </table></div>
495 </div>
496 </div>
497 <hr>
498 <div class="refsect2">
499 <a name="nice-address-copy-to-sockaddr"></a><h3>nice_address_copy_to_sockaddr ()</h3>
500 <pre class="programlisting"><span class="returnvalue">void</span>
501 nice_address_copy_to_sockaddr (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>,
502                                <em class="parameter"><code><span class="type">struct sockaddr</span> *sin</code></em>);</pre>
503 <p>Fills the sockaddr structure <em class="parameter"><code>sin</code></em>
504  with the address contained in <em class="parameter"><code>addr</code></em>
505 </p>
506 <div class="refsect3">
507 <a name="nice-address-copy-to-sockaddr.parameters"></a><h4>Parameters</h4>
508 <div class="informaltable"><table class="informaltable" width="100%" border="0">
509 <colgroup>
510 <col width="150px" class="parameters_name">
511 <col class="parameters_description">
512 <col width="200px" class="parameters_annotations">
513 </colgroup>
514 <tbody>
515 <tr>
516 <td class="parameter_name"><p>addr</p></td>
517 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to query</p></td>
518 <td class="parameter_annotations"> </td>
519 </tr>
520 <tr>
521 <td class="parameter_name"><p>sin</p></td>
522 <td class="parameter_description"><p>The sockaddr to fill</p></td>
523 <td class="parameter_annotations"> </td>
524 </tr>
525 </tbody>
526 </table></div>
527 </div>
528 </div>
529 <hr>
530 <div class="refsect2">
531 <a name="nice-address-equal"></a><h3>nice_address_equal ()</h3>
532 <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
533 nice_address_equal (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *a</code></em>,
534                     <em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *b</code></em>);</pre>
535 <p>Compares two <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> structures to see if they contain the same address
536 and the same port.</p>
537 <div class="refsect3">
538 <a name="nice-address-equal.parameters"></a><h4>Parameters</h4>
539 <div class="informaltable"><table class="informaltable" width="100%" border="0">
540 <colgroup>
541 <col width="150px" class="parameters_name">
542 <col class="parameters_description">
543 <col width="200px" class="parameters_annotations">
544 </colgroup>
545 <tbody>
546 <tr>
547 <td class="parameter_name"><p>a</p></td>
548 <td class="parameter_description"><p>First <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to compare</p></td>
549 <td class="parameter_annotations"> </td>
550 </tr>
551 <tr>
552 <td class="parameter_name"><p>b</p></td>
553 <td class="parameter_description"><p>Second <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to compare</p></td>
554 <td class="parameter_annotations"> </td>
555 </tr>
556 </tbody>
557 </table></div>
558 </div>
559 <div class="refsect3">
560 <a name="nice-address-equal.returns"></a><h4>Returns</h4>
561 <p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>a</code></em>
562 and <em class="parameter"><code>b</code></em>
563 are the same address, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if they are different</p>
564 </div>
565 </div>
566 <hr>
567 <div class="refsect2">
568 <a name="nice-address-equal-no-port"></a><h3>nice_address_equal_no_port ()</h3>
569 <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
570 nice_address_equal_no_port (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *a</code></em>,
571                             <em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *b</code></em>);</pre>
572 <p>Compares two <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> structures to see if they contain the same address,
573 ignoring the port.</p>
574 <div class="refsect3">
575 <a name="nice-address-equal-no-port.parameters"></a><h4>Parameters</h4>
576 <div class="informaltable"><table class="informaltable" width="100%" border="0">
577 <colgroup>
578 <col width="150px" class="parameters_name">
579 <col class="parameters_description">
580 <col width="200px" class="parameters_annotations">
581 </colgroup>
582 <tbody>
583 <tr>
584 <td class="parameter_name"><p>a</p></td>
585 <td class="parameter_description"><p>First <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to compare</p></td>
586 <td class="parameter_annotations"> </td>
587 </tr>
588 <tr>
589 <td class="parameter_name"><p>b</p></td>
590 <td class="parameter_description"><p>Second <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to compare</p></td>
591 <td class="parameter_annotations"> </td>
592 </tr>
593 </tbody>
594 </table></div>
595 </div>
596 <div class="refsect3">
597 <a name="nice-address-equal-no-port.returns"></a><h4>Returns</h4>
598 <p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>a</code></em>
599 and <em class="parameter"><code>b</code></em>
600 are the same address, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if they
601 are different</p>
602 </div>
603 <p class="since">Since: <a class="link" href="ix12.html#api-index-0.1.8">0.1.8</a></p>
604 </div>
605 <hr>
606 <div class="refsect2">
607 <a name="nice-address-to-string"></a><h3>nice_address_to_string ()</h3>
608 <pre class="programlisting"><span class="returnvalue">void</span>
609 nice_address_to_string (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>,
610                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dst</code></em>);</pre>
611 <p>Transforms the address <em class="parameter"><code>addr</code></em>
612  into a human readable string</p>
613 <div class="refsect3">
614 <a name="nice-address-to-string.parameters"></a><h4>Parameters</h4>
615 <div class="informaltable"><table class="informaltable" width="100%" border="0">
616 <colgroup>
617 <col width="150px" class="parameters_name">
618 <col class="parameters_description">
619 <col width="200px" class="parameters_annotations">
620 </colgroup>
621 <tbody>
622 <tr>
623 <td class="parameter_name"><p>addr</p></td>
624 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to query</p></td>
625 <td class="parameter_annotations"> </td>
626 </tr>
627 <tr>
628 <td class="parameter_name"><p>dst</p></td>
629 <td class="parameter_description"><p>The string to fill</p></td>
630 <td class="parameter_annotations"> </td>
631 </tr>
632 </tbody>
633 </table></div>
634 </div>
635 </div>
636 <hr>
637 <div class="refsect2">
638 <a name="nice-address-is-private"></a><h3>nice_address_is_private ()</h3>
639 <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
640 nice_address_is_private (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>);</pre>
641 <p>Verifies if the address in <em class="parameter"><code>addr</code></em>
642  is a private address or not</p>
643 <div class="refsect3">
644 <a name="nice-address-is-private.parameters"></a><h4>Parameters</h4>
645 <div class="informaltable"><table class="informaltable" width="100%" border="0">
646 <colgroup>
647 <col width="150px" class="parameters_name">
648 <col class="parameters_description">
649 <col width="200px" class="parameters_annotations">
650 </colgroup>
651 <tbody><tr>
652 <td class="parameter_name"><p>addr</p></td>
653 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to query</p></td>
654 <td class="parameter_annotations"> </td>
655 </tr></tbody>
656 </table></div>
657 </div>
658 <div class="refsect3">
659 <a name="nice-address-is-private.returns"></a><h4>Returns</h4>
660 <p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>addr</code></em>
661 is a private address, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
662 </div>
663 </div>
664 <hr>
665 <div class="refsect2">
666 <a name="nice-address-is-valid"></a><h3>nice_address_is_valid ()</h3>
667 <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
668 nice_address_is_valid (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>);</pre>
669 <p>Validate whether the <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> <em class="parameter"><code>addr</code></em>
670  is a valid IPv4 or IPv6 address</p>
671 <div class="refsect3">
672 <a name="nice-address-is-valid.parameters"></a><h4>Parameters</h4>
673 <div class="informaltable"><table class="informaltable" width="100%" border="0">
674 <colgroup>
675 <col width="150px" class="parameters_name">
676 <col class="parameters_description">
677 <col width="200px" class="parameters_annotations">
678 </colgroup>
679 <tbody><tr>
680 <td class="parameter_name"><p>addr</p></td>
681 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to query</p></td>
682 <td class="parameter_annotations"> </td>
683 </tr></tbody>
684 </table></div>
685 </div>
686 <div class="refsect3">
687 <a name="nice-address-is-valid.returns"></a><h4>Returns</h4>
688 <p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>addr</code></em>
689 is valid, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
690 </div>
691 </div>
692 <hr>
693 <div class="refsect2">
694 <a name="nice-address-ip-version"></a><h3>nice_address_ip_version ()</h3>
695 <pre class="programlisting"><span class="returnvalue">int</span>
696 nice_address_ip_version (<em class="parameter"><code>const <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> *addr</code></em>);</pre>
697 <p>Returns the IP version of the address</p>
698 <div class="refsect3">
699 <a name="nice-address-ip-version.parameters"></a><h4>Parameters</h4>
700 <div class="informaltable"><table class="informaltable" width="100%" border="0">
701 <colgroup>
702 <col width="150px" class="parameters_name">
703 <col class="parameters_description">
704 <col width="200px" class="parameters_annotations">
705 </colgroup>
706 <tbody><tr>
707 <td class="parameter_name"><p>addr</p></td>
708 <td class="parameter_description"><p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> to query</p></td>
709 <td class="parameter_annotations"> </td>
710 </tr></tbody>
711 </table></div>
712 </div>
713 <div class="refsect3">
714 <a name="nice-address-ip-version.returns"></a><h4>Returns</h4>
715 <p> 4 for IPv4, 6 for IPv6 and 0 for undefined address</p>
716 </div>
717 </div>
718 </div>
719 <div class="refsect1">
720 <a name="libnice-NiceAddress.other_details"></a><h2>Types and Values</h2>
721 <div class="refsect2">
722 <a name="NiceAddress"></a><h3>NiceAddress</h3>
723 <pre class="programlisting">typedef struct {
724   union
725   {
726     struct sockaddr     addr;
727     struct sockaddr_in  ip4;
728     struct sockaddr_in6 ip6;
729   } s;
730 } NiceAddress;
731 </pre>
732 <p>The <a class="link" href="libnice-NiceAddress.html#NiceAddress" title="NiceAddress"><span class="type">NiceAddress</span></a> structure that represents an IPv4 or IPv6 address.</p>
733 </div>
734 <hr>
735 <div class="refsect2">
736 <a name="NICE-ADDRESS-STRING-LEN:CAPS"></a><h3>NICE_ADDRESS_STRING_LEN</h3>
737 <pre class="programlisting">#define NICE_ADDRESS_STRING_LEN INET6_ADDRSTRLEN
738 </pre>
739 <p>The maximum string length representation of an address.
740 When using <a class="link" href="libnice-NiceAddress.html#nice-address-to-string" title="nice_address_to_string ()"><code class="function">nice_address_to_string()</code></a> make sure the string has a size of
741 at least <a class="link" href="libnice-NiceAddress.html#NICE-ADDRESS-STRING-LEN:CAPS" title="NICE_ADDRESS_STRING_LEN"><code class="literal">NICE_ADDRESS_STRING_LEN</code></a></p>
742 </div>
743 </div>
744 </div>
745 <div class="footer">
746 <hr>Generated by GTK-Doc V1.29</div>
747 </body>
748 </html>