Revize 1902
Přidáno uživatelem Michal Kliment před více než 11 roky(ů)
freenetis/branches/1.1/application/models/device.php | ||
---|---|---|
// DHCP server on subnet is running
|
||
if ($ip_address->subnet->dhcp)
|
||
{
|
||
$range_start = long2ip(ip2long($ip_address->ip_address)+1);
|
||
$range_end = long2ip(ip2long($broadcast)-1);
|
||
|
||
$dhcp_server = arr::to_object(array
|
||
(
|
||
'name' => text::cs_utf2ascii($ip_address->subnet->name),
|
||
... | ... | |
'broadcast' => $broadcast,
|
||
'cidr' => $cidr,
|
||
'interface' => $iface->name,
|
||
'range_start' => long2ip(ip2long($ip_address->ip_address)+1),
|
||
'range_end' => long2ip(ip2long($broadcast)-1),
|
||
'range_start' => $range_start,
|
||
'range_end' => $range_end,
|
||
'ranges' => array
|
||
(
|
||
arr::to_object(array
|
||
(
|
||
'start' => $range_start,
|
||
'end' => $range_end
|
||
), 'stdClass', FALSE),
|
||
),
|
||
'hosts' => array(),
|
||
'comment' => '{name}'
|
||
), 'stdClass', FALSE);
|
||
|
||
$mac_addresses = array();
|
||
|
||
$ip_addresses = array();
|
||
|
||
// find all hosts in subnets
|
||
foreach ($ip_address->subnet->ip_addresses as $dhcp_ip_address)
|
||
{
|
||
... | ... | |
{
|
||
$mac_addresses[] = $host->mac;
|
||
|
||
$ranges = array();
|
||
|
||
|
||
foreach ($dhcp_server->ranges as $i => $range)
|
||
{
|
||
// ip address is in range, split range
|
||
if (ip2long($host->ip_address) >= ip2long($range->start)
|
||
&& ip2long($host->ip_address) <= ip2long($range->end))
|
||
{
|
||
if ($range->start != $host->ip_address)
|
||
{
|
||
$ranges[] = arr::to_object(array
|
||
(
|
||
'start' => $range->start,
|
||
'end' => long2ip(ip2long($host->ip_address)-1)
|
||
));
|
||
}
|
||
|
||
if ($range->end != $host->ip_address)
|
||
{
|
||
$ranges[] = arr::to_object(array
|
||
(
|
||
'start' => long2ip(ip2long($host->ip_address)+1),
|
||
'end' => $range->end
|
||
));
|
||
}
|
||
}
|
||
else
|
||
{
|
||
$ranges[] = $range;
|
||
}
|
||
}
|
||
|
||
$dhcp_server->ranges = $ranges;
|
||
|
||
$dhcp_server->hosts[] = $host;
|
||
}
|
||
}
|
freenetis/branches/1.1/application/views/device_export_templates/debian-etc-dhcp-dhcpd.php | ||
---|---|---|
# <?php echo $dhcp_server->name ?>
|
||
subnet <?php echo $dhcp_server->network ?> netmask <?php echo $dhcp_server->netmask ?>
|
||
{
|
||
range <?php echo $dhcp_server->range_start ?> <?php echo $dhcp_server->range_end ?>;
|
||
option subnet-mask <?php echo $dhcp_server->netmask ?>;
|
||
option broadcast-address <?php echo $dhcp_server->broadcast ?>;
|
||
option routers <?php echo $dhcp_server->gateway ?>;
|
||
<?php foreach ($dhcp_server->ranges as $range): ?>
|
||
range <?php echo $range->start ?> <?php echo $range->end ?>;
|
||
<?php endforeach ?>
|
||
|
||
<?php foreach ($dhcp_server->hosts as $host): ?>
|
||
# <?php echo text::cs_utf2ascii(text::object_format($host, $host->comment)) ?>
|
freenetis/branches/1.1/version.php | ||
---|---|---|
* The current version of FreenetIS.
|
||
* This value must be changed by developers in a new release of FreenetIS.
|
||
*/
|
||
define('FREENETIS_VERSION', '1.1.0~alpha20');
|
||
define('FREENETIS_VERSION', '1.1.0~alpha21');
|
Také k dispozici: Unified diff
freenetis-1.1.0~alpha21
Opravy:
- fixes #542: Staticke IP adresy u ISC DHCP serveru