Liblinphone
5.3.0
|
Policy to use to pass through NATs/firewalls. More...
#include <nat_policy.hh>
Public Member Functions | |
LINPHONECXX_PUBLIC | NatPolicy (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneNatPolicy * | cPtr () |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Core > | getCore () const |
Returns the Core object managing this nat policy, if any. More... | |
LINPHONECXX_PUBLIC bool | iceEnabled () const |
Tell whether ICE is enabled. More... | |
LINPHONECXX_PUBLIC void | enableIce (bool enable) |
Enable ICE. More... | |
LINPHONECXX_PUBLIC std::string | getNatV4Address () const |
Get the mandatory v4 IP address to use with this NAT policy as server-reflexive candidate for ICE. More... | |
LINPHONECXX_PUBLIC void | setNatV4Address (const std::string &v4Address) |
Set the mandatory v4 IP address to use with this NAT policy as server-reflexive candidate for ICE. More... | |
LINPHONECXX_PUBLIC std::string | getNatV6Address () const |
Get the mandatory v6 IP address to use with this NAT policy as server-reflexive candidate for ICE. More... | |
LINPHONECXX_PUBLIC void | setNatV6Address (const std::string &v4Address) |
Set the mandatory v6 IP address to use with this NAT policy as server-reflexive candidate for ICE. More... | |
LINPHONECXX_PUBLIC bool | stunEnabled () const |
Tell whether STUN is enabled. More... | |
LINPHONECXX_PUBLIC void | enableStun (bool enable) |
Enable STUN. More... | |
LINPHONECXX_PUBLIC std::string | getStunServer () const |
Get the STUN/TURN server to use with this NAT policy. More... | |
LINPHONECXX_PUBLIC void | setStunServer (const std::string &stunServer) |
Set the STUN/TURN server to use with this NAT policy. More... | |
LINPHONECXX_PUBLIC std::string | getStunServerUsername () const |
Get the username used to authenticate with the STUN/TURN server. More... | |
LINPHONECXX_PUBLIC void | setStunServerUsername (const std::string &username) |
Set the username used to authenticate with the STUN/TURN server. More... | |
LINPHONECXX_PUBLIC bool | tcpTurnTransportEnabled () const |
Tells whether TCP TURN transport is enabled. More... | |
LINPHONECXX_PUBLIC void | enableTcpTurnTransport (bool enable) |
Enable TCP TURN transport. More... | |
LINPHONECXX_PUBLIC bool | tlsTurnTransportEnabled () const |
Tells whether TLS TURN transport is enabled. More... | |
LINPHONECXX_PUBLIC void | enableTlsTurnTransport (bool enable) |
Enable TLS TURN transport. More... | |
LINPHONECXX_PUBLIC bool | turnEnabled () const |
Tell whether TURN is enabled. More... | |
LINPHONECXX_PUBLIC void | enableTurn (bool enable) |
Enable TURN. More... | |
LINPHONECXX_PUBLIC bool | udpTurnTransportEnabled () const |
Tells whether UDP TURN transport is enabled. More... | |
LINPHONECXX_PUBLIC void | enableUdpTurnTransport (bool enable) |
Enable UDP TURN transport. More... | |
LINPHONECXX_PUBLIC bool | upnpEnabled () const |
Tell whether uPnP is enabled. More... | |
LINPHONECXX_PUBLIC void | enableUpnp (bool enable) |
Enable uPnP. More... | |
LINPHONECXX_PUBLIC void | clear () |
Clear a NAT policy (deactivate all protocols and unset the STUN server). | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::NatPolicy > | clone () const |
Clone an existing NatPolicy object. More... | |
LINPHONECXX_PUBLIC void | resolveStunServer () |
Start a STUN server DNS resolution. | |
Policy to use to pass through NATs/firewalls.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::NatPolicy> linphone::NatPolicy::clone | ( | ) | const |
LINPHONECXX_PUBLIC void linphone::NatPolicy::enableIce | ( | bool | enable | ) |
Enable ICE.
ICE can be enabled without STUN/TURN, in which case only the local candidates will be used.
enable | Boolean value telling whether to enable ICE. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::enableStun | ( | bool | enable | ) |
Enable STUN.
If TURN is also enabled, TURN will be used instead of STUN.
enable | Boolean value telling whether to enable STUN. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::enableTcpTurnTransport | ( | bool | enable | ) |
Enable TCP TURN transport.
Used when TURN is enabled.
enable | Boolean value telling whether to enable TCP TURN transport. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::enableTlsTurnTransport | ( | bool | enable | ) |
Enable TLS TURN transport.
Used when TURN is enabled.
enable | Boolean value telling whether to enable TLS TURN transport. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::enableTurn | ( | bool | enable | ) |
Enable TURN.
If STUN is also enabled, it is ignored and TURN is used.
enable | Boolean value telling whether to enable TURN. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::enableUdpTurnTransport | ( | bool | enable | ) |
Enable UDP TURN transport.
Used when TURN is enabled.
enable | Boolean value telling whether to enable UDP TURN transport. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::enableUpnp | ( | bool | enable | ) |
Enable uPnP.
This has the effect to disable every other policies (ICE, STUN and TURN).
enable | Boolean value telling whether to enable uPnP. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::NatPolicy::getCore | ( | ) | const |
LINPHONECXX_PUBLIC std::string linphone::NatPolicy::getNatV4Address | ( | ) | const |
Get the mandatory v4 IP address to use with this NAT policy as server-reflexive candidate for ICE.
Used when STUN or TURN are enabled.
LINPHONECXX_PUBLIC std::string linphone::NatPolicy::getNatV6Address | ( | ) | const |
Get the mandatory v6 IP address to use with this NAT policy as server-reflexive candidate for ICE.
Used when STUN or TURN are enabled.
LINPHONECXX_PUBLIC std::string linphone::NatPolicy::getStunServer | ( | ) | const |
Get the STUN/TURN server to use with this NAT policy.
Used when STUN or TURN are enabled.
LINPHONECXX_PUBLIC std::string linphone::NatPolicy::getStunServerUsername | ( | ) | const |
Get the username used to authenticate with the STUN/TURN server.
The authentication will search for a AuthInfo with this username. If it is not set the username of the currently used ProxyConfig is used to search for a LinphoneAuthInfo.
LINPHONECXX_PUBLIC bool linphone::NatPolicy::iceEnabled | ( | ) | const |
Tell whether ICE is enabled.
LINPHONECXX_PUBLIC void linphone::NatPolicy::setNatV4Address | ( | const std::string & | v4Address | ) |
Set the mandatory v4 IP address to use with this NAT policy as server-reflexive candidate for ICE.
The IP address is used only if no stun server is set for server-reflexive candidate gathering. Using this method is useful when Liblinphone is used in a server product, when the server does not own the public IP address. Used when STUN or TURN are enabled.
v4Address | The STUN server to use with this NAT policy. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::setNatV6Address | ( | const std::string & | v4Address | ) |
Set the mandatory v6 IP address to use with this NAT policy as server-reflexive candidate for ICE.
The IP address is used only if no stun server is set for server-reflexive candidate gathering. Using this method is useful when Liblinphone is used in a server product, when the server does not own the public IP address. Used when STUN or TURN are enabled.
v4Address | The STUN server to use with this NAT policy. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::setStunServer | ( | const std::string & | stunServer | ) |
Set the STUN/TURN server to use with this NAT policy.
Used when STUN or TURN are enabled.
stunServer | The STUN server to use with this NAT policy. |
LINPHONECXX_PUBLIC void linphone::NatPolicy::setStunServerUsername | ( | const std::string & | username | ) |
Set the username used to authenticate with the STUN/TURN server.
The authentication will search for a AuthInfo with this username. If it is not set the username of the currently used ProxyConfig is used to search for a LinphoneAuthInfo.
username | The username used to authenticate with the STUN/TURN server. |
LINPHONECXX_PUBLIC bool linphone::NatPolicy::stunEnabled | ( | ) | const |
Tell whether STUN is enabled.
LINPHONECXX_PUBLIC bool linphone::NatPolicy::tcpTurnTransportEnabled | ( | ) | const |
Tells whether TCP TURN transport is enabled.
Used when TURN is enabled.
LINPHONECXX_PUBLIC bool linphone::NatPolicy::tlsTurnTransportEnabled | ( | ) | const |
Tells whether TLS TURN transport is enabled.
Used when TURN is enabled.
LINPHONECXX_PUBLIC bool linphone::NatPolicy::turnEnabled | ( | ) | const |
Tell whether TURN is enabled.
LINPHONECXX_PUBLIC bool linphone::NatPolicy::udpTurnTransportEnabled | ( | ) | const |
Tells whether UDP TURN transport is enabled.
Used when TURN is enabled.
LINPHONECXX_PUBLIC bool linphone::NatPolicy::upnpEnabled | ( | ) | const |
Tell whether uPnP is enabled.