From 532b0fb81731189cda49874d6f5dbffb33be69c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Tue, 5 May 2009 23:38:02 +0000 Subject: Rename filter_translate_type_to_real_interface to interface_translate_type_to_real Move this function to interfaces.inc where it belongs. --- etc/inc/interfaces.inc | 17 +++++++++++++++-- etc/inc/pfsense-utils.inc | 15 +-------------- etc/inc/vpn.inc | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 845e042..a36eef3 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1052,7 +1052,7 @@ function interfaces_carp_configure() { $vip_password = str_replace(" ", "", $vip_password); if($vip['password'] != "") $password = " pass \"" . $vip_password . "\""; - $interface = filter_translate_type_to_real_interface($vip['interface']); + $interface = interface_translate_type_to_real($vip['interface']); $carpint = "carp" . $carp_instances_counter; switch ($vip['mode']) { @@ -2033,7 +2033,7 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan") { return $ifname; /* XXX: ermal - The 3 lines below are totally bogus code. */ - $int = filter_translate_type_to_real_interface($if); + $int = interface_translate_type_to_real($if); if($ifname == $interface) return $ifname; @@ -2090,6 +2090,19 @@ function convert_real_interface_to_friendly_descr($interface) { return $interface; } +/* + * interface_translate_type_to_real($interface): + * returns the real hardware interface name for a friendly interface. ie: wan + */ +function interface_translate_type_to_real($interface) { + global $config; + + if ($config['interfaces'][$interface]['if'] <> "") + return $config['interfaces'][$interface]['if']; + else + return $interface; +} + function get_real_interface($interface = "wan") { global $config; diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 45e1ec5..753ba8e 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -226,7 +226,7 @@ function enable_hardware_offloading($interface) { return; /* translate wan, lan, opt -> real interface if needed */ - $int = filter_translate_type_to_real_interface($interface); + $int = interface_translate_type_to_real($interface); if($int <> "") $interface = $int; $int_family = preg_split("/[0-9]+/", $int); $options = strtolower(`/sbin/ifconfig -m {$interface} | grep capabilities`); @@ -615,19 +615,6 @@ function convert_ip_to_network_format($ip, $subnet) { } /* - * filter_translate_type_to_real_interface($interface): - * returns the real hardware interface name for a friendly interface. ie: wan - */ -function filter_translate_type_to_real_interface($interface) { - global $config; - if($config['interfaces'][$interface]['if'] <> "") { - return $config['interfaces'][$interface]['if']; - } else { - return $interface; - } -} - -/* * get_carp_interface_status($carpinterface): returns the status of a carp ip */ function get_carp_interface_status($carpinterface) { diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 3b53145..5f4cad2 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -1148,7 +1148,7 @@ function vpn_pppoe_configure() { case 'server' : - $pppoe_interface = filter_translate_type_to_real_interface($pppoecfg['interface']); + $pppoe_interface = interface_translate_type_to_real($pppoecfg['interface']); if ($pppoecfg['paporchap'] == "chap") $paporchap = "set link enable chap"; -- cgit v1.1