Project

General

Profile

Download (16.5 KB) Statistics
| Branch: | Tag: | Revision:
1 8cccee1c Scott Ullrich
<?php
2 2bdf4a03 Scott Ullrich
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	status_interfaces.php
5 0d7b21de sullrich
	part of pfSense
6
	Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>.
7 8c3e8725 Scott Ullrich
	All rights reserved.
8 8cccee1c Scott Ullrich
9 8c3e8725 Scott Ullrich
	originally part of m0n0wall (http://m0n0.ch/wall)
10 c26e2cf0 Scott Ullrich
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
11 5b237745 Scott Ullrich
	All rights reserved.
12 8cccee1c Scott Ullrich
13 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
14
	modification, are permitted provided that the following conditions are met:
15 8cccee1c Scott Ullrich
16 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
17
	   this list of conditions and the following disclaimer.
18 8cccee1c Scott Ullrich
19 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
20
	   notice, this list of conditions and the following disclaimer in the
21
	   documentation and/or other materials provided with the distribution.
22 8cccee1c Scott Ullrich
23 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
	POSSIBILITY OF SUCH DAMAGE.
33
*/
34 1d333258 Scott Ullrich
/*	
35
	pfSense_MODULE:	interfaces
36
*/
37 5b237745 Scott Ullrich
38 6b07c15a Matthew Grooms
##|+PRIV
39
##|*IDENT=page-status-interfaces
40
##|*NAME=Status: Interfaces page
41
##|*DESCR=Allow access to the 'Status: Interfaces' page.
42
##|*MATCH=status_interfaces.php*
43
##|-PRIV
44
45 51caa77a Scott Ullrich
require_once("guiconfig.inc");
46 5b237745 Scott Ullrich
47 07c17911 Ermal Luçi
if ($_GET['if']) {
48
	$interface = $_GET['if'];
49
	if ($_GET['action'] == "Disconnect" || $_GET['action'] == "Release") {
50 80bf3f4a Ermal Luçi
		interface_bring_down($interface);
51 07c17911 Ermal Luçi
	} else if ($_GET['action'] == "Connect" || $_GET['action'] == "Renew") {
52 80bf3f4a Ermal Luçi
		interface_configure($interface); 
53 c26e2cf0 Scott Ullrich
	}
54 56e1d16e Ermal Lu?i
	header("Location: status_interfaces.php");
55
	exit;
56 c26e2cf0 Scott Ullrich
}
57
58 ee644822 Carlos Eduardo Ramos
$pgtitle = array(gettext("Status"),gettext("Interfaces"));
59 4df96eff Scott Ullrich
include("head.inc");
60
61 5b237745 Scott Ullrich
?>
62 8cccee1c Scott Ullrich
63
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
64 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
65 0d7b21de sullrich
<table width="100%" border="0" cellspacing="0" cellpadding="0">
66
<?php 
67
	$i = 0; 
68
	$ifdescrs = get_configured_interface_with_descr(false, true);
69
	foreach ($ifdescrs as $ifdescr => $ifname):
70
	$ifinfo = get_interface_info($ifdescr);
71 57f2840e Evgeny
	// Load MAC-Manufacturer table
72
	$mac_man = load_mac_manufacturer_table();
73 0d7b21de sullrich
?>
74
<?php if ($i): ?>
75
	<tr>
76
		<td colspan="8" class="list" height="12"></td>
77
	</tr>
78
<?php endif; ?>
79
	<tr>
80
		<td colspan="2" class="listtopic">
81 ee644822 Carlos Eduardo Ramos
			<?=htmlspecialchars($ifname);?> <?=gettext("interface"); ?> (<?=htmlspecialchars($ifinfo['hwif']);?>)
82 0d7b21de sullrich
		</td>
83
	</tr>
84
	<tr>
85 ee644822 Carlos Eduardo Ramos
		<td width="22%" class="vncellt"><?=gettext("Status"); ?></td>
86 0d7b21de sullrich
		<td width="78%" class="listr">
87
			<?=htmlspecialchars($ifinfo['status']);?>
88
		</td>
89
	</tr>
90
	<?php if ($ifinfo['dhcplink']): ?>
91
	<tr>
92
		<td width="22%" class="vncellt">
93
			DHCP
94
		</td>
95
		<td width="78%" class="listr">
96
			<?=htmlspecialchars($ifinfo['dhcplink']);?>&nbsp;&nbsp;
97
			<?php if ($ifinfo['dhcplink'] == "up"): ?>
98
				<a href="status_interfaces.php?action=Release&if=<?php echo $ifdescr; ?>">
99 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Release");?>" class="formbtns">
100 0d7b21de sullrich
			<?php else: ?>
101
				<a href="status_interfaces.php?action=Renew&if=<?php echo $ifdescr; ?>">
102 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Renew");?>" class="formbtns">
103 0d7b21de sullrich
			<?php endif; ?>
104
			</a>
105
		</td>
106
	</tr>
107 1132ff35 smos
	<?php endif;
108
	if ($ifinfo['dhcp6link']): ?>
109
	<tr>
110
		<td width="22%" class="vncellt">
111
			DHCP6
112
		</td>
113
		<td width="78%" class="listr">
114
			<?=htmlspecialchars($ifinfo['dhcp6link']);?>&nbsp;&nbsp;
115
			<?php if ($ifinfo['dhcp6link'] == "up"): ?>
116
				<a href="status_interfaces.php?action=Release&if=<?php echo $ifdescr; ?>">
117
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Release");?>" class="formbtns">
118
			<?php else: ?>
119
				<a href="status_interfaces.php?action=Renew&if=<?php echo $ifdescr; ?>">
120
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Renew");?>" class="formbtns">
121
			<?php endif; ?>
122
			</a>
123
		</td>
124
	</tr>
125 0d7b21de sullrich
	<?php endif; if ($ifinfo['pppoelink']): ?>
126
	<tr>
127 ee644822 Carlos Eduardo Ramos
		<td width="22%" class="vncellt"><?=gettext("PPPoE"); ?></td>
128 0d7b21de sullrich
		<td width="78%" class="listr">
129
			<?=htmlspecialchars($ifinfo['pppoelink']);?>&nbsp;&nbsp;
130
			<?php if ($ifinfo['pppoelink'] == "up"): ?>
131
				<a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
132 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
133 0d7b21de sullrich
			<?php else: ?>
134
				<a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
135 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
136 0d7b21de sullrich
				<?php endif; ?>
137
			</a>
138
		</td>
139
	</tr>
140
	<?php  endif; if ($ifinfo['pptplink']): ?>
141
	<tr>
142 ee644822 Carlos Eduardo Ramos
		<td width="22%" class="vncellt"><?=gettext("PPTP"); ?></td>
143 0d7b21de sullrich
		<td width="78%" class="listr">
144
			<?=htmlspecialchars($ifinfo['pptplink']);?>&nbsp;&nbsp;
145
			<?php if ($ifinfo['pptplink'] == "up"): ?>
146
				<a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
147 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
148 0d7b21de sullrich
			<?php else: ?>
149
				<a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
150 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
151 0d7b21de sullrich
			<?php endif; ?>
152
			</a>
153
		</td>
154
	</tr>
155 633de329 gnhb
	<?php  endif; if ($ifinfo['l2tplink']): ?>
156
	<tr>
157
		<td width="22%" class="vncellt"><?=gettext("L2TP"); ?></td>
158
		<td width="78%" class="listr">
159
			<?=htmlspecialchars($ifinfo['l2tplink']);?>&nbsp;&nbsp;
160
			<?php if ($ifinfo['l2tplink'] == "up"): ?>
161
				<a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
162
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
163
			<?php else: ?>
164 0d7b21de sullrich
				<a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
165 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
166 0d7b21de sullrich
			<?php endif; ?>
167
			</a>
168
		</td>
169
	</tr>
170
	<?php  endif; if ($ifinfo['ppplink']): ?>
171
	<tr>
172 ee644822 Carlos Eduardo Ramos
		<td width="22%" class="vncellt"><?=gettext("PPP"); ?></td>
173 0d7b21de sullrich
		<td width="78%" class="listr">
174 c90f2471 gnhb
			<?=htmlspecialchars($ifinfo['pppinfo']);?>
175
			<?php if ($ifinfo['ppplink'] == "up"): ?>
176 0d7b21de sullrich
				<a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
177 c8927bfb Rafael Lucas
				<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
178 0d7b21de sullrich
			<?php else: ?>
179 c90f2471 gnhb
				<?php if (!$ifinfo['nodevice']): ?>
180 9ebe7028 gnhb
					<a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
181 c8927bfb Rafael Lucas
					<input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
182 9ebe7028 gnhb
				<?php endif; ?>
183 0d7b21de sullrich
			<?php endif; ?>
184
			</a>
185
		</td>
186
	</tr>
187 8eb2f33a Scott Ullrich
	<?php  endif; if ($ifinfo['ppp_uptime'] || $ifinfo['ppp_uptime_accumulated']): ?>
188
	<tr>
189 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("Uptime ");?><?php if ($ifinfo['ppp_uptime_accumulated']) echo "(historical)"; ?></td>
190 59db783a gnhb
		<td width="78%" class="listr">
191
			<?=htmlspecialchars($ifinfo['ppp_uptime']);?> <?=htmlspecialchars($ifinfo['ppp_uptime_accumulated']);?>
192
		</td>
193 8eb2f33a Scott Ullrich
        </tr>
194 5e589685 smos
	<?php  endif; if ($ifinfo['cell_rssi']): ?>
195
	<tr>
196
		<td width="22%" class="vncellt"><?=gettext("Cell Signal (RSSI)");?></td>
197
		<td width="78%" class="listr">
198 d23e157a smos
			<?=htmlspecialchars($ifinfo['cell_rssi']);?>
199 5e589685 smos
		</td>
200
        </tr>
201 99f95f7d smos
	<?php  endif; if ($ifinfo['cell_mode']): ?>
202
	<tr>
203
		<td width="22%" class="vncellt"><?=gettext("Cell Mode");?></td>
204
		<td width="78%" class="listr">
205
			<?=htmlspecialchars($ifinfo['cell_mode']);?>
206
		</td>
207
        </tr>
208 d23e157a smos
	<?php  endif; if ($ifinfo['cell_simstate']): ?>
209
	<tr>
210
		<td width="22%" class="vncellt"><?=gettext("Cell SIM State");?></td>
211
		<td width="78%" class="listr">
212
			<?=htmlspecialchars($ifinfo['cell_simstate']);?>
213
		</td>
214
        </tr>
215
	<?php  endif; if ($ifinfo['cell_service']): ?>
216
	<tr>
217
		<td width="22%" class="vncellt"><?=gettext("Cell Service");?></td>
218
		<td width="78%" class="listr">
219
			<?=htmlspecialchars($ifinfo['cell_service']);?>
220
		</td>
221
        </tr>
222
	<?php  endif; if ($ifinfo['cell_bwupstream']): ?>
223 5e589685 smos
	<tr>
224
		<td width="22%" class="vncellt"><?=gettext("Cell Upstream");?></td>
225 d23e157a smos
		<td width="78%" class="listr">
226
			<?=htmlspecialchars($ifinfo['cell_bwupstream']);?> kbit/s
227
		</td>
228
        </tr>
229
	<?php  endif; if ($ifinfo['cell_bwdownstream']): ?>
230
	<tr>
231
		<td width="22%" class="vncellt"><?=gettext("Cell Downstream");?></td>
232
		<td width="78%" class="listr">
233
			<?=htmlspecialchars($ifinfo['cell_bwdownstream']);?> kbit/s
234
		</td>
235
        </tr>
236
	<?php  endif; if ($ifinfo['cell_upstream']): ?>
237
	<tr>
238
		<td width="22%" class="vncellt"><?=gettext("Cell Current Up");?></td>
239 5e589685 smos
		<td width="78%" class="listr">
240
			<?=htmlspecialchars($ifinfo['cell_upstream']);?> kbit/s
241
		</td>
242
        </tr>
243
	<?php  endif; if ($ifinfo['cell_downstream']): ?>
244
	<tr>
245 d23e157a smos
		<td width="22%" class="vncellt"><?=gettext("Cell Current Down");?></td>
246 5e589685 smos
		<td width="78%" class="listr">
247
			<?=htmlspecialchars($ifinfo['cell_downstream']);?> kbit/s
248
		</td>
249
        </tr>
250 0d7b21de sullrich
	<?php  endif; if ($ifinfo['macaddr']): ?>
251
	<tr>
252 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("MAC address");?></td>
253 0d7b21de sullrich
		<td width="78%" class="listr">
254 57f2840e Evgeny
			<?php 
255
			$mac=$ifinfo['macaddr']; 
256
			$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
257 81debd44 Chris Buechler
			if(isset($mac_man[$mac_hi])){ print "<span>" . $mac . " - " . htmlspecialchars($mac_man[$mac_hi]); print "</span>"; }
258 57f2840e Evgeny
			      else {print htmlspecialchars($mac);}
259
			?>
260 0d7b21de sullrich
		</td>
261
	</tr>
262
	<?php endif; if ($ifinfo['status'] != "down"): ?>
263
	<?php if ($ifinfo['dhcplink'] != "down" && $ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down"): ?>
264
	<?php if ($ifinfo['ipaddr']): ?>
265
	<tr>
266 bbcc0f9c Seth Mos
		<td width="22%" class="vncellt"><?=gettext("IPv4 address");?></td>
267 0d7b21de sullrich
		<td width="78%" class="listr">
268
			<?=htmlspecialchars($ifinfo['ipaddr']);?>
269
			&nbsp; 
270
		</td>
271
	</tr>
272
	<?php endif; ?><?php if ($ifinfo['subnet']): ?>
273
	<tr>
274 bbcc0f9c Seth Mos
		<td width="22%" class="vncellt"><?=gettext("Subnet mask IPv4");?></td>
275 0d7b21de sullrich
		<td width="78%" class="listr">
276
			<?=htmlspecialchars($ifinfo['subnet']);?>
277
		</td>
278
	</tr>
279
	<?php endif; ?><?php if ($ifinfo['gateway']): ?>
280
	<tr>
281 bbcc0f9c Seth Mos
		<td width="22%" class="vncellt"><?=gettext("Gateway IPv4");?></td>
282 0d7b21de sullrich
		<td width="78%" class="listr">
283 dde9a4fc Seth Mos
			<?=htmlspecialchars($config['interfaces'][$ifdescr]['gateway']);?>
284
			<?=htmlspecialchars($ifinfo['gateway']);?>
285 0d7b21de sullrich
		</td>
286
	</tr>
287 58418355 smos
	<?php endif; ?><?php if ($ifinfo['linklocal']): ?>
288
	<tr>
289
		<td width="22%" class="vncellt"><?=gettext("IPv6 Link Local");?></td>
290
		<td width="78%" class="listr">
291
			<?=htmlspecialchars($ifinfo['linklocal']);?>
292
			&nbsp; 
293
		</td>
294
	</tr>
295
	<?php endif; ?><?php if ($ifinfo['ipaddrv6']): ?>
296 bbcc0f9c Seth Mos
	<tr>
297
		<td width="22%" class="vncellt"><?=gettext("IPv6 address");?></td>
298
		<td width="78%" class="listr">
299
			<?=htmlspecialchars($ifinfo['ipaddrv6']);?>
300
			&nbsp; 
301
		</td>
302
	</tr>
303
	<?php endif; ?><?php if ($ifinfo['subnetv6']): ?>
304
	<tr>
305
		<td width="22%" class="vncellt"><?=gettext("Subnet mask IPv6");?></td>
306
		<td width="78%" class="listr">
307
			<?=htmlspecialchars($ifinfo['subnetv6']);?>
308
		</td>
309
	</tr>
310
	<?php endif; ?><?php if ($ifinfo['gatewayv6']): ?>
311
	<tr>
312
		<td width="22%" class="vncellt"><?=gettext("Gateway IPv6");?></td>
313
		<td width="78%" class="listr">
314
			<?=htmlspecialchars($config['interfaces'][$ifdescr]['gatewayv6']);?>
315
			<?=htmlspecialchars($ifinfo['gatewayv6']);?>
316
		</td>
317
	</tr>
318 0d7b21de sullrich
	<?php endif; if ($ifdescr == "wan" && file_exists("{$g['varetc_path']}/resolv.conf")): ?>
319
	<tr>
320 c8927bfb Rafael Lucas
	<td width="22%" class="vncellt"><?=gettext("ISP DNS servers");?></td>
321 0d7b21de sullrich
	<td width="78%" class="listr">
322 6205a304 Scott Ullrich
		<?php
323
			$dns_servers = get_dns_servers();
324
			foreach($dns_servers as $dns) {
325
				echo "{$dns}<br>";
326 f559eaf6 Scott Ullrich
			}
327 6205a304 Scott Ullrich
		?>
328
		</td>
329 0d7b21de sullrich
	</tr>
330
	<?php endif; endif; if ($ifinfo['media']): ?>
331
	<tr>
332 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("Media");?></td>
333 0d7b21de sullrich
		<td width="78%" class="listr">
334
			<?=htmlspecialchars($ifinfo['media']);?>
335
		</td>
336
	</tr>
337 0b29093b jim-p
	<?php endif; if ($ifinfo['laggproto']): ?>
338
	<tr>
339
		<td width="22%" class="vncellt"><?=gettext("LAGG Protocol");?></td>
340
		<td width="78%" class="listr">
341
			<?=htmlspecialchars($ifinfo['laggproto']);?>
342
		</td>
343
	</tr>
344
	<?php endif; if (is_array($ifinfo['laggport'])): ?>
345
	<tr>
346
		<td width="22%" class="vncellt"><?=gettext("LAGG Ports");?></td>
347
		<td width="78%" class="listr">
348
			<?php 	foreach ($ifinfo['laggport'] as $laggport) { ?>
349
					<?php echo htmlspecialchars($laggport); ?><br/>
350
			<?php	} ?>
351
		</td>
352
	</tr>
353 0d7b21de sullrich
<?php endif; ?><?php if ($ifinfo['channel']): ?>
354
	<tr>
355 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("Channel");?></td>
356 0d7b21de sullrich
		<td width="78%" class="listr">
357
			<?=htmlspecialchars($ifinfo['channel']);?>
358
		</td>
359
	</tr>
360
<?php endif; ?><?php if ($ifinfo['ssid']): ?>
361
	<tr>
362 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("SSID");?></td>
363 0d7b21de sullrich
		<td width="78%" class="listr">
364
			<?=htmlspecialchars($ifinfo['ssid']);?>
365
		</td>
366
	</tr>
367
<?php endif; ?><?php if ($ifinfo['bssid']): ?>
368
	<tr>
369 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("BSSID");?></td>
370 0d7b21de sullrich
		<td width="78%" class="listr">
371
			<?=htmlspecialchars($ifinfo['bssid']);?>
372
		</td>
373
	</tr>
374
<?php endif; ?><?php if ($ifinfo['rate']): ?>
375
	<tr>
376 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("Rate");?></td>
377 0d7b21de sullrich
		<td width="78%" class="listr">
378
			<?=htmlspecialchars($ifinfo['rate']);?>
379
		</td>
380
	</tr>
381
<?php endif; ?><?php if ($ifinfo['rssi']): ?>
382
	<tr>
383 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("RSSI");?></td>
384 0d7b21de sullrich
		<td width="78%" class="listr">
385
			<?=htmlspecialchars($ifinfo['rssi']);?>
386
		</td>
387
	</tr>
388
<?php endif; ?>
389
	<tr>
390 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("In/out packets");?></td>
391 0d7b21de sullrich
		<td width="78%" class="listr">
392
		<?php
393
			echo htmlspecialchars($ifinfo['inpkts'] . "/" . $ifinfo['outpkts'] . " (");
394
			echo htmlspecialchars(format_bytes($ifinfo['inbytes']) . "/" . format_bytes($ifinfo['outbytes']) . ")");
395
		?>
396
		</td>
397
	</tr>
398
	<tr>
399 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("In/out packets (pass)");?></td>
400 0d7b21de sullrich
		<td width="78%" class="listr">
401
			<?php
402
				echo htmlspecialchars($ifinfo['inpktspass'] . "/" . $ifinfo['outpktspass'] . " (");
403
				echo htmlspecialchars(format_bytes($ifinfo['inbytespass']) . "/" . format_bytes($ifinfo['outbytespass']) . ")");
404
			?>
405
		</td>
406
	</tr>
407
	<tr>
408 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("In/out packets (block)");?></td>
409 0d7b21de sullrich
		<td width="78%" class="listr">
410
			<?php
411
				echo htmlspecialchars($ifinfo['inpktsblock'] . "/" . $ifinfo['outpktsblock'] . " (");
412
				echo htmlspecialchars(format_bytes($ifinfo['inbytesblock']) . "/" . format_bytes($ifinfo['outbytesblock']) . ")");
413
			?>
414
		</td>
415
	</tr>
416
<?php if (isset($ifinfo['inerrs'])): ?>
417
	<tr>
418 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("In/out errors");?></td>
419 0d7b21de sullrich
		<td width="78%" class="listr">
420
			<?=htmlspecialchars($ifinfo['inerrs'] . "/" . $ifinfo['outerrs']);?>
421
		</td>
422
	</tr>
423
<?php endif; ?>
424
<?php if (isset($ifinfo['collisions'])): ?>
425
	<tr>
426 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("Collisions");?></td>
427 0d7b21de sullrich
		<td width="78%" class="listr">
428
			<?=htmlspecialchars($ifinfo['collisions']);?>
429
		</td>
430
	</tr>
431
<?php endif; ?>
432
<?php endif; ?>
433
<?php if ($ifinfo['bridge']): ?>
434
	<tr>
435 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?php printf(gettext("Bridge (%s)"),$ifinfo['bridgeint']);?></td>
436 0d7b21de sullrich
		<td width="78%" class="listr">
437
			<?=$ifinfo['bridge'];?>
438
		</td>
439
	</tr>
440
<?php endif; ?>
441
<?php if(file_exists("/usr/bin/vmstat")): ?>
442
<?php
443
	$real_interface = "";
444
	$interrupt_total = "";
445
	$interrupt_sec = "";
446
	$real_interface = $ifinfo['hwif'];
447
	$interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $3 }'`;
448
	$interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
449
	if(strstr($interrupt_total, "hci")) {
450
		$interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
451
		$interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $5 }'`;          	
452
	}
