Project

General

Profile

Download (17.2 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php 
2
/*
3
	interfaces_assign.php
4
	part of m0n0wall (http://m0n0.ch/wall)
5
	Written by Jim McBeath based on existing m0n0wall files
6
	
7 94a77286 Scott Ullrich
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
8 5b237745 Scott Ullrich
	All rights reserved.
9
	
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
	
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
	
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19
	
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31 7ac5a4cb Scott Ullrich
/*
32
	pfSense_BUILDER_BINARIES:	/bin/rm
33
	pfSense_MODULE:	interfaces
34
*/
35 5b237745 Scott Ullrich
36 6b07c15a Matthew Grooms
##|+PRIV
37
##|*IDENT=page-interfaces-assignnetworkports
38
##|*NAME=Interfaces: Assign network ports page
39
##|*DESCR=Allow access to the 'Interfaces: Assign network ports' page.
40
##|*MATCH=interfaces_assign.php*
41
##|-PRIV
42
43 8cc6876f groo
$pgtitle = array(gettext("Interfaces"),gettext("Assign network ports"));
44 af1e2031 jim-p
$statusurl = "status_interfaces.php";
45
46 5b237745 Scott Ullrich
require("guiconfig.inc");
47 5a7d827b sullrich
require("functions.inc");
48
require("filter.inc");
49
require("shaper.inc");
50
require("ipsec.inc");
51
require("vpn.inc");
52 4c86a165 sullrich
require("captiveportal.inc");
53 6e6233d0 sullrich
require("rrd.inc");
54 5b237745 Scott Ullrich
55
/*
56
	In this file, "port" refers to the physical port name,
57
	while "interface" refers to LAN, WAN, or OPTn.
58
*/
59
60
/* get list without VLAN interfaces */
61
$portlist = get_interface_list();
62
63 7c53bc7b Erik Fonnesbeck
/* add wireless clone interfaces */
64
if (is_array($config['wireless']['clone']) && count($config['wireless']['clone'])) {
65
	foreach ($config['wireless']['clone'] as $clone) {
66
		$portlist[$clone['cloneif']] = $clone;
67
		$portlist[$clone['cloneif']]['iswlclone'] = true;
68
	}
69
}
70
71 5b237745 Scott Ullrich
/* add VLAN interfaces */
72
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
73
	foreach ($config['vlans']['vlan'] as $vlan) {
74 d59557dc Ermal Luçi
		$portlist[$vlan['vlanif']] = $vlan;
75
		$portlist[$vlan['vlanif']]['isvlan'] = true;
76 5b237745 Scott Ullrich
	}
77
}
78
79 38738505 Ermal Luçi
/* add Bridge interfaces */
80 b47c94bd Ermal Luçi
if (is_array($config['bridges']['bridged']) && count($config['bridges']['bridged'])) {
81
        foreach ($config['bridges']['bridged'] as $bridge) {
82 38738505 Ermal Luçi
                $portlist[$bridge['bridgeif']] = $bridge;
83
                $portlist[$bridge['bridgeif']]['isbridge'] = true;
84
        }
85
}
86
87
/* add GIF interfaces */
88
if (is_array($config['gifs']['gif']) && count($config['gifs']['gif'])) {
89
        foreach ($config['gifs']['gif'] as $gif) {
90
                $portlist[$gif['gifif']] = $gif;
91
                $portlist[$gif['gifif']]['isgif'] = true;
92
        }
93
}
94
95
/* add GRE interfaces */
96
if (is_array($config['gres']['gre']) && count($config['gres']['gre'])) {
97
        foreach ($config['gres']['gre'] as $gre) {
98
                $portlist[$gre['greif']] = $gre;
99
                $portlist[$gre['greif']]['isgre'] = true;
100
        }
101
}
102
103 dbdd08af Ermal Luçi
/* add LAGG interfaces */
104 c720925c Ermal Luçi
if (is_array($config['laggs']['lagg']) && count($config['laggs']['lagg'])) {
105
        foreach ($config['laggs']['lagg'] as $lagg) {
106
                $portlist[$lagg['laggif']] = $lagg;
107
                $portlist[$lagg['laggif']]['islagg'] = true;
108 dbdd08af Ermal Luçi
		/* LAGG members cannot be assigned */
109
		$lagifs = explode(',', $lagg['members']);
110
		foreach ($lagifs as $lagif)
111
			if (isset($portlist[$lagif]))
112
				unset($portlist[$lagif]);
113 c720925c Ermal Luçi
        }
114
}
115
116 265188ea Ermal Lu?i
/* add QinQ interfaces */
117
if (is_array($config['qinqs']['qinqentry']) && count($config['qinqs']['qinqentry'])) {
118
        foreach ($config['qinqs']['qinqentry'] as $qinq) {
119 08057ba6 Ermal Lu?i
                $portlist["vlan{$qinq['tag']}"]['descr'] = "VLAN {$qinq['tag']}";
120 265188ea Ermal Lu?i
                $portlist["vlan{$qinq['tag']}"]['isqinq'] = true;
121
                /* QinQ members */
122
                $qinqifs = explode(' ', $qinq['members']);
123
                foreach ($qinqifs as $qinqif) {
124
			$portlist["vlan{$qinq['tag']}_{$qinqif}"]['descr'] = "QinQ {$qinqif}";
125
			$portlist["vlan{$qinq['tag']}_{$qinqif}"]['isqinq'] = true;
126
		}
127
        }
128
}
129 c720925c Ermal Luçi
130 860c4e80 Chris Buechler
/* add PPP interfaces */
131
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
132 611ae852 Ermal
	foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
