~ubuntu-branches/debian/jessie/libnice/jessie

« back to all changes in this revision

Viewing changes to docs/reference/libnice/html/libnice-StunAgent.html

  • Committer: Bazaar Package Importer
  • Author(s): Sjoerd Simons
  • Date: 2010-05-20 14:38:50 UTC
  • mfrom: (1.2.4 upstream) (5.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100520143850-413jycrqvl22ukg5
Tags: 0.0.12-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
<link rel="up" href="ch03.html" title="">
9
9
<link rel="prev" href="ch03.html" title="">
10
10
<link rel="next" href="libnice-StunMessage.html" title="StunMessage">
11
 
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="part" href="pt01.html" title="Part I. ICE Library">
14
14
<link rel="chapter" href="ch01.html" title="">
16
16
<link rel="part" href="pt02.html" title="Part II. STUN Library">
17
17
<link rel="chapter" href="ch03.html" title="">
18
18
<link rel="chapter" href="ch04.html" title="STUN usages">
 
19
<link rel="part" href="pt03.html" title="Part III. Pseudo TCP Socket implementation">
 
20
<link rel="chapter" href="ch05.html" title="">
19
21
</head>
20
22
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
21
23
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
28
30
</tr>
29
31
<tr><td colspan="5" class="shortcuts">
30
32
<a href="#libnice-StunAgent.synopsis" class="shortcut">Top</a>
31
 
                 | 
32
 
                <a href="#libnice-StunAgent.description" class="shortcut">Description</a>
 
33
                   | 
 
34
                  <a href="#libnice-StunAgent.description" class="shortcut">Description</a>
33
35
</td></tr>
34
36
</table>
35
37
<div class="refentry" title="StunAgent">
48
50
<div class="refsynopsisdiv" title="Synopsis">
49
51
<a name="libnice-StunAgent.synopsis"></a><h2>Synopsis</h2>
50
52
<pre class="synopsis">
51
 
 
52
53
#include &lt;stun/stunagent.h&gt;
53
54
 
54
55
typedef             <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a>;
55
56
enum                <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility">StunCompatibility</a>;
56
57
enum                <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags">StunAgentUsageFlags</a>;
57
58
enum                <a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus">StunValidationStatus</a>;
58
 
bool                (<a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()">*StunMessageIntegrityValidate</a>)     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
59
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *message,
60
 
                                                         uint8_t *username,
61
 
                                                         uint16_t username_len,
62
 
                                                         uint8_t **password,
63
 
                                                         size_t *password_len,
64
 
                                                         void *user_data);
 
59
<span class="returnvalue">bool</span>                (<a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()">*StunMessageIntegrityValidate</a>)     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
60
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *message,
 
61
                                                         <span class="returnvalue">uint8_t</span> *username,
 
62
                                                         <span class="returnvalue">uint16_t</span> username_len,
 
63
                                                         <span class="returnvalue">uint8_t</span> **password,
 
64
                                                         <span class="returnvalue">size_t</span> *password_len,
 
65
                                                         <span class="returnvalue">void</span> *user_data);
65
66
                    <a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData">StunDefaultValidaterData</a>;
66
 
void                <a class="link" href="libnice-StunAgent.html#stun-agent-init" title="stun_agent_init ()">stun_agent_init</a>                     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
67
 
                                                         const uint16_t *known_attributes,
68
 
                                                         <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility">StunCompatibility</a> compatibility,
69
 
                                                         <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags">StunAgentUsageFlags</a> usage_flags);
70
 
<a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus">StunValidationStatus</a>  <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()">stun_agent_validate</a>               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
71
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
72
 
                                                         const uint8_t *buffer,
73
 
                                                         size_t buffer_len,
74
 
                                                         <a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()">StunMessageIntegrityValidate</a> validater,
75
 
                                                         void *validater_data);
76
 
bool                <a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()">stun_agent_default_validater</a>        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
77
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *message,
78
 
                                                         uint8_t *username,
79
 
                                                         uint16_t username_len,
80
 
                                                         uint8_t **password,
81
 
                                                         size_t *password_len,
82
 
                                                         void *user_data);
83
 
bool                <a class="link" href="libnice-StunAgent.html#stun-agent-init-request" title="stun_agent_init_request ()">stun_agent_init_request</a>             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
84
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
85
 
                                                         uint8_t *buffer,
86
 
                                                         size_t buffer_len,
87
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod">StunMethod</a> m);
88
 
bool                <a class="link" href="libnice-StunAgent.html#stun-agent-init-indication" title="stun_agent_init_indication ()">stun_agent_init_indication</a>          (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
89
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
90
 
                                                         uint8_t *buffer,
91
 
                                                         size_t buffer_len,
92
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod">StunMethod</a> m);
93
 
bool                <a class="link" href="libnice-StunAgent.html#stun-agent-init-response" title="stun_agent_init_response ()">stun_agent_init_response</a>            (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
94
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
95
 
                                                         uint8_t *buffer,
96
 
                                                         size_t buffer_len,
97
 
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *request);
98
 
bool                <a class="link" href="libnice-StunAgent.html#stun-agent-init-error" title="stun_agent_init_error ()">stun_agent_init_error</a>               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
99
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
100
 
                                                         uint8_t *buffer,
101
 
                                                         size_t buffer_len,
102
 
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *request,
103
 
                                                         <a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError">StunError</a> err);
104
 
size_t              <a class="link" href="libnice-StunAgent.html#stun-agent-build-unknown-attributes-error" title="stun_agent_build_unknown_attributes_error ()">stun_agent_build_unknown_attributes_error</a>
105
 
                                                        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
106
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
107
 
                                                         uint8_t *buffer,
108
 
                                                         size_t buffer_len,
109
 
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *request);
110
 
size_t              <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()">stun_agent_finish_message</a>           (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
111
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
112
 
                                                         const uint8_t *key,
113
 
                                                         size_t key_len);
114
 
bool                <a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()">stun_agent_forget_transaction</a>       (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
115
 
                                                         <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId">StunTransactionId</a> id);
116
 
void                <a class="link" href="libnice-StunAgent.html#stun-agent-set-software" title="stun_agent_set_software ()">stun_agent_set_software</a>             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
117
 
                                                         const char *software);
118
 
void                <a class="link" href="libnice-StunAgent.html#stun-debug-enable" title="stun_debug_enable ()">stun_debug_enable</a>                   (void);
119
 
void                <a class="link" href="libnice-StunAgent.html#stun-debug-disable" title="stun_debug_disable ()">stun_debug_disable</a>                  (void);
 
