feat: add default values for s3, s4

This commit is contained in:
Mark Puha 2025-07-04 14:07:26 +02:00
parent 96330798cb
commit a79e375df3
14 changed files with 359 additions and 267 deletions

View file

@ -266,9 +266,15 @@ bool AwgConfigModel::isHeadersEqual(const QString &h1, const QString &h2, const
return (h1 == h2) || (h1 == h3) || (h1 == h4) || (h2 == h3) || (h2 == h4) || (h3 == h4);
}
bool AwgConfigModel::isPacketSizeEqual(const int s1, const int s2)
bool AwgConfigModel::isPacketSizeEqual(const int s1, const int s2, const int s3, const int s4)
{
return (AwgConstant::messageInitiationSize + s1 == AwgConstant::messageResponseSize + s2);
int initSize = AwgConstant::messageInitiationSize + s1;
int responseSize = AwgConstant::messageResponseSize + s2;
int cookieSize = AwgConstant::messageCookieReplySize + s3;
int transportSize = AwgConstant::messageTransportSize + s4;
return (initSize == responseSize || initSize == cookieSize || initSize == transportSize
|| responseSize == cookieSize || responseSize == transportSize || cookieSize == transportSize);
}
bool AwgConfigModel::isServerSettingsEqual()

View file

@ -10,6 +10,8 @@ namespace AwgConstant
{
const int messageInitiationSize = 148;
const int messageResponseSize = 92;
const int messageCookieReplySize = 64;
const int messageTransportSize = 32;
}
struct AwgConfig
@ -98,7 +100,7 @@ public slots:
QJsonObject getConfig();
bool isHeadersEqual(const QString &h1, const QString &h2, const QString &h3, const QString &h4);
bool isPacketSizeEqual(const int s1, const int s2);
bool isPacketSizeEqual(const int s1, const int s2, const int s3, const int s4);
bool isServerSettingsEqual();