Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
b4246f04
Commit
b4246f04
authored
Nov 03, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace all references to 3489BIS into RFC 5389 as it has just been released
parent
241a240f
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
52 additions
and
53 deletions
+52
-53
README
README
+1
-2
agent/agent.c
agent/agent.c
+3
-3
docs/design.txt
docs/design.txt
+1
-1
socket/udp-turn.c
socket/udp-turn.c
+1
-1
stun/Makefile.am
stun/Makefile.am
+1
-1
stun/stun5389.c
stun/stun5389.c
+0
-0
stun/stun5389.h
stun/stun5389.h
+3
-3
stun/stunagent.c
stun/stunagent.c
+7
-7
stun/stunagent.h
stun/stunagent.h
+2
-2
stun/stunmessage.c
stun/stunmessage.c
+2
-2
stun/stunmessage.h
stun/stunmessage.h
+19
-19
stun/tests/test-bind.c
stun/tests/test-bind.c
+3
-3
stun/tests/test-conncheck.c
stun/tests/test-conncheck.c
+1
-1
stun/tests/test-format.c
stun/tests/test-format.c
+2
-2
stun/tests/test-parse.c
stun/tests/test-parse.c
+3
-3
stun/tests/test-turn.c
stun/tests/test-turn.c
+1
-1
stun/tools/stund.c
stun/tools/stund.c
+1
-1
stun/usages/bind.c
stun/usages/bind.c
+1
-1
No files found.
README
View file @
b4246f04
...
@@ -47,8 +47,7 @@ ICE draft 15
...
@@ -47,8 +47,7 @@ ICE draft 15
http://tools.ietf.org/wg/mmusic/draft-ietf-mmusic-ice/
http://tools.ietf.org/wg/mmusic/draft-ietf-mmusic-ice/
STUN
STUN
http://tools.ietf.org/html/rfc3489
http://tools.ietf.org/html/rfc3489
STUN bis (used by ICE)
http://tools.ietf.org/html/rfc5389
http://tools.ietf.org/wg/behave/draft-ietf-behave-rfc3489bis/
TURN
TURN
http://tools.ietf.org/wg/behave/draft-ietf-behave-turn/
http://tools.ietf.org/wg/behave/draft-ietf-behave-turn/
RTP
RTP
...
...
agent/agent.c
View file @
b4246f04
...
@@ -442,7 +442,7 @@ nice_agent_init (NiceAgent *agent)
...
@@ -442,7 +442,7 @@ nice_agent_init (NiceAgent *agent)
agent
->
compatibility
=
NICE_COMPATIBILITY_DRAFT19
;
agent
->
compatibility
=
NICE_COMPATIBILITY_DRAFT19
;
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_AGENT_USAGE_USE_FINGERPRINT
);
...
@@ -540,7 +540,7 @@ nice_agent_set_property (
...
@@ -540,7 +540,7 @@ nice_agent_set_property (
agent
->
compatibility
=
g_value_get_uint
(
value
);
agent
->
compatibility
=
g_value_get_uint
(
value
);
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
)
{
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_AGENT_USAGE_USE_FINGERPRINT
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
...
@@ -789,7 +789,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
...
@@ -789,7 +789,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
)
{
stun_agent_init
(
&
cdisco
->
turn_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
cdisco
->
turn_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_ADD_SOFTWARE
|
STUN_AGENT_USAGE_ADD_SOFTWARE
|
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
...
...
docs/design.txt
View file @
b4246f04
...
@@ -197,7 +197,7 @@ uses the lower layer API.
...
@@ -197,7 +197,7 @@ uses the lower layer API.
The following STUN usages are currently implemented by the
The following STUN usages are currently implemented by the
transaction layer:
transaction layer:
- Binding discovery (RFC
3489bis
with RFC3489 backward compatibility)
- Binding discovery (RFC
5389
with RFC3489 backward compatibility)
- ICE connectivity checks
- ICE connectivity checks
The following usages are planned but not implemented currently:
The following usages are planned but not implemented currently:
...
...
socket/udp-turn.c
View file @
b4246f04
...
@@ -717,7 +717,7 @@ nice_udp_turn_socket_new (
...
@@ -717,7 +717,7 @@ nice_udp_turn_socket_new (
if
(
compatibility
==
NICE_UDP_TURN_SOCKET_COMPATIBILITY_DRAFT9
)
{
if
(
compatibility
==
NICE_UDP_TURN_SOCKET_COMPATIBILITY_DRAFT9
)
{
stun_agent_init
(
&
priv
->
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
priv
->
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
}
else
if
(
compatibility
==
NICE_UDP_TURN_SOCKET_COMPATIBILITY_MSN
)
{
}
else
if
(
compatibility
==
NICE_UDP_TURN_SOCKET_COMPATIBILITY_MSN
)
{
stun_agent_init
(
&
priv
->
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
priv
->
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
...
...
stun/Makefile.am
View file @
b4246f04
...
@@ -18,7 +18,7 @@ noinst_LTLIBRARIES = libstun.la
...
@@ -18,7 +18,7 @@ noinst_LTLIBRARIES = libstun.la
libstun_la_SOURCES
=
constants.h
\
libstun_la_SOURCES
=
constants.h
\
stunagent.c stunagent.h
\
stunagent.c stunagent.h
\
stunmessage.c stunmessage.h
\
stunmessage.c stunmessage.h
\
stun
3489bis.c stun3489bis
.h
\
stun
5389.c stun5389
.h
\
stuncrc32.c stuncrc32.h
\
stuncrc32.c stuncrc32.h
\
stunhmac.c stunhmac.h
\
stunhmac.c stunhmac.h
\
utils.c utils.h
\
utils.c utils.h
\
...
...
stun/stun
3489bis
.c
→
stun/stun
5389
.c
View file @
b4246f04
File moved
stun/stun
3489bis
.h
→
stun/stun
5389
.h
View file @
b4246f04
...
@@ -36,8 +36,8 @@
...
@@ -36,8 +36,8 @@
*/
*/
#ifndef _STUN_
3489BIS
_H
#ifndef _STUN_
5389
_H
#define _STUN_
3489BIS
_H
#define _STUN_
5389
_H
#ifdef _WIN32
#ifdef _WIN32
...
@@ -64,5 +64,5 @@ bool stun_has_cookie (const StunMessage *msg);
...
@@ -64,5 +64,5 @@ bool stun_has_cookie (const StunMessage *msg);
int
stun_message_append_software
(
StunMessage
*
msg
);
int
stun_message_append_software
(
StunMessage
*
msg
);
#endif
/* _STUN_
3489BIS
_H */
#endif
/* _STUN_
5389
_H */
stun/stunagent.c
View file @
b4246f04
...
@@ -129,13 +129,13 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
...
@@ -129,13 +129,13 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
msg
->
long_term_valid
=
FALSE
;
msg
->
long_term_valid
=
FALSE
;
/* TODO: reject it or not ? */
/* TODO: reject it or not ? */
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
3489BIS
&&
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
RFC5389
&&
!
stun_has_cookie
(
msg
))
{
!
stun_has_cookie
(
msg
))
{
stun_debug
(
"STUN demux error: no cookie!
\n
"
);
stun_debug
(
"STUN demux error: no cookie!
\n
"
);
return
STUN_VALIDATION_BAD_REQUEST
;
return
STUN_VALIDATION_BAD_REQUEST
;
}
}
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
3489BIS
&&
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
RFC5389
&&
agent
->
usage_flags
&
STUN_AGENT_USAGE_USE_FINGERPRINT
)
{
agent
->
usage_flags
&
STUN_AGENT_USAGE_USE_FINGERPRINT
)
{
/* Looks for FINGERPRINT */
/* Looks for FINGERPRINT */
if
(
stun_message_find32
(
msg
,
STUN_ATTRIBUTE_FINGERPRINT
,
&
fpr
)
!=
0
)
{
if
(
stun_message_find32
(
msg
,
STUN_ATTRIBUTE_FINGERPRINT
,
&
fpr
)
!=
0
)
{
...
@@ -314,7 +314,7 @@ bool stun_agent_init_request (StunAgent *agent, StunMessage *msg,
...
@@ -314,7 +314,7 @@ bool stun_agent_init_request (StunAgent *agent, StunMessage *msg,
ret
=
stun_message_init
(
msg
,
STUN_REQUEST
,
m
,
id
);
ret
=
stun_message_init
(
msg
,
STUN_REQUEST
,
m
,
id
);
if
(
ret
)
{
if
(
ret
)
{
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
3489BIS
)
{
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
RFC5389
)
{
uint32_t
cookie
=
htonl
(
STUN_MAGIC_COOKIE
);
uint32_t
cookie
=
htonl
(
STUN_MAGIC_COOKIE
);
memcpy
(
msg
->
buffer
+
STUN_MESSAGE_TRANS_ID_POS
,
&
cookie
,
sizeof
(
cookie
));
memcpy
(
msg
->
buffer
+
STUN_MESSAGE_TRANS_ID_POS
,
&
cookie
,
sizeof
(
cookie
));
}
}
...
@@ -341,7 +341,7 @@ bool stun_agent_init_indication (StunAgent *agent, StunMessage *msg,
...
@@ -341,7 +341,7 @@ bool stun_agent_init_indication (StunAgent *agent, StunMessage *msg,
ret
=
stun_message_init
(
msg
,
STUN_INDICATION
,
m
,
id
);
ret
=
stun_message_init
(
msg
,
STUN_INDICATION
,
m
,
id
);
if
(
ret
)
{
if
(
ret
)
{
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
3489BIS
)
{
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
RFC5389
)
{
uint32_t
cookie
=
htonl
(
STUN_MAGIC_COOKIE
);
uint32_t
cookie
=
htonl
(
STUN_MAGIC_COOKIE
);
memcpy
(
msg
->
buffer
+
STUN_MESSAGE_TRANS_ID_POS
,
&
cookie
,
sizeof
(
cookie
));
memcpy
(
msg
->
buffer
+
STUN_MESSAGE_TRANS_ID_POS
,
&
cookie
,
sizeof
(
cookie
));
}
}
...
@@ -375,7 +375,7 @@ bool stun_agent_init_response (StunAgent *agent, StunMessage *msg,
...
@@ -375,7 +375,7 @@ bool stun_agent_init_response (StunAgent *agent, StunMessage *msg,
if
(
stun_message_init
(
msg
,
STUN_RESPONSE
,
if
(
stun_message_init
(
msg
,
STUN_RESPONSE
,
stun_message_get_method
(
request
),
id
))
{
stun_message_get_method
(
request
),
id
))
{
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
3489BIS
&&
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
RFC5389
&&
agent
->
usage_flags
&
STUN_AGENT_USAGE_ADD_SOFTWARE
)
{
agent
->
usage_flags
&
STUN_AGENT_USAGE_ADD_SOFTWARE
)
{
stun_message_append_software
(
msg
);
stun_message_append_software
(
msg
);
}
}
...
@@ -410,7 +410,7 @@ bool stun_agent_init_error (StunAgent *agent, StunMessage *msg,
...
@@ -410,7 +410,7 @@ bool stun_agent_init_error (StunAgent *agent, StunMessage *msg,
if
(
stun_message_init
(
msg
,
STUN_ERROR
,
if
(
stun_message_init
(
msg
,
STUN_ERROR
,
stun_message_get_method
(
request
),
id
))
{
stun_message_get_method
(
request
),
id
))
{
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
3489BIS
&&
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
RFC5389
&&
agent
->
usage_flags
&
STUN_AGENT_USAGE_ADD_SOFTWARE
)
{
agent
->
usage_flags
&
STUN_AGENT_USAGE_ADD_SOFTWARE
)
{
stun_message_append_software
(
msg
);
stun_message_append_software
(
msg
);
}
}
...
@@ -515,7 +515,7 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
...
@@ -515,7 +515,7 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
}
}
}
}
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
3489BIS
&&
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_
RFC5389
&&
agent
->
usage_flags
&
STUN_AGENT_USAGE_USE_FINGERPRINT
)
{
agent
->
usage_flags
&
STUN_AGENT_USAGE_USE_FINGERPRINT
)
{
ptr
=
stun_message_append
(
msg
,
STUN_ATTRIBUTE_FINGERPRINT
,
4
);
ptr
=
stun_message_append
(
msg
,
STUN_ATTRIBUTE_FINGERPRINT
,
4
);
if
(
ptr
==
NULL
)
{
if
(
ptr
==
NULL
)
{
...
...
stun/stunagent.h
View file @
b4246f04
...
@@ -52,8 +52,8 @@ typedef struct stun_agent_t StunAgent;
...
@@ -52,8 +52,8 @@ typedef struct stun_agent_t StunAgent;
typedef
enum
{
typedef
enum
{
STUN_COMPATIBILITY_RFC3489
,
STUN_COMPATIBILITY_RFC3489
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_COMPATIBILITY_
RFC5389
,
STUN_COMPATIBILITY_LAST
=
STUN_COMPATIBILITY_
3489BIS
STUN_COMPATIBILITY_LAST
=
STUN_COMPATIBILITY_
RFC5389
}
StunCompatibility
;
}
StunCompatibility
;
...
...
stun/stunmessage.c
View file @
b4246f04
...
@@ -603,7 +603,7 @@ stun_method_t stun_message_get_method (const StunMessage *msg)
...
@@ -603,7 +603,7 @@ stun_method_t stun_message_get_method (const StunMessage *msg)
{
{
uint16_t
t
=
stun_getw
(
msg
->
buffer
);
uint16_t
t
=
stun_getw
(
msg
->
buffer
);
/* HACK HACK HACK
/* HACK HACK HACK
A google/msn data indication is 0x0115 which is contrary to the
rfc3489bis
A google/msn data indication is 0x0115 which is contrary to the
RFC 5389
which states that 8th and 12th bits are for the class and that 0x01 is
which states that 8th and 12th bits are for the class and that 0x01 is
for indications...
for indications...
So 0x0115 is reported as a "connect error response", while it should be
So 0x0115 is reported as a "connect error response", while it should be
...
@@ -624,7 +624,7 @@ stun_class_t stun_message_get_class (const StunMessage *msg)
...
@@ -624,7 +624,7 @@ stun_class_t stun_message_get_class (const StunMessage *msg)
{
{
uint16_t
t
=
stun_getw
(
msg
->
buffer
);
uint16_t
t
=
stun_getw
(
msg
->
buffer
);
/* HACK HACK HACK
/* HACK HACK HACK
A google/msn data indication is 0x0115 which is contrary to the
rfc3489bis
A google/msn data indication is 0x0115 which is contrary to the
RFC 5389
which states that 8th and 12th bits are for the class and that 0x01 is
which states that 8th and 12th bits are for the class and that 0x01 is
for indications...
for indications...
So 0x0115 is reported as a "connect error response", while it should be
So 0x0115 is reported as a "connect error response", while it should be
...
...
stun/stunmessage.h
View file @
b4246f04
...
@@ -68,7 +68,7 @@ typedef enum
...
@@ -68,7 +68,7 @@ typedef enum
/* Message methods */
/* Message methods */
typedef
enum
typedef
enum
{
{
STUN_BINDING
=
0x001
,
/* RFC
3489bis-11
*/
STUN_BINDING
=
0x001
,
/* RFC
5389
*/
STUN_OLD_SHARED_SECRET
=
0x002
,
/* old RFC3489 */
STUN_OLD_SHARED_SECRET
=
0x002
,
/* old RFC3489 */
STUN_ALLOCATE
=
0x003
,
/* TURN-09 */
STUN_ALLOCATE
=
0x003
,
/* TURN-09 */
STUN_SET_ACTIVE_DST
=
0x004
,
/* TURN-04 */
STUN_SET_ACTIVE_DST
=
0x004
,
/* TURN-04 */
...
@@ -90,16 +90,16 @@ typedef enum
...
@@ -90,16 +90,16 @@ typedef enum
{
{
/* Mandatory attributes */
/* Mandatory attributes */
/* 0x0000 */
/* reserved */
/* 0x0000 */
/* reserved */
STUN_ATTRIBUTE_MAPPED_ADDRESS
=
0x0001
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_MAPPED_ADDRESS
=
0x0001
,
/* RFC
5389
*/
STUN_ATTRIBUTE_OLD_RESPONSE_ADDRESS
=
0x0002
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_RESPONSE_ADDRESS
=
0x0002
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_CHANGE_REQUEST
=
0x0003
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_CHANGE_REQUEST
=
0x0003
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_SOURCE_ADDRESS
=
0x0004
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_SOURCE_ADDRESS
=
0x0004
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_CHANGED_ADDRESS
=
0x0005
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_CHANGED_ADDRESS
=
0x0005
,
/* old RFC3489 */
STUN_ATTRIBUTE_USERNAME
=
0x0006
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_USERNAME
=
0x0006
,
/* RFC
5389
*/
STUN_ATTRIBUTE_OLD_PASSWORD
=
0x0007
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_PASSWORD
=
0x0007
,
/* old RFC3489 */
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
=
0x0008
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
=
0x0008
,
/* RFC
5389
*/
STUN_ATTRIBUTE_ERROR_CODE
=
0x0009
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_ERROR_CODE
=
0x0009
,
/* RFC
5389
*/
STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES
=
0x000A
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES
=
0x000A
,
/* RFC
5389
*/
STUN_ATTRIBUTE_OLD_REFLECTED_FROM
=
0x000B
,
/* old RFC3489 */
STUN_ATTRIBUTE_OLD_REFLECTED_FROM
=
0x000B
,
/* old RFC3489 */
STUN_ATTRIBUTE_CHANNEL_NUMBER
=
0x000C
,
/* TURN-09 */
STUN_ATTRIBUTE_CHANNEL_NUMBER
=
0x000C
,
/* TURN-09 */
STUN_ATTRIBUTE_LIFETIME
=
0x000D
,
/* TURN-04 */
STUN_ATTRIBUTE_LIFETIME
=
0x000D
,
/* TURN-04 */
...
@@ -110,8 +110,8 @@ typedef enum
...
@@ -110,8 +110,8 @@ typedef enum
STUN_ATTRIBUTE_REMOTE_ADDRESS
=
0x0012
,
/* TURN-04 */
STUN_ATTRIBUTE_REMOTE_ADDRESS
=
0x0012
,
/* TURN-04 */
STUN_ATTRIBUTE_PEER_ADDRESS
=
0x0012
,
/* TURN-09 */
STUN_ATTRIBUTE_PEER_ADDRESS
=
0x0012
,
/* TURN-09 */
STUN_ATTRIBUTE_DATA
=
0x0013
,
/* TURN-04 */
STUN_ATTRIBUTE_DATA
=
0x0013
,
/* TURN-04 */
STUN_ATTRIBUTE_REALM
=
0x0014
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_REALM
=
0x0014
,
/* RFC
5389
*/
STUN_ATTRIBUTE_NONCE
=
0x0015
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_NONCE
=
0x0015
,
/* RFC
5389
*/
STUN_ATTRIBUTE_RELAY_ADDRESS
=
0x0016
,
/* TURN-04 */
STUN_ATTRIBUTE_RELAY_ADDRESS
=
0x0016
,
/* TURN-04 */
STUN_ATTRIBUTE_RELAYED_ADDRESS
=
0x0016
,
/* TURN-09 */
STUN_ATTRIBUTE_RELAYED_ADDRESS
=
0x0016
,
/* TURN-09 */
STUN_ATTRIBUTE_REQUESTED_ADDRESS_TYPE
=
0x0017
,
/* TURN-IPv6-03 */
STUN_ATTRIBUTE_REQUESTED_ADDRESS_TYPE
=
0x0017
,
/* TURN-IPv6-03 */
...
@@ -123,7 +123,7 @@ typedef enum
...
@@ -123,7 +123,7 @@ typedef enum
/* 0x001D */
/* reserved */
/* 0x001D */
/* reserved */
/* 0x001E */
/* reserved */
/* 0x001E */
/* reserved */
/* 0x001F */
/* reserved */
/* 0x001F */
/* reserved */
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
=
0x0020
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
=
0x0020
,
/* RFC
5389
*/
STUN_ATTRIBUTE_TIMER_VAL
=
0x0021
,
/* TURN-04 */
STUN_ATTRIBUTE_TIMER_VAL
=
0x0021
,
/* TURN-04 */
STUN_ATTRIBUTE_REQUESTED_IP
=
0x0022
,
/* TURN-04 */
STUN_ATTRIBUTE_REQUESTED_IP
=
0x0022
,
/* TURN-04 */
STUN_ATTRIBUTE_RESERVATION_TOKEN
=
0x0022
,
/* TURN-09 */
STUN_ATTRIBUTE_RESERVATION_TOKEN
=
0x0022
,
/* TURN-09 */
...
@@ -139,13 +139,13 @@ typedef enum
...
@@ -139,13 +139,13 @@ typedef enum
/* Optional attributes */
/* Optional attributes */
/* 0x8000-0x8021 */
/* reserved */
/* 0x8000-0x8021 */
/* reserved */
STUN_ATTRIBUTE_OPTIONS
=
0x8001
,
/* libjingle */
STUN_ATTRIBUTE_OPTIONS
=
0x8001
,
/* libjingle */
STUN_ATTRIBUTE_SOFTWARE
=
0x8022
,
/* RFC
3489bis-17
*/
STUN_ATTRIBUTE_SOFTWARE
=
0x8022
,
/* RFC
5389
*/
STUN_ATTRIBUTE_ALTERNATE_SERVER
=
0x8023
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_ALTERNATE_SERVER
=
0x8023
,
/* RFC
5389
*/
STUN_ATTRIBUTE_REFRESH_INTERVAL
=
0x8024
,
/* wing-nat-control-04 */
STUN_ATTRIBUTE_REFRESH_INTERVAL
=
0x8024
,
/* wing-nat-control-04 */
/* 0x8025 */
/* reserved */
/* 0x8025 */
/* reserved */
/* 0x8026 */
/* reserved */
/* 0x8026 */
/* reserved */
/* 0x8027 */
/* reserved */
/* 0x8027 */
/* reserved */
STUN_ATTRIBUTE_FINGERPRINT
=
0x8028
,
/* RFC
3489bis-11
*/
STUN_ATTRIBUTE_FINGERPRINT
=
0x8028
,
/* RFC
5389
*/
STUN_ATTRIBUTE_ICE_CONTROLLED
=
0x8029
,
/* ICE-18 */
STUN_ATTRIBUTE_ICE_CONTROLLED
=
0x8029
,
/* ICE-18 */
STUN_ATTRIBUTE_ICE_CONTROLLING
=
0x802A
,
/* ICE-18 */
STUN_ATTRIBUTE_ICE_CONTROLLING
=
0x802A
,
/* ICE-18 */
/* 0x802B-0xFFFF */
/* reserved */
/* 0x802B-0xFFFF */
/* reserved */
...
@@ -200,12 +200,12 @@ typedef uint8_t stun_transid_t[STUN_MESSAGE_TRANS_ID_LEN];
...
@@ -200,12 +200,12 @@ typedef uint8_t stun_transid_t[STUN_MESSAGE_TRANS_ID_LEN];
*/
*/
typedef
enum
typedef
enum
{
{
STUN_ERROR_TRY_ALTERNATE
=
300
,
/* RFC
3489bis-11
*/
STUN_ERROR_TRY_ALTERNATE
=
300
,
/* RFC
5389
*/
STUN_ERROR_BAD_REQUEST
=
400
,
/* RFC
3489bis-11
*/
STUN_ERROR_BAD_REQUEST
=
400
,
/* RFC
5389
*/
STUN_ERROR_UNAUTHORIZED
=
401
,
/* RFC
3489bis-11
*/
STUN_ERROR_UNAUTHORIZED
=
401
,
/* RFC
5389
*/
STUN_ERROR_UNKNOWN_ATTRIBUTE
=
420
,
/* RFC
3489bis-11
*/
STUN_ERROR_UNKNOWN_ATTRIBUTE
=
420
,
/* RFC
5389
*/
STUN_ERROR_NO_BINDING
=
437
,
/* TURN-04 */
STUN_ERROR_NO_BINDING
=
437
,
/* TURN-04 */
STUN_ERROR_STALE_NONCE
=
438
,
/* RFC
3489bis-11
*/
STUN_ERROR_STALE_NONCE
=
438
,
/* RFC
5389
*/
STUN_ERROR_ACT_DST_ALREADY
=
439
,
/* TURN-04 */
STUN_ERROR_ACT_DST_ALREADY
=
439
,
/* TURN-04 */
STUN_ERROR_UNSUPP_FAMILY
=
440
,
/* TURN-IPv6-03 */
STUN_ERROR_UNSUPP_FAMILY
=
440
,
/* TURN-IPv6-03 */
STUN_ERROR_UNSUPP_TRANSPORT
=
442
,
/* TURN-04 */
STUN_ERROR_UNSUPP_TRANSPORT
=
442
,
/* TURN-04 */
...
@@ -215,7 +215,7 @@ typedef enum
...
@@ -215,7 +215,7 @@ typedef enum
STUN_ERROR_CONN_ALREADY
=
446
,
/* TURN-04 */
STUN_ERROR_CONN_ALREADY
=
446
,
/* TURN-04 */
STUN_ERROR_ALLOC_OVER_QUOTA
=
486
,
/* TURN-04 */
STUN_ERROR_ALLOC_OVER_QUOTA
=
486
,
/* TURN-04 */
STUN_ERROR_ROLE_CONFLICT
=
487
,
/* ICE-18 */
STUN_ERROR_ROLE_CONFLICT
=
487
,
/* ICE-18 */
STUN_ERROR_SERVER_ERROR
=
500
,
/* RFC
3489bis-11
*/
STUN_ERROR_SERVER_ERROR
=
500
,
/* RFC
5389
*/
STUN_ERROR_SERVER_CAPACITY
=
507
,
/* TURN-04 */
STUN_ERROR_SERVER_CAPACITY
=
507
,
/* TURN-04 */
STUN_ERROR_MAX
=
699
STUN_ERROR_MAX
=
699
}
stun_error_t
;
}
stun_error_t
;
...
@@ -225,7 +225,7 @@ typedef enum
...
@@ -225,7 +225,7 @@ typedef enum
#include "stunhmac.h"
#include "stunhmac.h"
#include "stuncrc32.h"
#include "stuncrc32.h"
#include "utils.h"
#include "utils.h"
#include "stun
3489bis
.h"
#include "stun
5389
.h"
struct
stun_message_t
{
struct
stun_message_t
{
StunAgent
*
agent
;
StunAgent
*
agent
;
...
...
stun/tests/test-bind.c
View file @
b4246f04
...
@@ -204,7 +204,7 @@ static void bad_responses (void)
...
@@ -204,7 +204,7 @@ static void bad_responses (void)
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
0
);
STUN_COMPATIBILITY_
RFC5389
,
0
);
/* Allocate a local UDP port */
/* Allocate a local UDP port */
int
servfd
=
listen_dgram
(),
fd
;
int
servfd
=
listen_dgram
(),
fd
;
...
@@ -282,7 +282,7 @@ static void responses (void)
...
@@ -282,7 +282,7 @@ static void responses (void)
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
0
);
STUN_COMPATIBILITY_
RFC5389
,
0
);
/* Allocate a local UDP port for server */
/* Allocate a local UDP port for server */
servfd
=
listen_dgram
();
servfd
=
listen_dgram
();
...
@@ -414,7 +414,7 @@ static void keepalive (void)
...
@@ -414,7 +414,7 @@ static void keepalive (void)
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
0
);
STUN_COMPATIBILITY_
RFC5389
,
0
);
/* Allocate a local UDP port for server */
/* Allocate a local UDP port for server */
servfd
=
listen_dgram
();
servfd
=
listen_dgram
();
...
...
stun/tests/test-conncheck.c
View file @
b4246f04
...
@@ -99,7 +99,7 @@ int main (void)
...
@@ -99,7 +99,7 @@ int main (void)
StunValidationStatus
valid
;
StunValidationStatus
valid
;
stun_agent_init
(
&
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_USE_FINGERPRINT
|
STUN_AGENT_USAGE_USE_FINGERPRINT
|
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
);
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
);
...
...
stun/tests/test-format.c
View file @
b4246f04
...
@@ -147,7 +147,7 @@ check_af (const char *name, int family, socklen_t addrlen)
...
@@ -147,7 +147,7 @@ check_af (const char *name, int family, socklen_t addrlen)
uint16_t
known_attributes
[]
=
{
STUN_ATTRIBUTE_USERNAME
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
uint16_t
known_attributes
[]
=
{
STUN_ATTRIBUTE_USERNAME
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
assert
(
addrlen
<=
sizeof
(
addr
));
assert
(
addrlen
<=
sizeof
(
addr
));
...
@@ -190,7 +190,7 @@ int main (void)
...
@@ -190,7 +190,7 @@ int main (void)
uint16_t
known_attributes
[]
=
{
STUN_ATTRIBUTE_USERNAME
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
uint16_t
known_attributes
[]
=
{
STUN_ATTRIBUTE_USERNAME
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
/* Request formatting test */
/* Request formatting test */
stun_agent_init_request
(
&
agent
,
&
msg
,
buf
,
sizeof
(
buf
),
STUN_BINDING
);
stun_agent_init_request
(
&
agent
,
&
msg
,
buf
,
sizeof
(
buf
),
STUN_BINDING
);
...
...
stun/tests/test-parse.c
View file @
b4246f04
...
@@ -183,7 +183,7 @@ static void test_message (void)
...
@@ -183,7 +183,7 @@ static void test_message (void)
validate
(
fpr_resp
,
36
);
validate
(
fpr_resp
,
36
);
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
if
(
stun_agent_validate
(
&
agent
,
&
msg
,
extra_garbage
,
sizeof
(
extra_garbage
),
if
(
stun_agent_validate
(
&
agent
,
&
msg
,
extra_garbage
,
sizeof
(
extra_garbage
),
NULL
,
NULL
)
!=
STUN_VALIDATION_NOT_STUN
)
NULL
,
NULL
)
!=
STUN_VALIDATION_NOT_STUN
)
...
@@ -298,7 +298,7 @@ static void test_attribute (void)
...
@@ -298,7 +298,7 @@ static void test_attribute (void)
printf
(
"Attribute test message length: %u
\n
"
,
sizeof
(
acme
));
printf
(
"Attribute test message length: %u
\n
"
,
sizeof
(
acme
));
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
);
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
);
if
(
stun_agent_validate
(
&
agent
,
&
msg
,
acme
,
sizeof
(
acme
),
if
(
stun_agent_validate
(
&
agent
,
&
msg
,
acme
,
sizeof
(
acme
),
NULL
,
NULL
)
!=
STUN_VALIDATION_UNAUTHORIZED
)
NULL
,
NULL
)
!=
STUN_VALIDATION_UNAUTHORIZED
)
...
@@ -529,7 +529,7 @@ static void test_vectors (void)
...
@@ -529,7 +529,7 @@ static void test_vectors (void)
STUN_ATTRIBUTE_PRIORITY
,
0
};
STUN_ATTRIBUTE_PRIORITY
,
0
};
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_AGENT_USAGE_USE_FINGERPRINT
);
...
...
stun/tests/test-turn.c
View file @
b4246f04
...
@@ -158,7 +158,7 @@ static void numb (void)
...
@@ -158,7 +158,7 @@ static void numb (void)
assert
(
ret
==
0
);
assert
(
ret
==
0
);
stun_agent_init
(
&
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
/* Allocate a client socket and connect to server */
/* Allocate a client socket and connect to server */
fd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
fd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
...
...
stun/tools/stund.c
View file @
b4246f04
...
@@ -267,7 +267,7 @@ static int run (int family, int protocol, unsigned port)
...
@@ -267,7 +267,7 @@ static int run (int family, int protocol, unsigned port)
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
known_attributes
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
for
(;;)
for
(;;)
dgram_process
(
sock
,
&
agent
);
dgram_process
(
sock
,
&
agent
);
...
...
stun/usages/bind.c
View file @
b4246f04
...
@@ -175,7 +175,7 @@ StunUsageBindReturn stun_usage_bind_run (const struct sockaddr *srv,
...
@@ -175,7 +175,7 @@ StunUsageBindReturn stun_usage_bind_run (const struct sockaddr *srv,
StunUsageBindReturn
bind_ret
;
StunUsageBindReturn
bind_ret
;
stun_agent_init
(
&
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_
3489BIS
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_COMPATIBILITY_
RFC5389
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
len
=
stun_usage_bind_create
(
&
agent
,
&
req
,
req_buf
,
sizeof
(
req_buf
));
len
=
stun_usage_bind_create
(
&
agent
,
&
req
,
req_buf
,
sizeof
(
req_buf
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment