Add support to option "dhcp-option" in ovpn file

This commit is contained in:
Dener Araújo
2020-09-06 15:03:47 -03:00
parent c50ec0a6af
commit 865f56794f
11 changed files with 154 additions and 3 deletions

View File

@@ -663,6 +663,14 @@ namespace openvpn {
se.friendlyName = i->friendlyName;
eval.serverList.push_back(se);
}
// Added by Dener Araújo - 2020-09-06
for (ParseClientConfig::DhcpOptionList::const_iterator i = cc.dhcpOptionList().begin(); i != cc.dhcpOptionList().end(); ++i)
{
DhcpOptionEntry de;
de.type = i->type;
de.address = i->address;
eval.dhcpOptionList.push_back(de);
}
}
catch (const std::exception& e)
{

View File

@@ -47,6 +47,15 @@ namespace openvpn {
std::string friendlyName;
};
// Added by Dener Araújo - 2020-09-06
// Represents an "dhcp-option" with its type (DNS, WINS, etc) and its address
// (client reads)
struct DhcpOptionEntry
{
std::string type;
std::string address;
};
// return properties of config
// (client reads)
struct EvalConfig
@@ -91,6 +100,10 @@ namespace openvpn {
// optional list of user-selectable VPN servers
std::vector<ServerEntry> serverList;
// Added by Dener Araújo - 2020-09-06
// optional list of "dhcp-option"
std::vector<DhcpOptionEntry> dhcpOptionList;
};
// used to pass credentials to VPN core