Commit 72bcc260 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: clean up and add `hn' devices

parent 3eac3eb8
...@@ -4981,31 +4981,47 @@ function interface_has_gatewayv6($friendly) { ...@@ -4981,31 +4981,47 @@ 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;
else if (stristr($int, "_vlan")) /* VLANs are name $parent_$vlan now */
return true; return true;
else if (stristr($int, "_wlan")) /* WLANs are name $parent_$wlan now */ }
return true;
else return false;
return false;
} }
/****f* interfaces/is_interface_wireless /****f* interfaces/is_interface_wireless
...@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment