Project

General

Profile

Todo #764 ยป pfsense-2.0-BETA3-add-static-mapping-netboot-filename.patch

Chris Buechler, 07/28/2010 01:29 PM

View differences:

new/etc/inc/services.inc 2010-07-12 13:25:12.450445328 +0300
$dhhostname = str_replace(".", "_", $dhhostname);
$dhcpdconf .= " option host-name {$dhhostname};\n";
}
if ($sm['netbootfile'])
$dhcpdconf .= " filename \"{$sm['netbootfile']}\";\n";
$dhcpdconf .= "}\n";
$i++;
new/usr/local/www/services_dhcp_edit.php 2010-07-12 12:56:37.172811936 +0300
}
$static_map_enabled=isset($config['dhcpd'][$if]['staticarp']);
$netboot_enabled=isset($config['dhcpd'][$if]['netboot']);
$a_maps = &$config['dhcpd'][$if]['staticmap'];
$ifcfgip = get_interface_ip($if);
$ifcfgsn = get_interface_subnet($if);
......
$pconfig['mac'] = $a_maps[$id]['mac'];
$pconfig['hostname'] = $a_maps[$id]['hostname'];
$pconfig['ipaddr'] = $a_maps[$id]['ipaddr'];
$pconfig['netbootfile'] = $a_maps[$id]['netbootfile'];
$pconfig['descr'] = $a_maps[$id]['descr'];
} else {
$pconfig['mac'] = $_GET['mac'];
$pconfig['hostname'] = $_GET['hostname'];
$pconfig['netbootfile'] = $_GET['netbootfile'];
$pconfig['descr'] = $_GET['descr'];
}
......
$mapent['ipaddr'] = $_POST['ipaddr'];
$mapent['hostname'] = $_POST['hostname'];
$mapent['descr'] = $_POST['descr'];
$mapent['netbootfile'] = $_POST['netbootfile'];
if (isset($id) && $a_maps[$id])
$a_maps[$id] = $mapent;
......
<input name="hostname" type="text" class="formfld unknown" id="hostname" size="20" value="<?=htmlspecialchars($pconfig['hostname']);?>">
<br> <span class="vexpl">Name of the host, without domain part.</span></td>
</tr>
<?php if($netboot_enabled) { ?>
<tr>
<td width="22%" valign="top" class="vncell">Netboot filename</td>
<td width="78%" class="vtable">
<input name="netbootfile" type="text" class="formfld unknown" id="netbootfile" size="20" value="<?=htmlspecialchars($pconfig['netbootfile']);?>">
<br> <span class="vexpl">Name of the file that should be loaded when this host boots off of the network, overrides setting on main page.</span></td>
</tr>
<?php } ?>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
<td width="78%" class="vtable">
    (1-1/1)