Project

General

Profile

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