Skip to content

Commit

Permalink
added parsing parameters for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nethius committed Oct 2, 2023
1 parent c254f2f commit 6dbbf1f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/daemon/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,11 @@ bool Daemon::parseConfig(const QJsonObject& obj, InterfaceConfig& config) {
return false;
}

if (!obj.value("Jc").isNull()) {
if (!obj.value("Jc").isNull() && !obj.value("Jmin").isNull()
&& !obj.value("Jmax").isNull() && !obj.value("S1").isNull()
&& !obj.value("S2").isNull() && !obj.value("H1").isNull()
&& !obj.value("H2").isNull() && !obj.value("H3").isNull()
&& !obj.value("H4").isNull()) {
config.m_junkPacketCount = obj.value("Jc").toString();
config.m_junkPacketMinSize = obj.value("Jmin").toString();
config.m_junkPacketMaxSize = obj.value("Jmax").toString();
Expand Down
31 changes: 31 additions & 0 deletions client/daemon/interfaceconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,37 @@ QString InterfaceConfig::toWgConf(const QMap<QString, QString>& extra) const {
out << "DNS = " << dnsServers.join(", ") << "\n";
}

if (!m_junkPacketCount.isNull()) {
out << "JunkPacketCount = " << m_junkPacketCount << "\n";
}
if (!m_junkPacketMinSize.isNull()) {
out << "JunkPacketMinSize = " << m_junkPacketMinSize << "\n";
}
if (!m_junkPacketMaxSize.isNull()) {
out << "JunkPacketMaxSize = " << m_junkPacketMaxSize << "\n";
}
if (!m_initPacketJunkSize.isNull()) {
out << "InitPacketJunkSize = " << m_initPacketJunkSize << "\n";
}
if (!m_responsePacketJunkSize.isNull()) {
out << "ResponsePacketJunkSize = " << m_responsePacketJunkSize << "\n";
}
if (!m_initPacketMagicHeader.isNull()) {
out << "InitPacketMagicHeader = " << m_initPacketMagicHeader << "\n";
}
if (!m_responsePacketMagicHeader.isNull()) {
out << "ResponsePacketMagicHeader = " << m_responsePacketMagicHeader
<< "\n";
}
if (!m_underloadPacketMagicHeader.isNull()) {
out << "UnderloadPacketMagicHeader = " << m_underloadPacketMagicHeader
<< "\n";
}
if (!m_transportPacketMagicHeader.isNull()) {
out << "TransportPacketMagicHeader = " << m_transportPacketMagicHeader
<< "\n";
}

// If any extra config was provided, append it now.
for (const QString& key : extra.keys()) {
out << key << " = " << extra[key] << "\n";
Expand Down

0 comments on commit 6dbbf1f

Please sign in to comment.