| 33 | } |
| 34 | |
| 35 | bool NetOrigin::isLocalAddress(const QHostAddress& address, const QHostAddress& local) |
| 36 | { |
| 37 | if (address.protocol() == QAbstractSocket::IPv4Protocol) |
| 38 | { |
| 39 | if (!address.isInSubnet(local, 24)) // 255.255.255.xxx; IPv4 0-32 |
| 40 | { |
| 41 | return false; |
| 42 | } |
| 43 | } |
| 44 | else if (address.protocol() == QAbstractSocket::IPv6Protocol) |
| 45 | { |
| 46 | if (!address.isInSubnet(local, 64)) // 2001:db8:abcd:0012:XXXX:XXXX:XXXX:XXXX; IPv6 0-128 |
| 47 | { |
| 48 | return false; |
| 49 | } |
| 50 | } |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | void NetOrigin::settingsChangedHandler(settings::type type, const QJsonDocument& config) |
| 55 | { |
no outgoing calls
no test coverage detected