diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2017-06-17 12:57:10 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2017-06-17 13:52:54 +0200 |
commit | 234f323f7b3ae009f4236a775a72dd96094ebba1 (patch) | |
tree | c15bedc17dac35438798604cb93f8f9d16a15e88 /tdecore/tdehw/tdenetworkconnections.h | |
parent | a8e587a9733dd076c0356dbfcef561eb7ed45e90 (diff) | |
download | tdelibs-234f323f7b3ae009f4236a775a72dd96094ebba1.tar.gz tdelibs-234f323f7b3ae009f4236a775a72dd96094ebba1.zip |
tdehwlib: Use TDENetworkDevice in TDENetworkConnectionManager instead of MAC address
Use interface name in TDENetworkConnectionManager_BackendNM instead of MAC address
This relates to bug 2748
The name of the network interface seems to be a more stable identifier than the MAC
address because the MAC address can be changed easily or even automatically - see
randomization of MAC addresses on wireless interfaces. Therefore, the use of the
MAC address as a network interface identifier was abandoned.
Beware, this change is an API / ABI change! However, most changes are internal
and the only one affected is application TDENetworkManager.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e0fd34a1bd2c6412171bcceb19520d129bbcb66d)
Diffstat (limited to 'tdecore/tdehw/tdenetworkconnections.h')
-rw-r--r-- | tdecore/tdehw/tdenetworkconnections.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/tdecore/tdehw/tdenetworkconnections.h b/tdecore/tdehw/tdenetworkconnections.h index 7cc6bae6c..806c162a8 100644 --- a/tdecore/tdehw/tdenetworkconnections.h +++ b/tdecore/tdehw/tdenetworkconnections.h @@ -1003,7 +1003,7 @@ class TDENetworkEventQueueEvent_Private TDENetworkConnectionStatus::TDENetworkConnectionStatus previousConnStatus; TDEMACAddress BSSID; TQString message; - TQString hwAddress; + TQString deviceNode; TDENetworkAPEventType::TDENetworkAPEventType apevent; TDENetworkDeviceEventType::TDENetworkDeviceEventType ndevent; TDENetworkVPNEventType::TDENetworkVPNEventType vpnevent; @@ -1020,12 +1020,12 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject public: /** * Constructor. - * @param macAddress The MAC address of the hardware device - * If an empty MAC address is passed, this object will make global networking backend + * @param networkDevice Pointer to holder network device + * If the network device is passed null, this object will make global networking backend * methods available exclusively (TDENetworkDeviceType::BackendOnly). */ - TDENetworkConnectionManager(TQString macAddress); - + TDENetworkConnectionManager(TDENetworkDevice *networkDevice); + /** * Destructor. */ @@ -1209,7 +1209,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject * If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address * of the networking hardware that has changed state. */ - void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress); + void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString deviceNode); /** * Emitted whenever the status of a wireless access point changes @@ -1254,6 +1254,11 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject virtual TDENetworkConnectionList* connections(); /** + * @return the interface name of this device + */ + TQString deviceNode(); + + /** * @return the MAC address of this device */ TQString deviceMACAddress(); @@ -1318,7 +1323,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject * @internal This method must be called by the network backend whenever a device changes state * It emits the appropriate signals to notify client applications of the state change */ - void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress=TQString::null); + void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString deviceNode=TQString::null); /** * @internal This method must be called by the network backend whenever a wireless access point changes state @@ -1350,7 +1355,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject protected: TDENetworkConnectionList* m_connectionList; TDENetworkHWNeighborList* m_hwNeighborList; - TQString m_macAddress; + TDENetworkDevice* m_networkDevice; TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags m_prevConnectionStatus; TQMap<TQString, TDENetworkConnectionStatus::TDENetworkConnectionStatus> m_prevDeviceStatus; TQTimer* m_emissionTimer; @@ -1528,7 +1533,7 @@ class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject * If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address * of the networking hardware that has changed state. */ - void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress); + void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString deviceNode); /** * Emitted whenever the status of a wireless access point changes |