453
	unset($interrupt_total); // XXX: FIX ME!  Need a regex and parse correct data 100% of the time.
454
?>
455
<?php if($interrupt_total): ?>
456
	<tr>
457 c8927bfb Rafael Lucas
		<td width="22%" class="vncellt"><?=gettext("Interrupts/Second");?></td>
458 0d7b21de sullrich
		<td width="78%" class="listr">
459
			<?php
460 ee644822 Carlos Eduardo Ramos
				echo $interrupt_total . " " . gettext("total");
461 0d7b21de sullrich
				echo "<br/>";
462 ee644822 Carlos Eduardo Ramos
				echo $interrupt_sec . " " . gettext("rate");
463 0d7b21de sullrich
			?>
464
		</td>
465
	</tr>
466
<?php endif; ?>
467
<?php endif; ?>
468
<?php $i++; endforeach; ?>
469
</table>
470 29ed06c9 Scott Ullrich
471 d290167c Seth Mos
<br/>
472 0d7b21de sullrich
473 c8927bfb Rafael Lucas
</strong><?php printf(gettext("Using dial-on-demand will bring the connection up again if any packet ".
474
"triggers it. To substantiate this point: disconnecting manually ".
475
"will %snot%s prevent dial-on-demand from making connections ".
476
"to the outside! Don't use dial-on-demand if you want to make sure that the line ".
477
"is kept disconnected."),'<strong>','</strong>')?>
478 71d9cd3d Scott Ullrich
479 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>