Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
5dc6c5cb
Commit
5dc6c5cb
authored
Jul 13, 2016
by
Ghislain MARY
Browse files
Add API and config parameter to enable/disable DNS search.
parent
02e1a3fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
0 deletions
+38
-0
coreapi/bellesip_sal/sal_impl.c
coreapi/bellesip_sal/sal_impl.c
+8
-0
coreapi/linphonecore.c
coreapi/linphonecore.c
+12
-0
coreapi/linphonecore.h
coreapi/linphonecore.h
+16
-0
include/sal/sal.h
include/sal/sal.h
+2
-0
No files found.
coreapi/bellesip_sal/sal_impl.c
View file @
5dc6c5cb
...
...
@@ -877,6 +877,14 @@ bool_t sal_dns_srv_enabled(const Sal *sal) {
return
(
bool_t
)
belle_sip_stack_dns_srv_enabled
(
sal
->
stack
);
}
void
sal_enable_dns_search
(
Sal
*
sal
,
bool_t
enable
)
{
belle_sip_stack_enable_dns_search
(
sal
->
stack
,
(
unsigned
char
)
enable
);
}
bool_t
sal_dns_search_enabled
(
const
Sal
*
sal
)
{
return
(
bool_t
)
belle_sip_stack_dns_search_enabled
(
sal
->
stack
);
}
void
sal_set_dns_user_hosts_file
(
Sal
*
sal
,
const
char
*
hosts_file
)
{
belle_sip_stack_set_dns_user_hosts_file
(
sal
->
stack
,
hosts_file
);
}
...
...
coreapi/linphonecore.c
View file @
5dc6c5cb
...
...
@@ -790,6 +790,8 @@ static void net_config_read (LinphoneCore *lc)
}
tmp
=
lp_config_get_int
(
lc
->
config
,
"net"
,
"dns_srv_enabled"
,
1
);
linphone_core_enable_dns_srv
(
lc
,
tmp
);
tmp
=
lp_config_get_int
(
lc
->
config
,
"net"
,
"dns_search_enabled"
,
1
);
linphone_core_enable_dns_search
(
lc
,
tmp
);
/* This is to filter out unsupported firewall policies */
if
(
nat_policy_ref
==
NULL
)
...
...
@@ -1523,6 +1525,16 @@ bool_t linphone_core_dns_srv_enabled(const LinphoneCore *lc) {
return
sal_dns_srv_enabled
(
lc
->
sal
);
}
void
linphone_core_enable_dns_search
(
LinphoneCore
*
lc
,
bool_t
enable
)
{
sal_enable_dns_search
(
lc
->
sal
,
enable
);
if
(
linphone_core_ready
(
lc
))
lp_config_set_int
(
lc
->
config
,
"net"
,
"dns_search_enabled"
,
enable
?
1
:
0
);
}
bool_t
linphone_core_dns_search_enabled
(
const
LinphoneCore
*
lc
)
{
return
sal_dns_search_enabled
(
lc
->
sal
);
}
int
linphone_core_get_download_bandwidth
(
const
LinphoneCore
*
lc
){
return
lc
->
net_conf
.
download_bw
;
}
...
...
coreapi/linphonecore.h
View file @
5dc6c5cb
...
...
@@ -2754,6 +2754,22 @@ LINPHONE_PUBLIC void linphone_core_enable_dns_srv(LinphoneCore *lc, bool_t enabl
*/
LINPHONE_PUBLIC
bool_t
linphone_core_dns_srv_enabled
(
const
LinphoneCore
*
lc
);
/**
* Enable or disable DNS search (use of local domain if the fully qualified name did return results).
* @param[in] lc #LinphoneCore object.
* @param[in] enable TRUE to enable DNS search, FALSE to disable it.
* @ingroup media_parameters
*/
LINPHONE_PUBLIC
void
linphone_core_enable_dns_search
(
LinphoneCore
*
lc
,
bool_t
enable
);
/**
* Tells whether DNS search (use of local domain if the fully qualified name did return results) is enabled.
* @param[in] lc #LinphoneCore object.
* @return TRUE if DNS search is enabled, FALSE if disabled.
* @ingroup media_parameters
*/
LINPHONE_PUBLIC
bool_t
linphone_core_dns_search_enabled
(
const
LinphoneCore
*
lc
);
/**
* Forces liblinphone to use the supplied list of dns servers, instead of system's ones.
* @param[in] lc #LinphoneCore object.
...
...
include/sal/sal.h
View file @
5dc6c5cb
...
...
@@ -870,6 +870,8 @@ LINPHONE_PUBLIC int sal_get_transport_timeout(const Sal* sal);
void
sal_set_dns_servers
(
Sal
*
sal
,
const
MSList
*
servers
);
LINPHONE_PUBLIC
void
sal_enable_dns_srv
(
Sal
*
sal
,
bool_t
enable
);
LINPHONE_PUBLIC
bool_t
sal_dns_srv_enabled
(
const
Sal
*
sal
);
LINPHONE_PUBLIC
void
sal_enable_dns_search
(
Sal
*
sal
,
bool_t
enable
);
LINPHONE_PUBLIC
bool_t
sal_dns_search_enabled
(
const
Sal
*
sal
);
LINPHONE_PUBLIC
void
sal_set_dns_user_hosts_file
(
Sal
*
sal
,
const
char
*
hosts_file
);
LINPHONE_PUBLIC
const
char
*
sal_get_dns_user_hosts_file
(
const
Sal
*
sal
);
unsigned
int
sal_get_random
(
void
);
...
...
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