Subversion Repositories ALCASAR

Rev

Rev 3100 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
2788 rexy 1
<?php
2
/**
3
 * NetDevice TO class
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PSI_TO
9
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
10
 * @copyright 2009 phpSysInfo
11
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
12
 * @version   SVN: $Id: class.NetDevice.inc.php 547 2012-03-22 09:44:38Z namiltd $
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
15
 /**
16
 * NetDevice TO class
17
 *
18
 * @category  PHP
19
 * @package   PSI_TO
20
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
21
 * @copyright 2009 phpSysInfo
22
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
23
 * @version   Release: 3.0
24
 * @link      http://phpsysinfo.sourceforge.net
25
 */
26
class NetDevice
27
{
28
    /**
29
     * name of the device
30
     *
3037 rexy 31
     * @var string
2788 rexy 32
     */
33
    private $_name = "";
34
 
35
    /**
36
     * transmitted bytes
37
     *
3037 rexy 38
     * @var int
2788 rexy 39
     */
40
    private $_txBytes = 0;
41
 
42
    /**
43
     * received bytes
44
     *
3037 rexy 45
     * @var int
2788 rexy 46
     */
47
    private $_rxBytes = 0;
48
 
49
    /**
50
     * counted error packages
51
     *
3037 rexy 52
     * @var int
2788 rexy 53
     */
54
    private $_errors = 0;
55
 
56
    /**
57
     * counted droped packages
58
     *
3037 rexy 59
     * @var int
2788 rexy 60
     */
61
    private $_drops = 0;
62
 
63
    /**
64
     * string with info
65
     *
3037 rexy 66
     * @var string
2788 rexy 67
     */
68
    private $_info = null;
69
 
70
    /**
3179 rexy 71
     * string with bridge
72
     *
73
     * @var string
74
     */
75
    private $_bridge = null;
76
 
77
    /**
3100 rexy 78
     * transmitted bytes rate
79
     *
80
     * @var int
81
     */
82
    private $_txRate = null;
83
 
84
    /**
85
     * received bytes rate
86
     *
87
     * @var int
88
     */
89
    private $_rxRate = null;
90
 
91
    /**
2788 rexy 92
     * Returns $_drops.
93
     *
94
     * @see NetDevice::$_drops
95
     *
3037 rexy 96
     * @return int
2788 rexy 97
     */
98
    public function getDrops()
99
    {
100
        return $this->_drops;
101
    }
102
 
103
    /**
104
     * Sets $_drops.
105
     *
3037 rexy 106
     * @param int $drops dropped packages
2788 rexy 107
     *
108
     * @see NetDevice::$_drops
109
     *
3037 rexy 110
     * @return void
2788 rexy 111
     */
112
    public function setDrops($drops)
113
    {
114
        $this->_drops = $drops;
115
    }
116
 
117
    /**
118
     * Returns $_errors.
119
     *
120
     * @see NetDevice::$_errors
121
     *
3037 rexy 122
     * @return int
2788 rexy 123
     */
124
    public function getErrors()
125
    {
126
        return $this->_errors;
127
    }
128
 
129
    /**
130
     * Sets $_errors.
131
     *
3037 rexy 132
     * @param int $errors error packages
2788 rexy 133
     *
134
     * @see NetDevice::$_errors
135
     *
3037 rexy 136
     * @return void
2788 rexy 137
     */
138
    public function setErrors($errors)
139
    {
140
        $this->_errors = $errors;
141
    }
142
 
143
    /**
144
     * Returns $_name.
145
     *
146
     * @see NetDevice::$_name
147
     *
148
     * @return String
149
     */
150
    public function getName()
151
    {
152
        return $this->_name;
153
    }
154
 
155
    /**
156
     * Sets $_name.
157
     *
158
     * @param String $name device name
159
     *
160
     * @see NetDevice::$_name
161
     *
3037 rexy 162
     * @return void
2788 rexy 163
     */
164
    public function setName($name)
165
    {
166
        $this->_name = $name;
167
    }
168
 
169
    /**
170
     * Returns $_rxBytes.
171
     *
172
     * @see NetDevice::$_rxBytes
173
     *
3037 rexy 174
     * @return int
2788 rexy 175
     */
176
    public function getRxBytes()
177
    {
178
        return $this->_rxBytes;
179
    }
180
 
181
    /**
182
     * Sets $_rxBytes.
183
     *
3037 rexy 184
     * @param int $rxBytes received bytes
2788 rexy 185
     *
186
     * @see NetDevice::$_rxBytes
187
     *
3037 rexy 188
     * @return void
2788 rexy 189
     */
190
    public function setRxBytes($rxBytes)
191
    {
192
        $this->_rxBytes = $rxBytes;
193
    }
194
 
195
    /**
196
     * Returns $_txBytes.
197
     *
198
     * @see NetDevice::$_txBytes
199
     *
3037 rexy 200
     * @return int
2788 rexy 201
     */
202
    public function getTxBytes()
203
    {
204
        return $this->_txBytes;
205
    }
206
 
207
    /**
208
     * Sets $_txBytes.
209
     *
3037 rexy 210
     * @param int $txBytes transmitted bytes
2788 rexy 211
     *
212
     * @see NetDevice::$_txBytes
213
     *
3037 rexy 214
     * @return void
2788 rexy 215
     */
216
    public function setTxBytes($txBytes)
217
    {
218
        $this->_txBytes = $txBytes;
219
    }
220
 
221
    /**
222
     * Returns $_info.
223
     *
224
     * @see NetDevice::$_info
225
     *
226
     * @return String
227
     */
228
    public function getInfo()
229
    {
230
        return $this->_info;
231
    }
232
 
233
    /**
234
     * Sets $_info.
235
     *
236
     * @param String $info info string
237
     *
238
     * @see NetDevice::$_info
239
     *
3037 rexy 240
     * @return void
2788 rexy 241
     */
242
    public function setInfo($info)
243
    {
244
        $this->_info = $info;
245
    }
3179 rexy 246
 
3100 rexy 247
    /**
3179 rexy 248
     * Returns $_bridge.
249
     *
250
     * @see NetDevice::$_bridge
251
     *
252
     * @return String
253
     */
254
    public function getBridge()
255
    {
256
        return $this->_bridge;
257
    }
258
 
259
    /**
260
     * Sets $_bridge.
261
     *
262
     * @param String $bridge bridge string
263
     *
264
     * @see NetDevice::$_bridge
265
     *
266
     * @return void
267
     */
268
    public function setBridge($bridge)
269
    {
270
        $this->_bridge = $bridge;
271
    }
272
 
273
    /**
3100 rexy 274
     * Returns $_rxRate.
275
     *
276
     * @see NetDevice::$_rxRate
277
     *
278
     * @return int
279
     */
280
    public function getRxRate()
281
    {
282
        return $this->_rxRate;
283
    }
284
 
285
    /**
286
     * Sets $_rxRate.
287
     *
288
     * @param int $rxRate received bytes rate
289
     *
290
     * @see NetDevice::$_rxRate
291
     *
292
     * @return void
293
     */
294
    public function setRxRate($rxRate)
295
    {
296
        $this->_rxRate = $rxRate;
297
    }
298
 
299
    /**
300
     * Returns $_txRate.
301
     *
302
     * @see NetDevice::$_txRate
303
     *
304
     * @return int
305
     */
306
    public function getTxRate()
307
    {
308
        return $this->_txRate;
309
    }
310
 
311
    /**
312
     * Sets $_txRate.
313
     *
314
     * @param int $txRate transmitted bytes rate
315
     *
316
     * @see NetDevice::$_txRate
317
     *
318
     * @return void
319
     */
320
    public function setTxRate($txRate)
321
    {
322
        $this->_txRate = $txRate;
323
    }
2788 rexy 324
}