~ubuntu-branches/debian/stretch/libnice/stretch

« back to all changes in this revision

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

Tags: 0.1.0-2
Add a Breaks: libgstfarsight0.10-0 (<< 0.22) for the gstreamer plugin as
farsight uses one libnice ABI and the gstreamer element uses another
libnice ABI things tend to go horribly wrong.

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.13 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
 
<link rel="part" href="pt01.html" title="Part I. ICE Library">
14
 
<link rel="chapter" href="ch01.html" title="">
15
 
<link rel="chapter" href="ch02.html" title="Libnice helper functions">
16
 
<link rel="part" href="pt02.html" title="Part II. STUN Library">
17
 
<link rel="chapter" href="ch03.html" title="">
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="">
21
13
</head>
22
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
23
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
56
48
enum                <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility">StunCompatibility</a>;
57
49
enum                <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags">StunAgentUsageFlags</a>;
58
50
enum                <a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus">StunValidationStatus</a>;
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);
 
51
<span class="returnvalue">bool</span>                (<a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()">*StunMessageIntegrityValidate</a>)     (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
52
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *message</code></em>,
 
53
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
 
54
                                                         <em class="parameter"><code><span class="type">uint16_t</span> username_len</code></em>,
 
55
                                                         <em class="parameter"><code><span class="type">uint8_t</span> **password</code></em>,
 
56
                                                         <em class="parameter"><code><span class="type">size_t</span> *password_len</code></em>,
 
57
                                                         <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);
66
58
                    <a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData">StunDefaultValidaterData</a>;
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);
 
59
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-agent-init" title="stun_agent_init ()">stun_agent_init</a>                     (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
60
                                                         <em class="parameter"><code>const <span class="type">uint16_t</span> *known_attributes</code></em>,
 
61
                                                         <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="type">StunCompatibility</span></a> compatibility</code></em>,
 
62
                                                         <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="type">StunAgentUsageFlags</span></a> usage_flags</code></em>);
 
63
<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>               (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
64
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
65
                                                         <em class="parameter"><code>const <span class="type">uint8_t</span> *buffer</code></em>,
 
66
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
67
                                                         <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> validater</code></em>,
 
68
                                                         <em class="parameter"><code><span class="type">void</span> *validater_data</code></em>);
 
69
<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>        (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
70
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *message</code></em>,
 
71
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
 
72
                                                         <em class="parameter"><code><span class="type">uint16_t</span> username_len</code></em>,
 
73
                                                         <em class="parameter"><code><span class="type">uint8_t</span> **password</code></em>,
 
74
                                                         <em class="parameter"><code><span class="type">size_t</span> *password_len</code></em>,
 
75
                                                         <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);
 
76
<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>             (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
77
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
78
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
79
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
80
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> m</code></em>);
 
81
<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>          (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
82
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
83
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
84
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
85
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> m</code></em>);
 
86
<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>            (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
87
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
88
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
89
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
90
                                                         <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *request</code></em>);
 
91
<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>               (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
92
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
93
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
94
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
95
                                                         <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *request</code></em>,
 
96
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="type">StunError</span></a> err</code></em>);
105
97
<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);
 
98
                                                        (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
99
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
100
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
101
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
102
                                                         <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *request</code></em>);
 
103
<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>           (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
104
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
105
                                                         <em class="parameter"><code>const <span class="type">uint8_t</span> *key</code></em>,
 
106
                                                         <em class="parameter"><code><span class="type">size_t</span> key_len</code></em>);
 
107
<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>       (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
108
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="type">StunTransactionId</span></a> id</code></em>);
 
109
<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>             (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
110
                                                         <em class="parameter"><code>const <span class="type">char</span> *software</code></em>);
 
111
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-debug-enable" title="stun_debug_enable ()">stun_debug_enable</a>                   (<em class="parameter"><code><span class="type">void</span></code></em>);
 
112
<span class="returnvalue">void</span>                <a class="link" href="libnice-StunAgent.html#stun-debug-disable" title="stun_debug_disable ()">stun_debug_disable</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
121
113
</pre>
122
114
</div>
123
115
<div class="refsect1" title="Description">
127
119
It's main purpose is to make sure the building and validation methods used
128
120
are compatible with the RFC you create it with. It also tracks the transaction
129
121
ids of the requests you send, so you can validate if a STUN response you
130
 
received should be processed by that agent or not.</p>
 
122
received should be processed by that agent or not.
 
123
</p>
131
124
</div>
132
125
<div class="refsect1" title="Details">
133
126
<a name="libnice-StunAgent.details"></a><h2>Details</h2>
136
129
<pre class="programlisting">typedef struct stun_agent_t StunAgent;
137
130
</pre>
138
131
<p>
139
 
An opaque structure representing the STUN agent.</p>
 
132
An opaque structure representing the STUN agent.
 
