Subversion Repositories ALCASAR

Rev

Rev 3037 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3037 Rev 3100
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
     * 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
    /**
71
     * Returns $_drops.
85
     * Returns $_drops.
72
     *
86
     *
73
     * @see NetDevice::$_drops
87
     * @see NetDevice::$_drops
74
     *
88
     *
75
     * @return int
89
     * @return int
76
     */
90
     */
77
    public function getDrops()
91
    public function getDrops()
78
    {
92
    {
79
        return $this->_drops;
93
        return $this->_drops;
80
    }
94
    }
81
 
95
 
82
    /**
96
    /**
83
     * Sets $_drops.
97
     * Sets $_drops.
84
     *
98
     *
85
     * @param int $drops dropped packages
99
     * @param int $drops dropped packages
86
     *
100
     *
87
     * @see NetDevice::$_drops
101
     * @see NetDevice::$_drops
88
     *
102
     *
89
     * @return void
103
     * @return void
90
     */
104
     */
91
    public function setDrops($drops)
105
    public function setDrops($drops)
92
    {
106
    {
93
        $this->_drops = $drops;
107
        $this->_drops = $drops;
94
    }
108
    }
95
 
109
 
96
    /**
110
    /**
97
     * Returns $_errors.
111
     * Returns $_errors.
98
     *
112
     *
99
     * @see NetDevice::$_errors
113
     * @see NetDevice::$_errors
100
     *
114
     *
101
     * @return int
115
     * @return int
102
     */
116
     */
103
    public function getErrors()
117
    public function getErrors()
104
    {
118
    {
105
        return $this->_errors;
119
        return $this->_errors;
106
    }
120
    }
107
 
121
 
108
    /**
122
    /**
109
     * Sets $_errors.
123
     * Sets $_errors.
110
     *
124
     *
111
     * @param int $errors error packages
125
     * @param int $errors error packages
112
     *
126
     *
113
     * @see NetDevice::$_errors
127
     * @see NetDevice::$_errors
114
     *
128
     *
115
     * @return void
129
     * @return void
116
     */
130
     */
117
    public function setErrors($errors)
131
    public function setErrors($errors)
118
    {
132
    {
119
        $this->_errors = $errors;
133
        $this->_errors = $errors;
120
    }
134
    }
121
 
135
 
122
    /**
136
    /**
123
     * Returns $_name.
137
     * Returns $_name.
124
     *
138
     *
125
     * @see NetDevice::$_name
139
     * @see NetDevice::$_name
126
     *
140
     *
127
     * @return String
141
     * @return String
128
     */
142
     */
129
    public function getName()
143
    public function getName()
130
    {
144
    {
131
        return $this->_name;
145
        return $this->_name;
132
    }
146
    }
133
 
147
 
134
    /**
148
    /**
135
     * Sets $_name.
149
     * Sets $_name.
136
     *
150
     *
137
     * @param String $name device name
151
     * @param String $name device name
138
     *
152
     *
139
     * @see NetDevice::$_name
153
     * @see NetDevice::$_name
140
     *
154
     *
141
     * @return void
155
     * @return void
142
     */
156
     */
143
    public function setName($name)
157
    public function setName($name)
144
    {
158
    {
145
        $this->_name = $name;
159
        $this->_name = $name;
146
    }
160
    }
147
 
161
 
148
    /**
162
    /**
149
     * Returns $_rxBytes.
163
     * Returns $_rxBytes.
150
     *
164
     *
151
     * @see NetDevice::$_rxBytes
165
     * @see NetDevice::$_rxBytes
152
     *
166
     *
153
     * @return int
167
     * @return int
154
     */
168
     */
155
    public function getRxBytes()
169
    public function getRxBytes()
156
    {
170
    {
157
        return $this->_rxBytes;
171
        return $this->_rxBytes;
158
    }
172
    }
159
 
173
 
160
    /**
174
    /**
161
     * Sets $_rxBytes.
175
     * Sets $_rxBytes.
162
     *
176
     *
163
     * @param int $rxBytes received bytes
177
     * @param int $rxBytes received bytes
164
     *
178
     *
165
     * @see NetDevice::$_rxBytes
179
     * @see NetDevice::$_rxBytes
166
     *
180
     *
167
     * @return void
181
     * @return void
168
     */
182
     */
169
    public function setRxBytes($rxBytes)
183
    public function setRxBytes($rxBytes)
170
    {
184
    {
171
        $this->_rxBytes = $rxBytes;
185
        $this->_rxBytes = $rxBytes;
172
    }
186
    }
173
 
187
 
174
    /**
188
    /**
175
     * Returns $_txBytes.
189
     * Returns $_txBytes.
176
     *
190
     *
177
     * @see NetDevice::$_txBytes
191
     * @see NetDevice::$_txBytes
178
     *
192
     *
179
     * @return int
193
     * @return int
180
     */
194
     */
181
    public function getTxBytes()
195
    public function getTxBytes()
182
    {
196
    {
183
        return $this->_txBytes;
197
        return $this->_txBytes;
184
    }
198
    }
185
 
199
 
186
    /**
200
    /**
187
     * Sets $_txBytes.
201
     * Sets $_txBytes.
188
     *
202
     *
189
     * @param int $txBytes transmitted bytes
203
     * @param int $txBytes transmitted bytes
190
     *
204
     *
191
     * @see NetDevice::$_txBytes
205
     * @see NetDevice::$_txBytes
192
     *
206
     *
193
     * @return void
207
     * @return void
194
     */
208
     */
195
    public function setTxBytes($txBytes)
209
    public function setTxBytes($txBytes)
196
    {
210
    {
197
        $this->_txBytes = $txBytes;
211
        $this->_txBytes = $txBytes;
198
    }
212
    }
199
 
213
 
200
    /**
214
    /**
201
     * Returns $_info.
215
     * Returns $_info.
202
     *
216
     *
203
     * @see NetDevice::$_info
217
     * @see NetDevice::$_info
204
     *
218
     *
205
     * @return String
219
     * @return String
206
     */
220
     */
207
    public function getInfo()
221
    public function getInfo()
208
    {
222
    {
209
        return $this->_info;
223
        return $this->_info;
210
    }
224
    }
211
 
225
 
212
    /**
226
    /**
213
     * Sets $_info.
227
     * Sets $_info.
214
     *
228
     *
215
     * @param String $info info string
229
     * @param String $info info string
216
     *
230
     *
217
     * @see NetDevice::$_info
231
     * @see NetDevice::$_info
218
     *
232
     *
219
     * @return void
233
     * @return void
220
     */
234
     */
221
    public function setInfo($info)
235
    public function setInfo($info)
222
    {
236
    {
223
        $this->_info = $info;
237
        $this->_info = $info;
224
    }
238
    }
-
 
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
    }
225
}
290
}
226
 
291