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
31cbcff2
Commit
31cbcff2
authored
Jun 20, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) move calculate_ipv6_delegation_length() to util.inc and change dependencies
parent
51c3f922
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
50 additions
and
36 deletions
+50
-36
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+0
-35
util.inc
src/etc/inc/util.inc
+33
-0
diag_logs_settings.php
src/www/diag_logs_settings.php
+1
-0
diag_logs_template.inc
src/www/diag_logs_template.inc
+2
-1
services_dhcp.php
src/www/services_dhcp.php
+1
-0
services_dhcpv6.php
src/www/services_dhcpv6.php
+1
-0
services_dnsmasq.php
src/www/services_dnsmasq.php
+1
-0
services_dnsmasq_domainoverride_edit.php
src/www/services_dnsmasq_domainoverride_edit.php
+1
-0
services_opendns.php
src/www/services_opendns.php
+1
-0
services_unbound.php
src/www/services_unbound.php
+1
-0
services_unbound_acls.php
src/www/services_unbound_acls.php
+1
-0
services_unbound_advanced.php
src/www/services_unbound_advanced.php
+1
-0
services_unbound_overrides.php
src/www/services_unbound_overrides.php
+1
-0
status_dhcp_leases.php
src/www/status_dhcp_leases.php
+1
-0
status_dhcpv6_leases.php
src/www/status_dhcpv6_leases.php
+1
-0
system_advanced_admin.php
src/www/system_advanced_admin.php
+1
-0
system_advanced_misc.php
src/www/system_advanced_misc.php
+1
-0
system_general.php
src/www/system_general.php
+1
-0
No files found.
src/etc/inc/pfsense-utils.inc
View file @
31cbcff2
...
...
@@ -25,38 +25,3 @@
RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/* Returns the calculated bit length of the prefix delegation from the WAN interface */
/* DHCP-PD is variable, calculate from the prefix-len on the WAN interface */
/* 6rd is variable, calculate from 64 - (v6 prefixlen - (32 - v4 prefixlen)) */
/* 6to4 is 16 bits, e.g. 65535 */
function
calculate_ipv6_delegation_length
(
$if
)
{
global
$config
;
if
(
!
isset
(
$config
[
'interfaces'
][
$if
])
||
!
is_array
(
$config
[
'interfaces'
][
$if
]))
{
return
false
;
}
elseif
(
!
isset
(
$config
[
'interfaces'
][
$if
][
'ipaddrv6'
]))
{
return
0
;
}
switch
(
$config
[
'interfaces'
][
$if
][
'ipaddrv6'
])
{
case
"6to4"
:
$pdlen
=
16
;
break
;
case
"6rd"
:
$rd6cfg
=
$config
[
'interfaces'
][
$if
];
$rd6plen
=
explode
(
"/"
,
$rd6cfg
[
'prefix-6rd'
]);
$pdlen
=
(
64
-
(
$rd6plen
[
1
]
+
(
32
-
$rd6cfg
[
'prefix-6rd-v4plen'
])));
break
;
case
"dhcp6"
:
$dhcp6cfg
=
$config
[
'interfaces'
][
$if
];
$pdlen
=
$dhcp6cfg
[
'dhcp6-ia-pd-len'
];
break
;
default
:
$pdlen
=
0
;
break
;
}
return
$pdlen
;
}
src/etc/inc/util.inc
View file @
31cbcff2
...
...
@@ -170,6 +170,39 @@ function gen_subnetv6_max($ipaddr, $bits)
return
(
inet_ntop
(
$inet_end
));
}
/* Returns the calculated bit length of the prefix delegation from the WAN interface */
/* DHCP-PD is variable, calculate from the prefix-len on the WAN interface */
/* 6rd is variable, calculate from 64 - (v6 prefixlen - (32 - v4 prefixlen)) */
/* 6to4 is 16 bits, e.g. 65535 */
function
calculate_ipv6_delegation_length
(
$if
)
{
global
$config
;
if
(
!
isset
(
$config
[
'interfaces'
][
$if
])
||
!
is_array
(
$config
[
'interfaces'
][
$if
]))
{
return
false
;
}
elseif
(
!
isset
(
$config
[
'interfaces'
][
$if
][
'ipaddrv6'
]))
{
return
0
;
}
switch
(
$config
[
'interfaces'
][
$if
][
'ipaddrv6'
])
{
case
"6to4"
:
$pdlen
=
16
;
break
;
case
"6rd"
:
$rd6cfg
=
$config
[
'interfaces'
][
$if
];
$rd6plen
=
explode
(
"/"
,
$rd6cfg
[
'prefix-6rd'
]);
$pdlen
=
(
64
-
(
$rd6plen
[
1
]
+
(
32
-
$rd6cfg
[
'prefix-6rd-v4plen'
])));
break
;
case
"dhcp6"
:
$dhcp6cfg
=
$config
[
'interfaces'
][
$if
];
$pdlen
=
$dhcp6cfg
[
'dhcp6-ia-pd-len'
];
break
;
default
:
$pdlen
=
0
;
break
;
}
return
$pdlen
;
}
/* returns a subnet mask (long given a bit count) */
function
gen_subnet_mask_long
(
$bits
)
{
...
...
src/www/diag_logs_settings.php
View file @
31cbcff2
...
...
@@ -34,6 +34,7 @@ require_once("interfaces.inc");
require_once
(
"filter.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
);
require_once
(
"plugins.inc"
);
...
...
src/www/diag_logs_template.inc
View file @
31cbcff2
...
...
@@ -33,7 +33,8 @@ require_once("guiconfig.inc");
require_once
(
"system.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"plugins.inc"
);
require_once
'services.inc'
;
require_once
(
"services.inc"
);
require_once
(
"util.inc"
);
/* expects $logfile to point to the system path */
/* expects $logclog to be true or false */
...
...
src/www/services_dhcp.php
View file @
31cbcff2
...
...
@@ -33,6 +33,7 @@ require_once("services.inc");
require_once
(
"system.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
/*
...
...
src/www/services_dhcpv6.php
View file @
31cbcff2
...
...
@@ -33,6 +33,7 @@ require_once("filter.inc");
require_once
(
"system.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/services_dnsmasq.php
View file @
31cbcff2
...
...
@@ -33,6 +33,7 @@ require_once("filter.inc");
require_once
(
"services.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"unbound.inc"
);
if
(
empty
(
$config
[
'dnsmasq'
][
'hosts'
])
||
!
is_array
(
$config
[
'dnsmasq'
][
'hosts'
]))
{
...
...
src/www/services_dnsmasq_domainoverride_edit.php
View file @
31cbcff2
...
...
@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once
(
"system.inc"
);
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"util.inc"
);
require_once
(
"pfsense-utils.inc"
);
$referer
=
(
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
'/services_dnsmasq.php'
);
...
...
src/www/services_opendns.php
View file @
31cbcff2
...
...
@@ -30,6 +30,7 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
...
...
src/www/services_unbound.php
View file @
31cbcff2
...
...
@@ -32,6 +32,7 @@ require_once("unbound.inc");
require_once
(
"services.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
if
(
empty
(
$config
[
'unbound'
])
||
!
is_array
(
$config
[
'unbound'
]))
{
...
...
src/www/services_unbound_acls.php
View file @
31cbcff2
...
...
@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once
(
"unbound.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
...
...
src/www/services_unbound_advanced.php
View file @
31cbcff2
...
...
@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once
(
"unbound.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
);
if
(
empty
(
$config
[
'unbound'
])
||
!
is_array
(
$config
[
'unbound'
]))
{
...
...
src/www/services_unbound_overrides.php
View file @
31cbcff2
...
...
@@ -33,6 +33,7 @@ require_once("unbound.inc");
require_once
(
"services.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
if
(
empty
(
$config
[
'unbound'
])
||
!
is_array
(
$config
[
'unbound'
]))
{
...
...
src/www/status_dhcp_leases.php
View file @
31cbcff2
...
...
@@ -33,6 +33,7 @@ require_once("config.inc");
require_once
(
"services.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"util.inc"
);
function
leasecmp
(
$a
,
$b
)
{
...
...
src/www/status_dhcpv6_leases.php
View file @
31cbcff2
...
...
@@ -31,6 +31,7 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/system_advanced_admin.php
View file @
31cbcff2
...
...
@@ -34,6 +34,7 @@ require_once("filter.inc");
require_once
(
"system.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
...
...
src/www/system_advanced_misc.php
View file @
31cbcff2
...
...
@@ -35,6 +35,7 @@ require_once("ipsec.inc");
require_once
(
"vslb.inc"
);
require_once
(
"system.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
...
...
src/www/system_general.php
View file @
31cbcff2
...
...
@@ -32,6 +32,7 @@ require_once("filter.inc");
require_once
(
"system.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"services.inc"
);
...
...
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