Subversion Repositories ALCASAR

Rev

Rev 3100 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

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