133
</p>
140
134
</div>
141
135
<hr>
142
136
<div class="refsect2" title="enum StunCompatibility">
145
139
  STUN_COMPATIBILITY_RFC3489,
146
140
  STUN_COMPATIBILITY_RFC5389,
147
141
  STUN_COMPATIBILITY_WLM2009,
148
 
  STUN_COMPATIBILITY_LAST = STUN_COMPATIBILITY_WLM2009
 
142
  STUN_COMPATIBILITY_OC2007,
 
143
  STUN_COMPATIBILITY_LAST = STUN_COMPATIBILITY_OC2007
149
144
} StunCompatibility;
150
145
</pre>
151
146
<p>
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>
 
147
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>
 
148
</p>
153
149
<div class="variablelist"><table border="0">
154
150
<col align="left" valign="top">
155
151
<tbody>
156
152
<tr>
157
153
<td><p><a name="STUN-COMPATIBILITY-RFC3489:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC3489</code></span></p></td>
158
 
<td> Use the STUN specifications compatible with
 
154
<td>Use the STUN specifications compatible with
159
155
RFC 3489
160
156
</td>
161
157
</tr>
162
158
<tr>
163
159
<td><p><a name="STUN-COMPATIBILITY-RFC5389:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_RFC5389</code></span></p></td>
164
 
<td> Use the STUN specifications compatible with
 
160
<td>Use the STUN specifications compatible with
165
161
RFC 5389
166
162
</td>
167
163
</tr>
168
164
<tr>
169
165
<td><p><a name="STUN-COMPATIBILITY-WLM2009:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_WLM2009</code></span></p></td>
170
 
<td> Use the STUN specifications compatible with
 
166
<td>Use the STUN specifications compatible with
171
167
Windows Live Messenger 2009 (a mix between RFC3489 and RFC5389, as well as
172
168
a special usecase against a typo in their code)
173
169
</td>
174
170
</tr>
175
171
<tr>
 
172
<td><p><a name="STUN-COMPATIBILITY-OC2007:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_OC2007</code></span></p></td>
 
173
<td>Use the STUN specifications compatible with
 
174
Microsoft Office Communicator 2007 (basically RFC3489 with swapped
 
175
REALM and NONCE attribute hex IDs, attributes are not aligned)
 
176
</td>
 
177
</tr>
 
178
<tr>
176
179
<td><p><a name="STUN-COMPATIBILITY-LAST:CAPS"></a><span class="term"><code class="literal">STUN_COMPATIBILITY_LAST</code></span></p></td>
177
 
<td> Dummy last compatibility mode
 
180
<td>Dummy last compatibility mode
178
181
</td>
179
182
</tr>
180
183
</tbody>
191
194
  STUN_AGENT_USAGE_IGNORE_CREDENTIALS        = (1 &lt;&lt; 4),
192
195
  STUN_AGENT_USAGE_NO_INDICATION_AUTH        = (1 &lt;&lt; 5),
193
196
  STUN_AGENT_USAGE_FORCE_VALIDATER           = (1 &lt;&lt; 6),
 
197
  STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES     = (1 &lt;&lt; 7),
194
198
} StunAgentUsageFlags;
195
199
</pre>
196
200
<p>
201
205
<p>
202
206
</p>
203
207
<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>
 
208
<p>
 
209
</p>
204
210
<div class="variablelist"><table border="0">
205
211
<col align="left" valign="top">
206
212
<tbody>
207
213
<tr>
208
214
<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>
209
 
<td> The agent should be using the short
 
215
<td>The agent should be using the short
210
216
term credentials mechanism for authenticating STUN messages
211
217
</td>
212
218
</tr>
213
219
<tr>
214
220
<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>
215
 
<td> The agent should be using the long
 
221
<td>The agent should be using the long
216
222
term credentials mechanism for authenticating STUN messages
217
223
</td>
218
224
</tr>
219
225
<tr>
220
226
<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>
221
 
<td> The agent should add the FINGERPRINT
 
227
<td>The agent should add the FINGERPRINT
222
228
attribute to the STUN messages it creates.
223
229
</td>
224
230
</tr>
225
231
<tr>
226
232
<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>
227
 
<td> The agent should add the SOFTWARE attribute
 
233
<td>The agent should add the SOFTWARE attribute
228
234
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
229
235
the same effect as enabling this Usage. STUN Indications do not have the
230
236
SOFTWARE attributes added to them though. The SOFTWARE attribute is only
233
239
</tr>
234
240
<tr>
235
241
<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>
236
 
<td> The agent should ignore any credentials
 
242
<td>The agent should ignore any credentials
237
243
in the STUN messages it receives (the MESSAGE-INTEGRITY attribute
238
244
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>)
239
245
</td>
240
246
</tr>
241
247
<tr>
242
248
<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>
243
 
<td> The agent should ignore credentials
 
249
<td>The agent should ignore credentials
244
250
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
245
251
<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
246
252
be authenticated, while others never add a MESSAGE-INTEGRITY attribute to a
249
255
</tr>
250
256
<tr>
251
257
<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>
252
 
