diff --git a/neighbor.cpp b/neighbor.cpp index f978e99..611ef34 100644 --- a/neighbor.cpp +++ b/neighbor.cpp @@ -194,6 +194,13 @@ QString Neighbor::macOfIP(QString ip, bool *ok) const { return macStr; } +/*! + Returns a string hash consisting of IP addresses (both IPv4 and IPv6) in the ARP cache as the keys, and their corresponding MAC addresses as the values. If there are no entries found or if there was an error obtaining the list, an empty hash with no keys are returned. If there was an error, *ok will be set to false, otherwise it will be true. +*/ +QHash Neighbor::list(bool *ok) { + return list(m_interface, ok); +} + /*! Returns a string hash consisting of IP addresses (both IPv4 and IPv6) in the ARP cache as the keys, and their corresponding MAC addresses as the values. By specifying \a interfaceString the returned list is confined to addresses seen from that named interface. If there are no entries found or if there was an error obtaining the list, an empty hash with no keys are returned. If there was an error, *ok will be set to false, otherwise it will be true. */ diff --git a/neighbor.h b/neighbor.h index 0ea0f28..74baa58 100644 --- a/neighbor.h +++ b/neighbor.h @@ -11,6 +11,7 @@ Q_OBJECT public: Neighbor(QString interface = QString()); QString macOfIP(QString ip, bool *ok = 0) const; + QHash list(bool *ok = 0); static QHash list(QString interface = QString(), bool *ok = 0); const QString& name() const;