133 99c26d44 gnhb
		$portname = $ppp['if'];
134 860c4e80 Chris Buechler
		$portlist[$portname] = $ppp;
135
		$portlist[$portname]['isppp'] = true;
136 3f2ef8d7 gnhb
		$ports_base = basename($ppp['ports']);
137 42809b4a gnhb
		if (isset($ppp['descr']))
138 99c26d44 gnhb
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['descr']}";
139 00b702cc gnhb
		else if (isset($ppp['username']))
140 99c26d44 gnhb
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['username']}";
141 42809b4a gnhb
		else
142 99c26d44 gnhb
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base})";
143 860c4e80 Chris Buechler
	}
144
}
145
146 d59557dc Ermal Luçi
if ($_POST['apply']) {
147
	if (file_exists("/var/run/interface_mismatch_reboot_needed"))
148 eef52225 jim-p
		system_reboot();
149 d59557dc Ermal Luçi
	else {
150
		write_config();
151
152
		$retval = 0;
153
		$retval = filter_configure();
154 0027de0a Ermal Lu?i
		$savemsg = get_std_save_message($retval);
155 d59557dc Ermal Luçi
156
		if (stristr($retval, "error") <> true)
157
			$savemsg = get_std_save_message($retval);
158
		else
159
			$savemsg = $retval;
160
	}
161
162
} else if ($_POST) {
163 5b237745 Scott Ullrich
164
	unset($input_errors);
165
166
	/* input validation */
167
168
	/* Build a list of the port names so we can see how the interfaces map */
169
	$portifmap = array();
170
	foreach ($portlist as $portname => $portinfo)
171
		$portifmap[$portname] = array();
172
173
	/* Go through the list of ports selected by the user,
174
	   build a list of port-to-interface mappings in portifmap */
175
	foreach ($_POST as $ifname => $ifport) {
176
		if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt'))
177
			$portifmap[$ifport][] = strtoupper($ifname);
178
	}
179
180
	/* Deliver error message for any port with more than one assignment */
181
	foreach ($portifmap as $portname => $ifnames) {
182
		if (count($ifnames) > 1) {
183 ddc55e12 Erik Fonnesbeck
			$errstr = sprintf(gettext('Port %1$s '.
184
				' was assigned to %2$s' .
185
				' interfaces:'), $portname, count($ifnames));
186 5b237745 Scott Ullrich
				
187
			foreach ($portifmap[$portname] as $ifn)
188
				$errstr .= " " . $ifn;
189
			
190
			$input_errors[] = $errstr;
191
		}
192
	}
193
194 66bcba1b Ermal
	if (is_array($config['vlans']['vlan'])) {
195
		foreach ($config['vlans']['vlan'] as $vlan) {
196
			if (does_interface_exist($vlan['if']) == false)
197
				$input_errors[] = "Vlan parent interface {$vlan['if']} does not exist anymore so vlan id {$vlan['tag']} cannot be created please fix the issue before continuing.";
198
		}
199
	}
200 5b237745 Scott Ullrich
201
	if (!$input_errors) {
202
		/* No errors detected, so update the config */
203
		foreach ($_POST as $ifname => $ifport) {
204
		
205
			if (($ifname == 'lan') || ($ifname == 'wan') ||
206
				(substr($ifname, 0, 3) == 'opt')) {
207
				
208
				if (!is_array($ifport)) {
209 e7bfa231 Ermal Lu?i
					$reloadif = false;
210 44088ce8 Ermal Lu?i
					if (!empty($config['interfaces'][$ifname]['if']) && $config['interfaces'][$ifname]['if'] <> $ifport) {
211
						interface_bring_down($ifname);
212 e7bfa231 Ermal Lu?i
						/* Mark this to be reconfigured in any case. */
213
						$reloadif = true;
214 44088ce8 Ermal Lu?i
					}
215 5b237745 Scott Ullrich
					$config['interfaces'][$ifname]['if'] = $ifport;
216 99c26d44 gnhb
					if (isset($portlist[$ifport]['isppp']))
217 c86e8f76 gnhb
						$config['interfaces'][$ifname]['ipaddr'] = $portlist[$ifport]['type'];
218 42809b4a gnhb
					
219 5b237745 Scott Ullrich
					/* check for wireless interfaces, set or clear ['wireless'] */
220 94a77286 Scott Ullrich
					if (preg_match($g['wireless_regex'], $ifport)) {
221 5b237745 Scott Ullrich
						if (!is_array($config['interfaces'][$ifname]['wireless']))
222
							$config['interfaces'][$ifname]['wireless'] = array();
223
					} else {
224
						unset($config['interfaces'][$ifname]['wireless']);
225
					}
226
					
227 d59557dc Ermal Luçi
					/* make sure there is a descr for all interfaces */
228
					if (!isset($config['interfaces'][$ifname]['descr']))
229
						$config['interfaces'][$ifname]['descr'] = strtoupper($ifname);
230 c86e8f76 gnhb
						
231 b13efb03 Erik Fonnesbeck
					if ($reloadif == true) {
232
						if (preg_match($g['wireless_regex'], $ifport))
233
							interface_sync_wireless_clones($config['interfaces'][$ifname], false);
234 e7bfa231 Ermal Lu?i
						/* Reload all for the interface. */
235
						interface_configure($ifname, true);
236 b13efb03 Erik Fonnesbeck
					}
237 5b237745 Scott Ullrich
				}
238
			}
239
		}
240
	
241
		write_config();
242 6e6233d0 sullrich
		
243
		enable_rrd_graphing();
244 5b237745 Scott Ullrich
	}
245
}
246
247
if ($_GET['act'] == "del") {
248
	$id = $_GET['id'];
249 3c43a344 Scott Ullrich
250 48f23632 Ermal
	if (link_interface_to_group($id))
251
		$input_errors[] = gettext("The interface is part of a group. Please remove it from the group to continue");
252
	else if (link_interface_to_bridge($id))
253 8cc6876f groo
		$input_errors[] = gettext("The interface is part of a bridge. Please remove it from the bridge to continue");
254 c6bacfe5 Ermal Luçi
	else if (link_interface_to_gre($id))
255 8cc6876f groo
		$input_errors[] = gettext("The interface is part of a gre tunnel. Please delete the tunnel to continue");
256 c6bacfe5 Ermal Luçi
	else if (link_interface_to_gif($id))
257 8cc6876f groo
		$input_errors[] = gettext("The interface is part of a gif tunnel. Please delete the tunnel to continue");
258 1723f72d Ermal Luçi
	else {
259
		unset($config['interfaces'][$id]['enable']);
260 fa4a331f Ermal
		$realid = get_real_interface($id);
261 1723f72d Ermal Luçi
		interface_bring_down($id);   /* down the interface */
262 3c43a344 Scott Ullrich
		
263 1723f72d Ermal Luçi
		unset($config['interfaces'][$id]);	/* delete the specified OPTn or LAN*/
264
265
		if($id == "lan") {
266
			unset($config['interfaces']['lan']);
267
			if (is_array($config['dhcpd']))
268
				unset($config['dhcpd']['lan']);
269
				unset($config['shaper']);
270
				unset($config['ezshaper']);
271
				unset($config['nat']);
272
				system("rm /var/dhcpd/var/db/*");
273
        			services_dhcpd_configure();
274
		}
275 c3bc7432 Ermal Luçi
276 05855d1d Ermal
		if (count($config['filter']['rule']) > 0) {
277 c86e8f76 gnhb
			foreach ($config['filter']['rule'] as $x => $rule) {
278
				if($rule['interface'] == $id)
279
					unset($config['filter']['rule'][$x]);
280 e27d0494 Ermal
			}
281 1723f72d Ermal Luçi
        	}
282 05855d1d Ermal
		if (is_array($config['nat']['advancedoutbound']) && count($config['nat']['advancedoutbound']['rule']) > 0) {
283 c86e8f76 gnhb
        	foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) {
284
				if($rule['interface'] == $id)
285
					unset($config['nat']['advancedoutbound']['rule'][$x]['interface']);
286 e27d0494 Ermal
        		}
287
		}
288 c86e8f76 gnhb
		if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
289
			foreach ($config['nat']['rule'] as $x => $rule) {
290
				if($rule['interface'] == $id)
291
					unset($config['nat']['rule'][$x]['interface']);
292 e27d0494 Ermal
			}
293 c86e8f76 gnhb
        }
