Subversion Repositories ALCASAR

Rev

Rev 3037 | Go to most recent revision | 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
    /**
3100 rexy 71
     * transmitted bytes rate
72
     *
73
     * @var int
74
     */
75
    private $_txRate = null;
76
 
77
    /**
78
     * received bytes rate
79
     *
80
     * @var int
81
     */
82
    private $_rxRate = null;
83
 
84
    /**
2788 rexy 85
     * Returns $_drops.
86
     *
87
     * @see NetDevice::$_drops
88
     *
3037 rexy 89
     * @return int
2788 rexy 90
     */
91
    public function getDrops()
92
    {
93
        return $this->_drops;
94
    }
95
 
96
    /**
97
     * Sets $_drops.
98
     *
3037 rexy 99
     * @param int $drops dropped packages
2788 rexy 100
     *
101
     * @see NetDevice::$_drops
102
     *
3037 rexy 103
     * @return void
2788 rexy 104
     */
105
    public function setDrops($drops)
106
    {
107
        $this->_drops = $drops;
108
    }
109
 
110
    /**
111
     * Returns $_errors.
112
     *
113
     * @see NetDevice::$_errors
114
     *
3037 rexy 115
     * @return int
2788 rexy 116
     */
117
    public function getErrors()
118
    {
119
        return $this->_errors;
120
    }
121
 
122
    /**
123
     * Sets $_errors.
124
     *
3037 rexy 125
     * @param int $errors error packages
2788 rexy 126
     *
127
     * @see NetDevice::$_errors
128
     *
3037 rexy 129
     * @return void
2788 rexy 130
     */
131
    public function setErrors($errors)
132
    {
133
        $this->_errors = $errors;
134
    }
135
 
136
    /**
137
     * Returns $_name.
138
     *
139
     * @see NetDevice::$_name
140
     *
141
     * @return String
142
     */
143
    public function getName()
144
    {
145
        return $this->_name;
146
    }
147
 
148
    /**
149
     * Sets $_name.
150
     *
151
     * @param String $name device name
152
     *
153
     * @see NetDevice::$_name
154
     *
3037 rexy 155
     * @return void
2788 rexy 156
     */
157
    public function setName($name)
158
    {
159
        $this->_name = $name;
160
    }
161
 
162
    /**
163
     * Returns $_rxBytes.
164
     *
165
     * @see NetDevice::$_rxBytes
166
     *
3037 rexy 167
     * @return int
2788 rexy 168
     */
169
    public function getRxBytes()
170
    {
171
        return $this->_rxBytes;
172
    }
173
 
174
    /**
175
     * Sets $_rxBytes.
176
     *
3037 rexy 177
     * @param int $rxBytes received bytes
2788 rexy 178
     *
179
     * @see NetDevice::$_rxBytes
180
     *
3037 rexy 181
     * @return void
2788 rexy 182
     */
183
    public function setRxBytes($rxBytes)
184
    {
185
        $this->_rxBytes = $rxBytes;
186
    }
187
 
188
    /**
189
     * Returns $_txBytes.
190
     *
191
     * @see NetDevice::$_txBytes
192
     *
3037 rexy 193
     * @return int
2788 rexy 194
     */
195
    public function getTxBytes()
196
    {
197
        return $this->_txBytes;
198
    }
199
 
200
    /**
201
     * Sets $_txBytes.
202
     *
3037 rexy 203
     * @param int $txBytes transmitted bytes
2788 rexy 204
     *
205
     * @see NetDevice::$_txBytes
206
     *
3037 rexy 207
     * @return void
2788 rexy 208
     */
209
    public function setTxBytes($txBytes)
210
    {
211
        $this->_txBytes = $txBytes;
212
    }
213
 
214
    /**
215
     * Returns $_info.
216
     *
217
     * @see NetDevice::$_info
218
     *
219
     * @return String
220
     */
221
    public function getInfo()
222
    {
223
        return $this->_info;
224
    }
225
 
226
    /**
227
     * Sets $_info.
228
     *
229
     * @param String $info info string
230
     *
231
     * @see NetDevice::$_info
232
     *
3037 rexy 233
     * @return void
2788 rexy 234
     */
235
    public function setInfo($info)
236
    {
237
        $this->_info = $info;
238
    }
3100 rexy 239
    /**
240
     * Returns $_rxRate.
241
     *
242
     * @see NetDevice::$_rxRate
243
     *
244
     * @return int
245
     */
246
    public function getRxRate()
247
    {
248
        return $this->_rxRate;
249
    }
250
 
251
    /**
252
     * Sets $_rxRate.
253
     *
254
     * @param int $rxRate received bytes rate
255
     *
256
     * @see NetDevice::$_rxRate
257
     *
258
     * @return void
259
     */
260
    public function setRxRate($rxRate)
261
    {
262
        $this->_rxRate = $rxRate;
263
    }
264
 
265
    /**
266
     * Returns $_txRate.
267
     *
268
     * @see NetDevice::$_txRate
269
     *
270
     * @return int
271
     */
272
    public function getTxRate()
273
    {
274
        return $this->_txRate;
275
    }
276
 
277
    /**
278
     * Sets $_txRate.
279
     *
280
     * @param int $txRate transmitted bytes rate
281
     *
282
     * @see NetDevice::$_txRate
283
     *
284
     * @return void
285
     */
286
    public function setTxRate($txRate)
287
    {
288
        $this->_txRate = $txRate;
289
    }
2788 rexy 290
}