View | Details | Raw Unified | Return to bug 218663
Collapse All | Expand All

(-)yast2-network-2.14.5.old/src/lan/hardware.ycp (-1 / +14 lines)
Lines 88-94 in the <b>IBM Device Drivers and Install Link Here
88
    string hwcfg = Lan::nm_name;
88
    string hwcfg = Lan::nm_name;
89
89
90
    // FIXME duplicated in address.ycp
90
    // FIXME duplicated in address.ycp
91
    list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan" ];
91
    list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond" ];
92
92
93
    if(Arch::s390 ())
93
    if(Arch::s390 ())
94
	device_types = [ "eth", "tr", "hsi", "ctc", "escon", "ficon", "iucv", "qeth", "lcs" ];
94
	device_types = [ "eth", "tr", "hsi", "ctc", "escon", "ficon", "iucv", "qeth", "lcs" ];
Lines 346-351 in the <b>IBM Device Drivers and Install Link Here
346
		UI::ChangeWidget(`id(`modul), `Value, modul);
346
		UI::ChangeWidget(`id(`modul), `Value, modul);
347
		UI::ChangeWidget(`id(`options), `Value, options);
347
		UI::ChangeWidget(`id(`options), `Value, options);
348
	    }
348
	    }
349
            else if (type == "bond")
350
            {
351
                UI::ChangeWidget(`id(`hwcfg), `Enabled, false);
352
                UI::ChangeWidget(`id(`modul), `Enabled, false);
353
                UI::ChangeWidget(`id(`options), `Enabled, false);
354
                UI::ChangeWidget(`id(`pcmcia), `Enabled, false);
355
                UI::ChangeWidget(`id(`usb), `Enabled, false);
356
		UI::ChangeWidget(`id(`list), `Enabled, false);
357
358
                UI::ChangeWidget(`id(`hwcfg), `Value, "");
359
                UI::ChangeWidget(`id(`modul), `Value, "");
360
                UI::ChangeWidget(`id(`options), `Value, "");
361
            }
349
362
350
	    continue;
363
	    continue;
351
	}
364
	}
(-)yast2-network-2.14.5.old/src/lan/address.ycp (-7 / +106 lines)
Lines 89-94 void StoreAddrWidget (string key, map ev Link Here
89
}
89
}
90
90
91
/**
91
/**
92
 * Default function to init the value of slave devices box.
93
 * @param key	id of the widget
94
 */
95
void InitSlave(string key)
96
{
97
    UI::ChangeWidget(`id(key), `SelectedItems, settings["SLAVES"]:[]);
98
}
99
100
/**
101
 * Default function to store the value of slave devices box.
102
 * @param key	id of the widget
103
 * @param key id of the widget
104
 */
105
void StoreSlave(string key, map event)
106
{
107
    settings["SLAVES"] = (list<string>)UI::QueryWidget (`id(key), `SelectedItems);
108
}
109
110
/**
92
 * Initialize a RadioButtonGroup
111
 * Initialize a RadioButtonGroup
93
 * Group called FOO has buttons FOO_bar FOO_qux and values bar qux
112
 * Group called FOO has buttons FOO_bar FOO_qux and values bar qux
94
 * @param key id of the widget
113
 * @param key id of the widget
Lines 417-422 the firewall will be disabled.</p>"), Link Here
417
	"handle": HandleIfcfg,
436
	"handle": HandleIfcfg,
418
	],
437
	],
419
438
439
    "BONDSLAVE": $[
440
        "widget": `multi_selection_box,
441
        "label": _("Bond Slaves"),
442
        "opt": [`shrinkable],
443
        "items" : [ ],
444
        "init": InitSlave,
445
        "store": StoreSlave,
446
        "help": _("<p>Select the salve devices for the bond device. Only the deveices which's Device Activation is Never and set as None Address Setup are available.</p>"),
447
    ],
448
449
    "BONDOPTION": $[
450
        "widget": `combobox,
451
        /* ComboBox label */
452
        "label": _("Bond Driver Options"),
453
        "opt": [`hstretch, `editable],
454
        "help": _("<p>Select the bond driver options, and edit it if you need. </p>"),
455
        "items": [["mode=balance-rr"], ["mode=active-backup"], ["mode=balance-xor"],
456
                  ["mode=broadcast"], ["mode=802.3ad"], ["mode=balance-tlb"], ["mode=balance-alb"]],
457
    ],
458
420
    "BOOTPROTO": $[
459
    "BOOTPROTO": $[
421
	"widget": `empty,
460
	"widget": `empty,
422
	"help": "",
461
	"help": "",
Lines 425-430 the firewall will be disabled.</p>"), Link Here
425
	"store": StoreWidgetRbg,
464
	"store": StoreWidgetRbg,
426
	],
465
	],
427
466
467
    "BOOTPROTO_none": $[
468
        "widget": `radio_button,
469
        // radio button label
470
        "label": _("None Address Setup"),
471
        "opt": [`notify],
472
        "init": CWM::InitNull,
473
        "store": CWM::StoreNull
474
    ],