294 c3bc7432 Ermal Luçi
295 1723f72d Ermal Luçi
		write_config();
296 21eebbb0 Scott Ullrich
	
297 b3a07b12 sullrich
		/* If we are in firewall/routing mode (not single interface)
298
		 * then ensure that we are not running DHCP on the wan which
299
		 * will make a lot of ISP's unhappy.
300
		 */
301 b8778031 lgcosta
		if($config['interfaces']['lan'] && $config['dhcpd']['wan']) {
302 1723f72d Ermal Luçi
			unset($config['dhcpd']['wan']);		
303
		}
304 7850de1c Ermal Lu?i
305 fa4a331f Ermal
		link_interface_to_vlans($realid, "update");
306 98a0128c Scott Ullrich
	
307 8cc6876f groo
		$savemsg = gettext("Interface has been deleted.");
308 1723f72d Ermal Luçi
	}
309 5b237745 Scott Ullrich
}
310
311 65c5cec3 Ermal
if ($_GET['act'] == "add" && (count($config['interfaces']) < count($portlist))) {
312 5b237745 Scott Ullrich
	/* find next free optional interface number */
313 bda86e8f Scott Ullrich
	if(!$config['interfaces']['lan']) {
314 8cc6876f groo
		$newifname = gettext("lan");
315
		$descr = gettext("LAN");
316 0d21552c Scott Ullrich
		$config['interfaces'][$newifname] = array();
317 d59557dc Ermal Luçi
		$config['interfaces'][$newifname]['descr'] = $descr;
318 bda86e8f Scott Ullrich
	} else {
319 8a648100 Ermal Luçi
		for ($i = 1; $i <= count($config['interfaces']); $i++) {
320
			if (!$config['interfaces']["opt{$i}"])
321
				break;
322
		}
323 bda86e8f Scott Ullrich
		$newifname = 'opt' . $i;
324 01b8a2ff Renato Botelho
		$descr = "OPT" . $i;
325 0d21552c Scott Ullrich
		$config['interfaces'][$newifname] = array();
326 d59557dc Ermal Luçi
		$config['interfaces'][$newifname]['descr'] = $descr;
327 bda86e8f Scott Ullrich
	}
328 cec4323f Erik Fonnesbeck
329 88bc2760 Erik Fonnesbeck
	uksort($config['interfaces'], "compare_interface_friendly_names");
330 cec4323f Erik Fonnesbeck
331 5b237745 Scott Ullrich
	/* Find an unused port for this interface */
332
	foreach ($portlist as $portname => $portinfo) {
333
		$portused = false;
334
		foreach ($config['interfaces'] as $ifname => $ifdata) {
335
			if ($ifdata['if'] == $portname) {
336
				$portused = true;
337
				break;
338
			}
339
		}
340
		if (!$portused) {
341
			$config['interfaces'][$newifname]['if'] = $portname;
342 8f0289e7 Erik Fonnesbeck
			if (preg_match($g['wireless_regex'], $portname)) {
343 5b237745 Scott Ullrich
				$config['interfaces'][$newifname]['wireless'] = array();
344 8f0289e7 Erik Fonnesbeck
				interface_sync_wireless_clones($config['interfaces'][$newifname], false);
345
			}
346 5b237745 Scott Ullrich
			break;
347
		}
348
	}
349
	
350 d59557dc Ermal Luçi
        /* XXX: Do not remove this. */
351 7ac5a4cb Scott Ullrich
        mwexec("/bin/rm -f /tmp/config.cache");
352 d59557dc Ermal Luçi
353 5b237745 Scott Ullrich
	write_config();
354 093a01b0 Scott Ullrich
355 8cc6876f groo
	$savemsg = gettext("Interface has been added.");
356 21eebbb0 Scott Ullrich
357 65c5cec3 Ermal
} else if ($_GET['act'] == "add")
358
	$input_errors[] = "No more interfaces available to be assigned.";
