Author: mzugec
Date: Sun Dec 9 16:09:41 2007
New Revision: 42864
URL: http://svn.opensuse.org/viewcvs/yast?rev=42864&view=rev
Log:
support for bridge devices (Fate #302084)
Modified:
branches/SuSE-SLE-10-SP2-Branch/network/VERSION
branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes
branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp
branches/SuSE-SLE-10-SP2-Branch/network/src/lan/hardware.ycp
branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp
branches/SuSE-SLE-10-SP2-Branch/network/src/routines/complex.ycp
branches/SuSE-SLE-10-SP2-Branch/network/src/routines/summary.ycp
Modified: branches/SuSE-SLE-10-SP2-Branch/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/VERSION?rev=42864&r1=42863&r2=42864&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/network/VERSION (original)
+++ branches/SuSE-SLE-10-SP2-Branch/network/VERSION Sun Dec 9 16:09:41 2007
@@ -1 +1 @@
-2.13.104
+2.13.105
Modified: branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes?rev=42864&r1=42863&r2=42864&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes (original)
+++ branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes Sun Dec 9 16:09:41 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Sun Dec 9 16:04:53 CET 2007 - mzugec@suse.cz
+
+- support for bridge devices (Fate #302084)
+- 2.13.105
+
+-------------------------------------------------------------------
Sat Dec 8 15:30:11 CET 2007 - mzugec@suse.cz
- support for VLANs (config+AY) (FaTE #142127)
Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp?rev=42864&r1=42863&r2=42864&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp Sun Dec 9 16:09:41 2007
@@ -92,6 +92,41 @@
}
/**
+ * Default function to init the value of devices attached to bridge (BRIDGE_PORTS).
+ * @param key id of the widget
+ */
+void InitBridge(string key)
+{
+ list items = [];
+ map configurations = NetworkDevices::FilterDevices("netcard");
+ foreach(string devtype, splitstring(NetworkDevices::CardRegex["netcard"]:"", "|"), {
+ foreach(string devnum, (list<string>) Map::Keys(configurations[devtype]:$[]), {
+
+ //filter the eth devices (IPADDR=0.0.0.0 - promiscuited mode)
+ if ((string)configurations[devtype, devnum, "IPADDR"]:"" == "0.0.0.0")
+ {
+ string dev_name = NetworkDevices::device_name(devtype, devnum);
+ items = add (items, `item(`id(dev_name), dev_name, contains(splitstring(NetworkDevices::Current["BRIDGE_PORTS"]:"", " "), dev_name)) );
+ }
+
+ });
+ });
+ UI::ChangeWidget(`id(key), `Items, items);
+}
+
+ /**
++ * Default function to store the value of devices attached to bridge (BRIDGE_PORTS).
++ * @param key id of the widget
++ * @param key id of the widget
++ */
+void StoreBridge(string key, map event)
+{
+ settings["BRIDGE_PORTS"] = mergestring((list<string>)UI::QueryWidget (`id(key), `SelectedItems), " ");
+}
+
+
+
+/**
* Default function to init the value of slave ETHERDEVICE box.
* @param key id of the widget
*/
@@ -101,7 +136,6 @@
settings["ETHERDEVICE"] = NetworkDevices::Current["ETHERDEVICE"]:"";
foreach(string dev_name, Lan::getUnconfiguredDevices(),{
items = add(items, `item(`id(dev_name), dev_name, (dev_name==settings["ETHERDEVICE"]:"")?true:false));
-//wd["ETHERDEVICE", "items"] = add( wd["ETHERDEVICE", "items"]:[], [ dev_name ] );
});
UI::ChangeWidget(`id(key), `Items, items);
}
@@ -479,7 +513,13 @@
"valid_chars": NetworkDevices::ValidCharsIfcfg (),
"handle": HandleIfcfg,
],
-
+ "BRIDGE_PORTS": $[
+ "widget": `multi_selection_box,
+ "label": _("Bridged Devices"),
+ "items" : [],
+ "init": InitBridge,
+ "store": StoreBridge,
+ ],
"ETHERDEVICE": $[
"widget": `combobox,
"label": _("Real Interface for &VLAN"),
@@ -847,10 +887,10 @@
}
// FIXME duplicated in hardware.ycp
- list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond", "vlan" ];
+ list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond", "vlan", "br" ];
if(Arch::s390 ())
- device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth", "lcs", "vlan" ];
+ device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth", "lcs", "vlan", "br" ];
if(Arch::ia64 ())
device_types = add(device_types, "xp");
@@ -1016,10 +1056,20 @@
"AD_ADDRESSES",
frame2
);
+ }
+ else if (Lan::type == "br")
+ {
+ address_contents = `VBox(
+ `Left(label),
+ just_address_contents,
+ `Frame("", `VBox("BRIDGE_PORTS")),
+ frame2
+ );
}
+
map functions = $[
"init" : InitAddrWidget,
"store" : StoreAddrWidget,
@@ -1127,7 +1177,10 @@
Lan::bond_slaves = (list<string>)settings["SLAVES"]:[];
} else if (Lan::type == "vlan"){
Lan::vlan_etherdevice = settings["ETHERDEVICE"]:"";
- }
+ } else if (Lan::type == "br"){
+ Lan::bridge_ports = settings["BRIDGE_PORTS"]:"";
+ }
+
// proceed with WLAN settings if appropriate, #42420
if (ret == `next && Lan::type == "wlan" && Lan::alias == "")
Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/lan/hardware.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/lan/hardware.ycp?rev=42864&r1=42863&r2=42864&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/network/src/lan/hardware.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/network/src/lan/hardware.ycp Sun Dec 9 16:09:41 2007
@@ -88,10 +88,10 @@
string hwcfg = Lan::nm_name;
// FIXME duplicated in address.ycp
- list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond", "vlan" ];
+ list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond", "vlan", "br" ];
if(Arch::s390 ())
- device_types = [ "eth", "tr", "hsi", "ctc", "escon", "ficon", "iucv", "qeth", "lcs", "vlan" ];
+ device_types = [ "eth", "tr", "hsi", "ctc", "escon", "ficon", "iucv", "qeth", "lcs", "vlan", "br" ];
if(Arch::ia64 ())
device_types = add(device_types, "xp");
@@ -348,7 +348,7 @@
UI::ChangeWidget(`id(`modul), `Value, modul);
UI::ChangeWidget(`id(`options), `Value, options);
}
- else if (type == "bond"||type == "vlan")
+ else if (contains(["bond", "vlan", "br"], type))
{
UI::ChangeWidget(`id(`hwcfg), `Enabled, false);
UI::ChangeWidget(`id(`modul), `Enabled, false);
Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp?rev=42864&r1=42863&r2=42864&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp Sun Dec 9 16:09:41 2007
@@ -107,6 +107,9 @@
// VLAN option
global string vlan_etherdevice="";
+// interfaces attached to bridge (list delimited by ' ')
+global string bridge_ports="";
+
/**
* wl_wpa_eap aggregates the settings in a map for easier CWM access.
* @struct wpa_eap
@@ -985,6 +988,7 @@
description = GetDeviceVar (devmap, defaults, "NAME");
bond_option = GetDeviceVar(devmap, defaults, "BONDING_MODULE_OPTS");
vlan_etherdevice = GetDeviceVar(devmap, defaults, "ETHERDEVICE");
+ bridge_ports = GetDeviceVar(devmap, defaults, "BRIDGE_PORTS");
bond_slaves=[];
foreach(any key, any value, devmap,
@@ -1333,6 +1337,10 @@
if (type=="vlan"){
newdev["ETHERDEVICE"]=vlan_etherdevice;
}
+ if (type=="br"){
+ newdev["BRIDGE_PORTS"]=bridge_ports;
+ newdev["BRIDGE"]="yes";
+ }
if(type == "wlan") {
newdev["WIRELESS_MODE"] = wl_mode;
@@ -1479,6 +1487,10 @@
tosel=$["device":interface["device"]:"", "type":"vlan"];
y2milestone("found vlan configuration");
}
+ if (issubstring(interface["device"]:"", "br")) {
+ tosel=$["device":interface["device"]:"", "type":"br"];
+ y2milestone("found bridge configuration");
+ }
list device_id = splitstring(interface["device"]:"", "-");
/* code for eth-id-00:80:c8:f6:48:4c configurations */
// *-id-$ID => find H["mac"] == $ID
@@ -1927,7 +1939,7 @@
aymodule["options"]:"" : tosel["options"]:"";
SelectHWMap(tosel);
- if (type=="bond" || type=="vlan") device = NetworkDevices::device_num(tosel["device"]:"");
+ if (contains(["bond", "vlan", "br"], type)) device = NetworkDevices::device_num(tosel["device"]:"");
}
/* Nothing detected -> use InstallInf */
else if(size(InstallInf) > 0) {
@@ -2056,6 +2068,10 @@
{
if (!PackageSystem::Installed("vlan")) pkgs = add (pkgs, "vlan");
}
+ if (NetworkDevices::List ("br") != [])
+ {
+ if (!PackageSystem::Installed("bridge-utils")) pkgs = add (pkgs, "bridge-utils");
+ }
// #47809
if (NetworkDevices::Locate ("WIRELESS_AUTH_MODE", "psk") != [] ||
NetworkDevices::Locate ("WIRELESS_AUTH_MODE", "eap") != [])
Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/routines/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/routines/complex.ycp?rev=42864&r1=42863&r2=42864&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/network/src/routines/complex.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/network/src/routines/complex.ycp Sun Dec 9 16:09:41 2007
@@ -298,7 +298,9 @@
/* Device type label */
"bond" : _("Bond Network"),
/* Device type label */
- "vlan" : _("Virtual LAN")
+ "vlan" : _("Virtual LAN"),
+ /* Device type label */
+ "br" : _("Network Bridge"),
];
if(haskey(device_names, devtype))
Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/routines/summary.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/routines/summary.ycp?rev=42864&r1=42863&r2=42864&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/network/src/routines/summary.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/network/src/routines/summary.ycp Sun Dec 9 16:09:41 2007
@@ -106,7 +106,10 @@
/* Device type label */
"bond" : _("Bond Network"),
/* Device type label */
- "vlan" : _("Virtual LAN")
+ "vlan" : _("Virtual LAN"),
+ /* Device type label */
+ "br" : _("Network Bridge"),
+
];
if(haskey(device_types, type))
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org