Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
external
sofia-sip
Commits
98174a01
Commit
98174a01
authored
Jan 30, 2006
by
Martti Mela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stun: dst addr improvements
darcs-hash:20060130105340-1b897-96dd75e9fb962b19f24298da01aef3c123fcc5dd.gz
parent
288c48a3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
25 deletions
+16
-25
libsofia-sip-ua/stun/ChangeLog
libsofia-sip-ua/stun/ChangeLog
+0
-18
libsofia-sip-ua/stun/stun.c
libsofia-sip-ua/stun/stun.c
+16
-7
No files found.
libsofia-sip-ua/stun/ChangeLog
View file @
98174a01
2006-02-09 Kai Vehmanen <kai.vehmanen@nokia.com>
* stun_tag.h: Added STUN_DOMAIN() and STUN_REQUIRE_INTEGRITY().
Deprecated STUN_INTEGRITY.
* stun.c: Mark wait entries as deregistered after
su_root_deregister().
2006-01-26 Martti Mela <martti.mela@nokia.com>
* STUN: initial keepalive dispatcher
M ./libsofia-sip-ua/stun/stun.c -28 +149
M ./libsofia-sip-ua/stun/stun.h +9
M ./libsofia-sip-ua/stun/stun_tag.c +16
M ./libsofia-sip-ua/stun/stun_tag.h +6
M ./libsofia-sip-ua/stun/stunc.c +6
2006-01-19 Martti Mela <martti.mela@nokia.com>
* stun.c: assign_socket() now takes care of socket registering and
...
...
libsofia-sip-ua/stun/stun.c
View file @
98174a01
...
...
@@ -917,11 +917,12 @@ int stun_handle_get_nattype(stun_handle_t *sh,
/* If no server given, use default address from stun_handle_create() */
if
(
!
server
)
{
memcpy
(
&
sd
->
sd_pri_info
,
&
sh
->
sh_pri_info
,
sizeof
(
su_addrinfo_t
));
memcpy
(
&
sd
->
sd_pri_
info
.
ai_
addr
,
sh
->
sh_pri_
info
.
ai_
addr
,
sizeof
(
su_sockaddr_t
));
/*
memcpy(&sd->sd_pri_info, &sh->sh_pri_info, sizeof(su_addrinfo_t));
*/
memcpy
(
sd
->
sd_pri_addr
,
sh
->
sh_pri_addr
,
sizeof
(
su_sockaddr_t
));
}
else
{
err
=
stun_atoaddr
(
AF_INET
,
&
sd
->
sd_pri_info
,
server
);
memcpy
(
sd
->
sd_pri_addr
,
&
sd
->
sd_pri_info
.
ai_addr
,
sizeof
(
su_sockaddr_t
));
}
destination
=
(
su_sockaddr_t
*
)
sd
->
sd_pri_addr
;
...
...
@@ -2204,11 +2205,12 @@ int stun_handle_get_lifetime(stun_handle_t *sh,
/* If no server given, use default address from stun_handle_create() */
if
(
!
server
)
{
memcpy
(
&
sd
->
sd_pri_info
,
&
sh
->
sh_pri_info
,
sizeof
(
su_addrinfo_t
));
memcpy
(
&
sd
->
sd_pri_
info
.
ai_
addr
,
sh
->
sh_pri_
info
.
ai_
addr
,
sizeof
(
su_sockaddr_t
));
//
memcpy(&sd->sd_pri_info, &sh->sh_pri_info, sizeof(su_addrinfo_t));
memcpy
(
sd
->
sd_pri_addr
,
sh
->
sh_pri_addr
,
sizeof
(
su_sockaddr_t
));
}
else
{
err
=
stun_atoaddr
(
AF_INET
,
&
sd
->
sd_pri_info
,
server
);
memcpy
(
sd
->
sd_pri_addr
,
&
sd
->
sd_pri_info
.
ai_addr
,
sizeof
(
su_sockaddr_t
));
}
destination
=
(
su_sockaddr_t
*
)
sd
->
sd_pri_addr
;
...
...
@@ -2241,7 +2243,11 @@ int stun_handle_get_lifetime(stun_handle_t *sh,
return
-
1
;
}
getsockname
(
sockfdy
,
(
struct
sockaddr
*
)
&
y_addr
,
&
y_len
);
if
(
getsockname
(
sockfdy
,
(
struct
sockaddr
*
)
&
y_addr
,
&
y_len
)
<
0
)
{
STUN_ERROR
(
errno
,
getsockname
);
return
-
1
;
}
SU_DEBUG_3
((
"%s: socket y bound to %s:%u
\n
"
,
__func__
,
inet_ntop
(
y_addr
.
su_family
,
SU_ADDR
(
&
y_addr
),
ipaddr
,
sizeof
(
ipaddr
)),
(
unsigned
)
ntohs
(
y_addr
.
su_port
)));
...
...
@@ -2440,7 +2446,8 @@ void stun_keepalive_timer_cb(su_root_magic_t *magic,
{
stun_request_t
*
req
=
arg
;
stun_handle_t
*
sh
=
req
->
sr_handle
;
int
timeout
=
-
1
;
int
s
=
-
1
,
timeout
=
-
1
,
err
;
int
sa_len
;
su_sockaddr_t
*
destination
;
su_timer_t
*
keepalive_timer
=
NULL
;
stun_discovery_t
*
sd
=
req
->
sr_discovery
;
...
...
@@ -2464,9 +2471,11 @@ void stun_keepalive_timer_cb(su_root_magic_t *magic,
int
stun_keepalive_destroy
(
stun_handle_t
*
sh
,
su_socket_t
s
)
{
stun_discovery_t
*
sd
;
stun_discovery_t
*
sd
,
*
tmp
;
stun_request_t
*
req
;
stun_action_t
action
=
stun_action_keepalive
;
int
i
;
for
(
req
=
sh
->
sh_requests
;
req
;
req
=
req
->
sr_next
)
{
sd
=
req
->
sr_discovery
;
...
...
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