0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00

Listen::Item: added AltRouting mode

Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
James Yonan 2017-12-28 22:47:37 -07:00 committed by Antonio Quartulli
parent 02e786bc92
commit ef3a40c271
No known key found for this signature in database
GPG Key ID: 07A53C580EF2CD74

View File

@ -44,6 +44,9 @@ namespace openvpn {
SSLUnspecified,
SSLOn,
SSLOff,
#ifdef OPENVPN_POLYSOCK_SUPPORTS_ALT_ROUTING
AltRouting,
#endif
};
std::string directive;
@ -60,10 +63,22 @@ namespace openvpn {
if (!proto.is_local())
ret += ' ' + port;
ret += ' ' + std::string(proto.str()) + ' ' + openvpn::to_string(n_threads);
if (ssl == SSLOn)
ret += " ssl";
else if (ssl == SSLOff)
ret += " !ssl";
switch (ssl)
{
case SSLUnspecified:
break;
case SSLOn:
ret += " ssl";
break;
case SSLOff:
ret += " !ssl";
break;
#ifdef OPENVPN_POLYSOCK_SUPPORTS_ALT_ROUTING
case AltRouting:
ret += " alt";
break;
#endif
}
return ret;
}
@ -192,6 +207,10 @@ namespace openvpn {
}
else if (ssl_qualifier == "!ssl")
e.ssl = Item::SSLOff;
#ifdef OPENVPN_POLYSOCK_SUPPORTS_ALT_ROUTING
else if (ssl_qualifier == "alt")
e.ssl = Item::AltRouting;
#endif
else
OPENVPN_THROW(option_error, e.directive << ": unrecognized SSL qualifier");
}