67
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init" title="stun_agent_init ()">stun_agent_init</a>                     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
68
                                                         const <span class="returnvalue">uint16_t</span> *known_attributes,
 
69
                                                         <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="returnvalue">StunCompatibility</span></a> compatibility,
 
70
                                                         <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="returnvalue">StunAgentUsageFlags</span></a> usage_flags);
 
71
<a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="returnvalue">StunValidationStatus</span></a>  <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()">stun_agent_validate</a>               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
72
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
73
                                                         const <span class="returnvalue">uint8_t</span> *buffer,
 
74
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
75
                                                         <a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="returnvalue">StunMessageIntegrityValidate</span></a> validater,
 
76
                                                         <span class="returnvalue">void</span> *validater_data);
 
77
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()">stun_agent_default_validater</a>        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
78
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *message,
 
79
                                                         <span class="returnvalue">uint8_t</span> *username,
 
80
                                                         <span class="returnvalue">uint16_t</span> username_len,
 
81
                                                         <span class="returnvalue">uint8_t</span> **password,
 
82
                                                         <span class="returnvalue">size_t</span> *password_len,
 
83
                                                         <span class="returnvalue">void</span> *user_data);
 
84
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-request" title="stun_agent_init_request ()">stun_agent_init_request</a>             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
85
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
86
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
87
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
88
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="returnvalue">StunMethod</span></a> m);
 
89
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-indication" title="stun_agent_init_indication ()">stun_agent_init_indication</a>          (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
90
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
91
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
92
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
93
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="returnvalue">StunMethod</span></a> m);
 
94
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-response" title="stun_agent_init_response ()">stun_agent_init_response</a>            (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
95
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
96
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
97
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
98
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *request);
 
99
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init-error" title="stun_agent_init_error ()">stun_agent_init_error</a>               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
100
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
101
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
102
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
103
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *request,
 
104
                                                         <a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="returnvalue">StunError</span></a> err);
 
105
<span class="returnvalue">size_t</span>              <a class="link" href="libnice-StunAgent.html#stun-agent-build-unknown-attributes-error" title="stun_agent_build_unknown_attributes_error ()">stun_agent_build_unknown_attributes_error</a>
 
106
                                                        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
107
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
108
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
109
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
110
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *request);
 
111
<span class="returnvalue">size_t</span>              <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()">stun_agent_finish_message</a>           (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
112
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
113
                                                         const <span class="returnvalue">uint8_t</span> *key,
 
114
                                                         <span class="returnvalue">size_t</span> key_len);
 
115
<span class="returnvalue">bool</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()">stun_agent_forget_transaction</a>       (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
116
                                                         <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="returnvalue">StunTransactionId</span></a> id);
 
117
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-set-software" title="stun_agent_set_software ()">stun_agent_set_software</a>             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
118
                                                         const <span class="returnvalue">char</span> *software);
 
119
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-debug-enable" title="stun_debug_enable ()">stun_debug_enable</a>                   (void);
 
120
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-debug-disable" title="stun_debug_disable ()">stun_debug_disable</a>                  (void);
120
121
</pre>
121
122
</div>
122
123
<div class="refsect1" title="Description">
127
128
are compatible with the RFC you create it with. It also tracks the transaction
128
129
ids of the requests you send, so you can validate if a STUN response you
129
130
received should be processed by that agent or not.</p>
130
 
<p>
131
 
</p>
132
131
</div>
133
132
<div class="refsect1" title="Details">
134
133
<a name="libnice-StunAgent.details"></a><h2>Details</h2>
138
137
</pre>
139
138
<p>
140
139
An opaque structure representing the STUN agent.</p>
141
 
<p>
142
 
</p>
143
140
</div>
144
141
<hr>
145
142
<div class="refsect2" title="enum StunCompatibility">
153
150
</pre>
154
151
<p>
155
152
Enum that specifies the STUN compatibility mode of the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a></p>
156
 
<p>
157
 
</p>
158
153
<div class="variablelist"><table border="0">
159
154
<col align="left" valign="top">
160
155
<tbody>
161
156
<tr>
162
 
<td><p><a name="STUN-COMPATIBILITY-RFC3489--CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC3489</code></span></p></td>
 
157
<td><p><a name="STUN-COMPATIBILITY-RFC3489:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC3489</code></span></p></td>
163
158
<td> Use the STUN specifications compatible with
164
159
RFC 3489
165
160
</td>
166
161
</tr>
167
162
<tr>
168
 
<td><p><a name="STUN-COMPATIBILITY-RFC5389--CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC5389</code></span></p></td>
 
163
<td><p><a name="STUN-COMPATIBILITY-RFC5389:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC5389</code></span></p></td>
169
164
<td> Use the STUN specifications compatible with
170
165
RFC 5389
171
166
</td>
172
167
</tr>
173
168
<tr>
174
 
<td><p><a name="STUN-COMPATIBILITY-WLM2009--CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_WLM2009</code></span></p></td>
 
169
<td><p><a name="STUN-COMPATIBILITY-WLM2009:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_WLM2009</code></span></p></td>
175
170
<td> Use the STUN specifications compatible with
176
171
Windows Live Messenger 2009 (a mix between RFC3489 and RFC5389, as well as
177
172
a special usecase against a typo in their code)
178
173
</td>
179
174
</tr>
180
175
<tr>
181
 
<td><p><a name="STUN-COMPATIBILITY-LAST--CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_LAST</code></span></p></td>
 
176
<td><p><a name="STUN-COMPATIBILITY-LAST:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_LAST</code></span></p></td>
182
177
<td> Dummy last compatibility mode
183
178
</td>
184
179
</tr>
206
201
<p>
207
202
</p>
208
203
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> </p>
209
 
<p>
210
 
</p>
211
204
<div class="variablelist"><table border="0">
212
205
<col align="left" valign="top">
213
206
<tbody>
214
207
<tr>
215
 
<td><p><a name="STUN-AGENT-USAGE-SHORT-TERM-CREDENTIALS--CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS</code></span></p></td>
 
208
<td><p><a name="STUN-AGENT-USAGE-SHORT-TERM-CREDENTIALS:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS</code></span></p></td>
216
209
<td> The agent should be using the short
217
210
term credentials mechanism for authenticating STUN messages
218
211
</td>
219
212
</tr>
220
213
<tr>
221
 
<td><p><a name="STUN-AGENT-USAGE-LONG-TERM-CREDENTIALS--CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS</code></span></p></td>
 
