Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
9c992c6a
Commit
9c992c6a
authored
Nov 22, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dhcp: interface column for leases; closes #860
Getting crowded... (cherry picked from commit
ce942771
)
parent
a38c6aeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
status_dhcp_leases.php
src/www/status_dhcp_leases.php
+6
-1
status_dhcpv6_leases.php
src/www/status_dhcpv6_leases.php
+6
-1
No files found.
src/www/status_dhcp_leases.php
View file @
9c992c6a
...
...
@@ -74,6 +74,7 @@ function remove_duplicate($array, $field)
return
$new
;
}
$interfaces
=
legacy_config_get_interfaces
(
array
(
'virtual'
=>
false
));
$leasesfile
=
services_dhcpd_leasesfile
();
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
...
...
@@ -226,7 +227,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
asort
(
$pools
);
}
foreach
(
legacy_config_get_interfaces
(
array
(
"virtual"
=>
false
))
as
$ifname
=>
$ifarr
)
{
foreach
(
$interfaces
as
$ifname
=>
$ifarr
)
{
if
(
isset
(
$config
[
'dhcpd'
][
$ifname
][
'staticmap'
]))
{
foreach
(
$config
[
'dhcpd'
][
$ifname
][
'staticmap'
]
as
$static
)
{
$slease
=
array
();
...
...
@@ -355,6 +356,7 @@ include("head.inc");?>
<table class="
table
table
-
striped
">
<thead>
<tr>
<td class="
act_sort
" data-field="
if
"><?=gettext("
Interface
"); ?></td>
<td class="
act_sort
" data-field="
ip
"><?=gettext("
IP
address
"); ?></td>
<td class="
act_sort
" data-field="
mac
"><?=gettext("
MAC
address
"); ?></td>
<td class="
act_sort
" data-field="
hostname
"><?=gettext("
Hostname
"); ?></td>
...
...
@@ -386,6 +388,7 @@ include("head.inc");?>
if(is_array(
$dhcpifconf['staticmap']
)) {
foreach (
$dhcpifconf['staticmap']
as
$staticent
) {
if (
$data['ip']
==
$staticent['ipaddr']
) {
$data['int']
= htmlspecialchars(
$interfaces[$dhcpif]['descr']
);
$data['if']
=
$dhcpif
;
break;
}
...
...
@@ -402,6 +405,7 @@ include("head.inc");?>
continue;
}
if ((
$lip
>= ip2ulong(
$dhcpifconf['range']['from']
)) && (
$lip
<= ip2ulong(
$dhcpifconf['range']['to']
))) {
$data['int']
= htmlspecialchars(
$interfaces[$dhcpif]['descr']
);
$data['if']
=
$dhcpif
;
break;
}
...
...
@@ -410,6 +414,7 @@ include("head.inc");?>
$mac_hi
= strtoupper(
$data['mac'][0]
.
$data['mac'][1]
.
$data['mac'][3]
.
$data['mac'][4]
.
$data['mac'][6]
.
$data['mac'][7]
);
?>
<tr>
<td><?=
$data['int']
;?></td>
<td><?=
$data['ip']
;?></td>
<td>
<a href="
services_wol
.
php
?
if
=<?=
$data
[
'if'
];
?>
&
mac=
<?=
$data
[
'mac'
];
?>
" title="
<?=
gettext
(
"send Wake on LAN packet to this MAC address"
);
?>
">
...
...
src/www/status_dhcpv6_leases.php
View file @
9c992c6a
...
...
@@ -96,6 +96,7 @@ function parse_duid($duid_string) {
return
array
(
$iaid
,
$duid
);
}
$interfaces
=
legacy_config_get_interfaces
(
array
(
'virtual'
=>
false
));
$leasesfile
=
services_dhcpdv6_leasesfile
();
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
...
...
@@ -291,7 +292,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
asort
(
$pools
);
}
foreach
(
legacy_config_get_interfaces
(
array
(
"virtual"
=>
false
))
as
$ifname
=>
$ifarr
)
{
foreach
(
$interfaces
as
$ifname
=>
$ifarr
)
{
if
(
isset
(
$config
[
'dhcpdv6'
][
$ifname
][
'staticmap'
]))
{
foreach
(
$config
[
'dhcpdv6'
][
$ifname
][
'staticmap'
]
as
$static
)
{
$slease
=
array
();
...
...
@@ -426,6 +427,7 @@ endif;?>
<table class="
table
table
-
striped
">
<thead>
<tr>
<th><?=gettext("
Interface
"); ?></td>
<th><?=gettext("
IPv6
address
"); ?></th>
<th><?=gettext("
IAID
"); ?></th>
<th><?=gettext("
DUID
"); ?></th>
...
...
@@ -447,6 +449,7 @@ endif;?>
if (is_array(
$dhcpifconf['staticmap']
)) {
foreach (
$dhcpifconf['staticmap']
as
$staticent
) {
if (
$data['ip']
==
$staticent['ipaddr']
) {
$data['int']
= htmlspecialchars(
$interfaces[$dhcpif]['descr']
);
$data['if']
=
$dhcpif
;
break;
}
...
...
@@ -459,9 +462,11 @@ endif;?>
}
} else {
$data['if']
= convert_real_interface_to_friendly_interface_name(guess_interface_from_ip(
$data['ip']
));
$data['int']
= htmlspecialchars(
$interfaces[$data['if']]['descr']
);
}
?>
<tr>
<td><?=
$data['int']
;?></td>
<td><?=
$data['ip']
;?></td>
<td><?=
$data['iaid']
;?></td>
<td><?=
$data['duid']
;?></td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment