Mailinglist Archive: yast-commit (683 mails)

< Previous Next >
[yast-commit] r42771 - in /trunk/network/src: lan/address.ycp lan/hardware.ycp modules/LanItems.ycp routines/complex.ycp routines/summary.ycp
  • From: mzugec@xxxxxxxxxxxxxxxx
  • Date: Thu, 06 Dec 2007 16:44:18 -0000
  • Message-id: <20071206164418.F41242D1BA@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Thu Dec 6 17:44:18 2007
New Revision: 42771

URL: http://svn.opensuse.org/viewcvs/yast?rev=42771&view=rev
Log:
FaTE #142127 - support for VLAN (initial)

Modified:
trunk/network/src/lan/address.ycp
trunk/network/src/lan/hardware.ycp
trunk/network/src/modules/LanItems.ycp
trunk/network/src/routines/complex.ycp
trunk/network/src/routines/summary.ycp

Modified: trunk/network/src/lan/address.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=42771&r1=42770&r2=42771&view=diff
==============================================================================
--- trunk/network/src/lan/address.ycp (original)
+++ trunk/network/src/lan/address.ycp Thu Dec 6 17:44:18 2007
@@ -101,6 +101,28 @@
settings[key] = value;
}

+
+/**
+ * Default function to init the value of slave ETHERDEVICE box.
+ * @param key id of the widget
+ */
+void InitVLANSlave(string key)
+{
+ UI::ChangeWidget(`id(key), `CurrentItem, settings["ETHERDEVICE"]:"");
+}
+
+/**
+ * Default function to store the value of ETHERDEVICE devices box.
+ * @param key id of the widget
+ * @param key id of the widget
+ */
+void StoreVLANSlave(string key, map event)
+{
+ settings["ETHERDEVICE"] = (string)UI::QueryWidget (`id(key), `CurrentItem);
+}
+
+
+
/**
* Default function to init the value of slave devices box.
* @param key id of the widget
@@ -468,6 +490,15 @@
// "handle": HandleIfcfg,
],

+ "ETHERDEVICE": $[
+ "widget": `selection_box,
+ "label": _("Real Interface for &VLAN"),
+ "opt": [`shrinkable],
+ "items" : [ ],
+ "init": InitVLANSlave,
+ "store": StoreVLANSlave,
+ "help": help["etherdevice"]:"",
+ ],
"BONDSLAVE": $[
"widget": `multi_selection_box,
"label": _("Bond &Slaves"),
@@ -481,7 +512,7 @@
"BONDOPTION": $[
"widget": `combobox,
/* ComboBox label */
- "label": _("Bond &Driver Options"),
+ "label": _("&Bond Driver Options"),
"opt": [`hstretch, `editable],
"help": _("<p>Select the bond driver options, and edit it if you need.
</p>"),
"items": [["mode=balance-rr"], ["mode=active-backup"],
["mode=balance-xor"],
@@ -633,10 +664,10 @@
}

// FIXME duplicated in hardware.ycp
- list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi",
"myri", "tr", "usb", "wlan", "bond" ];
+ list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi",
"myri", "tr", "usb", "wlan", "bond", "vlan" ];

if(Arch::s390 ())
- device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth",
"lcs" ];
+ device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth",
"lcs", "vlan" ];

if(Arch::ia64 ())
device_types = add(device_types, "xp");
@@ -733,7 +764,6 @@
is_ptp? address_p2p_contents:
(no_dhcp? address_static_contents: address_dhcp_contents);