214
<td><p><a name="STUN-AGENT-USAGE-LONG-TERM-CREDENTIALS:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS</code></span></p></td>
222
215
<td> The agent should be using the long
223
216
term credentials mechanism for authenticating STUN messages
224
217
</td>
225
218
</tr>
226
219
<tr>
227
 
<td><p><a name="STUN-AGENT-USAGE-USE-FINGERPRINT--CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_USE_FINGERPRINT</code></span></p></td>
 
220
<td><p><a name="STUN-AGENT-USAGE-USE-FINGERPRINT:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_USE_FINGERPRINT</code></span></p></td>
228
221
<td> The agent should add the FINGERPRINT
229
222
attribute to the STUN messages it creates.
230
223
</td>
231
224
</tr>
232
225
<tr>
233
 
<td><p><a name="STUN-AGENT-USAGE-ADD-SOFTWARE--CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_ADD_SOFTWARE</code></span></p></td>
 
226
<td><p><a name="STUN-AGENT-USAGE-ADD-SOFTWARE:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_ADD_SOFTWARE</code></span></p></td>
234
227
<td> The agent should add the SOFTWARE attribute
235
228
to the STUN messages it creates. Calling <a class="link" href="NiceAgent.html#nice-agent-set-software" title="nice_agent_set_software ()"><code class="function">nice_agent_set_software()</code></a> will have
236
229
the same effect as enabling this Usage. STUN Indications do not have the
239
232
</td>
240
233
</tr>
241
234
<tr>
242
 
<td><p><a name="STUN-AGENT-USAGE-IGNORE-CREDENTIALS--CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_IGNORE_CREDENTIALS</code></span></p></td>
 
235
<td><p><a name="STUN-AGENT-USAGE-IGNORE-CREDENTIALS:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_IGNORE_CREDENTIALS</code></span></p></td>
243
236
<td> The agent should ignore any credentials
244
237
in the STUN messages it receives (the MESSAGE-INTEGRITY attribute
245
238
will never be validated by <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>)
246
239
</td>
247
240
</tr>
248
241
<tr>
249
 
<td><p><a name="STUN-AGENT-USAGE-NO-INDICATION-AUTH--CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_NO_INDICATION_AUTH</code></span></p></td>
 
242
<td><p><a name="STUN-AGENT-USAGE-NO-INDICATION-AUTH:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_NO_INDICATION_AUTH</code></span></p></td>
250
243
<td> The agent should ignore credentials
251
244
in the STUN messages it receives if the <a class="link" href="libnice-StunMessage.html#StunClass" title="enum StunClass"><span class="type">StunClass</span></a> of the message is
252
 
<a class="link" href="libnice-StunMessage.html#STUN-INDICATION--CAPS"><span class="type">STUN_INDICATION</span></a> (some implementation require <a class="link" href="libnice-StunMessage.html#STUN-INDICATION--CAPS"><span class="type">STUN_INDICATION</span></a> messages to
 
245
<a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> (some implementation require <a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> messages to
253
246
be authenticated, while others never add a MESSAGE-INTEGRITY attribute to a
254
 
<a class="link" href="libnice-StunMessage.html#STUN-INDICATION--CAPS"><span class="type">STUN_INDICATION</span></a> message)
 
247
<a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> message)
255
248
</td>
256
249
</tr>
257
250
<tr>
258
 
<td><p><a name="STUN-AGENT-USAGE-FORCE-VALIDATER--CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_FORCE_VALIDATER</code></span></p></td>
 
251
<td><p><a name="STUN-AGENT-USAGE-FORCE-VALIDATER:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_FORCE_VALIDATER</code></span></p></td>
259
252
<td> The agent should always try to validate
260
253
the password of a STUN message, even if it already knows what the password
261
254
should be (a response to a previously created request). This means that the
284
277
<p>
285
278
This enum is used as the return value of <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> and represents
286
279
the status result of the validation of a STUN message.</p>
287
 
<p>
288
 
</p>
289
280
<div class="variablelist"><table border="0">
290
281
<col align="left" valign="top">
291
282
<tbody>
292
283
<tr>
293
 
<td><p><a name="STUN-VALIDATION-SUCCESS--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_SUCCESS</code></span></p></td>
 
284
<td><p><a name="STUN-VALIDATION-SUCCESS:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_SUCCESS</code></span></p></td>
294
285
<td> The message is validated
295
286
</td>
296
287
</tr>
297
288
<tr>
298
 
<td><p><a name="STUN-VALIDATION-NOT-STUN--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_NOT_STUN</code></span></p></td>
 
289
<td><p><a name="STUN-VALIDATION-NOT-STUN:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_NOT_STUN</code></span></p></td>
299
290
<td> This is not a valid STUN message
300
291
</td>
301
292
</tr>
302
293
<tr>
303
 
<td><p><a name="STUN-VALIDATION-INCOMPLETE-STUN--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_INCOMPLETE_STUN</code></span></p></td>
 
294
<td><p><a name="STUN-VALIDATION-INCOMPLETE-STUN:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_INCOMPLETE_STUN</code></span></p></td>
304
295
<td> The message seems to be valid but incomplete
305
296
</td>
306
297
</tr>
307
298
<tr>
308
 
<td><p><a name="STUN-VALIDATION-BAD-REQUEST--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_BAD_REQUEST</code></span></p></td>
 
299
<td><p><a name="STUN-VALIDATION-BAD-REQUEST:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_BAD_REQUEST</code></span></p></td>
309
300
<td> The message does not have the cookie or the
310
301
fingerprint while the agent needs it with its usage
311
302
</td>
312
303
</tr>
313
304
<tr>
314
 
<td><p><a name="STUN-VALIDATION-UNAUTHORIZED-BAD-REQUEST--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST</code></span></p></td>
 
305
<td><p><a name="STUN-VALIDATION-UNAUTHORIZED-BAD-REQUEST:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST</code></span></p></td>
315
306
<td> The message is valid but
316
307
unauthorized with no username and message-integrity attributes.
317
308
A BAD_REQUEST error must be generated
318
309
</td>
319
310
</tr>
320
311
<tr>
321
 
<td><p><a name="STUN-VALIDATION-UNAUTHORIZED--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNAUTHORIZED</code></span></p></td>
 
312
<td><p><a name="STUN-VALIDATION-UNAUTHORIZED:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNAUTHORIZED</code></span></p></td>
322
313
<td> The message is valid but unauthorized as
323
314
the username/password do not match.
324
315
An UNAUTHORIZED error must be generated
325
316
</td>
326
317
</tr>
327
318
<tr>
328
 
<td><p><a name="STUN-VALIDATION-UNMATCHED-RESPONSE--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNMATCHED_RESPONSE</code></span></p></td>
 