359 5b237745 Scott Ullrich
360 7f43ca88 Scott Ullrich
include("head.inc");
361
362 23be6f1b Scott Ullrich
if(file_exists("/var/run/interface_mismatch_reboot_needed")) 
363 d59557dc Ermal Luçi
	if ($_POST)
364 8cc6876f groo
		$savemsg = gettext("Reboot is needed. Please apply the settings in order to reboot.");
365 c35e12af Scott Ullrich
	else
366 8cc6876f groo
		$savemsg = gettext("Interface mismatch detected.  Please resolve the mismatch and click Save.  The firewall will reboot afterwards.");
367 23be6f1b Scott Ullrich
368 5b237745 Scott Ullrich
?>
369 6eb47218 Scott Ullrich
370
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
371 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
372 a2dab9bc Bill Marquette
373 5b237745 Scott Ullrich
<form action="interfaces_assign.php" method="post" name="iform" id="iform">
374 f2cb6a9f Scott Ullrich
375 d59557dc Ermal Luçi
<?php if (file_exists("/tmp/reload_interfaces")): ?><p>
376 120c21bd jim-p
	<?php print_info_box_np(gettext("The interface configuration has been changed.<br>You must apply the changes in order for them to take effect."));?><br>
377 b100b85d Scott Ullrich
<?php elseif($savemsg): ?>
378
	<?php print_info_box($savemsg); ?>
