/usr/share/gtk-doc/html/libnice/libnice-TURN.html is in libnice-doc 0.1.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TURN</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libnice Reference Manual">
<link rel="up" href="ch04.html" title="STUN usages">
<link rel="prev" href="libnice-ICE.html" title="ICE">
<link rel="next" href="libnice-Timer.html" title="Timer">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="libnice-ICE.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch04.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">libnice Reference Manual</th>
<td><a accesskey="n" href="libnice-Timer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libnice-TURN.synopsis" class="shortcut">Top</a>
|
<a href="#libnice-TURN.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libnice-TURN"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libnice-TURN.top_of_page"></a>TURN</span></h2>
<p>TURN — TURN Allocation Usage</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libnice-TURN.stability-level"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="libnice-TURN.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <stun/usages/turn.h>
enum <a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility">StunUsageTurnCompatibility</a>;
enum <a class="link" href="libnice-TURN.html#StunUsageTurnRequestPorts" title="enum StunUsageTurnRequestPorts">StunUsageTurnRequestPorts</a>;
enum <a class="link" href="libnice-TURN.html#StunUsageTurnReturn" title="enum StunUsageTurnReturn">StunUsageTurnReturn</a>;
<span class="returnvalue">size_t</span> <a class="link" href="libnice-TURN.html#stun-usage-turn-create" title="stun_usage_turn_create ()">stun_usage_turn_create</a> (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *previous_response</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnRequestPorts" title="enum StunUsageTurnRequestPorts"><span class="type">StunUsageTurnRequestPorts</span></a> request_ports</code></em>,
<em class="parameter"><code><span class="type">int32_t</span> bandwidth</code></em>,
<em class="parameter"><code><span class="type">int32_t</span> lifetime</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
<em class="parameter"><code><span class="type">size_t</span> username_len</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *password</code></em>,
<em class="parameter"><code><span class="type">size_t</span> password_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);
<span class="returnvalue">size_t</span> <a class="link" href="libnice-TURN.html#stun-usage-turn-create-refresh" title="stun_usage_turn_create_refresh ()">stun_usage_turn_create_refresh</a> (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *previous_response</code></em>,
<em class="parameter"><code><span class="type">int32_t</span> lifetime</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
<em class="parameter"><code><span class="type">size_t</span> username_len</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *password</code></em>,
<em class="parameter"><code><span class="type">size_t</span> password_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);
<a class="link" href="libnice-TURN.html#StunUsageTurnReturn" title="enum StunUsageTurnReturn"><span class="returnvalue">StunUsageTurnReturn</span></a> <a class="link" href="libnice-TURN.html#stun-usage-turn-process" title="stun_usage_turn_process ()">stun_usage_turn_process</a> (<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">struct sockaddr</span> *relay_addr</code></em>,
<em class="parameter"><code><span class="type">socklen_t</span> *relay_addrlen</code></em>,
<em class="parameter"><code><span class="type">struct sockaddr</span> *addr</code></em>,
<em class="parameter"><code><span class="type">socklen_t</span> *addrlen</code></em>,
<em class="parameter"><code><span class="type">struct sockaddr</span> *alternate_server</code></em>,
<em class="parameter"><code><span class="type">socklen_t</span> *alternate_server_len</code></em>,
<em class="parameter"><code><span class="type">uint32_t</span> *bandwidth</code></em>,
<em class="parameter"><code><span class="type">uint32_t</span> *lifetime</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);
<a class="link" href="libnice-TURN.html#StunUsageTurnReturn" title="enum StunUsageTurnReturn"><span class="returnvalue">StunUsageTurnReturn</span></a> <a class="link" href="libnice-TURN.html#stun-usage-turn-refresh-process" title="stun_usage_turn_refresh_process ()">stun_usage_turn_refresh_process</a> (<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">uint32_t</span> *lifetime</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libnice-TURN.description"></a><h2>Description</h2>
<p>
The STUN TURN usage allows for easily creating and parsing STUN Allocate
requests and responses used for TURN. The API allows you to create a new
allocation or refresh an existing one as well as to parse a response to
an allocate or refresh request.
</p>
</div>
<div class="refsect1">
<a name="libnice-TURN.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="StunUsageTurnCompatibility"></a><h3>enum StunUsageTurnCompatibility</h3>
<pre class="programlisting">typedef enum {
STUN_USAGE_TURN_COMPATIBILITY_DRAFT9,
STUN_USAGE_TURN_COMPATIBILITY_GOOGLE,
STUN_USAGE_TURN_COMPATIBILITY_MSN,
STUN_USAGE_TURN_COMPATIBILITY_OC2007,
STUN_USAGE_TURN_COMPATIBILITY_RFC5766,
} StunUsageTurnCompatibility;
</pre>
<p>
Specifies which TURN specification compatibility to use
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="STUN-USAGE-TURN-COMPATIBILITY-DRAFT9:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_COMPATIBILITY_DRAFT9</code></span></p></td>
<td>Use the specification compatible with
TURN Draft 09
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-COMPATIBILITY-GOOGLE:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_COMPATIBILITY_GOOGLE</code></span></p></td>
<td>Use the specification compatible with
Google Talk's relay server
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-COMPATIBILITY-MSN:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_COMPATIBILITY_MSN</code></span></p></td>
<td>Use the specification compatible with
MSN TURN servers
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-COMPATIBILITY-OC2007:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_COMPATIBILITY_OC2007</code></span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-COMPATIBILITY-RFC5766:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_COMPATIBILITY_RFC5766</code></span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="StunUsageTurnRequestPorts"></a><h3>enum StunUsageTurnRequestPorts</h3>
<pre class="programlisting">typedef enum {
STUN_USAGE_TURN_REQUEST_PORT_NORMAL = 0,
STUN_USAGE_TURN_REQUEST_PORT_EVEN = 1,
STUN_USAGE_TURN_REQUEST_PORT_EVEN_AND_RESERVE = 2
} StunUsageTurnRequestPorts;
</pre>
<p>
This enum is used to specify which port configuration you want when creating
a new Allocation
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="STUN-USAGE-TURN-REQUEST-PORT-NORMAL:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_REQUEST_PORT_NORMAL</code></span></p></td>
<td>Request a normal port
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-REQUEST-PORT-EVEN:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_REQUEST_PORT_EVEN</code></span></p></td>
<td>Request an even port
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-REQUEST-PORT-EVEN-AND-RESERVE:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_REQUEST_PORT_EVEN_AND_RESERVE</code></span></p></td>
<td>Request an even port and
reserve the next higher port
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="StunUsageTurnReturn"></a><h3>enum StunUsageTurnReturn</h3>
<pre class="programlisting">typedef enum {
STUN_USAGE_TURN_RETURN_RELAY_SUCCESS,
STUN_USAGE_TURN_RETURN_MAPPED_SUCCESS,
STUN_USAGE_TURN_RETURN_ERROR,
STUN_USAGE_TURN_RETURN_INVALID,
STUN_USAGE_TURN_RETURN_ALTERNATE_SERVER,
} StunUsageTurnReturn;
</pre>
<p>
Return value of <a class="link" href="libnice-TURN.html#stun-usage-turn-process" title="stun_usage_turn_process ()"><code class="function">stun_usage_turn_process()</code></a> and
<a class="link" href="libnice-TURN.html#stun-usage-turn-refresh-process" title="stun_usage_turn_refresh_process ()"><code class="function">stun_usage_turn_refresh_process()</code></a> which allows you to see what status the
function call returned.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="STUN-USAGE-TURN-RETURN-RELAY-SUCCESS:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_RETURN_RELAY_SUCCESS</code></span></p></td>
<td>The response was successful and a relay
address is provided
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-RETURN-MAPPED-SUCCESS:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_RETURN_MAPPED_SUCCESS</code></span></p></td>
<td>The response was successful and a
relay address as well as a mapped address are provided
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-RETURN-ERROR:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_RETURN_ERROR</code></span></p></td>
<td>The response resulted in an error
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-RETURN-INVALID:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_RETURN_INVALID</code></span></p></td>
<td>The response is not a valid response
</td>
</tr>
<tr>
<td><p><a name="STUN-USAGE-TURN-RETURN-ALTERNATE-SERVER:CAPS"></a><span class="term"><code class="literal">STUN_USAGE_TURN_RETURN_ALTERNATE_SERVER</code></span></p></td>
<td>The server requests the message
to be sent to an alternate server
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="stun-usage-turn-create"></a><h3>stun_usage_turn_create ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span> stun_usage_turn_create (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *previous_response</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnRequestPorts" title="enum StunUsageTurnRequestPorts"><span class="type">StunUsageTurnRequestPorts</span></a> request_ports</code></em>,
<em class="parameter"><code><span class="type">int32_t</span> bandwidth</code></em>,
<em class="parameter"><code><span class="type">int32_t</span> lifetime</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
<em class="parameter"><code><span class="type">size_t</span> username_len</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *password</code></em>,
<em class="parameter"><code><span class="type">size_t</span> password_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);</pre>
<p>
Create a new TURN Allocation request
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to use to build the request</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to use for creating the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The size of the <em class="parameter"><code>buffer</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>previous_response</code></em> :</span></p></td>
<td>If this is the first request you are sending, set this
argument to NULL, if it's a subsequent request you are building, then set this
argument to the response you have received. This argument is used for building
long term credentials (using the REALM and NONCE attributes) as well as for
getting the RESERVATION-TOKEN attribute when you previously requested an
allocation which reserved two ports</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request_ports</code></em> :</span></p></td>
<td>Specify how you want to request the allocated port(s).
This is only used if the compatibility is set to
<a class="link" href="libnice-TURN.html#STUN-USAGE-TURN-COMPATIBILITY-DRAFT9:CAPS"><span class="type">STUN_USAGE_TURN_COMPATIBILITY_DRAFT9</span></a>
<p>See <a class="link" href="libnice-TURN.html#StunUsageTurnRequestPorts" title="enum StunUsageTurnRequestPorts"><span class="type">StunUsageTurnRequestPorts</span></a> </p>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bandwidth</code></em> :</span></p></td>
<td>The bandwidth to request from the server for the allocation. If
this value is negative, then no BANDWIDTH attribute is added to the request.
This is only used if the compatibility is set to
<a class="link" href="libnice-TURN.html#STUN-USAGE-TURN-COMPATIBILITY-DRAFT9:CAPS"><span class="type">STUN_USAGE_TURN_COMPATIBILITY_DRAFT9</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>lifetime</code></em> :</span></p></td>
<td>The lifetime of the allocation to request from the server. If
this value is negative, then no LIFETIME attribute is added to the request.
This is only used if the compatibility is set to
<a class="link" href="libnice-TURN.html#STUN-USAGE-TURN-COMPATIBILITY-DRAFT9:CAPS"><span class="type">STUN_USAGE_TURN_COMPATIBILITY_DRAFT9</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
<td>The username to use in the request</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>username</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>The key to use for building the MESSAGE-INTEGRITY</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>password</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>compatibility</code></em> :</span></p></td>
<td>The compatibility mode to use for building the Allocation
request</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The length of the message to send</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="stun-usage-turn-create-refresh"></a><h3>stun_usage_turn_create_refresh ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span> stun_usage_turn_create_refresh (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *previous_response</code></em>,
<em class="parameter"><code><span class="type">int32_t</span> lifetime</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
<em class="parameter"><code><span class="type">size_t</span> username_len</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *password</code></em>,
<em class="parameter"><code><span class="type">size_t</span> password_len</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);</pre>
<p>
Create a new TURN Refresh request
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to use to build the request</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The buffer to use for creating the <a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
<td>The size of the <em class="parameter"><code>buffer</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>previous_response</code></em> :</span></p></td>
<td>If this is the first request you are sending, set this
argument to NULL, if it's a subsequent request you are building, then set this
argument to the response you have received. This argument is used for building
long term credentials (using the REALM and NONCE attributes)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>lifetime</code></em> :</span></p></td>
<td>The lifetime of the allocation to request from the server. If
this value is negative, then no LIFETIME attribute is added to the request.
This is only used if the compatibility is set to
<a class="link" href="libnice-TURN.html#STUN-USAGE-TURN-COMPATIBILITY-DRAFT9:CAPS"><span class="type">STUN_USAGE_TURN_COMPATIBILITY_DRAFT9</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
<td>The username to use in the request</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>username</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>The key to use for building the MESSAGE-INTEGRITY</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>password</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>compatibility</code></em> :</span></p></td>
<td>The compatibility mode to use for building the Allocation
request</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The length of the message to send</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="stun-usage-turn-process"></a><h3>stun_usage_turn_process ()</h3>
<pre class="programlisting"><a class="link" href="libnice-TURN.html#StunUsageTurnReturn" title="enum StunUsageTurnReturn"><span class="returnvalue">StunUsageTurnReturn</span></a> stun_usage_turn_process (<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">struct sockaddr</span> *relay_addr</code></em>,
<em class="parameter"><code><span class="type">socklen_t</span> *relay_addrlen</code></em>,
<em class="parameter"><code><span class="type">struct sockaddr</span> *addr</code></em>,
<em class="parameter"><code><span class="type">socklen_t</span> *addrlen</code></em>,
<em class="parameter"><code><span class="type">struct sockaddr</span> *alternate_server</code></em>,
<em class="parameter"><code><span class="type">socklen_t</span> *alternate_server_len</code></em>,
<em class="parameter"><code><span class="type">uint32_t</span> *bandwidth</code></em>,
<em class="parameter"><code><span class="type">uint32_t</span> *lifetime</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);</pre>
<p>
Process a TURN Allocate response and extract the necessary information from
the message
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The message containing the response</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>relay_addr</code></em> :</span></p></td>
<td>A pointer to a <span class="type">sockaddr</span> structure to fill with the relay address
that the TURN server allocated for us</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>relay_addrlen</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>relay_addr</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>addr</code></em> :</span></p></td>
<td>A pointer to a <span class="type">sockaddr</span> structure to fill with the mapped address
that the STUN response contains.
This argument will only be filled if the return value
of the function is <a class="link" href="libnice-TURN.html#STUN-USAGE-TURN-RETURN-MAPPED-SUCCESS:CAPS"><span class="type">STUN_USAGE_TURN_RETURN_MAPPED_SUCCESS</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>addrlen</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>addr</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>alternate_server</code></em> :</span></p></td>
<td>A pointer to a <span class="type">sockaddr</span> structure to fill with the
address of an alternate server to which we should send our new STUN
Allocate request, in case the currently used TURN server is requesting the use
of an alternate server. This argument will only be filled if the return value
of the function is <a class="link" href="libnice-TURN.html#STUN-USAGE-TURN-RETURN-ALTERNATE-SERVER:CAPS"><span class="type">STUN_USAGE_TURN_RETURN_ALTERNATE_SERVER</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>alternate_server_len</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>alternate_server</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bandwidth</code></em> :</span></p></td>
<td>A pointer to fill with the bandwidth the TURN server allocated us</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>lifetime</code></em> :</span></p></td>
<td>A pointer to fill with the lifetime of the allocation</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>compatibility</code></em> :</span></p></td>
<td>The compatibility mode to use for processing the Allocation
response</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a class="link" href="libnice-TURN.html#StunUsageTurnReturn" title="enum StunUsageTurnReturn"><span class="type">StunUsageTurnReturn</span></a> value</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="stun-usage-turn-refresh-process"></a><h3>stun_usage_turn_refresh_process ()</h3>
<pre class="programlisting"><a class="link" href="libnice-TURN.html#StunUsageTurnReturn" title="enum StunUsageTurnReturn"><span class="returnvalue">StunUsageTurnReturn</span></a> stun_usage_turn_refresh_process (<em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="struct StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
<em class="parameter"><code><span class="type">uint32_t</span> *lifetime</code></em>,
<em class="parameter"><code><a class="link" href="libnice-TURN.html#StunUsageTurnCompatibility" title="enum StunUsageTurnCompatibility"><span class="type">StunUsageTurnCompatibility</span></a> compatibility</code></em>);</pre>
<p>
Process a TURN Refresh response and extract the necessary information from
the message
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>The message containing the response</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>lifetime</code></em> :</span></p></td>
<td>A pointer to fill with the lifetime of the allocation</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>compatibility</code></em> :</span></p></td>
<td>The compatibility mode to use for processing the Refresh
response</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a class="link" href="libnice-TURN.html#StunUsageTurnReturn" title="enum StunUsageTurnReturn"><span class="type">StunUsageTurnReturn</span></a> value. A <a class="link" href="libnice-TURN.html#STUN-USAGE-TURN-RETURN-RELAY-SUCCESS:CAPS"><span class="type">STUN_USAGE_TURN_RETURN_RELAY_SUCCESS</span></a>
means the Refresh was successful, but no relay address is given (kept the same
as for the original allocation)</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|