319
<td><p><a name="STUN-VALIDATION-UNMATCHED-RESPONSE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNMATCHED_RESPONSE</code></span></p></td>
329
320
<td> The message is valid but this is a
330
321
response/error that doesn't match a previously sent request
331
322
</td>
332
323
</tr>
333
324
<tr>
334
 
<td><p><a name="STUN-VALIDATION-UNKNOWN-REQUEST-ATTRIBUTE--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE</code></span></p></td>
 
325
<td><p><a name="STUN-VALIDATION-UNKNOWN-REQUEST-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE</code></span></p></td>
335
326
<td> The message is valid but
336
327
contains one or more unknown comprehension attributes.
337
328
<a class="link" href="libnice-StunAgent.html#stun-agent-build-unknown-attributes-error" title="stun_agent_build_unknown_attributes_error ()"><code class="function">stun_agent_build_unknown_attributes_error()</code></a> should be called
338
329
</td>
339
330
</tr>
340
331
<tr>
341
 
<td><p><a name="STUN-VALIDATION-UNKNOWN-ATTRIBUTE--CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNKNOWN_ATTRIBUTE</code></span></p></td>
 
332
<td><p><a name="STUN-VALIDATION-UNKNOWN-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNKNOWN_ATTRIBUTE</code></span></p></td>
342
333
<td> The message is valid but contains one
343
334
or more unknown comprehension attributes. This is a response, or error,
344
335
or indication message and no error response should be sent
350
341
<hr>
351
342
<div class="refsect2" title="StunMessageIntegrityValidate ()">
352
343
<a name="StunMessageIntegrityValidate"></a><h3>StunMessageIntegrityValidate ()</h3>
353
 
<pre class="programlisting">bool                (*StunMessageIntegrityValidate)     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
354
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *message,
355
 
                                                         uint8_t *username,
356
 
                                                         uint16_t username_len,
357
 
                                                         uint8_t **password,
358
 
                                                         size_t *password_len,
359
 
                                                         void *user_data);</pre>
 
344
<pre class="programlisting"><span class="returnvalue">bool</span>                (*StunMessageIntegrityValidate)     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
345
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *message,
 
346
                                                         <span class="returnvalue">uint8_t</span> *username,
 
347
                                                         <span class="returnvalue">uint16_t</span> username_len,
 
348
                                                         <span class="returnvalue">uint8_t</span> **password,
 
349
                                                         <span class="returnvalue">size_t</span> *password_len,
 
350
                                                         <span class="returnvalue">void</span> *user_data);</pre>
360
351
<p>
361
352
This is the prototype for the <em class="parameter"><code>validater</code></em> argument of the <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>
362
353
function.
363
354
</p>
364
355
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> </p>
365
 
<p>
366
 
</p>
367
356
<div class="variablelist"><table border="0">
368
357
<col align="left" valign="top">
369
358
<tbody>
406
395
</tr>
407
396
<tr>
408
397
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
409
 
<td> <a
410
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
411
 
><code class="literal">TRUE</code></a> if the authentication was successful,
412
 
<a
413
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
414
 
><code class="literal">FALSE</code></a> if the authentication failed
 
398
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the authentication was successful,
 
399
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the authentication failed
415
400
</td>
416
401
</tr>
417
402
</tbody>
433
418
message during validationg.
434
419
</p>
435
420
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()"><code class="function">stun_agent_default_validater()</code></a> </p>
436
 
<p>
437
 
</p>
438
421
<div class="variablelist"><table border="0">
439
422
<col align="left" valign="top">
440
423
<tbody>
441
424
<tr>
442
 
<td><p><span class="term">uint8_t *<em class="structfield"><code>username</code></em>;</span></p></td>
 
425
<td><p><span class="term"><span class="type">uint8_t</span> *<em class="structfield"><code><a name="StunDefaultValidaterData.username"></a>username</code></em>;</span></p></td>
443
426
<td> The username
444
427
</td>
445
428
</tr>
446
429
<tr>
447
 
<td><p><span class="term">size_t <em class="structfield"><code>username_len</code></em>;</span></p></td>
 
430
<td><p><span class="term"><span class="type">size_t</span> <em class="structfield"><code><a name="StunDefaultValidaterData.username-len"></a>username_len</code></em>;</span></p></td>
448
431
<td> The length of the <em class="parameter"><code>username</code></em>
449
432
</td>
450
433
</tr>
451
434
<tr>
452
 
<td><p><span class="term">uint8_t *<em class="structfield"><code>password</code></em>;</span></p></td>
 
435
<td><p><span class="term"><span class="type">uint8_t</span> *<em class="structfield"><code><a name="StunDefaultValidaterData.password"></a>password</code></em>;</span></p></td>
453
436
<td> The password
454
437
</td>
455
438
</tr>
456
439
<tr>
457
 
<td><p><span class="term">size_t <em class="structfield"><code>password_len</code></em>;</span></p></td>
 
440
<td><p><span class="term"><span class="type">size_t</span> <em class="structfield"><code><a name="StunDefaultValidaterData.password-len"></a>password_len</code></em>;</span></p></td>
458
441
<td> The length of the <em class="parameter"><code>password</code></em>
459
442
</td>
460
443
</tr>
464
447
<hr>
465
448
<div class="refsect2" title="stun_agent_init ()">
466
449
<a name="stun-agent-init"></a><h3>stun_agent_init ()</h3>
467
 
<pre class="programlisting">void                stun_agent_init                     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
468
 
                                                         const uint16_t *known_attributes,
469
 
                                                         <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility">StunCompatibility</a> compatibility,
470
 
                                                         <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags">StunAgentUsageFlags</a> usage_flags);</pre>
 
450
<pre class="programlisting"><span class="returnvalue">void</span>                stun_agent_init                     (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
451
                                                         const <span class="returnvalue">uint16_t</span> *known_attributes,
 
452
                                                         <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="returnvalue">StunCompatibility</span></a> compatibility,
 
453
                                                         <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="returnvalue">StunAgentUsageFlags</span></a> usage_flags);</pre>
471
454
<p>
472
455
This function must be called to initialize an agent before it is being used.
473
456
</p>
479
462
    The <em class="parameter"><code>known_attributes</code></em> data must exist in memory as long as the <em class="parameter"><code>agent</code></em> is used
480
463
    </p>
481
464
<p>
482
 
    If the <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-SHORT-TERM-CREDENTIALS--CAPS"><span class="type">STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS</span></a> and
