mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Add ip subnet whitelist for bypassing webui auth
This commit is contained in:
parent
04cec39277
commit
95bf63330e
15 changed files with 504 additions and 20 deletions
|
@ -28,13 +28,26 @@
|
|||
|
||||
#ifndef BASE_UTILS_NET_H
|
||||
#define BASE_UTILS_NET_H
|
||||
|
||||
#include <QList>
|
||||
#include <QPair>
|
||||
|
||||
class QHostAddress;
|
||||
class QString;
|
||||
class QStringList;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
namespace Net
|
||||
{
|
||||
using Subnet = QPair<QHostAddress, int>;
|
||||
|
||||
bool isValidIP(const QString &ip);
|
||||
Subnet parseSubnet(const QString &subnetStr, bool *ok = nullptr);
|
||||
bool canParseSubnet(const QString &subnetStr);
|
||||
bool isLoopbackAddress(const QHostAddress &addr);
|
||||
bool isIPInRange(const QHostAddress &addr, const QList<Subnet> &subnets);
|
||||
QString subnetToString(const Subnet &subnet);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue