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
72bcc260
Commit
72bcc260
authored
Apr 20, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: clean up and add `hn' devices
parent
3eac3eb8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
24 deletions
+36
-24
interfaces.inc
src/etc/inc/interfaces.inc
+36
-24
No files found.
src/etc/inc/interfaces.inc
View file @
72bcc260
...
@@ -4981,30 +4981,46 @@ function interface_has_gatewayv6($friendly) {
...
@@ -4981,30 +4981,46 @@ function interface_has_gatewayv6($friendly) {
* boolean - true or false
* boolean - true or false
******/
******/
function
is_altq_capable
(
$int
)
{
function
is_altq_capable
(
$int
)
{
if
(
stristr
(
$int
,
'_vlan'
)
||
stristr
(
$int
,
'_wlan'
))
{
return
true
;
}
/* Per:
/* Per:
* http://www.freebsd.org/cgi/man.cgi?query=altq&apropos=0&sektion=0&manpath=FreeBSD+
8.3
-RELEASE&arch=default&format=html
* http://www.freebsd.org/cgi/man.cgi?query=altq&apropos=0&sektion=0&manpath=FreeBSD+
10.1
-RELEASE&arch=default&format=html
* Only the following drivers have ALTQ support
* Only the following drivers have ALTQ support
*/
*/
$capable
=
array
(
"ae"
,
"age"
,
"alc"
,
"ale"
,
"an"
,
"ath"
,
"aue"
,
"axe"
,
"awi"
,
"bce"
,
$capable
=
array
(
"bfe"
,
"bge"
,
"bridge"
,
"cas"
,
"dc"
,
"de"
,
"ed"
,
"em"
,
"ep"
,
"epair"
,
"et"
,
"fxp"
,
"gem"
,
'ae'
,
'age'
,
'alc'
,
'ale'
,
'an'
,
'ath'
,
'aue'
,
'axe'
,
'awi'
,
"hme"
,
"igb"
,
"ipw"
,
"iwi"
,
"ixgbe"
,
"jme"
,
"le"
,
"lem"
,
"msk"
,
"mxge"
,
"my"
,
"nfe"
,
'bce'
,
'bfe'
,
'bge'
,
'bridge'
,
'bwn'
,
"nge"
,
"npe"
,
"nve"
,
"ral"
,
"re"
,
"rl"
,
"rum"
,
"run"
,
"bwn"
,
"sf"
,
"sge"
,
"sis"
,
"sk"
,
'cas'
,
"ste"
,
"stge"
,
"ti"
,
"txp"
,
"udav"
,
"ural"
,
"vge"
,
"vr"
,
"vte"
,
"wi"
,
"xl"
,
'dc'
,
'de'
,
"ndis"
,
"tun"
,
"ovpns"
,
"ovpnc"
,
"vlan"
,
"pppoe"
,
"pptp"
,
"ng"
,
'ed'
,
'em'
,
'ep'
,
'epair'
,
'et'
,
"l2tp"
,
"ppp"
,
"vtnet"
);
'fxp'
,
'gem'
,
$int_family
=
remove_ifindex
(
$int
);
'hme'
,
'hn'
,
'igb'
,
'ipw'
,
'iwi'
,
'ixgbe'
,
'jme'
,
'l2tp'
,
'le'
,
'lem'
,
'msk'
,
'mxge'
,
'my'
,
'ndis'
,
'nfe'
,
'nge'
,
'npe'
,
'nve'
,
'ng'
,
'ovpns'
,
'ovpnc'
,
'pppoe'
,
'pptp'
,
'ppp'
,
'ral'
,
're'
,
'rl'
,
'rum'
,
'run'
,
'sf'
,
'sge'
,
'sis'
,
'sk'
,
'ste'
,
'stge'
,
'ti'
,
'txp'
,
'tun'
,
'udav'
,
'ural'
,
'vge'
,
'vr'
,
'vte'
,
'vlan'
,
'vtnet'
,
'wi'
,
'xl'
);
if
(
in_array
(
$int_family
,
$capable
))
$int_family
=
preg_replace
(
'/[0-9]+$/'
,
''
,
$ifname
);
return
true
;
if
(
in_array
(
$int_family
,
$capable
))
{
else
if
(
stristr
(
$int
,
"l2tp"
))
/* VLANs are name $parent_$vlan now */
return
true
;
return
true
;
else
if
(
stristr
(
$int
,
"_vlan"
))
/* VLANs are name $parent_$vlan now */
}
return
true
;
else
if
(
stristr
(
$int
,
"_wlan"
))
/* WLANs are name $parent_$wlan now */
return
true
;
else
return
false
;
return
false
;
}
}
...
@@ -5244,7 +5260,3 @@ function get_failover_interface($interface, $family = "all") {
...
@@ -5244,7 +5260,3 @@ function get_failover_interface($interface, $family = "all") {
/* XXX: Really needed? */
/* XXX: Really needed? */
return
get_real_interface
(
$interface
,
$family
);
return
get_real_interface
(
$interface
,
$family
);
}
}
function
remove_ifindex
(
$ifname
)
{
return
preg_replace
(
"/[0-9]+$/"
,
""
,
$ifname
);
}
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