483
 
    <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-LONG-TERM-CREDENTIALS--CAPS"><span class="type">STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS</span></a> usage flags are not set, then the
 
465
    If the <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-SHORT-TERM-CREDENTIALS:CAPS"><span class="type">STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS</span></a> and
 
466
    <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-LONG-TERM-CREDENTIALS:CAPS"><span class="type">STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS</span></a> usage flags are not set, then the
484
467
    agent will default in using the short term credentials mechanism
485
468
    </p>
486
469
<p>
487
 
    The <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-USE-FINGERPRINT--CAPS"><span class="type">STUN_AGENT_USAGE_USE_FINGERPRINT</span></a> and <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-ADD-SOFTWARE--CAPS"><span class="type">STUN_AGENT_USAGE_ADD_SOFTWARE</span></a>
488
 
    usage flags are only valid if the <a class="link" href="libnice-StunAgent.html#STUN-COMPATIBILITY-RFC5389--CAPS"><span class="type">STUN_COMPATIBILITY_RFC5389</span></a> or
489
 
    <a class="link" href="libnice-StunAgent.html#STUN-COMPATIBILITY-WLM2009--CAPS"><span class="type">STUN_COMPATIBILITY_WLM2009</span></a> <em class="parameter"><code>compatibility</code></em> is used
 
470
    The <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-USE-FINGERPRINT:CAPS"><span class="type">STUN_AGENT_USAGE_USE_FINGERPRINT</span></a> and <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-ADD-SOFTWARE:CAPS"><span class="type">STUN_AGENT_USAGE_ADD_SOFTWARE</span></a>
 
471
    usage flags are only valid if the <a class="link" href="libnice-StunAgent.html#STUN-COMPATIBILITY-RFC5389:CAPS"><span class="type">STUN_COMPATIBILITY_RFC5389</span></a> or
 
472
    <a class="link" href="libnice-StunAgent.html#STUN-COMPATIBILITY-WLM2009:CAPS"><span class="type">STUN_COMPATIBILITY_WLM2009</span></a> <em class="parameter"><code>compatibility</code></em> is used
490
473
    </p>
491
474
</div>
492
 
<p>
493
 
</p>
494
475
<div class="variablelist"><table border="0">
495
476
<col align="left" valign="top">
496
477
<tbody>
504
485
<td> An array of <span class="type">uint16_t</span> specifying which attributes should
505
486
be known by the agent. Any STUN message received that contains a mandatory
506
487
attribute that is not in this array will yield a
507
 
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNKNOWN-REQUEST-ATTRIBUTE--CAPS"><span class="type">STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE</span></a> or a
508
 
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNKNOWN-ATTRIBUTE--CAPS"><span class="type">STUN_VALIDATION_UNKNOWN_ATTRIBUTE</span></a> error when calling <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>
 
488
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNKNOWN-REQUEST-ATTRIBUTE:CAPS"><span class="type">STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE</span></a> or a
 
489
<a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNKNOWN-ATTRIBUTE:CAPS"><span class="type">STUN_VALIDATION_UNKNOWN_ATTRIBUTE</span></a> error when calling <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>
509
490
</td>
510
491
</tr>
511
492
<tr>
526
507
<hr>
527
508
<div class="refsect2" title="stun_agent_validate ()">
528
509
<a name="stun-agent-validate"></a><h3>stun_agent_validate ()</h3>
529
 
<pre class="programlisting"><a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus">StunValidationStatus</a>  stun_agent_validate               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
530
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
531
 
                                                         const uint8_t *buffer,
532
 
                                                         size_t buffer_len,
533
 
                                                         <a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()">StunMessageIntegrityValidate</a> validater,
534
 
                                                         void *validater_data);</pre>
 
510
<pre class="programlisting"><a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="returnvalue">StunValidationStatus</span></a>  stun_agent_validate               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
511
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
512
                                                         const <span class="returnvalue">uint8_t</span> *buffer,
 
513
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
514
                                                         <a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="returnvalue">StunMessageIntegrityValidate</span></a> validater,
 
515
                                                         <span class="returnvalue">void</span> *validater_data);</pre>
535
516
<p>
536
517
This function is used to validate an inbound STUN message and transform its
537
518
data buffer into a <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>. It will take care of various validation
539
520
authenticated.
540
521
</p>
541
522
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-default-validater" title="stun_agent_default_validater ()"><code class="function">stun_agent_default_validater()</code></a> </p>
542
 
<p>
543
 
</p>
544
523
<div class="variablelist"><table border="0">
545
524
<col align="left" valign="top">
546
525
<tbody>
570
549
be called if the agent needs to validate a MESSAGE-INTEGRITY attribute. It
571
550
will only be called if the agent finds a message that needs authentication
572
551
and a USERNAME is present in the STUN message, but no password is known.
573
 
The validater will not be called if the <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-IGNORE-CREDENTIALS--CAPS"><span class="type">STUN_AGENT_USAGE_IGNORE_CREDENTIALS</span></a>
 
552
The validater will not be called if the <a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-IGNORE-CREDENTIALS:CAPS"><span class="type">STUN_AGENT_USAGE_IGNORE_CREDENTIALS</span></a>
574
553
usage flag is set on the agent, and it will always be called if the
575
 
<a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-FORCE-VALIDATER--CAPS"><span class="type">STUN_AGENT_USAGE_FORCE_VALIDATER</span></a> usage flag is set on the agent.
 
554
<a class="link" href="libnice-StunAgent.html#STUN-AGENT-USAGE-FORCE-VALIDATER:CAPS"><span class="type">STUN_AGENT_USAGE_FORCE_VALIDATER</span></a> usage flag is set on the agent.
576
555
</td>
577
556
</tr>
578
557
<tr>
587
566
 <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
588
567
<h3 class="title">Note</h3>
589
568
<p>
590
 
   if the return value is different from <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-NOT-STUN--CAPS"><span class="type">STUN_VALIDATION_NOT_STUN</span></a> or
591
 
   <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-INCOMPLETE-STUN--CAPS"><span class="type">STUN_VALIDATION_INCOMPLETE_STUN</span></a>, then the <em class="parameter"><code>msg</code></em> argument will contain a valid
 
569
   if the return value is different from <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-NOT-STUN:CAPS"><span class="type">STUN_VALIDATION_NOT_STUN</span></a> or
 
570
   <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-INCOMPLETE-STUN:CAPS"><span class="type">STUN_VALIDATION_INCOMPLETE_STUN</span></a>, then the <em class="parameter"><code>msg</code></em> argument will contain a valid
592
571
   STUN message that can be used.
