definition of the routing string to be deleted for wg and ikev2 connections

This commit is contained in:
Fedotov Anton 2021-12-10 13:02:54 +03:00
parent 4abfc58ad0
commit 0d0c29493b
8 changed files with 111 additions and 60 deletions

View file

@ -263,19 +263,23 @@ void OpenVpnProtocol::onReadyReadDataFromManagementServer()
qDebug()<<"My openvpn m_routeGateway "<<m_routeGateway;
qDebug()<<"My openvpn m_vpnLocalAddress "<<m_vpnLocalAddress;
qDebug()<<"My openvpn m_vpnGateway "<< m_vpnGateway;
auto ret = adpinfo::get_route_table();
qDebug()<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
auto ret = adpinfo::get_route_table(p2.c_str());
{
for (const auto &itret: ret){
const auto ip = std::get<0>(itret);
const auto msk = std::get<1>(itret);
const auto gw = std::get<2>(itret);
const auto itf = std::get<3>(itret);
qDebug()<<"IP["<<ip.c_str()<<"]"<<"Mask["<<msk.c_str()<<"]"<<"gateway["<<gw.c_str()<<"]"<<"Interface["<<itf.c_str()<<"]";
const auto ip = itret.szDestIp;//std::get<0>(itret);
const auto msk = itret.szMaskIp;//std::get<1>(itret);
const auto gw = itret.szGatewayIp;//std::get<2>(itret);
const auto itf = itret.szInterfaceIp;//std::get<3>(itret);
const auto itfInd = itret.ulIfIndex;
qDebug()<<"IP["<<ip.c_str()<<"]"<<"Mask["<<msk.c_str()<<"]"<<"gateway["<<gw.c_str()<<"]"<<"Interface["<<itf.c_str()<<"]"<<"Interface index["<<itfInd<<"]";
emit route_avaible(QString::fromStdString(ip),
QString::fromStdString(msk),
QString::fromStdString(gw),
QString::fromStdString(itf),
itfInd);
}
}
qDebug()<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
}
else{
qDebug()<<"We can't get information about active adapter:"<<QString::fromStdString(std::get<1>(ret));