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
65aa0382
Commit
65aa0382
authored
Jun 20, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) move is_private_ip() to util.inc
parent
1a7199cc
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
22 additions
and
25 deletions
+22
-25
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+0
-25
util.inc
src/etc/inc/util.inc
+11
-0
firewall_nat_out.php
src/www/firewall_nat_out.php
+1
-0
interfaces.php
src/www/interfaces.php
+1
-0
interfaces_assign.php
src/www/interfaces_assign.php
+1
-0
interfaces_bridge_edit.php
src/www/interfaces_bridge_edit.php
+1
-0
interfaces_gif_edit.php
src/www/interfaces_gif_edit.php
+1
-0
interfaces_gre_edit.php
src/www/interfaces_gre_edit.php
+1
-0
interfaces_lagg_edit.php
src/www/interfaces_lagg_edit.php
+1
-0
interfaces_vlan_edit.php
src/www/interfaces_vlan_edit.php
+1
-0
services_dyndns_edit.php
src/www/services_dyndns_edit.php
+1
-0
status_interfaces.php
src/www/status_interfaces.php
+1
-0
vpn_openvpn_export.php
src/www/vpn_openvpn_export.php
+1
-0
No files found.
src/etc/inc/pfsense-utils.inc
View file @
65aa0382
...
...
@@ -26,31 +26,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/****f* legacy/is_private_ip
* NAME
* is_private_ip
* INPUTS
* none
* RESULT
* returns true if an ip address is in a private range
******/
function
is_private_ip
(
$iptocheck
)
{
$isprivate
=
false
;
$ip_private_list
=
array
(
"10.0.0.0/8"
,
"100.64.0.0/10"
,
"172.16.0.0/12"
,
"192.168.0.0/16"
,
);
foreach
(
$ip_private_list
as
$private
)
{
if
(
ip_in_subnet
(
$iptocheck
,
$private
)
==
true
)
{
$isprivate
=
true
;
}
}
return
$isprivate
;
}
/*
* restore_config_section($section_name, new_contents): restore a configuration section,
* and write the configuration out
...
...
src/etc/inc/util.inc
View file @
65aa0382
...
...
@@ -1126,6 +1126,17 @@ function ip_in_subnet($addr,$subnet)
}
}
function
is_private_ip
(
$iptocheck
)
{
foreach
(
array
(
"10.0.0.0/8"
,
"100.64.0.0/10"
,
"172.16.0.0/12"
,
"192.168.0.0/16"
)
as
$private
)
{
if
(
ip_in_subnet
(
$iptocheck
,
$private
)
==
true
)
{
return
true
;
}
}
return
false
;
}
function
resolve_retry
(
$hostname
,
$retries
=
5
)
{
if
(
is_ipaddr
(
$hostname
))
{
...
...
src/www/firewall_nat_out.php
View file @
65aa0382
...
...
@@ -31,6 +31,7 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
/**
...
...
src/www/interfaces.php
View file @
65aa0382
...
...
@@ -38,6 +38,7 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"ipsec.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"util.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"services.inc"
);
require_once
(
"unbound.inc"
);
...
...
src/www/interfaces_assign.php
View file @
65aa0382
...
...
@@ -36,6 +36,7 @@ require_once("interfaces.inc");
require_once
(
"ipsec.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
);
require_once
(
"unbound.inc"
);
...
...
src/www/interfaces_bridge_edit.php
View file @
65aa0382
...
...
@@ -32,6 +32,7 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/interfaces_gif_edit.php
View file @
65aa0382
...
...
@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once
(
"system.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/interfaces_gre_edit.php
View file @
65aa0382
...
...
@@ -32,6 +32,7 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/interfaces_lagg_edit.php
View file @
65aa0382
...
...
@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once
(
"system.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/interfaces_vlan_edit.php
View file @
65aa0382
...
...
@@ -32,6 +32,7 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/services_dyndns_edit.php
View file @
65aa0382
...
...
@@ -29,6 +29,7 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"services.inc"
)
;
require_once
(
"interfaces.inc"
);
...
...
src/www/status_interfaces.php
View file @
65aa0382
...
...
@@ -33,6 +33,7 @@ require_once("system.inc");
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"unbound.inc"
);
require_once
(
"services.inc"
);
...
...
src/www/vpn_openvpn_export.php
View file @
65aa0382
...
...
@@ -32,6 +32,7 @@ require_once("openvpn.inc");
require_once
(
"services.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"util.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"openvpn-client-export.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