<td> The agent should always try to validate
 
258
<td>The agent should always try to validate
253
259
the password of a STUN message, even if it already knows what the password
254
260
should be (a response to a previously created request). This means that the
255
261
<a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> callback will always be called when there is
256
262
a MESSAGE-INTEGRITY attribute.
257
263
</td>
258
264
</tr>
 
265
<tr>
 
266
<td><p><a name="STUN-AGENT-USAGE-NO-ALIGNED-ATTRIBUTES:CAPS"></a><span class="term"><code class="literal">STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES</code></span></p></td>
 
267
<td>The agent should not assume STUN
 
268
attributes are aligned on 32-bit boundaries when parsing messages and also
 
269
do not add padding when creating messages.
 
270
</td>
 
271
</tr>
259
272
</tbody>
260
273
</table></div>
261
274
</div>
276
289
</pre>
277
290
<p>
278
291
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
279
 
the status result of the validation of a STUN message.</p>
 
292
the status result of the validation of a STUN message.
 
293
</p>
280
294
<div class="variablelist"><table border="0">
281
295
<col align="left" valign="top">
282
296
<tbody>
283
297
<tr>
284
298
<td><p><a name="STUN-VALIDATION-SUCCESS:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_SUCCESS</code></span></p></td>
285
 
<td> The message is validated
 
299
<td>The message is validated
286
300
</td>
287
301
</tr>
288
302
<tr>
289
303
<td><p><a name="STUN-VALIDATION-NOT-STUN:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_NOT_STUN</code></span></p></td>
290
 
<td> This is not a valid STUN message
 
304
<td>This is not a valid STUN message
291
305
</td>
292
306
</tr>
293
307
<tr>
294
308
<td><p><a name="STUN-VALIDATION-INCOMPLETE-STUN:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_INCOMPLETE_STUN</code></span></p></td>
295
 
<td> The message seems to be valid but incomplete
 
309
<td>The message seems to be valid but incomplete
296
310
</td>
297
311
</tr>
298
312
<tr>
299
313
<td><p><a name="STUN-VALIDATION-BAD-REQUEST:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_BAD_REQUEST</code></span></p></td>
300
 
<td> The message does not have the cookie or the
 
314
<td>The message does not have the cookie or the
301
315
fingerprint while the agent needs it with its usage
302
316
</td>
303
317
</tr>
304
318
<tr>
305
319
<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>
306
 
<td> The message is valid but
 
320
<td>The message is valid but
307
321
unauthorized with no username and message-integrity attributes.
308
322
A BAD_REQUEST error must be generated
309
323
</td>
310
324
</tr>
311
325
<tr>
312
326
<td><p><a name="STUN-VALIDATION-UNAUTHORIZED:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNAUTHORIZED</code></span></p></td>
313
 
<td> The message is valid but unauthorized as
 
327
<td>The message is valid but unauthorized as
314
328
the username/password do not match.
315
329
An UNAUTHORIZED error must be generated
316
330
</td>
317
331
</tr>
318
332
<tr>
319
333
<td><p><a name="STUN-VALIDATION-UNMATCHED-RESPONSE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNMATCHED_RESPONSE</code></span></p></td>
320
 
<td> The message is valid but this is a
 
334
<td>The message is valid but this is a
321
335
response/error that doesn't match a previously sent request
322
336
</td>
323
337
</tr>
324
338
<tr>
325
339
<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>
326
 
<td> The message is valid but
 
340
<td>The message is valid but
327
341
contains one or more unknown comprehension attributes.
328
342
<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
329
343
</td>
330
344
</tr>
331
345
<tr>
332
346
<td><p><a name="STUN-VALIDATION-UNKNOWN-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">STUN_VALIDATION_UNKNOWN_ATTRIBUTE</code></span></p></td>
333
 
<td> The message is valid but contains one
 
347
<td>The message is valid but contains one
334
348
or more unknown comprehension attributes. This is a response, or error,
335
349
or indication message and no error response should be sent
336
350
</td>
341
355
<hr>
342
356
<div class="refsect2" title="StunMessageIntegrityValidate ()">
343
357
<a name="StunMessageIntegrityValidate"></a><h3>StunMessageIntegrityValidate ()</h3>
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>
 