- term bond = `MarginBox(1, 0, `Frame( "", `VBox("BONDSLAVE",
"BONDOPTION")));

if (LanItems::type == "bond")
{
@@ -760,6 +790,19 @@
wd["BONDOPTION", "items"] = prepend(wd["BONDOPTION", "items"]:[],
[LanItems::bond_option]);
}

+ if (LanItems::type == "vlan")
+ {
+ foreach(integer row, any value, LanItems::Items,{
+ LanItems::current = row;
+ if (!LanItems::IsItemConfigured()){
+ string dev_name = LanItems::getCurrentItem()["hwinfo",
"dev_name"]:"";
+ if (hasAnyValue(dev_name)) wd["ETHERDEVICE", "items"] = add(
wd["ETHERDEVICE", "items"]:[], [ dev_name ] );
+ }
+ });
+settings["ETHERDEVICE"] = NetworkDevices::Current["ETHERDEVICE"]:"";
+settings["STARTMODE"] = "onboot";
+ }
+

term address_contents = `VBox(
`Left(label),
@@ -771,10 +814,18 @@
address_contents = `VBox(
`Left(label),
just_address_contents,
- bond,
+ `MarginBox(1, 0, `Frame( "", `VBox("BONDSLAVE", "BONDOPTION"))),
frame2
);
- }
+ } else if (LanItems::type == "vlan"){
+ address_contents = `VBox(
+ `Left(label),
+ just_address_contents,
+ `MarginBox(1, 0, `Frame( "", `VBox("ETHERDEVICE"))),
+ frame2
+ );
+}
+
else
{
address_contents = `VBox(
@@ -934,7 +985,10 @@
{
LanItems::bond_option = settings["BONDOPTION"]:"";
LanItems::bond_slaves = (list<string>)settings["SLAVES"]:[];
- }
+ } else if (LanItems::type == "vlan"){
+ LanItems::vlan_etherdevice = settings["ETHERDEVICE"]:"";
+ }
+

// proceed with WLAN settings if appropriate, #42420
if (ret == `next && LanItems::type == "wlan" && LanItems::alias == "")

Modified: trunk/network/src/lan/hardware.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/hardware.ycp?rev=42771&r1=42770&r2=42771&view=diff
==============================================================================
--- trunk/network/src/lan/hardware.ycp (original)
+++ trunk/network/src/lan/hardware.ycp Thu Dec 6 17:44:18 2007
@@ -99,10 +99,10 @@
if (!hasAnyValue(LanItems::nm_name) && hasAnyValue(LanItems::nm_name_old))
hardware["hwcfg"]=LanItems::nm_name_old;
*/
// FIXME duplicated in address.ycp
- hardware["device_types"] = [ "arc", "bnep", "dummy", "eth", "fddi",
"myri", "tr", "usb", "wlan", "bond" ];
+ hardware["device_types"] = [ "arc", "bnep", "dummy", "eth", "fddi",
"myri", "tr", "usb", "wlan", "bond", "vlan" ];

if(Arch::s390 ())
- hardware["device_types"] = [ "eth", "tr", "hsi", "ctc", "escon",
"ficon", "iucv", "qeth", "lcs" ];
+ hardware["device_types"] = [ "eth", "tr", "hsi", "ctc", "escon",
"ficon", "iucv", "qeth", "lcs", "vlan" ];

if(Arch::ia64 ())
hardware["device_types"] = add(hardware["device_types"]:[], "xp");
@@ -425,7 +425,7 @@
UI::ChangeWidget(`id(`modul), `Value, hardware["modul"]:"");
UI::ChangeWidget(`id(`options), `Value, hardware["options"]:"");
}
- else if (hardware["type"]:"" == "bond")
+ else if (contains(["bond", "vlan"], hardware["type"]:""))
{
UI::ChangeWidget(`id(`hwcfg), `Enabled, false);
UI::ChangeWidget(`id(`modul), `Enabled, false);

Modified: trunk/network/src/modules/LanItems.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp?rev=42771&r1=42770&r2=42771&view=diff
==============================================================================
--- trunk/network/src/modules/LanItems.ycp (original)
+++ trunk/network/src/modules/LanItems.ycp Thu Dec 6 17:44:18 2007
@@ -77,6 +77,10 @@
//bond options
global list<string> bond_slaves = [];
global string bond_option="";
+
+// VLAN option
+global string vlan_etherdevice="";
+
/**
* wl_wpa_eap aggregates the settings in a map for easier CWM access.
* @struct wpa_eap
@@ -330,7 +334,7 @@
NetworkDevices::Select(Items[key, "ifcfg"]:"");
if (!hasAnyValue(type)) type = NetworkDevices::device_type(Items[key,
"ifcfg"]:"");
descr = BuildDescription(type, NetworkDevices::device_type(Items[key,
"ifcfg"]:""), NetworkDevices::Current, [Items[key, "hwinfo"]:$[]]);
- string dev = NetworkDevices::device_name(type, NetworkDevices::Name);
+ string dev = NetworkDevices::Name; //NetworkDevices::device_name(type,
NetworkDevices::Name);
ip = DeviceProtocol(NetworkDevices::Current);
string status = DeviceStatus(type,
NetworkDevices::device_num(NetworkDevices::Name), NetworkDevices::Current);

@@ -1018,6 +1022,10 @@
newdev["BONDING_MASTER"] = "yes";
}

+ if (type=="vlan"){
+ newdev["ETHERDEVICE"]=vlan_etherdevice;
+ }
+
if(type == "wlan") {
newdev["WIRELESS_MODE"] = wl_mode;
newdev["WIRELESS_ESSID"] = wl_essid;

Modified: trunk/network/src/routines/complex.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/routines/complex.ycp?rev=42771&r1=42770&r2=42771&view=diff
==============================================================================
--- trunk/network/src/routines/complex.ycp (original)
+++ trunk/network/src/routines/complex.ycp Thu Dec 6 17:44:18 2007
@@ -302,6 +302,8 @@
"xp" : _("XP Network"),
/* Device type label */
"bond" : _("Bond Network"),
+ /* Device type label */
+ "vlan" : _("Virtual LAN"),
];

if(haskey(device_names, devtype))

Modified: trunk/network/src/routines/summary.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/routines/summary.ycp?rev=42771&r1=42770&r2=42771&view=diff
==============================================================================
--- trunk/network/src/routines/summary.ycp (original)
+++ trunk/network/src/routines/summary.ycp Thu Dec 6 17:44:18 2007
@@ -105,6 +105,8 @@
"wlan" : _("Wireless"),
/* Device type label */
"xp" : _("XPNET"),
+ /* Device type label */
+ "vlan" : _("Virtual LAN"),
];

if(haskey(device_types, type))

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages