• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
  • tdehw
tdenetworkdevice.cpp
1 /* This file is part of the TDE libraries
2  Copyright (C) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net>
3  (C) 2013 Golubev Alexander <fatzer2@gmail.com>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "tdenetworkdevice.h"
21 
22 // Network connection manager
23 #include "tdenetworkconnections.h"
24 
25 #include "config.h"
26 
27 #ifdef WITH_NETWORK_MANAGER_BACKEND
28  #include "network-manager.h"
29 #endif // WITH_NETWORK_MANAGER_BACKEND
30 
31 
32 TDENetworkDevice::TDENetworkDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn) {
33  m_rxbytes = -1;
34  m_txbytes = -1;
35  m_rxpackets = -1;
36  m_txpackets = -1;
37  m_connectionManager = NULL;
38 }
39 
40 TDENetworkDevice::~TDENetworkDevice() {
41  if (m_connectionManager) {
42  delete m_connectionManager;
43  }
44 }
45 
46 TQString TDENetworkDevice::macAddress() {
47  return m_macAddress;
48 }
49 
50 void TDENetworkDevice::internalSetMacAddress(TQString ma) {
51  m_macAddress = ma;
52 }
53 
54 TQString TDENetworkDevice::state() {
55  return m_state;
56 }
57 
58 void TDENetworkDevice::internalSetState(TQString st) {
59  m_state = st;
60 }
61 
62 bool TDENetworkDevice::carrierPresent() {
63  return m_carrier;
64 }
65 
66 void TDENetworkDevice::internalSetCarrierPresent(bool cp) {
67  m_carrier = cp;
68 }
69 
70 bool TDENetworkDevice::dormant() {
71  return m_dormant;
72 }
73 
74 void TDENetworkDevice::internalSetDormant(bool dm) {
75  m_dormant = dm;
76 }
77 
78 TQString TDENetworkDevice::ipV4Address() {
79  return m_ipV4Address;
80 }
81 
82 void TDENetworkDevice::internalSetIpV4Address(TQString ad) {
83  m_ipV4Address = ad;
84 }
85 
86 TQString TDENetworkDevice::ipV6Address() {
87  return m_ipV6Address;
88 }
89 
90 void TDENetworkDevice::internalSetIpV6Address(TQString ad) {
91  m_ipV6Address = ad;
92 }
93 
94 TQString TDENetworkDevice::ipV4Netmask() {
95  return m_ipV4Netmask;
96 }
97 
98 void TDENetworkDevice::internalSetIpV4Netmask(TQString nm) {
99  m_ipV4Netmask = nm;
100 }
101 
102 TQString TDENetworkDevice::ipV6Netmask() {
103  return m_ipV6Netmask;
104 }
105 
106 void TDENetworkDevice::internalSetIpV6Netmask(TQString nm) {
107  m_ipV6Netmask = nm;
108 }
109 
110 TQString TDENetworkDevice::ipV4Broadcast() {
111  return m_ipV4Broadcast;
112 }
113 
114 void TDENetworkDevice::internalSetIpV4Broadcast(TQString br) {
115  m_ipV4Broadcast = br;
116 }
117 
118 TQString TDENetworkDevice::ipV6Broadcast() {
119  return m_ipV6Broadcast;
120 }
121 
122 void TDENetworkDevice::internalSetIpV6Broadcast(TQString br) {
123  m_ipV6Broadcast = br;
124 }
125 
126 TQString TDENetworkDevice::ipV4Destination() {
127  return m_ipV4Destination;
128 }
129 
130 void TDENetworkDevice::internalSetIpV4Destination(TQString ds) {
131  m_ipV4Destination = ds;
132 }
133 
134 TQString TDENetworkDevice::ipV6Destination() {
135  return m_ipV6Destination;
136 }
137 
138 void TDENetworkDevice::internalSetIpV6Destination(TQString ds) {
139  m_ipV6Destination = ds;
140 }
141 
142 double TDENetworkDevice::rxBytes() {
143  return m_rxbytes;
144 }
145 
146 void TDENetworkDevice::internalSetRxBytes(double rx) {
147  m_rxbytes = rx;
148 }
149 
150 double TDENetworkDevice::txBytes() {
151  return m_txbytes;
152 }
153 
154 void TDENetworkDevice::internalSetTxBytes(double tx) {
155  m_txbytes = tx;
156 }
157 
158 double TDENetworkDevice::rxPackets() {
159  return m_rxpackets;
160 }
161 
162 void TDENetworkDevice::internalSetRxPackets(double rx) {
163  m_rxpackets = rx;
164 }
165 
166 double TDENetworkDevice::txPackets() {
167  return m_txpackets;
168 }
169 
170 void TDENetworkDevice::internalSetTxPackets(double tx) {
171  m_txpackets = tx;
172 }
173 
174 TDENetworkConnectionManager* TDENetworkDevice::connectionManager() {
175 #ifdef WITH_NETWORK_MANAGER_BACKEND
176  if (!m_connectionManager) {
177  m_connectionManager = new TDENetworkConnectionManager_BackendNM(this);
178  }
179 #endif // WITH_NETWORK_MANAGER_BACKEND
180 
181  return m_connectionManager;
182 }
183 
184 void TDENetworkDevice::internalSetConnectionManager(TDENetworkConnectionManager* mgr) {
185  m_connectionManager = mgr;
186 }
187 
188 #include "tdenetworkdevice.moc"

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.