358
<pre class="programlisting"><span class="returnvalue">bool</span>                (*StunMessageIntegrityValidate)     (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
359
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *message</code></em>,
 
360
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
 
361
                                                         <em class="parameter"><code><span class="type">uint16_t</span> username_len</code></em>,
 
362
                                                         <em class="parameter"><code><span class="type">uint8_t</span> **password</code></em>,
 
363
                                                         <em class="parameter"><code><span class="type">size_t</span> *password_len</code></em>,
 
364
                                                         <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
351
365
<p>
352
366
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>
353
367
function.
354
368
</p>
355
369
<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>
 
370
<p>
 
371
</p>
356
372
<div class="variablelist"><table border="0">
357
373
<col align="left" valign="top">
358
374
<tbody>
359
375
<tr>
360
376
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
361
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
377
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
362
378
</td>
363
379
</tr>
364
380
<tr>
365
381
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
366
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> being validated
 
382
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> being validated
367
383
</td>
368
384
</tr>
369
385
<tr>
370
386
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
371
 
<td> The username found in the <em class="parameter"><code>message</code></em>
 
387
<td>The username found in the <em class="parameter"><code>message</code></em>
372
388
</td>
373
389
</tr>
374
390
<tr>
375
391
<td><p><span class="term"><em class="parameter"><code>username_len</code></em> :</span></p></td>
376
 
<td> The length of <em class="parameter"><code>username</code></em>
 
392
<td>The length of <em class="parameter"><code>username</code></em>
377
393
</td>
378
394
</tr>
379
395
<tr>
380
396
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
381
 
<td> The password associated with that username. This argument is a
 
397
<td>The password associated with that username. This argument is a
382
398
pointer to a byte array that must be set by the validater function.
383
399
</td>
384
400
</tr>
385
401
<tr>
386
402
<td><p><span class="term"><em class="parameter"><code>password_len</code></em> :</span></p></td>
387
 
<td> The length of <em class="parameter"><code>password</code></em> which must also be set by the
 
403
<td>The length of <em class="parameter"><code>password</code></em> which must also be set by the
388
404
validater function.
389
405
</td>
390
406
</tr>
391
407
<tr>
392
408
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
393
 
<td> Data to give the function
 
409
<td>Data to give the function
394
410
</td>
395
411
</tr>
396
412
<tr>
418
434
message during validationg.
419
435
</p>
420
436
<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>
 
437
<p>
 
438
</p>
421
439
<div class="variablelist"><table border="0">
422
440
<col align="left" valign="top">
423
441
<tbody>
424
442
<tr>
425
443
<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>
426
 
<td> The username
 
444
<td>The username
427
445
</td>
428
446
</tr>
429
447
<tr>
430
448
<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>
431
 
<td> The length of the <em class="parameter"><code>username</code></em>
 
449
<td>The length of the <em class="parameter"><code>username</code></em>
432
450
</td>
433
451
</tr>
434
452
<tr>
435
453
<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>
436
 
<td> The password
 
454
<td>The password
437
455
</td>
438
456
</tr>
439
457
<tr>
440
458
<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>
441
 
<td> The length of the <em class="parameter"><code>password</code></em>
 
459
<td>The length of the <em class="parameter"><code>password</code></em>
442
460
</td>
443
461
</tr>
444
462
</tbody>
447
465
<hr>
448
466
<div class="refsect2" title="stun_agent_init ()">
449
467
<a name="stun-agent-init"></a><h3>stun_agent_init ()</h3>
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>
 
468
<pre class="programlisting"><span class="returnvalue">void</span>                stun_agent_init                     (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
469
                                                         <em class="parameter"><code>const <span class="type">uint16_t</span> *known_attributes</code></em>,
 
470
                                                         <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="type">StunCompatibility</span></a> compatibility</code></em>,
 
471
                                                         <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="type">StunAgentUsageFlags</span></a> usage_flags</code></em>);</pre>
454
472
<p>
455
473
This function must be called to initialize an agent before it is being used.
456
474
</p>
472
490
    <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
473
491
    </p>
474
492
</div>
 
493
<p>
 
494
</p>
475
495
<div class="variablelist"><table border="0">
476
496
<col align="left" valign="top">
477
497
<tbody>
478
498
<tr>
479
499
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
480
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to initialize
 
500
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> to initialize
481
501
</td>
482
502
</tr>
483
503
<tr>
484
504
<td><p><span class="term"><em class="parameter"><code>known_attributes</code></em> :</span></p></td>
485
 
<td> An array of <span class="type">uint16_t</span> specifying which attributes should
 
505
<td>An array of <span class="type">uint16_t</span> specifying which attributes should
486
506
be known by the agent. Any STUN message received that contains a mandatory
487
507
attribute that is not in this array will yield a
488
508
<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
491
511
</tr>
492
512
<tr>
493
513
<td><p><span class="term"><em class="parameter"><code>compatibility</code></em> :</span></p></td>
494
 
<td> The <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="type">StunCompatibility</span></a> to use for this agent. This will affect
 
514
<td>The <a class="link" href="libnice-StunAgent.html#StunCompatibility" title="enum StunCompatibility"><span class="type">StunCompatibility</span></a> to use for this agent. This will affect
495
515
how the agent builds and validates the STUN messages
496
516
</td>
497
517
</tr>
498
518
<tr>
499
519
<td><p><span class="term"><em class="parameter"><code>usage_flags</code></em> :</span></p></td>
500
 
<td> A bitflag using <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="type">StunAgentUsageFlags</span></a> values to define which
 
520
<td>A bitflag using <a class="link" href="libnice-StunAgent.html#StunAgentUsageFlags" title="enum StunAgentUsageFlags"><span class="type">StunAgentUsageFlags</span></a> values to define which
501
521
STUN usages the agent should use.
502
522
</td>
503
523
</tr>
507
527
<hr>
508
528
<div class="refsect2" title="stun_agent_validate ()">
509
529
<a name="stun-agent-validate"></a><h3>stun_agent_validate ()</h3>
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>
 
530
<pre class="programlisting"><a class="link" href="libnice-StunAgent.html#StunValidationStatus" title="enum StunValidationStatus"><span class="returnvalue">StunValidationStatus</span></a>  stun_agent_validate               (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
531
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
532
                                                         <em class="parameter"><code>const <span class="type">uint8_t</span> *buffer</code></em>,
 
533
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
534
                                                         <em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> validater</code></em>,
 
535
                                                         <em class="parameter"><code><span class="type">void</span> *validater_data</code></em>);</pre>
516
536
<p>
517
537
This function is used to validate an inbound STUN message and transform its
518
538
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
520
540
authenticated.
521
541
</p>
522
542
<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>
 
543
<p>
 
544
</p>
523
545
<div class="variablelist"><table border="0">
524
546
<col align="left" valign="top">
525
547
<tbody>
526
548
<tr>
527
549
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
528
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
550
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
529
551
</td>
530
552
</tr>
531
553
<tr>
532
554
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
533
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
 
555
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
534
556
</td>
535
557
</tr>
536
558
<tr>
537
559
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
538
 
<td> The data buffer of the STUN message
 
560
<td>The data buffer of the STUN message
539
561
</td>
540
562
</tr>
541
563
<tr>
542
564
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
543
 
<td> The length of <em class="parameter"><code>buffer</code></em>
 
565
<td>The length of <em class="parameter"><code>buffer</code></em>
544
566
</td>
545
567
</tr>
546
568
<tr>
547
569
<td><p><span class="term"><em class="parameter"><code>validater</code></em> :</span></p></td>
548
 
<td> A <a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> function callback that will
 
570
<td>A <a class="link" href="libnice-StunAgent.html#StunMessageIntegrityValidate" title="StunMessageIntegrityValidate ()"><span class="type">StunMessageIntegrityValidate</span></a> function callback that will
549
571
be called if the agent needs to validate a MESSAGE-INTEGRITY attribute. It
550
572
will only be called if the agent finds a message that needs authentication
551
573
and a USERNAME is present in the STUN message, but no password is known.
556
578
</tr>
557
579
<tr>
558
580
<td><p><span class="term"><em class="parameter"><code>validater_data</code></em> :</span></p></td>
559
 
<td> A user data to give to the <em class="parameter"><code>validater</code></em> callback when it gets
 
581
<td>A user data to give to the <em class="parameter"><code>validater</code></em> callback when it gets
560
582
called.
561
583
</td>
562
584
</tr>
586
608
<hr>
587
609
<div class="refsect2" title="stun_agent_default_validater ()">
588
610
<a name="stun-agent-default-validater"></a><h3>stun_agent_default_validater ()</h3>
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>
 
611
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_default_validater        (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
612
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *message</code></em>,
 
613
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *username</code></em>,
 
614
                                                         <em class="parameter"><code><span class="type">uint16_t</span> username_len</code></em>,
 
615
                                                         <em class="parameter"><code><span class="type">uint8_t</span> **password</code></em>,
 
616
                                                         <em class="parameter"><code><span class="type">size_t</span> *password_len</code></em>,
 
617
                                                         <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
596
618
<p>
597
619
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
598
620
complicated processing of the username needs to be done, this function can
602
624
password
603
625
</p>
604
626
<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>
 
627
<p>
 
628
</p>
605
629
<div class="variablelist"><table border="0">
606
630
<col align="left" valign="top">
607
631
<tbody>
608
632
<tr>
609
633
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
610
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
634
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
611
635
</td>
612
636
</tr>
613
637
<tr>
614
638
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
615
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> being validated
 
639
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> being validated
616
640
</td>
617
641
</tr>
618
642
<tr>
619
643
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
620
 
<td> The username found in the <em class="parameter"><code>message</code></em>
 
644
<td>The username found in the <em class="parameter"><code>message</code></em>
621
645
</td>
622
646
</tr>
623
647
<tr>
624
648
<td><p><span class="term"><em class="parameter"><code>username_len</code></em> :</span></p></td>
625
 
<td> The length of <em class="parameter"><code>username</code></em>
 
649
<td>The length of <em class="parameter"><code>username</code></em>
626
650
</td>
627
651
</tr>
628
652
<tr>
629
653
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
630
 
<td> The password associated with that username. This argument is a
 
654
<td>The password associated with that username. This argument is a
631
655
pointer to a byte array that must be set by the validater function.
632
656
</td>
633
657
</tr>
634
658
<tr>
635
659
<td><p><span class="term"><em class="parameter"><code>password_len</code></em> :</span></p></td>
636
 
<td> The length of <em class="parameter"><code>password</code></em> which must also be set by the
 
660
<td>The length of <em class="parameter"><code>password</code></em> which must also be set by the
637
661
validater function.
638
662
</td>
639
663
</tr>
640
664
<tr>
641
665
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
642
 
<td> This must be an array of <a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData"><span class="type">StunDefaultValidaterData</span></a> structures.
 
666
<td>This must be an array of <a class="link" href="libnice-StunAgent.html#StunDefaultValidaterData" title="StunDefaultValidaterData"><span class="type">StunDefaultValidaterData</span></a> structures.
643
667
The last element in the array must have a username set to NULL
644
668
</td>
645
669
</tr>
655
679
<hr>
656
680
<div class="refsect2" title="stun_agent_init_request ()">
657
681
<a name="stun-agent-init-request"></a><h3>stun_agent_init_request ()</h3>
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>
 
682
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_request             (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
683
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
684
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
685
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
686
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> m</code></em>);</pre>
663
687
<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>
 
688
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>
 
689
</p>
665
690
<div class="variablelist"><table border="0">
666
691
<col align="left" valign="top">
667
692
<tbody>
668
693
<tr>
669
694
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
670
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
695
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
671
696
</td>
672
697
</tr>
673
698
<tr>
674
699
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
675
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
 
700
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
676
701
</td>
677
702
</tr>
678
703
<tr>
679
704
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
680
 
<td> The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
 
705
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
681
706
</td>
682
707
</tr>
683
708
<tr>
684
709
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
685
 
<td> The length of the buffer
 
710
<td>The length of the buffer
686
711
</td>
687
712
</tr>
688
713
<tr>
689
714
<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
690
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the request
 
715
<td>The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the request
691
716
</td>
692
717
</tr>
693
718
<tr>
701
726
<hr>
702
727
<div class="refsect2" title="stun_agent_init_indication ()">
703
728
<a name="stun-agent-init-indication"></a><h3>stun_agent_init_indication ()</h3>
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>
 
729
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_indication          (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
730
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
731
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
732
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
733
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> m</code></em>);</pre>
709
734
<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>
 
735
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>
 
736
</p>
711
737
<div class="variablelist"><table border="0">
712
738
<col align="left" valign="top">
713
739
<tbody>
714
740
<tr>
715
741
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
716
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
742
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
717
743
</td>
718
744
</tr>
719
745
<tr>
720
746
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
721
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
 
747
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
722
748
</td>
723
749
</tr>
724
750
<tr>
725
751
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
726
 
<td> The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
 
752
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
727
753
</td>
728
754
</tr>
729
755
<tr>
730
756
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
731
 
<td> The length of the buffer
 
757
<td>The length of the buffer
732
758
</td>
733
759
</tr>
734
760
<tr>
735
761
<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
736
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the indication
 
762
<td>The <a class="link" href="libnice-StunMessage.html#StunMethod" title="enum StunMethod"><span class="type">StunMethod</span></a> of the indication
737
763
</td>
738
764
</tr>
739
765
<tr>
747
773
<hr>
748
774
<div class="refsect2" title="stun_agent_init_response ()">
749
775
<a name="stun-agent-init-response"></a><h3>stun_agent_init_response ()</h3>
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>
 
776
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_response            (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
777
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
778
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
779
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
780
                                                         <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *request</code></em>);</pre>
755
781
<p>
756
782
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
757
783
and transaction ID as the message <em class="parameter"><code>request</code></em>. This will also copy the pointer
758
784
to the key that was used to authenticate the request, so you won't need to
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>
 
785
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>
 
786
</p>
760
787
<div class="variablelist"><table border="0">
761
788
<col align="left" valign="top">
762
789
<tbody>
763
790
<tr>
764
791
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
765
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
792
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
766
793
</td>
767
794
</tr>
768
795
<tr>
769
796
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
770
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
 
797
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
771
798
</td>
772
799
</tr>
773
800
<tr>
774
801
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
775
 
<td> The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
 
802
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
776
803
</td>
777
804
</tr>
778
805
<tr>
779
806
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
780
 
<td> The length of the buffer
 
807
<td>The length of the buffer
781
808
</td>
782
809
</tr>
783
810
<tr>
784
811
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
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
 
812
<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
786
813
</td>
787
814
</tr>
788
815
<tr>
796
823
<hr>
797
824
<div class="refsect2" title="stun_agent_init_error ()">
798
825
<a name="stun-agent-init-error"></a><h3>stun_agent_init_error ()</h3>
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>
 
826
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_init_error               (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
827
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
828
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
829
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
830
                                                         <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *request</code></em>,
 
831
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="type">StunError</span></a> err</code></em>);</pre>
805
832
<p>
806
833
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
807
834
and transaction ID as the message <em class="parameter"><code>request</code></em>. This will also copy the pointer
808
835
to the key that was used to authenticate the request (if authenticated),
809
836
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>.
810
837
It will then add the ERROR-CODE attribute with code <em class="parameter"><code>err</code></em> and the associated
811
 
string.</p>
 
838
string.
 
839
</p>
812
840
<div class="variablelist"><table border="0">
813
841
<col align="left" valign="top">
814
842
<tbody>
815
843
<tr>
816
844
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
817
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
845
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
818
846
</td>
819
847
</tr>
820
848
<tr>
821
849
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
822
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
 
850
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
823
851
</td>
824
852
</tr>
825
853
<tr>
826
854
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
827
 
<td> The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
 
855
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
828
856
</td>
829
857
</tr>
830
858
<tr>
831
859
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
832
 
<td> The length of the buffer
 
860
<td>The length of the buffer
833
861
</td>
834
862
</tr>
835
863
<tr>
836
864
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
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
 
865
<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
838
866
is for
839
867
</td>
840
868
</tr>
841
869
<tr>
842
870
<td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
843
 
<td> The <a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="type">StunError</span></a> to put in the ERROR-CODE attribute of the error response
 
871
<td>The <a class="link" href="libnice-StunMessage.html#StunError" title="enum StunError"><span class="type">StunError</span></a> to put in the ERROR-CODE attribute of the error response
844
872
</td>
845
873
</tr>
846
874
<tr>
855
883
<div class="refsect2" title="stun_agent_build_unknown_attributes_error ()">
856
884
<a name="stun-agent-build-unknown-attributes-error"></a><h3>stun_agent_build_unknown_attributes_error ()</h3>
857
885
<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>
 
886
                                                        (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
887
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
888
                                                         <em class="parameter"><code><span class="type">uint8_t</span> *buffer</code></em>,
 
889
                                                         <em class="parameter"><code><span class="type">size_t</span> buffer_len</code></em>,
 
890
                                                         <em class="parameter"><code>const <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *request</code></em>);</pre>
863
891
<p>
864
892
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
865
893
and transaction ID as the message <em class="parameter"><code>request</code></em>.  It will then add the ERROR-CODE
866
894
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
867
895
mandatory attributes from the <em class="parameter"><code>request</code></em> STUN message in the
868
896
<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
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>
 
897
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>
 
898
</p>
870
899
<div class="variablelist"><table border="0">
871
900
<col align="left" valign="top">
872
901
<tbody>
873
902
<tr>
874
903
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
875
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
904
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
876
905
</td>
877
906
</tr>
878
907
<tr>
879
908
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
880
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
 
909
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to build
881
910
</td>
882
911
</tr>
883
912
<tr>
884
913
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
885
 
<td> The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
 
914
<td>The buffer to use in the <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a>
886
915
</td>
887
916
</tr>
888
917
<tr>
889
918
<td><p><span class="term"><em class="parameter"><code>buffer_len</code></em> :</span></p></td>
890
 
<td> The length of the buffer
 
919
<td>The length of the buffer
891
920
</td>
892
921
</tr>
893
922
<tr>
894
923
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
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
 
924
<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
896
925
</td>
897
926
</tr>
898
927
<tr>
906
935
<hr>
907
936
<div class="refsect2" title="stun_agent_finish_message ()">
908
937
<a name="stun-agent-finish-message"></a><h3>stun_agent_finish_message ()</h3>
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>
 
938
<pre class="programlisting"><span class="returnvalue">size_t</span>              stun_agent_finish_message           (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
939
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> *msg</code></em>,
 
940
                                                         <em class="parameter"><code>const <span class="type">uint8_t</span> *key</code></em>,
 
941
                                                         <em class="parameter"><code><span class="type">size_t</span> key_len</code></em>);</pre>
913
942
<p>
914
943
This function will 'finish' a message and make it ready to be sent. It will
915
944
add the MESSAGE-INTEGRITY and FINGERPRINT attributes if necessary. If the
917
946
the message in the agent for future matching of the response.
918
947
</p>
919
948
<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>
 
949
<p>
 
950
</p>
920
951
<div class="variablelist"><table border="0">
921
952
<col align="left" valign="top">
922
953
<tbody>
923
954
<tr>
924
955
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
925
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
956
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
926
957
</td>
927
958
</tr>
928
959
<tr>
929
960
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
930
 
<td> The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to finish
 
961
<td>The <a class="link" href="libnice-StunMessage.html#StunMessage" title="StunMessage"><span class="type">StunMessage</span></a> to finish
931
962
</td>
932
963
</tr>
933
964
<tr>
934
965
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
935
 
<td> The key to use for the MESSAGE-INTEGRITY attribute
 
966
<td>The key to use for the MESSAGE-INTEGRITY attribute
936
967
</td>
937
968
</tr>
938
969
<tr>
939
970
<td><p><span class="term"><em class="parameter"><code>key_len</code></em> :</span></p></td>
940
 
<td> The length of the <em class="parameter"><code>key</code></em>
 
971
<td>The length of the <em class="parameter"><code>key</code></em>
941
972
</td>
942
973
</tr>
943
974
<tr>
967
998
<hr>
968
999
<div class="refsect2" title="stun_agent_forget_transaction ()">
969
1000
<a name="stun-agent-forget-transaction"></a><h3>stun_agent_forget_transaction ()</h3>
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>
 
1001
<pre class="programlisting"><span class="returnvalue">bool</span>                stun_agent_forget_transaction       (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
1002
                                                         <em class="parameter"><code><a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="type">StunTransactionId</span></a> id</code></em>);</pre>
972
1003
<p>
973
1004
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
974
1005
created transaction.
981
1012
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
982
1013
free its slot for future transactions.
983
1014
</p>
 
1015
<p>
 
1016
</p>
984
1017
<div class="variablelist"><table border="0">
985
1018
<col align="left" valign="top">
986
1019
<tbody>
987
1020
<tr>
988
1021
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
989
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
1022
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
990
1023
</td>
991
1024
</tr>
992
1025
<tr>
993
1026
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
994
 
<td> The <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="type">StunTransactionId</span></a> of the transaction to forget
 
1027
<td>The <a class="link" href="libnice-StunMessage.html#StunTransactionId" title="StunTransactionId"><span class="type">StunTransactionId</span></a> of the transaction to forget
995
1028
</td>
996
1029
</tr>
997
1030
<tr>
1006
1039
<hr>
1007
1040
<div class="refsect2" title="stun_agent_set_software ()">
1008
1041
<a name="stun-agent-set-software"></a><h3>stun_agent_set_software ()</h3>
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>
 
1042
<pre class="programlisting"><span class="returnvalue">void</span>                stun_agent_set_software             (<em class="parameter"><code><a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a> *agent</code></em>,
 
1043
                                                         <em class="parameter"><code>const <span class="type">char</span> *software</code></em>);</pre>
1011
1044
<p>
1012
1045
This function will set the value of the SOFTWARE attribute to be added to
1013
1046
STUN requests, responses and error responses.
1033
1066
       the StunAgent's life. Do not free its content.
1034
1067
     </p>
1035
1068
</div>
 
1069
<p>
 
1070
</p>
1036
1071
<div class="variablelist"><table border="0">
1037
1072
<col align="left" valign="top">
1038
1073
<tbody>
1039
1074
<tr>
1040
1075
<td><p><span class="term"><em class="parameter"><code>agent</code></em> :</span></p></td>
1041
 
<td> The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
 
1076
<td>The <a class="link" href="libnice-StunAgent.html#StunAgent" title="StunAgent"><span class="type">StunAgent</span></a>
1042
1077
</td>
1043
1078
</tr>
1044
1079
<tr>
1045
1080
<td><p><span class="term"><em class="parameter"><code>software</code></em> :</span></p></td>
1046
 
<td> The value of the SOFTWARE attribute to add.
 
1081
<td>The value of the SOFTWARE attribute to add.
1047
1082
</td>
1048
1083
</tr>
1049
1084
</tbody>
1053
1088
<hr>
1054
1089
<div class="refsect2" title="stun_debug_enable ()">
1055
1090
<a name="stun-debug-enable"></a><h3>stun_debug_enable ()</h3>
1056
 
<pre class="programlisting"><span class="returnvalue">void</span>                stun_debug_enable                   (void);</pre>
 
1091
<pre class="programlisting"><span class="returnvalue">void</span>                stun_debug_enable                   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
1057
1092
<p>
1058
 
Enable debug messages to stderr</p>
 
1093
Enable debug messages to stderr
 
1094
</p>
1059
1095
</div>
1060
1096
<hr>
1061
1097
<div class="refsect2" title="stun_debug_disable ()">
1062
1098
<a name="stun-debug-disable"></a><h3>stun_debug_disable ()</h3>
1063
 
<pre class="programlisting"><span class="returnvalue">void</span>                stun_debug_disable                  (void);</pre>
 
1099
<pre class="programlisting"><span class="returnvalue">void</span>                stun_debug_disable                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
1064
1100
<p>
1065
 
Disable debug messages to stderr</p>
 
1101
Disable debug messages to stderr
 
1102
</p>
1066
1103
</div>
1067
1104
</div>
1068
1105
<div class="refsect1" title="See Also">
1072
1109
</div>
1073
1110
<div class="footer">
1074
1111
<hr>
1075
 
          Generated by GTK-Doc V1.13</div>
 
1112
          Generated by GTK-Doc V1.15</div>
1076
1113
</body>
1077
1114
</html>
 
 
b'\\ No newline at end of file'