593
572
   This means that you can use the <em class="parameter"><code>msg</code></em> variable as the <em class="parameter"><code>request</code></em> argument to
594
573
   functions like <a class="link" href="libnice-StunAgent.html#stun-agent-init-error" title="stun_agent_init_error ()"><code class="function">stun_agent_init_error()</code></a> or
595
574
   <a class="link" href="libnice-StunAgent.html#stun-agent-build-unknown-attributes-error" title="stun_agent_build_unknown_attributes_error ()"><code class="function">stun_agent_build_unknown_attributes_error()</code></a>.
596
 
   If the return value is <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-BAD-REQUEST--CAPS"><span class="type">STUN_VALIDATION_BAD_REQUEST</span></a>,
597
 
   <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNAUTHORIZED--CAPS"><span class="type">STUN_VALIDATION_UNAUTHORIZED</span></a> or <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNAUTHORIZED-BAD-REQUEST--CAPS"><span class="type">STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST</span></a>
 
575
   If the return value is <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-BAD-REQUEST:CAPS"><span class="type">STUN_VALIDATION_BAD_REQUEST</span></a>,
 
576
   <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNAUTHORIZED:CAPS"><span class="type">STUN_VALIDATION_UNAUTHORIZED</span></a> or <a class="link" href="libnice-StunAgent.html#STUN-VALIDATION-UNAUTHORIZED-BAD-REQUEST:CAPS"><span class="type">STUN_VALIDATION_UNAUTHORIZED_BAD_REQUEST</span></a>
598
577
   then the <em class="parameter"><code>key</code></em> in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> will not be set, so that error responses
599
578
   will not have a MESSAGE-INTEGRITY attribute.
600
579
   </p>
607
586
<hr>
608
587
<div class="refsect2" title="stun_agent_default_validater ()">
609
588
<a name="stun-agent-default-validater"></a><h3>stun_agent_default_validater ()</h3>
610
 
<pre class="programlisting">bool                stun_agent_default_validater        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
611
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *message,
612
 
                                                         uint8_t *username,
613
 
                                                         uint16_t username_len,
614
 
                                                         uint8_t **password,
615
 
                                                         size_t *password_len,
616
 
                                                         void *user_data);</pre>
 
589
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_default_validater        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
590
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *message,
 
591
                                                         <span class="returnvalue">uint8_t</span> *username,
 
592
                                                         <span class="returnvalue">uint16_t</span> username_len,
 
593
                                                         <span class="returnvalue">uint8_t</span> **password,
 
594
                                                         <span class="returnvalue">size_t</span> *password_len,
 
595
                                                         <span class="returnvalue">void</span> *user_data);</pre>
617
596
<p>
618
597
This is a helper function to be used with <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a>. If no
619
598
complicated processing of the username needs to be done, this function can
623
602
password
624
603
</p>
625
604
<p> See also: <a class="link" href="libnice-StunAgent.html#stun-agent-validate" title="stun_agent_validate ()"><code class="function">stun_agent_validate()</code></a> </p>
626
 
<p>
627
 
</p>
628
605
<div class="variablelist"><table border="0">
629
606
<col align="left" valign="top">
630
607
<tbody>
668
645
</tr>
669
646
<tr>
670
647
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
671
 
<td> <a
672
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
673
 
><code class="literal">TRUE</code></a> if the authentication was successful,
674
 
<a
675
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
676
 
><code class="literal">FALSE</code></a> if the authentication failed
 
648
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the authentication was successful,
 
649
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the authentication failed
677
650
</td>
678
651
</tr>
679
652
</tbody>
682
655
<hr>
683
656
<div class="refsect2" title="stun_agent_init_request ()">
684
657
<a name="stun-agent-init-request"></a><h3>stun_agent_init_request ()</h3>
685
 
<pre class="programlisting">bool                stun_agent_init_request             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
686
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
687
 
                                                         uint8_t *buffer,
688
 
                                                         size_t buffer_len,
689
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod">StunMethod</a> m);</pre>
690
 
<p>
691
 
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST--CAPS"><span class="type">STUN_REQUEST</span></a> and with the method <em class="parameter"><code>m</code></em></p>
692
 
<p>
693
 
</p>
 
658
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_request             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
659
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
660
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
661
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
662
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="returnvalue">StunMethod</span></a> m);</pre>
 
663
<p>
 
664
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> and with the method <em class="parameter"><code>m</code></em></p>
694
665
<div class="variablelist"><table border="0">
695
666
<col align="left" valign="top">
696
667
<tbody>
721
692
</tr>
722
693
<tr>
723
694
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
724
 
<td> <a
725
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
726
 
><code class="literal">TRUE</code></a> if the message was initialized correctly, <a
727
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
728
 
><code class="literal">FALSE</code></a> otherwise
 
695
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
729
696
</td>
730
697
</tr>
731
698
</tbody>
734
701
<hr>
735
702
<div class="refsect2" title="stun_agent_init_indication ()">
736
703
<a name="stun-agent-init-indication"></a><h3>stun_agent_init_indication ()</h3>
737
 
