tdenetworkdevice.h
00001 /* This file is part of the TDE libraries 00002 Copyright (C) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net> 00003 (C) 2013 Golubev Alexander <fatzer2@gmail.com> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _TDENETWORKDEVICE_H 00021 #define _TDENETWORKDEVICE_H 00022 00023 #include "tdegenericdevice.h" 00024 00025 class TDENetworkConnectionManager; 00026 00027 class TDECORE_EXPORT TDENetworkDevice : public TDEGenericDevice 00028 { 00029 public: 00034 TDENetworkDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null); 00035 00039 ~TDENetworkDevice(); 00040 00044 TQString macAddress(); 00045 00049 TQString state(); 00050 00054 bool carrierPresent(); 00055 00059 bool dormant(); 00060 00064 TQString ipV4Address(); 00065 00069 TQString ipV6Address(); 00070 00074 TQString ipV4Netmask(); 00075 00079 TQString ipV6Netmask(); 00080 00084 TQString ipV4Broadcast(); 00085 00089 TQString ipV6Broadcast(); 00090 00094 TQString ipV4Destination(); 00095 00099 TQString ipV6Destination(); 00100 00104 double rxBytes(); 00105 00109 double txBytes(); 00110 00114 double rxPackets(); 00115 00119 double txPackets(); 00120 00124 TDENetworkConnectionManager* connectionManager(); 00125 00126 protected: 00131 void internalSetMacAddress(TQString ma); 00132 00137 void internalSetState(TQString st); 00138 00143 void internalSetCarrierPresent(bool cp); 00144 00149 void internalSetDormant(bool dm); 00150 00155 void internalSetIpV4Address(TQString ad); 00156 00161 void internalSetIpV6Address(TQString ad); 00162 00167 void internalSetIpV4Netmask(TQString nm); 00168 00173 void internalSetIpV6Netmask(TQString nm); 00174 00179 void internalSetIpV4Broadcast(TQString br); 00180 00185 void internalSetIpV6Broadcast(TQString br); 00186 00191 void internalSetIpV4Destination(TQString ds); 00192 00197 void internalSetIpV6Destination(TQString ds); 00198 00203 void internalSetRxBytes(double rx); 00204 00209 void internalSetTxBytes(double tx); 00210 00215 void internalSetRxPackets(double rx); 00216 00221 void internalSetTxPackets(double tx); 00222 00226 void internalSetConnectionManager(TDENetworkConnectionManager* mgr); 00227 00228 private: 00229 TQString m_macAddress; 00230 TQString m_state; 00231 bool m_carrier; 00232 bool m_dormant; 00233 TQString m_ipV4Address; 00234 TQString m_ipV6Address; 00235 TQString m_ipV4Netmask; 00236 TQString m_ipV6Netmask; 00237 TQString m_ipV4Broadcast; 00238 TQString m_ipV6Broadcast; 00239 TQString m_ipV4Destination; 00240 TQString m_ipV6Destination; 00241 double m_rxbytes; 00242 double m_txbytes; 00243 double m_rxpackets; 00244 double m_txpackets; 00245 TDENetworkConnectionManager* m_connectionManager; 00246 00247 friend class TDEHardwareDevices; 00248 }; 00249 00250 #endif // _TDENETWORKDEVICE_H