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
8b971219
Commit
8b971219
authored
Feb 23, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename stun_has_cookie into stun_message_has_cookie
parent
7d5a2667
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
stun/stun5389.c
stun/stun5389.c
+1
-1
stun/stun5389.h
stun/stun5389.h
+2
-2
stun/stunagent.c
stun/stunagent.c
+2
-2
stun/stunmessage.c
stun/stunmessage.c
+1
-1
stun/tools/stund.c
stun/tools/stund.c
+1
-1
stun/usages/ice.c
stun/usages/ice.c
+1
-1
No files found.
stun/stun5389.c
View file @
8b971219
...
...
@@ -70,7 +70,7 @@ uint32_t stun_fingerprint (const uint8_t *msg, size_t len)
return
htonl
(
crc32
(
data
,
3
)
^
0x5354554e
);
}
bool
stun_has_cookie
(
const
StunMessage
*
msg
)
bool
stun_
message_
has_cookie
(
const
StunMessage
*
msg
)
{
StunTransactionId
id
;
uint32_t
cookie
=
htonl
(
STUN_MAGIC_COOKIE
);
...
...
stun/stun5389.h
View file @
8b971219
...
...
@@ -60,14 +60,14 @@
uint32_t
stun_fingerprint
(
const
uint8_t
*
msg
,
size_t
len
);
/**
* stun_has_cookie:
* stun_
message_
has_cookie:
* @msg: The #StunMessage
*
* Checks if the STUN message has a RFC5389 compatible cookie
*
* Returns: %TRUE if the cookie is present, %FALSE otherwise
*/
bool
stun_has_cookie
(
const
StunMessage
*
msg
);
bool
stun_
message_
has_cookie
(
const
StunMessage
*
msg
);
StunMessageReturn
stun_message_append_software
(
StunMessage
*
msg
);
...
...
stun/stunagent.c
View file @
8b971219
...
...
@@ -131,7 +131,7 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
/* TODO: reject it or not ? */
if
((
agent
->
compatibility
==
STUN_COMPATIBILITY_RFC5389
||
agent
->
compatibility
==
STUN_COMPATIBILITY_WLM2009
)
&&
!
stun_has_cookie
(
msg
))
{
!
stun_
message_
has_cookie
(
msg
))
{
stun_debug
(
"STUN demux error: no cookie!
\n
"
);
return
STUN_VALIDATION_BAD_REQUEST
;
}
...
...
@@ -470,7 +470,7 @@ size_t stun_agent_build_unknown_attributes_error (StunAgent *agent,
/* NOTE: Old RFC3489 compatibility:
* When counter is odd, duplicate one value for 32-bits padding. */
if
(
!
stun_has_cookie
(
request
)
&&
(
counter
&
1
))
if
(
!
stun_
message_
has_cookie
(
request
)
&&
(
counter
&
1
))
ids
[
counter
++
]
=
ids
[
0
];
if
(
stun_message_append_bytes
(
msg
,
STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES
,
...
...
stun/stunmessage.c
View file @
8b971219
...
...
@@ -320,7 +320,7 @@ stun_message_append (StunMessage *msg, StunAttribute type, size_t length)
a
=
stun_setw
(
a
,
type
);
/* NOTE: If cookie is not present, we need to force the attribute length
* to a multiple of 4 for compatibility with old RFC3489 */
a
=
stun_setw
(
a
,
stun_has_cookie
(
msg
)
?
length
:
stun_align
(
length
));
a
=
stun_setw
(
a
,
stun_
message_
has_cookie
(
msg
)
?
length
:
stun_align
(
length
));
mlen
+=
4
+
length
;
/* Add padding if needed */
...
...
stun/tools/stund.c
View file @
8b971219
...
...
@@ -250,7 +250,7 @@ static int dgram_process (int sock, StunAgent *oldagent, StunAgent *newagent)
{
case
STUN_BINDING
:
stun_agent_init_response
(
agent
,
&
response
,
buf
,
sizeof
(
buf
),
&
request
);
if
(
stun_has_cookie
(
&
request
))
if
(
stun_
message_
has_cookie
(
&
request
))
stun_message_append_xor_addr
(
&
response
,
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
,
mh
.
msg_name
,
mh
.
msg_namelen
);
...
...
stun/usages/ice.c
View file @
8b971219
...
...
@@ -263,7 +263,7 @@ stun_usage_ice_conncheck_create_reply (StunAgent *agent, StunMessage *req,
val
=
stun_message_append_xor_addr_full
(
msg
,
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
,
src
,
srclen
,
htonl
(
magic_cookie
));
}
else
if
(
stun_has_cookie
(
msg
))
{
}
else
if
(
stun_
message_
has_cookie
(
msg
))
{
val
=
stun_message_append_xor_addr
(
msg
,
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
,
src
,
srclen
);
}
else
{
...
...
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