From 3736dcb65e92ea3d6f1af827a52b09ebd1250f7e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 24 Oct 2011 11:01:09 +0100 Subject: Network - Add QHostAddress::isLoopback API. The standard IPv4 loopback address is 127.0.0.1, however anything in the 127.0.0.0/8 range is also a loopback address. isLoopback returns true for any address that is in the IPv4 loopback address range, or is the single IPv6 loopback address ::1 Task-number: QTBUG-22246 Change-Id: Ic39100e2e97a52db700e01b109998a1cfd4335e3 Reviewed-by: Thiago Macieira (Intel) --- src/network/kernel/qhostaddress.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/network/kernel/qhostaddress.h') diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index 3d364de6e6..83e8a7ce3c 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -120,6 +120,8 @@ public: bool isInSubnet(const QHostAddress &subnet, int netmask) const; bool isInSubnet(const QPair &subnet) const; + bool isLoopback() const; + static QPair parseSubnet(const QString &subnet); protected: -- cgit v1.2.3