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
6e7f8e50
Commit
6e7f8e50
authored
May 26, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(plugins, interfaces) move legacy vpn interfaces to plugins
parent
d082febd
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
152 deletions
+159
-152
filter.inc
src/etc/inc/filter.inc
+87
-137
interfaces.inc
src/etc/inc/interfaces.inc
+4
-15
vpn.inc
src/etc/inc/plugins.inc.d/vpn.inc
+68
-0
No files found.
src/etc/inc/filter.inc
View file @
6e7f8e50
This diff is collapsed.
Click to expand it.
src/etc/inc/interfaces.inc
View file @
6e7f8e50
...
...
@@ -4104,7 +4104,7 @@ function convert_real_interface_to_friendly_interface_name($interface = 'wan')
return
null
;
}
foreach
(
$config
[
'interfaces'
]
as
$if
=>
$ifname
)
{
foreach
(
legacy_config_get_interfaces
()
as
$if
=>
$ifname
)
{
if
(
$if
==
$interface
||
$ifname
[
'if'
]
==
$interface
)
{
return
$if
;
}
...
...
@@ -4295,25 +4295,14 @@ function get_real_interface($interface = "wan", $family = "all", $realv6iface =
$wanif
=
null
;
switch
(
$interface
)
{
case
"l2tp"
:
$wanif
=
"l2tp"
;
break
;
case
"pptp"
:
$wanif
=
"pptp"
;
break
;
case
"pppoe"
:
$wanif
=
"pppoe"
;
break
;
case
"openvpn"
:
$wanif
=
"openvpn"
;
case
"ppp"
:
$wanif
=
$interface
;
break
;
case
"ipsec"
:
case
"enc0"
:
$wanif
=
"enc0"
;
break
;
case
"ppp"
:
$wanif
=
"ppp"
;
break
;
default
:
// If a real interface was alread passed simply
// pass the real interface back. This encourages
...
...
@@ -4482,7 +4471,7 @@ function link_interface_to_track6($int, $action = '')
if
(
isset
(
$config
[
'interfaces'
]))
{
$list
=
array
();
foreach
(
$config
[
'interfaces'
]
as
$ifname
=>
$ifcfg
)
{
foreach
(
legacy_config_get_interfaces
(
array
(
"virtual"
=>
false
))
as
$ifname
=>
$ifcfg
)
{
if
(
!
isset
(
$ifcfg
[
'enable'
]))
{
continue
;
}
...
...
src/etc/inc/plugins.inc.d/vpn.inc
View file @
6e7f8e50
...
...
@@ -657,3 +657,71 @@ EOD;
return
0
;
}
function
vpn_interface
()
{
global
$config
;
$interfaces
=
array
();
if
(
isset
(
$config
[
'pptpd'
][
'mode'
])
&&
$config
[
'pptpd'
][
'mode'
]
==
'server'
)
{
$oic
=
array
(
"enable"
=>
true
);
$oic
[
'if'
]
=
'pptp'
;
$oic
[
'descr'
]
=
'pptp'
;
$oic
[
'ip'
]
=
$config
[
'pptpd'
][
'localip'
];
$oic
[
'sa'
]
=
$config
[
'pptpd'
][
'remoteip'
];
if
(
!
empty
(
$config
[
'pptpd'
][
'pptp_subnet'
]))
{
$oic
[
'sn'
]
=
$config
[
'pptpd'
][
'pptp_subnet'
];
}
else
{
$oic
[
'sn'
]
=
"32"
;
}
$oic
[
'mode'
]
=
$config
[
'pptpd'
][
'mode'
];
$oic
[
'virtual'
]
=
true
;
$interfaces
[
'pptp'
]
=
$oic
;
}
if
(
isset
(
$config
[
'l2tp'
][
'mode'
])
&&
$config
[
'l2tp'
][
'mode'
]
==
'server'
)
{
$oic
=
array
(
"enable"
=>
true
);
$oic
[
'if'
]
=
'l2tp'
;
$oic
[
'descr'
]
=
'L2TP'
;
$oic
[
'ip'
]
=
$config
[
'l2tp'
][
'localip'
];
$oic
[
'sa'
]
=
$config
[
'l2tp'
][
'remoteip'
];
if
(
!
empty
(
$config
[
'l2tp'
][
'l2tp_subnet'
]))
{
$oic
[
'sn'
]
=
$config
[
'l2tp'
][
'l2tp_subnet'
];
}
else
{
$oic
[
'sn'
]
=
"32"
;
}
$oic
[
'mode'
]
=
$config
[
'l2tp'
][
'mode'
];
$oic
[
'virtual'
]
=
true
;
$interfaces
[
'l2tp'
]
=
$oic
;
}
if
(
isset
(
$config
[
'pppoes'
][
'pppoe'
]))
{
$pppoeifs
=
array
(
'networks'
=>
array
());
foreach
(
$config
[
'pppoes'
][
'pppoe'
]
as
$pppoe
)
{
if
(
$pppoe
[
'mode'
]
==
"server"
)
{
$oic
=
array
();
$oic
[
'sa'
]
=
$pppoe
[
'remoteip'
];
if
(
$pppoe
[
'pppoe_subnet'
]
<>
""
)
{
$oic
[
'sn'
]
=
$pppoe
[
'pppoe_subnet'
];
}
else
{
$oic
[
'sn'
]
=
"32"
;
}
$oic
[
'ip'
]
=
$pppoe
[
'localip'
];
$pppoeifs
[
'networks'
][]
=
$oic
;
}
}
if
(
count
(
$pppoeifs
[
'networks'
]))
{
$pppoeifs
[
'enable'
]
=
true
;
$pppoeifs
[
'if'
]
=
'pppoe'
;
$pppoeifs
[
'descr'
]
=
'pppoe'
;
$pppoeifs
[
'ip'
]
=
""
;
$pppoeifs
[
'sa'
]
=
""
;
$pppoeifs
[
'sn'
]
=
"32"
;
$pppoeifs
[
'mode'
]
=
""
;
$pppoeifs
[
'virtual'
]
=
true
;
$interfaces
[
'pppoe'
]
=
$pppoeifs
;
}
}
return
$interfaces
;
}
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