379 d59557dc Ermal Luçi
<?php endif; ?>
380
381 f2cb6a9f Scott Ullrich
<?php if ($input_errors) print_input_errors($input_errors); ?>
382
383 5b237745 Scott Ullrich
<table width="100%" border="0" cellpadding="0" cellspacing="0">
384 94a77286 Scott Ullrich
  <tr><td class="tabnavtbl">
385 c8b8ff69 Scott Ullrich
<?php
386
	$tab_array = array();
387 5465972a Carlos Eduardo Ramos
	$tab_array[0] = array(gettext("Interface assignments"), true, "interfaces_assign.php");
388
	$tab_array[1] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
389
	$tab_array[2] = array(gettext("Wireless"), false, "interfaces_wireless.php");
390
	$tab_array[3] = array(gettext("VLANs"), false, "interfaces_vlan.php");
391
	$tab_array[4] = array(gettext("QinQs"), false, "interfaces_qinq.php");
392
	$tab_array[5] = array(gettext("PPPs"), false, "interfaces_ppps.php");
393
	$tab_array[7] = array(gettext("GRE"), false, "interfaces_gre.php");
394
	$tab_array[8] = array(gettext("GIF"), false, "interfaces_gif.php");
395
	$tab_array[9] = array(gettext("Bridges"), false, "interfaces_bridge.php");
396
	$tab_array[10] = array(gettext("LAGG"), false, "interfaces_lagg.php");
397 c8b8ff69 Scott Ullrich
	display_top_tabs($tab_array);
398
?>  
399 5b237745 Scott Ullrich
  </td></tr>
400
  <tr> 
401 d732f186 Bill Marquette
    <td>
402
	<div id="mainarea">
403
        <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
404
       <tr> 
405 5465972a Carlos Eduardo Ramos
	<td class="listhdrr"><?=gettext("Interface"); ?></td>
406
	<td class="listhdr"><?=gettext("Network port"); ?></td>
407 5b237745 Scott Ullrich
	<td class="list">&nbsp;</td>
408
  </tr>
409
  <?php foreach ($config['interfaces'] as $ifname => $iface):
410
  	if ($iface['descr'])
411 96302ebd Scott Ullrich
		$ifdescr = $iface['descr'];
412 5b237745 Scott Ullrich
	else
413
		$ifdescr = strtoupper($ifname);
414
	?>
415
  <tr> 
416
	<td class="listlr" valign="middle"><strong><?=$ifdescr;?></strong></td>
417
	  <td valign="middle" class="listr">
418 32600a96 jim-p
		<select onChange="javascript:$('savediv').appear();" name="<?=$ifname;?>" id="<?=$ifname;?>">
419 5b237745 Scott Ullrich
		  <?php foreach ($portlist as $portname => $portinfo): ?>
420 46d8071e Scott Ullrich
			<option  value="<?=$portname;?>"  <?php if ($portname == $iface['if']) echo " selected";?>>