<pre class="programlisting">bool                stun_agent_init_indication          (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
738
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
739
 
                                                         uint8_t *buffer,
740
 
                                                         size_t buffer_len,
741
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod">StunMethod</a> m);</pre>
742
 
<p>
743
 
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-INDICATION--CAPS"><span class="type">STUN_INDICATION</span></a> and with the method <em class="parameter"><code>m</code></em></p>
744
 
<p>
745
 
</p>
 
704
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_indication          (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
705
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
706
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
707
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
708
                                                         <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="returnvalue">StunMethod</span></a> m);</pre>
 
709
<p>
 
710
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-INDICATION:CAPS"><span class="type">STUN_INDICATION</span></a> and with the method <em class="parameter"><code>m</code></em></p>
746
711
<div class="variablelist"><table border="0">
747
712
<col align="left" valign="top">
748
713
<tbody>
773
738
</tr>
774
739
<tr>
775
740
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
776
 
<td> <a
777
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
778
 
><code class="literal">TRUE</code></a> if the message was initialized correctly, <a
779
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
780
 
><code class="literal">FALSE</code></a> otherwise
 
741
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
781
742
</td>
782
743
</tr>
783
744
</tbody>
786
747
<hr>
787
748
<div class="refsect2" title="stun_agent_init_response ()">
788
749
<a name="stun-agent-init-response"></a><h3>stun_agent_init_response ()</h3>
789
 
<pre class="programlisting">bool                stun_agent_init_response            (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
790
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
791
 
                                                         uint8_t *buffer,
792
 
                                                         size_t buffer_len,
793
 
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *request);</pre>
 
750
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_response            (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
751
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
752
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
753
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
754
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *request);</pre>
794
755
<p>
795
 
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-RESPONSE--CAPS"><span class="type">STUN_RESPONSE</span></a> and with the same method
 
756
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-RESPONSE:CAPS"><span class="type">STUN_RESPONSE</span></a> and with the same method
796
757
and transaction ID as the message <em class="parameter"><code>request</code></em>. This will also copy the pointer
797
758
to the key that was used to authenticate the request, so you won't need to
798
759
specify the key with <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a></p>
799
 
<p>
800
 
</p>
801
760
<div class="variablelist"><table border="0">
802
761
<col align="left" valign="top">
803
762
<tbody>
823
782
</tr>
824
783
<tr>
825
784
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
826
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST--CAPS"><span class="type">STUN_REQUEST</span></a> that this response is for
 
785
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> that this response is for
827
786
</td>
828
787
</tr>
829
788
<tr>
830
789
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
831
 
<td> <a
832
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
833
 
><code class="literal">TRUE</code></a> if the message was initialized correctly, <a
834
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
835
 
><code class="literal">FALSE</code></a> otherwise
 
790
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
836
791
</td>
837
792
</tr>
838
793
</tbody>
841
796
<hr>
842
797
<div class="refsect2" title="stun_agent_init_error ()">
843
798
<a name="stun-agent-init-error"></a><h3>stun_agent_init_error ()</h3>
844
 
<pre class="programlisting">bool                stun_agent_init_error               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
845
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
846
 
                                                         uint8_t *buffer,
847
 
                                                         size_t buffer_len,
848
 
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *request,
849
 
                                                         <a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError">StunError</a> err);</pre>
 
799
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_error               (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
800
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
801
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
802
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
803
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *request,
 
804
                                                         <a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="returnvalue">StunError</span></a> err);</pre>
850
805
<p>
851
 
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-ERROR--CAPS"><span class="type">STUN_ERROR</span></a> and with the same method
 
806
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-ERROR:CAPS"><span class="type">STUN_ERROR</span></a> and with the same method
852
807
and transaction ID as the message <em class="parameter"><code>request</code></em>. This will also copy the pointer
853
808
to the key that was used to authenticate the request (if authenticated),
854
809
so you won't need to specify the key with <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a>.
855
810
It will then add the ERROR-CODE attribute with code <em class="parameter"><code>err</code></em> and the associated
856
811
string.</p>
857
 
<p>
858
 
</p>
859
812
<div class="variablelist"><table border="0">
860
813
<col align="left" valign="top">
861
814
<tbody>
881
834
</tr>
882
835
<tr>
883
836
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
884
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST--CAPS"><span class="type">STUN_REQUEST</span></a> that this error response
 
837
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> that this error response
885
838
is for
886
839
</td>
887
840
</tr>
892
845
</tr>
893
846
<tr>
894
847
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
895
 
<td> <a
896
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
897
 
><code class="literal">TRUE</code></a> if the message was initialized correctly, <a
898
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
899
 
><code class="literal">FALSE</code></a> otherwise
 
848
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the message was initialized correctly, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
900
849
</td>
901
850
</tr>
902
851
</tbody>
905
854
<hr>
906
855
<div class="refsect2" title="stun_agent_build_unknown_attributes_error ()">
907
856
<a name="stun-agent-build-unknown-attributes-error"></a><h3>stun_agent_build_unknown_attributes_error ()</h3>
908
 
<pre class="programlisting">size_t              stun_agent_build_unknown_attributes_error
909
 
                                                        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
910
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
911
 
                                                         uint8_t *buffer,
912
 
                                                         size_t buffer_len,
913
 
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *request);</pre>
 
857
<pre class="programlisting"><span class="returnvalue">size_t</span>              stun_agent_build_unknown_attributes_error
 
858
                                                        (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
859
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
860
                                                         <span class="returnvalue">uint8_t</span> *buffer,
 
861
                                                         <span class="returnvalue">size_t</span> buffer_len,
 
862
                                                         const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *request);</pre>
914
863
<p>
915
 
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-ERROR--CAPS"><span class="type">STUN_ERROR</span></a> and with the same method
 
864
Creates a new STUN message of class <a class="link" href="libnice-StunMessage.html#STUN-ERROR:CAPS"><span class="type">STUN_ERROR</span></a> and with the same method
916
865
and transaction ID as the message <em class="parameter"><code>request</code></em>.  It will then add the ERROR-CODE
917
 
attribute with code <a class="link" href="libnice-StunMessage.html#STUN-ERROR-UNKNOWN-ATTRIBUTE--CAPS"><span class="type">STUN_ERROR_UNKNOWN_ATTRIBUTE</span></a> and add all the unknown
 
866
attribute with code <a class="link" href="libnice-StunMessage.html#STUN-ERROR-UNKNOWN-ATTRIBUTE:CAPS"><span class="type">STUN_ERROR_UNKNOWN_ATTRIBUTE</span></a> and add all the unknown
918
867
mandatory attributes from the <em class="parameter"><code>request</code></em> STUN message in the
919
 
<a class="link" href="libnice-StunMessage.html#STUN-ATTRIBUTE-UNKNOWN-ATTRIBUTES--CAPS"><span class="type">STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES</span></a> attribute, it will then finish the message
 
868
<a class="link" href="libnice-StunMessage.html#STUN-ATTRIBUTE-UNKNOWN-ATTRIBUTES:CAPS"><span class="type">STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES</span></a> attribute, it will then finish the message
920
869
by calling <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a></p>
921
 
<p>
922
 
</p>
923
870
<div class="variablelist"><table border="0">
924
871
<col align="left" valign="top">
925
872
<tbody>
945
892
</tr>
946
893
<tr>
947
894
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
948
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST--CAPS"><span class="type">STUN_REQUEST</span></a> that this response is for
 
895
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> of class <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> that this response is for
949
896
</td>
950
897
</tr>
951
898
<tr>
959
906
<hr>
960
907
<div class="refsect2" title="stun_agent_finish_message ()">
961
908
<a name="stun-agent-finish-message"></a><h3>stun_agent_finish_message ()</h3>
962
 
<pre class="programlisting">size_t              stun_agent_finish_message           (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
963
 
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage">StunMessage</a> *msg,
964
 
                                                         const uint8_t *key,
965
 
                                                         size_t key_len);</pre>
 