475
428
    "BOOTPROTO_dhcp": $[
476
    "BOOTPROTO_dhcp": $[
429
	"widget": `radio_button,
477
	"widget": `radio_button,
430
	// radio button label
478
	// radio button label
Lines 435-440 the firewall will be disabled.</p>"), Link Here
435
	"help":
483
	"help":
436
	/* Address dialog help 2-6/8: dynamic address preferred */
484
	/* Address dialog help 2-6/8: dynamic address preferred */
437
	/* Address dialog help 2/8 */
485
	/* Address dialog help 2/8 */
486
    _("<p>You can select none address setup if you don't want any IP address.</p>") +
487
438
    _("<p>You can select dynamic address assignment
488
    _("<p>You can select dynamic address assignment
439
if you have a <b>DHCP server</b> running on your local network.</p>
489
if you have a <b>DHCP server</b> running on your local network.</p>
440
") +
490
") +
Lines 743-749 define any AddressDialog() { Link Here
743
    }
793
    }
744
794
745
    // FIXME duplicated in hardware.ycp
795
    // FIXME duplicated in hardware.ycp
746
    list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan" ];
796
    list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond" ];
747
797
748
    if(Arch::s390 ())
798
    if(Arch::s390 ())
749
	device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth", "lcs" ];
799
	device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth", "lcs" ];
Lines 849-854 Components of this product might not wor Link Here
849
	    `id ("BOOTPROTO"),	// CWM must not expand `id
899
	    `id ("BOOTPROTO"),	// CWM must not expand `id
850
	    `MarginBox (1, 0,
900
	    `MarginBox (1, 0,
851
		`VBox (
901
		`VBox (
902
		    `Left ("BOOTPROTO_none"),
852
		    `Left ("BOOTPROTO_dhcp"), // TODO: widget attribute align: left
903
		    `Left ("BOOTPROTO_dhcp"), // TODO: widget attribute align: left
853
		    `Left ("BOOTPROTO_static"),
904
		    `Left ("BOOTPROTO_static"),
854
		    address_static_contents)
905
		    address_static_contents)
Lines 861-872 Components of this product might not wor Link Here
861
	is_ptp? address_p2p_contents:
912
	is_ptp? address_p2p_contents:
862
	(no_dhcp? address_static_contents: address_dhcp_contents);
913
	(no_dhcp? address_static_contents: address_dhcp_contents);
863
914
864
    term address_contents = `HSquash(`VBox(
915
    term bond = `MarginBox(1, 0, `Frame( "", `VBox("BONDSLAVE", "BONDOPTION")));
865
	`Left(label),
916
866
	just_address_contents,
917
    if (Lan::type == "bond")
867
	frame2,
918
    {
868
	"_DIALOG"
919
        settings["SLAVES"] = Lan::bond_slaves;
869
    ));
920
921
        //get all eth devices
922
        map<string, map<string, map<string, any> > > devices = (map<string, map<string, map<string, any> > >)NetworkDevices::FilterDevices("");
923
	map<string, map<string, any> > avails= devices["eth"]:$[];
924
925
        //filter the eth devices (BOOT_PROTO=none && START_MODE=off)
926
        foreach (string num, map<string, any> value, avails, 
927
        {
928
            if (((string)value["BOOTPROTO"]:"" == "none") && ((string)value["STARTMODE"]:"" == "off"))
929
            wd["BONDSLAVE", "items"] = add (wd["BONDSLAVE", "items"]:[], [NetworkDevices::device_name("eth", num)] );
930
        });
931
932
        settings["BONDOPTION"] = Lan::bond_option;
933
934
        //fill up the drop list and make the default value first
935
        wd["BONDOPTION", "items"] = filter(list<string> v, wd["BONDOPTION", "items"]:[],
936
        {
937
            return v[0]:"" != Lan::bond_option;
938
        });
939
        wd["BONDOPTION", "items"] = prepend(wd["BONDOPTION", "items"]:[], [Lan::bond_option]);
940
    }
941
942
943
    term address_contents = nil;
944
    if (Lan::type == "bond")
945
    {
946
        address_contents = `HSquash(`VBox(
947
                `Left(label),
948
		just_address_contents,
949
		bond,
950
		frame2,
951
		"_DIALOG"
952
	));
953
    }
954
    else
955
    {
956
	address_contents = `HSquash(`VBox(
957
		`Left(label),
958
		just_address_contents,
959
		frame2,
960
		"_DIALOG"
961
	));
962
    }
870
963
871
    map functions = $[
964
    map functions = $[
872
        "init" : InitAddrWidget,
965
        "init" : InitAddrWidget,
Lines 965-970 Components of this product might not wor Link Here
965
	}
1058
	}
966
    }
1059
    }
967
1060
1061
    if (Lan::type == "bond")
1062
    {
1063
        Lan::bond_option = settings["BONDOPTION"]:"";
1064
	Lan::bond_slaves = (list<string>)settings["SLAVES"]:[];
1065
    }
1066
968
    // proceed with WLAN settings if appropriate, #42420
1067
    // proceed with WLAN settings if appropriate, #42420
969
    if (ret == `next && Lan::type == "wlan" && Lan::alias == "")
1068
    if (ret == `next && Lan::type == "wlan" && Lan::alias == "")
970
    {
1069
    {
(-)yast2-network-2.14.5.old/src/modules/Lan.ycp (-1 / +39 lines)
Lines 98-103 global string wl_key_length = ""; Link Here
98
global list<string> wl_key = [];
98
global list<string> wl_key = [];
99
global integer wl_default_key = 0;
99
global integer wl_default_key = 0;
100
global string wl_nick = "";
100
global string wl_nick = "";
101
102
//bond options
103
global list<string> bond_slaves = [];
104
global string bond_option="";
101
/**
105
/**
102
 * wl_wpa_eap aggregates the settings in a map for easier CWM access.
106
 * wl_wpa_eap aggregates the settings in a map for easier CWM access.
103
 * @struct wpa_eap
107
 * @struct wpa_eap
Lines 854-859 map<string, string> SysconfigDefaults = Link Here
854
    "WIRELESS_CA_CERT": "",
858
    "WIRELESS_CA_CERT": "",
855
    "WIRELESS_EAP_AUTH": "",
859
    "WIRELESS_EAP_AUTH": "",
856
    "WIRELESS_PEAP_VERSION": "",
860
    "WIRELESS_PEAP_VERSION": "",
861
862
    "BONDING_MODULE_OPTS": "",
857
    ];
863
    ];
858
864
859
string GetDeviceVar (map primary, map fallback, string key) {
865
string GetDeviceVar (map primary, map fallback, string key) {
Lines 882-887 void SetDeviceVars(map devmap, map defau Link Here
882
    startmode = GetDeviceVar (devmap, defaults, "STARTMODE");
888
    startmode = GetDeviceVar (devmap, defaults, "STARTMODE");
883
    usercontrol = GetDeviceVar (devmap, defaults, "USERCONTROL") == "yes";
889
    usercontrol = GetDeviceVar (devmap, defaults, "USERCONTROL") == "yes";
884
    description = GetDeviceVar (devmap, defaults, "NAME");
890
    description = GetDeviceVar (devmap, defaults, "NAME");
891
    bond_option = GetDeviceVar(devmap, defaults, "BONDING_MODULE_OPTS");
892
893
    bond_slaves=[];
894
    foreach(any key, any value, devmap,
895
    {
896
        if (regexpmatch((string)key, "BONDING_SLAVE[0-9]+"))
897
            if ((string)value != nil)
898
                bond_slaves = add(bond_slaves, (string)value);
899
    });
885
900
886
    /* wireless options */
901
    /* wireless options */
887
    wl_mode = GetDeviceVar (devmap, defaults, "WIRELESS_MODE");
902
    wl_mode = GetDeviceVar (devmap, defaults, "WIRELESS_MODE");
Lines 1037-1043 global define boolean Select(string dev) Link Here
1037
	qeth_macaddress = devmap["LLADDR"]:"00:00:00:00:00:00";
1052
	qeth_macaddress = devmap["LLADDR"]:"00:00:00:00:00:00";
1038
    }
1053
    }
1039
1054
1040
    if(bootproto == "none") bootproto = "static";
1055
    //if(bootproto == "none") bootproto = "static";
1041
1056
1042
    return true;
1057
    return true;
1043
}
1058
}
Lines 1196-1201 global define boolean Commit() { Link Here
1196
	if(hotplug == "pcmcia")
1211
	if(hotplug == "pcmcia")
1197
	    newdev["DHCLIENT_SET_DOWN_LINK"] = "yes";
1212
	    newdev["DHCLIENT_SET_DOWN_LINK"] = "yes";
1198
1213
1214
1215
	if (type == "bond")
1216
	{
1217
            integer i = 0;
1218
            foreach (string slave, bond_slaves,
1219
            {
1220
		newdev[sformat("BONDING_SLAVE%1", i)] = slave;
1221
                i = i + 1;
1222
            });
1223
1224
            //assign nil to rest BONDING_SLAVEn to remove them
1225
            while (i<10)
1226
            {
1227
               newdev[sformat("BONDING_SLAVE%1", i)] = nil;
1228
               i = i + 1;
1229
            };
1230
1231
            newdev["BONDING_MODULE_OPTS"] = bond_option;
1232
1233
            //BONDING_MASTER always is yes
1234
            newdev["BONDING_MASTER"] = "yes";
1235
	}
1236
1199
	if(type == "wlan") {
1237
	if(type == "wlan") {
1200
	    newdev["WIRELESS_MODE"] = wl_mode;
1238
	    newdev["WIRELESS_MODE"] = wl_mode;
1201
	    newdev["WIRELESS_ESSID"] = wl_essid;
1239
	    newdev["WIRELESS_ESSID"] = wl_essid;
(-)yast2-network-2.14.5.old/src/routines/complex.ycp (+17 lines)
Lines 295-300 define string CheckEmptyName(string devt Link Here
295
	"wlan-usb"	: _("USB Wireless Network Card"),
295
	"wlan-usb"	: _("USB Wireless Network Card"),
296
	/* Device type label */
296
	/* Device type label */
297
	"xp"		: _("XP Network"),
297
	"xp"		: _("XP Network"),
298
	/* Device type label */
299
        "bond"          : _("Bond Network"),
298
    ];
300
    ];
299
301
300
    if(haskey(device_names, devtype))
302
    if(haskey(device_names, devtype))
Lines 485-490 define list BuildOverviewDevs(map<string Link Here
485
	"ifplugd": _("Started automatically on cable connection"),
487
	"ifplugd": _("Started automatically on cable connection"),
486
	// summary description of STARTMODE=managed
488
	// summary description of STARTMODE=managed
487
	"managed": _("Managed by NetworkManager"),
489
	"managed": _("Managed by NetworkManager"),
490
        // summary description of STARTMODE=off
491
        "off": _("Never started"),
488
	];
492
	];
489
list<string> models = [];
493
list<string> models = [];
490
foreach(map<string, any>row, (list<map<string, any> >)SCR::Read (.probe.netcard), {
494
foreach(map<string, any>row, (list<map<string, any> >)SCR::Read (.probe.netcard), {
Lines 547-552 foreach(map<string, any>row, (list<map<s Link Here
547
				, ip, v["NETMASK"]:""),
551
				, ip, v["NETMASK"]:""),
548
			];
552
			];
549
		}
553
		}
554
555
                // build the "Bond Slaves" entry of rich box
556
		if (type == "bond")
557
		{
558
			string slaves = "";
559
			foreach (string key, any value, (map<string, any>)v, {
560
				if ((value != nil) && (regexpmatch(key, "BONDING_SLAVE[0-9]")))
561
					slaves = slaves + ((slaves != "") ? ", " : "") + (string)value;
562
			});
563
			if (slaves != "")
564
				bullets = bullets + [_("Bond slaves")+ " : " + slaves];
565
		}
566
550
		// create the rich text description
567
		// create the rich text description
551
		string rich = HTML::Bold ( sformat("%1 %2", descr, (contains(models, v["NAME"]:"") )?"":_("(not connected)"))) +"<br>"+ HTML::List (bullets);
568
		string rich = HTML::Bold ( sformat("%1 %2", descr, (contains(models, v["NAME"]:"") )?"":_("(not connected)"))) +"<br>"+ HTML::List (bullets);
552
		
569
		

Return to bug 218663