summaryrefslogtreecommitdiffstats
path: root/src/etc/inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-03-01 19:18:50 -0600
committerChris Buechler <cmb@pfsense.org>2016-03-01 19:19:20 -0600
commit8332312ba1ac1d736b7ef60573060c12203d54c9 (patch)
treea88c4439b274c2ee2cd5b09831bd46af8e5f7e10 /src/etc/inc
parentdc60c81618e8f97bcd5dfe0bfa190c60c9efac9f (diff)
downloadpfsense-8332312ba1ac1d736b7ef60573060c12203d54c9.zip
pfsense-8332312ba1ac1d736b7ef60573060c12203d54c9.tar.gz
Add function to return the physical interface(s) for a given parent. related to Ticket #5081
Diffstat (limited to 'src/etc/inc')
-rw-r--r--src/etc/inc/interfaces.inc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index d8535de..2929ca3 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -4679,6 +4679,27 @@ function get_parent_interface($interface, $avoidrecurse = false) {
return $parents;
}
+/*
+ * get_parent_physical_interface($interface):
+ * - returns an array of parent interface(s) for a given interface friendly name (e.g. wan)
+ * differs from get_parent_interface in that it traverses to find the physical NICs on lagg
+ */
+function get_parent_physical_interface($interface) {
+ global $config;
+
+ $realif = get_parent_interface($interface);
+
+ if (substr($realif[0], 0, 4) == "lagg") {
+ foreach ($config['laggs']['lagg'] as $lagg) {
+ if ($realif[0] == $lagg['laggif']) {
+ return explode(",", $lagg['members']);
+ }
+ }
+ } else {
+ return $realif;
+ }
+}
+
function interface_is_wireless_clone($wlif) {
if (!stristr($wlif, "_wlan")) {
return false;
OpenPOWER on IntegriCloud