421 99c26d44 gnhb
				<?php if ($portinfo['isvlan']) {
422 ddc55e12 Erik Fonnesbeck
					$descr = sprintf(gettext('VLAN %1$s on %2$s'),$portinfo['tag'],$portinfo['if']);
423 91a5b98a gnhb
				if ($portinfo['descr'])
424 e3feac4e Scott Ullrich
					$descr .= " (" . $portinfo['descr'] . ")";
425 91a5b98a gnhb
					echo htmlspecialchars($descr);
426
				} elseif ($portinfo['iswlclone']) {
427
					$descr = $portinfo['cloneif'];
428
					if ($portinfo['descr'])
429
						$descr .= " (" . $portinfo['descr'] . ")";
430
					echo htmlspecialchars($descr);
431
				} elseif ($portinfo['isppp']) {
432
					echo htmlspecialchars($portinfo['descr']);
433
				} elseif ($portinfo['isbridge']) {
434
					$descr = strtoupper($portinfo['bridgeif']);
435
					if ($portinfo['descr'])
436
						$descr .= " (" . $portinfo['descr'] . ")";
437
					echo htmlspecialchars($descr);
438
				} elseif ($portinfo['isgre']) {
439
					$descr = "GRE {$portinfo['remote-addr']}";
440
					if ($portinfo['descr'])
441
						$descr .= " (" . $portinfo['descr'] . ")";
442
					echo htmlspecialchars($descr);
443
				} elseif ($portinfo['isgif']) {
444 40b0c024 Ermal
					$descr = "GIF {$portinfo['remote-addr']}";
445 91a5b98a gnhb
					if ($portinfo['descr'])
446
						$descr .= " (" . $portinfo['descr'] . ")";
447
					echo htmlspecialchars($descr);
448
				} elseif ($portinfo['islagg']) {
449
					$descr = strtoupper($portinfo['laggif']);
450
					if ($portinfo['descr'])
451
						$descr .= " (" . $portinfo['descr'] . ")";
452
					echo htmlspecialchars($descr);
453
				} elseif ($portinfo['isqinq']) {
454
					echo htmlspecialchars($portinfo['descr']);
455
				} else
456
					echo htmlspecialchars($portname . " (" . $portinfo['mac'] . ")");
457 c86e8f76 gnhb
			?></option>
458 265188ea Ermal Lu?i
		<?php endforeach; ?>
459
	</select>
460
	</td>
461
	<td valign="middle" class="list">
462 b0d756ba Scott Ullrich
		  <?php if ($ifname != 'wan'): ?>
463 310a9d7b Erik Fonnesbeck
		  <a href="interfaces_assign.php?act=del&id=<?=$ifname;?>" onclick="return confirm('<?=gettext("Do you really want to delete this interface?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title=<?=gettext("delete interface"); ?> width="17" height="17" border="0"></a> 
464 5b237745 Scott Ullrich
		  <?php endif; ?>
465
		</td>
466
  </tr>
467
  <?php endforeach; ?>
468
  <?php if (count($config['interfaces']) < count($portlist)): ?>
469
  <tr>
470
	<td class="list" colspan="2"></td>
471
	<td class="list" nowrap>
472 8cc6876f groo
	<a href="interfaces_assign.php?act=add"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title=<?=gettext("add interface"); ?> width="17" height="17" border="0"></a>
473 5b237745 Scott Ullrich
	</td>
474
  </tr>
475
  <?php else: ?>
476
  <tr>
477
	<td class="list" colspan="3" height="10"></td>
478
  </tr>
479
  <?php endif; ?>
480
</table>
481 d732f186 Bill Marquette
</div>
482 0d21552c Scott Ullrich
<br/>
483 1f9921aa jim-p
<div name='savediv' id='savediv' <?php if (empty($_GET['act'])) echo "style='display:none;'"; ?>>
484 46d8071e Scott Ullrich
	<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"><br><br>
485
	<p>
486
</div>
487 bd705fb8 Scott Ullrich
</p>
488 94a77286 Scott Ullrich
<ul>
489 036371d2 jim-p
	<li><span class="vexpl"><?=gettext("Interfaces that are configured as members of a lagg(4) interface will not be shown."); ?></span></li>
490 31b85492 jim-p
</ul>
491
</td>
492
</tr>
493 5b237745 Scott Ullrich
</table>
494
</form>
495
<?php include("fend.inc"); ?>
496 c8b8ff69 Scott Ullrich
</body>
497
</html>