diff options
author | Bill Marquette <billm@pfsense.org> | 2005-09-15 04:55:20 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-09-15 04:55:20 +0000 |
commit | 081065c1e687840b782e36bf61e8231eb80bd843 (patch) | |
tree | 74d99d2910255108a960db17f29c5fd1d07c27e4 | |
parent | 232097e208254bf5cac0f4c9132e7f5b777babae (diff) | |
download | pfsense-081065c1e687840b782e36bf61e8231eb80bd843.zip pfsense-081065c1e687840b782e36bf61e8231eb80bd843.tar.gz |
Add is_jumbo_capable() function
Tests to see if an interface is jumbo frame capable
-rw-r--r-- | etc/inc/interfaces.inc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index aafc542..b465b2d 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1160,4 +1160,28 @@ function get_current_wan_address() { } } +/****f* interfaces/is_jumbo_capable + * NAME + * is_jumbo_capable - Test if interface is jumbo frame capable. Useful for determining VLAN capability. + * INPUTS + * $int - string containing interface name + * RESULT + * boolean - true or false + ******/ + +function is_jumbo_capable($int) { + /* Per: + * http://www.freebsd.org/cgi/man.cgi?query=vlan&manpath=FreeBSD+6.0-current&format=html + * Only the following drivers support large frames + */ + $capable = array("bfe", "dc", "de", "fxp", "hme", "rl", "sis", "ste", "tl", "tx", "xl" ); + + $int_family = preg_split("/[0-9]+/", $int); + + if (in_array($int_family[0], $capable)) + return true; + else + return false; +} + ?> |