909
<pre class="programlisting"><span class="returnvalue">size_t</span>              stun_agent_finish_message           (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
910
                                                         <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="returnvalue">StunMessage</span></a> *msg,
 
911
                                                         const <span class="returnvalue">uint8_t</span> *key,
 
912
                                                         <span class="returnvalue">size_t</span> key_len);</pre>
966
913
<p>
967
914
This function will 'finish' a message and make it ready to be sent. It will
968
915
add the MESSAGE-INTEGRITY and FINGERPRINT attributes if necessary. If the
969
 
STUN message has a <a class="link" href="libnice-StunMessage.html#STUN-REQUEST--CAPS"><span class="type">STUN_REQUEST</span></a> class, it will save the transaction id of
 
916
STUN message has a <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a> class, it will save the transaction id of
970
917
the message in the agent for future matching of the response.
971
918
</p>
972
919
<p>See also: <a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()"><code class="function">stun_agent_forget_transaction()</code></a></p>
973
 
<p>
974
 
</p>
975
920
<div class="variablelist"><table border="0">
976
921
<col align="left" valign="top">
977
922
<tbody>
1007
952
       for saving the sent id in the agent's state.
1008
953
     </p>
1009
954
<p>
1010
 
       Everytime <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a> is called for a <a class="link" href="libnice-StunMessage.html#STUN-REQUEST--CAPS"><span class="type">STUN_REQUEST</span></a>
 
955
       Everytime <a class="link" href="libnice-StunAgent.html#stun-agent-finish-message" title="stun_agent_finish_message ()"><code class="function">stun_agent_finish_message()</code></a> is called for a <a class="link" href="libnice-StunMessage.html#STUN-REQUEST:CAPS"><span class="type">STUN_REQUEST</span></a>
1011
956
       message, you must make sure to call <a class="link" href="libnice-StunAgent.html#stun-agent-forget-transaction" title="stun_agent_forget_transaction ()"><code class="function">stun_agent_forget_transaction()</code></a> in
1012
957
       case the response times out and is never received. This is to avoid
1013
958
       filling up the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>'s sent ids state preventing any further
1022
967
<hr>
1023
968
<div class="refsect2" title="stun_agent_forget_transaction ()">
1024
969
<a name="stun-agent-forget-transaction"></a><h3>stun_agent_forget_transaction ()</h3>
1025
 
<pre class="programlisting">bool                stun_agent_forget_transaction       (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
1026
 
                                                         <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId">StunTransactionId</a> id);</pre>
 
970
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_forget_transaction       (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
971
                                                         <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="returnvalue">StunTransactionId</span></a> id);</pre>
1027
972
<p>
1028
973
This function is used to make the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> forget about a previously
1029
974
created transaction.
1036
981
this will allow the <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to forget about the timed out transaction and
1037
982
free its slot for future transactions.
1038
983
</p>
1039
 
<p>
1040
 
</p>
1041
984
<div class="variablelist"><table border="0">
1042
985
<col align="left" valign="top">
1043
986
<tbody>
1053
996
</tr>
1054
997
<tr>
1055
998
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1056
 
<td> <a
1057
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
1058
 
><code class="literal">TRUE</code></a> if the transaction was found, <a
1059
 
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
1060
 
><code class="literal">FALSE</code></a> otherwise
 
999
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the transaction was found, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
1061
1000
</td>
1062
1001
</tr>
1063
1002
</tbody>
1064
1003
</table></div>
 
1004
<p class="since">Since 0.0.6</p>
1065
1005
</div>
1066
1006
<hr>
1067
1007
<div class="refsect2" title="stun_agent_set_software ()">
1068
1008
<a name="stun-agent-set-software"></a><h3>stun_agent_set_software ()</h3>
1069
 
<pre class="programlisting">void                stun_agent_set_software             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent">StunAgent</a> *agent,
1070
 
                                                         const char *software);</pre>
 
1009
<pre class="programlisting"><span class="returnvalue">void</span>                stun_agent_set_software             (<a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="returnvalue">StunAgent</span></a> *agent,
 
1010
                                                         const <span class="returnvalue">char</span> *software);</pre>
1071
1011
<p>
1072
1012
This function will set the value of the SOFTWARE attribute to be added to
1073
1013
STUN requests, responses and error responses.
1078
1018
</p>
1079
1019
<p>
1080
1020
</p>
 
1021
<p>
 
1022
</p>
 
1023
<p>
 
1024
</p>
1081
1025
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
1082
1026
<h3 class="title">Note</h3>
1083
1027
<p>
1089
1033
       the StunAgent's life. Do not free its content.
1090
1034
     </p>
1091
1035
</div>
1092
 
<p>
1093
 
</p>
1094
1036
<div class="variablelist"><table border="0">
1095
1037
<col align="left" valign="top">
1096
1038
<tbody>
1106
1048
</tr>
1107
1049
</tbody>
1108
1050
</table></div>
 
1051
<p class="since">Since 0.0.10</p>
1109
1052
</div>
1110
1053
<hr>
1111
1054
<div class="refsect2" title="stun_debug_enable ()">
1112
1055
<a name="stun-debug-enable"></a><h3>stun_debug_enable ()</h3>
1113
 
<pre class="programlisting">void                stun_debug_enable                   (void);</pre>
 
1056
<pre class="programlisting"><span class="returnvalue">void</span>                stun_debug_enable                   (void);</pre>
1114
1057
<p>
1115
1058
Enable debug messages to stderr</p>
1116
 
<p>
1117
 
</p>
1118
1059
</div>
1119
1060
<hr>
1120
1061
<div class="refsect2" title="stun_debug_disable ()">
1121
1062
<a name="stun-debug-disable"></a><h3>stun_debug_disable ()</h3>
1122
 
<pre class="programlisting">void                stun_debug_disable                  (void);</pre>
 
1063
<pre class="programlisting"><span class="returnvalue">void</span>                stun_debug_disable                  (void);</pre>
1123
1064
<p>
1124
1065
Disable debug messages to stderr</p>
1125
 
<p>
1126
 
</p>
1127
1066
</div>
1128
1067
</div>
1129
1068
<div class="refsect1" title="See Also">
1130
1069
<a name="libnice-StunAgent.see-also"></a><h2>See Also</h2>
1131
 
#StunMessage
 
1070
<a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
1132
1071
</div>
1133
1072
</div>
1134
1073
<div class="footer">
1135
1074
<hr>
1136
 
          Generated by GTK-Doc V1.11</div>
 
1075
          Generated by GTK-Doc V1.13</div>
1137
1076
</body>
1138
 
</html>
 
1077
</html>
 
 
b'\\ No newline at end of file'