diff options
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | iw/network_gui.py | 903 | ||||
-rw-r--r-- | loader2/net.c | 14 | ||||
-rw-r--r-- | network.py | 12 | ||||
-rw-r--r-- | ui/netpostconfig.glade | 976 |
5 files changed, 1510 insertions, 412 deletions
@@ -1,3 +1,20 @@ +2006-12-12 David Cantrell <dcantrell@redhat.com> + + * ui/netpostconfig.glade: Defines the Edit Network Device window used + in the stage 2 part of anaconda. + + * loader2/net.c (writeNetInfo): Write out IPv6 settings. + + * network.py (Network): Move the useIPv4 and useIPv6 flags to be per + device rather than per system. + + * iw/network_gui.py: Removed old code in editDevice(), replaced with + NetworkDeviceEditWindow class. Removed the awful mess of input + validation code I had since the new dialog box handles all of that. + Support independent IPv4 and IPv6 stack configuration per device and + offer IPv6 automatic neighbor discovery in addition to DHCPv6 and + static configuration (#213110, #213112). + 2006-12-11 Jeremy Katz <katzj@redhat.com> * iscsi.py (has_iscsi): Fix typo (#218513) diff --git a/iw/network_gui.py b/iw/network_gui.py index b61f7b7db..b89c52ae0 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -33,11 +33,6 @@ descr = { 'ipaddr': 'IPv4 address', 'ipv6addr': 'IPv6 address' } -# order to check input values -checkorder = ['ipaddr', 'netmask', 'ipv6addr', 'ipv6prefix', - 'remip', 'essid', 'key' - ] - class NetworkWindow(InstallWindow): windowTitle = N_("Network Configuration") @@ -45,7 +40,6 @@ class NetworkWindow(InstallWindow): InstallWindow.__init__(self, ics) def getNext(self): - if self.getNumberActiveDevices() == 0: rc = self.handleNoActiveDevices() if not rc: @@ -170,21 +164,11 @@ class NetworkWindow(InstallWindow): _("The hostname \"%s\" is not valid for the following reason:\n\n%s") % (hostname, error)) def handleIPMissing(self, field): - try: - newfield = descr[field] - except: - newfield = field - self.intf.messageWindow(_("Error With Data"), - _("A value is required for the field %s.") % (newfield,)) + _("A value is required for the field %s.") % (field,)) def handleIPError(self, field, msg): - try: - newfield = descr[field] - except: - newfield = field - - self.intf.messageWindow(_("Error With %s Data") % (newfield,), + self.intf.messageWindow(_("Error With %s Data") % (field,), _("%s") % msg.__str__()) def handleBroadCastError(self): @@ -196,421 +180,157 @@ class NetworkWindow(InstallWindow): return self.intf.messageWindow(_("Error With Data"), _("You have no active network devices. Your system will not be able to communicate over a network by default without at least one device active."), type="custom", custom_buttons=["gtk-cancel", _("C_ontinue")]) def editDevice(self, data): - v4list = [] - v6list = [] - ptplist = [] - wifilist = [] - - def DHCPtoggled(widget): - active = widget.get_active() - - if wifilist: - for widget in wifilist: - widget.set_sensitive(True) - - if active: - bootproto = "dhcp" - - for widget in v4list: - widget.set_sensitive(False) - - for widget in v6list: - widget.set_sensitive(False) - - if ptplist: - for widget in ptplist: - widget.set_sensitive(False) - else: - bootproto = "static" - - if IPV4cb.get_active(): - for widget in v4list: - widget.set_sensitive(True) - - if IPV6cb.get_active(): - for widget in v6list: - widget.set_sensitive(True) - - if ptplist: - for widget in ptplist: - widget.set_sensitive(True) - - def IPV4toggled(widget): - active = widget.get_active() - self.network.useIPv4 = active - if not DHCPcb.get_active(): - if active: - for widget in v4list: - widget.set_sensitive(True) - else: - for widget in v4list: - widget.set_sensitive(False) - - def IPV6toggled(widget): - active = widget.get_active() - self.network.useIPv6 = active - if not DHCPcb.get_active(): - if active: - for widget in v6list: - widget.set_sensitive(True) - else: - for widget in v6list: - widget.set_sensitive(False) - - - if self.ignoreEvents: - return - - selection = self.ethdevices.get_selection() + selection = self.ethdevices.get_selection() (model, iter) = selection.get_selected() if not iter: return None dev = model.get_value(iter, 1) - bootproto = model.get_value(iter, 2) - onboot = model.get_value(iter, 0) - - # create dialog box - editWin = gtk.Dialog(_("Edit Interface %s") % (dev,), - flags=gtk.DIALOG_MODAL) - gui.addFrame(editWin) - editWin.set_modal(True) - editWin.set_position (gtk.WIN_POS_CENTER) - - # create contents - devbox = gtk.VBox() - - hwaddr = self.devices[dev].get("hwaddr") - if hwaddr is not None and len(hwaddr) > 0: - align = gtk.Alignment() - label = gtk.Label(_("Hardware address: %s") % (hwaddr,)) - align.add(label) - devbox.pack_start(align, False, padding=3) - - align = gtk.Alignment() - DHCPcb = gtk.CheckButton(_("Use dynamic IP configuration (_DHCP)")) - align.add(DHCPcb) - devbox.pack_start(align, False, padding=3) - - align = gtk.Alignment() - IPV4cb = gtk.CheckButton(_("Enable IPv4 support")) - align.add(IPV4cb) - devbox.pack_start(align, False, padding=3) - - align = gtk.Alignment() - IPV6cb = gtk.CheckButton(_("Enable IPv6 support")) - align.add(IPV6cb) - devbox.pack_start(align, False, padding=3) - - # FIXME: radio group to pick static or RFC2462 autoconfig - - align = gtk.Alignment() - bootcb = gtk.CheckButton(_("_Activate on boot")) - - bootcb.connect("toggled", self.onBootToggled, self.devices[dev]) - bootcb.set_active(onboot) - align.add(bootcb) - devbox.pack_start(align, False, padding=3) - - ipTableLength = 3 - - if (network.isPtpDev(dev)): - ipTableLength += 1 - - if (isys.isWireless(dev)): - ipTableLength += 2 - - ipTable = gtk.Table(ipTableLength, 4) - - DHCPcb.connect("toggled", DHCPtoggled) - IPV4cb.connect("toggled", IPV4toggled) - IPV6cb.connect("toggled", IPV6toggled) - - entrys = {} - - # build the IP options table: - - # put some column labels on the table - cl = gtk.Label(_("Address")) - cl.set_alignment(0.5, 0.5) - ipTable.attach(cl, 1, 2, 0, 1, xpadding=0, ypadding=0) - cl = gtk.Label(_("Prefix (Netmask)")) - cl.set_alignment(0.5, 0.5) - ipTable.attach(cl, 3, 4, 0, 1, xpadding=0, ypadding=0) - - # IPv4 address and mask - v4list.append(gtk.Label(_("IPv_4:"))) - v4list[0].set_alignment(0.0, 0.5) - v4list[0].set_property("use_underline", True) - ipTable.attach(v4list[0], 0, 1, 1, 2, xpadding=0, ypadding=0) - - v4list.append(gtk.Entry()) - v4list[1].set_width_chars(16) - v4list[1].set_text(self.devices[dev].get('ipaddr')) - entrys['ipaddr'] = v4list[1] - ipTable.attach(v4list[1], 1, 2, 1, 2, xpadding=0, ypadding=0) - - v4list.append(gtk.Label("/")) - v4list[2].set_alignment(0.5, 0.5) - ipTable.attach(v4list[2], 2, 3, 1, 2, xpadding=4, ypadding=0) - - v4list.append(gtk.Entry()) - v4list[3].set_width_chars(16) - v4list[3].set_text(self.devices[dev].get('netmask')) - entrys['netmask'] = v4list[3] - ipTable.attach(v4list[3], 3, 4, 1, 2, xpadding=0, ypadding=0) - - # IPv6 address and prefix - v6list.append(gtk.Label(_("IPv_6:"))) - v6list[0].set_alignment(0.0, 0.5) - v6list[0].set_property("use_underline", True) - ipTable.attach(v6list[0], 0, 1, 2, 3, xpadding=0, ypadding=0) - - v6list.append(gtk.Entry()) - v6list[1].set_width_chars(41) + bootproto = model.get_value(iter, 2) + onboot = model.get_value(iter, 0) + + # create dialog box for editing this interface + editwin = NetworkDeviceEditWindow(self) + editwin.setTitle(dev) + editwin.setDescription(self.devices[dev].get('desc')) + editwin.setHardwareAddress(self.devices[dev].get('hwaddr')) + ipaddr = self.devices[dev].get('ipaddr') + netmask = self.devices[dev].get('netmask') + editwin.setIPv4Manual(ipaddr, netmask) + + ipv6_autoconf = self.devices[dev].get('ipv6_autoconf') ipv6addr = self.devices[dev].get('ipv6addr') + ipv6prefix = self.devices[dev].get('ipv6prefix') brk = ipv6addr.find('/') if brk != -1: ipv6addr = ipv6addr[0:brk] brk += 1 ipv6prefix = ipv6addr[brk:] - - v6list[1].set_text(ipv6addr) - entrys['ipv6addr'] = v6list[1] - ipTable.attach(v6list[1], 1, 2, 2, 3, xpadding=0, ypadding=0) - - v6list.append(gtk.Label("/")) - v6list[2].set_alignment(0.5, 0.5) - ipTable.attach(v6list[2], 2, 3, 2, 3, xpadding=4, ypadding=0) - - v6list.append(gtk.Entry()) - v6list[3].set_width_chars(4) - v6list[3].set_text(self.devices[dev].get('ipv6prefix')) - entrys['ipv6prefix'] = v6list[3] - ipTable.attach(v6list[3], 3, 4, 2, 3, xpadding=0, ypadding=0) - - # Point to Point address - if (network.isPtpDev(dev)): - ptplist.append(gtk.Label(_("_Point to Point (IP):"))) - ptplist[0].set_alignment(0.0, 0.5) - ptplist[0].set_property("use_underline", True) - ipTable.attach(ptplist[0], 0, 1, 3, 4, xpadding=0, ypadding=0) - - ptplist.append(gtk.Entry()) - ptplist[1].set_width_chars(41) - ptplist[1].set_text(self.devices[dev].get('remip')) - entrys['remip'] = ptplist[1] - ipTable.attach(ptplist[1], 1, 2, 3, 4, xpadding=0, ypadding=0) - - # Wireless settings - if (isys.isWireless(dev)): - wifilist.append(gtk.Label(_("_ESSID:"))) - wifilist[0].set_alignment(0.0, 0.5) - wifilist[0].set_property("use_underline", True) - ipTable.attach(wifilist[0], 0, 1, 4, 5, xpadding=0, ypadding=0) - - wifilist.append(gtk.Entry()) - wifilist[1].set_text(self.devices[dev].get('essid')) - entrys['essid'] = wifilist[1] - ipTable.attach(wifilist[1], 1, 2, 4, 5, xpadding=0, ypadding=0) - - wifilist.append(gtk.Label(_("Encryption _Key:"))) - wifilist[2].set_alignment(0.0, 0.5) - wifilist[2].set_property("use_underline", True) - ipTable.attach(wifilist[2], 0, 1, 5, 6, xpadding=0, ypadding=0) - - wifilist.append(gtk.Entry()) - wifilist[3].set_text(self.devices[dev].get('key')) - entrys['key'] = wifilist[3] - ipTable.attach(wifilist[3], 1, 2, 5, 6, xpadding=0, ypadding=0) - - devbox.pack_start(ipTable, False, False, 6) - devbox.set_border_width(6) - - # go ahead and set up DHCP on the first device - DHCPcb.set_active(self.devices[dev].get('bootproto').lower() == 'dhcp') - - # set the IPv4 and IPv6 check boxes - IPV4cb.set_active(self.network.useIPv4) - IPV6cb.set_active(self.network.useIPv6) - - # set widget sensitivity - DHCPtoggled(DHCPcb) - IPV4toggled(IPV4cb) - IPV6toggled(IPV6cb) - - framelab = _("Configure %s") % (dev,) - descr = self.devices[dev].get("desc") - if descr is not None and len(descr) > 0: - framelab += " - " + descr[:70] - - l = gtk.Label() - l.set_markup("<b>%s</b>" %(framelab,)) - - frame = gtk.Frame() - frame.set_label_widget(l) - frame.set_border_width(12) - frame.add(devbox) - frame.set_shadow_type(gtk.SHADOW_NONE) - editWin.vbox.pack_start(frame, padding=6) - editWin.set_position(gtk.WIN_POS_CENTER) - editWin.show_all() - editWin.add_button('gtk-cancel', 2) - editWin.add_button('gtk-ok', 1) - - while 1: - rc = editWin.run() - - if rc == 2: - editWin.destroy() + editwin.setIPv6Manual(ipv6addr, ipv6prefix) + + if isys.isWireless(dev): + editwin.showWirelessTable() + editwin.setESSID(self.devices[dev].get('essid')) + editwin.setEncKey(self.devices[dev].get('key')) + else: + editwin.hideWirelessTable() + + if network.isPtpDev(dev): + editwin.showPtPTable() + editwin.setPtP(self.devices[dev].get('remip')) + else: + editwin.hidePtPTable() + + editwin.setActiveOnBoot(onboot) + + editwin.setEnableIPv4(self.devices[dev].get('useIPv4')) + editwin.selectIPv4Method(ipaddr) + + editwin.setEnableIPv6(self.devices[dev].get('useIPv6')) + editwin.selectIPv6Method(ipv6_autoconf, ipv6addr) + + rc = 1 + while rc == 1: + editwin.run() + rc = editwin.getInputValidationResults() + if rc == 3: return - if DHCPcb.get_active(): - bootproto = 'dhcp' - else: - bootproto = 'static' - - if IPV4cb.get_active() is False and IPV6cb.get_active() is False: - self.intf.messageWindow(_("Missing Protocol"), - _("You must select at least IPv4 " - "or IPv6 support.")) - continue - - if bootcb.get_active(): - onboot = 'yes' - else: - onboot = 'no' - - if bootproto.lower() != 'dhcp': - valsgood = 1 - tmpvals = {} - - for t in checkorder: - if not entrys.has_key(t): - continue - - val = entrys[t].get_text() - - if ((t == 'ipaddr' or t == 'netmask') and \ - IPV4cb.get_active() is True) or \ - (t == 'ipv6addr' and IPV6cb.get_active() is True) or \ - (t == 'remip'): - if t == 'netmask' and val.find('.') == -1: - try: - if int(val) > 32 or int(val) < 0: - self.intf.messageWindow(_("Invalid Prefix"), - _("IPv4 prefix " - "must be between " - "0 and 32.")) - valsgood = 0 - break - else: - val = isys.prefix2netmask(int(val)) - except: - self.handleIPMissing(t) - valsgood = 0 - break - - try: - network.sanityCheckIPString(val) - tmpvals[t] = val - except network.IPMissing, msg: - self.handleIPMissing(t) - valsgood = 0 - break - except network.IPError, msg: - self.handleIPError(t, msg) - valsgood = 0 - break - - elif t == 'ipv6prefix' and IPV6cb.get_active() is True: - try: - if int(val) > 128 or int(val) < 0: - self.intf.messageWindow(_("Invalid Prefix"), - _("IPv6 prefix must be " - "between 0 and 128.")) - valsgood = 0 - break - except: - self.intf.messageWindow(_("Invalid Prefix"), - _("Invalid or missing " - "IPv6 prefix (must be " - "between 0 and 128).")) - valsgood = 0 - break - - if valsgood == 0: - continue - - if IPV4cb.get_active() is True: - try: - (net, bc) = isys.inet_calcNetBroad (tmpvals['ipaddr'], - tmpvals['netmask']) - except Exception, e: - print e - self.handleBroadCastError() - valsgood = 0 - - if not valsgood: - continue - - for t in entrys.keys(): - if tmpvals.has_key(t): - if t == 'ipv6addr': - if entrys['ipv6prefix'] is not None: - a = tmpvals[t] - if a.find('/') != -1: - a = a[0:a.find('/')] - p = entrys['ipv6prefix'].get_text() - q = "%s/%s" % (a, p,) - else: - q = "%s" % (tmpvals[t],) - - self.devices[dev].set((t, q)) - else: - self.devices[dev].set((t, tmpvals[t])) - else: - self.devices[dev].set((t, entrys[t].get_text())) - - if IPV4cb.get_active() is True: - self.devices[dev].set(('network', net), ('broadcast', bc)) - - self.devices[dev].set(('bootproto', bootproto)) - self.devices[dev].set(('ONBOOT', onboot)) - model.set_value(iter, 0, onboot == 'yes') - model.set_value(iter, 2, self.createIPV4Repr(self.devices[dev])) - model.set_value(iter, 3, self.createIPV6Repr(self.devices[dev])) - - editWin.destroy() - - self.setIPTableSensitivity() - self.setHostOptionsSensitivity() + # collect results + onboot = editwin.isActiveOnBoot() + useipv4 = editwin.isIPv4Enabled() + useipv6 = editwin.isIPv6Enabled() + + self.devices[dev].set(('useIPv4', useipv4)) + self.devices[dev].set(('useIPv6', useipv6)) + + if useipv4: + bootproto = editwin.getIPv4Method() + + if bootproto == 'dhcp': + self.devices[dev].set(('ipaddr', bootproto)) + elif bootproto == 'static': + try: + (net, bc) = isys.inet_calcNetBroad(editwin.getIPv4Address(), + editwin.getIPv4Prefix()) + self.devices[dev].set(('network', net), ('broadcast', bc)) + except Exception, e: + self.handleBroadCastError() + return + + self.devices[dev].set(('ipaddr', editwin.getIPv4Address())) + self.devices[dev].set(('netmask', editwin.getIPv4Prefix())) + + if useipv6: + method = editwin.getIPv6Method() + + if method == 'auto': + self.devices[dev].set(('ipv6_autoconf', 'yes')) + self.devices[dev].set(('ipv6addr', '')) + self.devices[dev].set(('ipv6prefix', '')) + elif method == 'dhcp': + self.devices[dev].set(('ipv6_autoconf', 'no')) + self.devices[dev].set(('ipv6addr', 'dhcp')) + self.devices[dev].set(('ipv6prefix', '')) + elif method == 'static': + self.devices[dev].set(('ipv6_autoconf', 'no')) + self.devices[dev].set(('ipv6addr', editwin.getIPv6Address())) + self.devices[dev].set(('ipv6prefix', editwin.getIPv6Prefix())) + + if editwin.isWirelessEnabled(): + self.devices[dev].set(('essid', editwin.getESSID())) + self.devices[dev].set(('key', editwin.getEncKey())) + + if editwin.isPtPEnabled(): + self.devices[dev].set(('remip', editwin.getPtP())) + + self.devices[dev].set(('bootproto', bootproto)) + + if onboot: + self.devices[dev].set(('onboot', 'yes')) + else: + self.devices[dev].set(('onboot', 'no')) + + model.set_value(iter, 0, onboot) + model.set_value(iter, 2, self.createIPV4Repr(self.devices[dev])) + model.set_value(iter, 3, self.createIPV6Repr(self.devices[dev])) + + editwin.close() + + self.setIPTableSensitivity() + self.setHostOptionsSensitivity() - return + return def createIPV4Repr(self, device): - bootproto = device.get("bootproto") - if self.network.useIPv4 is False: + if device.get('useIPv4') is False: return _("Disabled") - if bootproto.lower() == "dhcp" and self.network.useIPv4 is True: - ip = "DHCP" + if device.get('ipaddr').lower() == 'dhcp': + ip = 'DHCP' + elif device.get('bootproto').lower() == 'dhcp': + ip = 'DHCP' else: - prefix = str(isys.netmask2prefix(device.get("netmask"))) - ip = "%s/%s" % (device.get("ipaddr"), prefix,) + prefix = str(isys.netmask2prefix(device.get('netmask'))) + ip = "%s/%s" % (device.get('ipaddr'), prefix,) return ip def createIPV6Repr(self, device): - bootproto = device.get("bootproto") - if self.network.useIPv6 is False: + if device.get('useIPv6') is False: return _("Disabled") - if bootproto.lower() == "dhcp" and self.network.useIPv6 is True: - ip = "DHCP" + auto = device.get('ipv6_autoconf').lower() + addr = device.get('ipv6addr').lower() + pfx = device.get('ipv6prefix').lower() + + if auto == 'yes' or addr == '': + ip = 'Auto' + elif addr == 'dhcp': + ip = 'DHCP' else: - ip = "%s" % (device.get("ipv6addr"),) + ip = "%s/%s" % (addr, pfx,) return ip @@ -842,6 +562,377 @@ class NetworkWindow(InstallWindow): return box +class NetworkDeviceEditWindow: + def __init__(self, netwin): + self.netwin = netwin + self.xml = gtk.glade.XML(gui.findGladeFile('netpostconfig.glade')) + + # Pull in a ton of widgets. + self.toplevel = self.xml.get_widget("net_post_config_win") + gui.addFrame(self.toplevel) + self.button_ok = self.xml.get_widget("button_ok") + self.button_cancel = self.xml.get_widget("button_cancel") + + self.configure_dev = self.xml.get_widget("configure_dev") + self.hardware_address = self.xml.get_widget("hardware_address") + self.activate_on_boot = self.xml.get_widget("activate_on_boot") + + self.enable_ipv4 = self.xml.get_widget("enable_ipv4") + self.dhcp_ipv4 = self.xml.get_widget("dhcp_ipv4") + self.manual_ipv4 = self.xml.get_widget("manual_ipv4") + self.ipv4_address_label = self.xml.get_widget("ipv4_address_label") + self.ipv4_prefix_label = self.xml.get_widget("ipv4_prefix_label") + self.ipv4_address = self.xml.get_widget("ipv4_address") + self.ipv4_slash = self.xml.get_widget("ipv4_slash_label") + self.ipv4_prefix = self.xml.get_widget("ipv4_prefix") + + self.enable_ipv6 = self.xml.get_widget("enable_ipv6") + self.auto_ipv6 = self.xml.get_widget("auto_ipv6") + self.dhcp_ipv6 = self.xml.get_widget("dhcp_ipv6") + self.manual_ipv6 = self.xml.get_widget("manual_ipv6") + self.ipv6_address_label = self.xml.get_widget("ipv6_address_label") + self.ipv6_prefix_label = self.xml.get_widget("ipv6_prefix_label") + self.ipv6_address = self.xml.get_widget("ipv6_address") + self.ipv6_slash = self.xml.get_widget("ipv6_slash_label") + self.ipv6_prefix = self.xml.get_widget("ipv6_prefix") + + self.toplevel.connect("destroy", self.destroy) + self.button_ok.connect("clicked", self.okClicked) + self.button_cancel.connect("clicked", self.cancelClicked) + + self.enable_ipv4.connect("toggled", self.ipv4_toggled) + self.dhcp_ipv4.connect("toggled", self.ipv4_changed) + self.manual_ipv4.connect("toggled", self.ipv4_changed) + self.enable_ipv6.connect("toggled", self.ipv6_toggled) + self.auto_ipv6.connect("toggled", self.ipv6_changed) + self.dhcp_ipv6.connect("toggled", self.ipv6_changed) + self.manual_ipv6.connect("toggled", self.ipv6_changed) + + self.enable_wireless = False + self.wireless_table = self.xml.get_widget("wireless_table") + self.essid = self.xml.get_widget("essid") + self.enc_key = self.xml.get_widget("enc_key") + + self.enable_ptp = 1 + self.ptp_table = self.xml.get_widget("ptp_table") + self.ptp_address = self.xml.get_widget("ptp_ip") + + self.valid_input = 1 + + def getInputValidationResults(self): + # 1=invalid input + # 2=valid input + # 3=cancel pressed + return self.valid_input + + def show(self): + self.toplevel.show_all() + + def run(self): + self.toplevel.run() + + def close(self): + self.toplevel.destroy() + + def setTitle(self, title): + self.toplevel.set_title(_('Edit Device ') + title) + + def setDescription(self, desc): + if desc is None: + desc = _('Unknown Ethernet Device') + + self.configure_dev.set_markup("<b>" + desc[:70] + "</b>") + + def setHardwareAddress(self, mac): + if mac is None: + mac = _('unknown') + + self.hardware_address.set_markup("<b>" + _("Hardware address: ") + mac + "</b>") + + def setActiveOnBoot(self, onboot): + self.activate_on_boot.set_active(onboot) + + def isActiveOnBoot(self): + return self.activate_on_boot.get_active() + + def isWirelessEnabled(self): + return self.enable_wireless + + def isPtPEnabled(self): + return self.enable_ptp + + def showWirelessTable(self): + self.enable_wireless = True + self.wireless_table.show() + self.toplevel.resize(1, 1) + + def hideWirelessTable(self): + self.enable_wireless = False + self.wireless_table.hide() + self.toplevel.resize(1, 1) + + def showPtPTable(self): + self.enable_ptp = True + self.ptp_table.show() + self.toplevel.resize(1, 1) + + def hidePtPTable(self): + self.enable_ptp = False + self.ptp_table.hide() + self.toplevel.resize(1, 1) + + def setIPv4Manual(self, ipaddr, netmask): + if ipaddr.lower() == 'dhcp': + return + + if ipaddr is not None: + self.ipv4_address.set_text(ipaddr) + + if netmask is not None: + self.ipv4_prefix.set_text(netmask) + + def getIPv4Address(self): + return self.ipv4_address.get_text() + + def getIPv4Prefix(self): + return self.ipv4_prefix.get_text() + + def setIPv6Manual(self, ipv6addr, ipv6prefix): + if ipv6addr.lower() == 'dhcp': + return + + if ipv6addr is not None: + self.ipv6_address.set_text(ipv6addr) + + if ipv6prefix is not None: + self.ipv6_prefix.set_text(ipv6prefix) + + def getIPv6Address(self): + return self.ipv6_address.get_text() + + def getIPv6Prefix(self): + return self.ipv6_prefix.get_text() + + def setESSID(self, essid): + if essid is not None: + self.essid.set_text(essid) + + def getESSID(self): + return self.essid.get_text() + + def setEncKey(self, key): + if key is not None: + self.enc_key.set_text(key) + + def getEncKey(self): + return self.enc_key.get_text() + + def setPtP(self, remip): + if remip is not None: + self.ptp_address.set_text(remip) + + def getPtP(self): + return self.ptp_address.get_text() + + def setEnableIPv4(self, enable_ipv4): + if enable_ipv4 is True: + self.enable_ipv4.set_active(1) + elif enable_ipv4 is False: + self.enable_ipv4.set_active(0) + + def setEnableIPv6(self, enable_ipv6): + if enable_ipv6 is True: + self.enable_ipv6.set_active(1) + elif enable_ipv6 is False: + self.enable_ipv6.set_active(0) + + def selectIPv4Method(self, ipaddr): + if ipaddr.lower() == 'dhcp': + self.dhcp_ipv4.set_active(1) + elif ipaddr != "": + self.manual_ipv4.set_active(1) + + def selectIPv6Method(self, ipv6_autoconf, ipv6addr): + if ipv6_autoconf.lower() == 'yes': + self.auto_ipv6.set_active(1) + elif ipv6addr.lower() == 'dhcp': + self.dhcp_ipv6.set_active(1) + elif ipv6addr != "": + self.manual_ipv6.set_active(1) + + def isIPv4Enabled(self): + return self.enable_ipv4.get_active() + + def getIPv4Method(self): + if self.isIPv4Enabled(): + if self.dhcp_ipv4.get_active(): + return 'dhcp' + elif self.manual_ipv4.get_active(): + return 'static' + + def isIPv6Enabled(self): + return self.enable_ipv6.get_active() + + def getIPv6Method(self): + if self.isIPv6Enabled(): + if self.auto_ipv6.get_active(): + return 'auto' + elif self.dhcp_ipv6.get_active(): + return 'dhcp' + elif self.manual_ipv6.get_active(): + return 'static' + + # Basic callbacks. + def destroy(self, args): + self.toplevel.destroy() + + def okClicked(self, args): + # input validation + if not self.isIPv4Enabled() and not self.isIPv6Enabled(): + self.netwin.intf.messageWindow(_("Missing Protocol"), + _("You must select at least IPv4 " + "or IPv6 support.")) + self.valid_input = 1 + return + + if self.isIPv4Enabled(): + if self.manual_ipv4.get_active(): + try: + network.sanityCheckIPString(self.ipv4_address.get_text()) + except network.IPMissing, msg: + self.netwin.handleIPMissing('IPv4 address') + self.valid_input = 1 + return + except network.IPError, msg: + self.netwin.handleIPError('IPv4 address', msg) + self.valid_input = 1 + return + + val = self.ipv4_prefix.get_text() + if val.find('.') == -1: + # user provided a CIDR prefix + try: + if int(val) > 32 or int(val) < 0: + self.netwin.intf.messageWindow(_("Invalid Prefix"), + _("IPv4 prefix " + "must be between " + "0 and 32.")) + self.valid_input = 1 + return + else: + self.ipv4_prefix.set_text(isys.prefix2netmask(int(val))) + except: + self.netwin.handleIPMissing('IPv4 network mask') + self.valid_input = 1 + return + else: + # user provided a dotted-quad netmask + try: + network.sanityCheckIPString(self.ipv4_prefix.get_text()) + except network.IPMissing, msg: + self.netwin.handleIPMissing('IPv4 network mask') + self.valid_input = 1 + return + except network.IPError, msg: + self.netwin.handleIPError('IPv4 network mask', msg) + self.valid_input = 1 + return + + if self.isIPv6Enabled(): + if self.manual_ipv6.get_active(): + try: + network.sanityCheckIPString(self.ipv6_address.get_text()) + except network.IPMissing, msg: + self.netwin.handleIPMissing('IPv6 address') + self.valid_input = 1 + return + except network.IPError, msg: + self.netwin.handleIPError('IPv6 address', msg) + self.valid_input = 1 + return + + val = self.ipv6_prefix.get_text() + try: + if int(val) > 128 or int(val) < 0: + self.netwin.intf.messageWindow(_("Invalid Prefix"), + _("IPv6 prefix must be " + "between 0 and 128.")) + self.valid_input = 1 + return + except: + self.netwin.intf.messageWindow(_("Invalid Prefix"), + _("IPv6 prefix must be " + "between 0 and 128.")) + self.valid_input = 1 + return + + if self.isPtPEnabled(): + try: + network.sanityCheckIPString(self.ptp_address.get_text()) + except network.IPMissing, msg: + self.netwin.handleIPMissing('point-to-point IP address') + self.valid_input = 1 + return + except network.IPError, msg: + self.netwin.handleIPError('point-to-point IP address', msg) + self.valid_input = 1 + return + + # if we made it this far, all input is good + self.valid_input = 2 + + def cancelClicked(self, args): + self.valid_input = 3 + self.toplevel.destroy() + + def _setManualIPv4Sensitivity(self, sensitive): + self.ipv4_address_label.set_sensitive(sensitive) + self.ipv4_prefix_label.set_sensitive(sensitive) + self.ipv4_address.set_sensitive(sensitive) + self.ipv4_slash.set_sensitive(sensitive) + self.ipv4_prefix.set_sensitive(sensitive) + + def _setManualIPv6Sensitivity(self, sensitive): + self.ipv6_address_label.set_sensitive(sensitive) + self.ipv6_prefix_label.set_sensitive(sensitive) + self.ipv6_address.set_sensitive(sensitive) + self.ipv6_slash.set_sensitive(sensitive) + self.ipv6_prefix.set_sensitive(sensitive) + + def _setIPv4Sensitivity(self, sensitive): + self.dhcp_ipv4.set_sensitive(sensitive) + self.manual_ipv4.set_sensitive(sensitive) + + # But be careful to only set these sensitive if their corresponding + # radiobutton is selected. + if self.manual_ipv4.get_active(): + self._setManualIPv4Sensitivity(sensitive) + + def _setIPv6Sensitivity(self, sensitive): + self.auto_ipv6.set_sensitive(sensitive) + self.dhcp_ipv6.set_sensitive(sensitive) + self.manual_ipv6.set_sensitive(sensitive) + + # But be careful to only set these sensitive if their corresponding + # radiobutton is selected. + if self.manual_ipv6.get_active(): + self._setManualIPv6Sensitivity(sensitive) + + # Called when the IPv4 and IPv6 CheckButtons are modified. + def ipv4_toggled(self, args): + self._setIPv4Sensitivity(self.enable_ipv4.get_active()) + + def ipv6_toggled(self, args): + self._setIPv6Sensitivity(self.enable_ipv6.get_active()) + + # Called when the dhcp/auto/manual config RadioButtons are modified. + def ipv4_changed(self, args): + self._setManualIPv4Sensitivity(self.manual_ipv4.get_active()) + + def ipv6_changed(self, args): + self._setManualIPv6Sensitivity(self.manual_ipv6.get_active()) + + class NetworkDeviceCheckList(checklist.CheckList): def toggled_item(self, data, row): checklist.CheckList.toggled_item(self, data, row) diff --git a/loader2/net.c b/loader2/net.c index 04b954790..d66922773 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -1364,7 +1364,7 @@ int writeNetInfo(const char * fn, struct networkDeviceConfig * dev) { } else { fprintf(f, "BOOTPROTO=static\n"); - tip = &(dev->dev.ip); + tip = &(dev->dev.ipv4); inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); fprintf(f, "IPADDR=%s\n", ret); @@ -1385,6 +1385,18 @@ int writeNetInfo(const char * fn, struct networkDeviceConfig * dev) { } } + if (!dev->noipv6) { + if (dev->ipv6method == IPV6_AUTO_METHOD) { + fprintf(f, "IPV6_AUTOCONF=yes\n"); + } else if (dev->ipv6method == IPV6_DHCP_METHOD) { + fprintf(f, "IPV6ADDR=dhcp\n"); + } else { + tip = &(dev->dev.ipv6); + inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); + fprintf(f, "IPV6ADDR=%s/%d\n", ret, dev->dev.ipv6_prefixlen); + } + } + if (dev->dev.set & PUMP_NETINFO_HAS_HOSTNAME) fprintf(f, "HOSTNAME=%s\n", dev->dev.hostname); if (dev->dev.set & PUMP_NETINFO_HAS_DOMAIN) diff --git a/network.py b/network.py index 576823f9c..a589404b3 100644 --- a/network.py +++ b/network.py @@ -172,8 +172,6 @@ class Network: self.domains = [] self.isConfigured = 0 self.hostname = "localhost.localdomain" - self.useIPv4 = flags.useIPv4 - self.useIPv6 = flags.useIPv6 # if we specify a hostname and are using dhcp, do an override # originally used by the gui but overloaded now @@ -204,6 +202,10 @@ class Network: "PEERID", "ESSID", "KEY", "IPV6ADDR", "IPV6_AUTOCONF"): if info.has_key(key): self.netdevices [info["DEVICE"]].set((key, info[key])) + + self.netdevices [info["DEVICE"]].set(('useIPv4', flags.useIPv4)) + self.netdevices [info["DEVICE"]].set(('useIPv6', flags.useIPv6)) + if info.has_key("GATEWAY"): self.gateway = info["GATEWAY"] if info.has_key("DOMAIN"): @@ -212,9 +214,9 @@ class Network: self.hostname = info["HOSTNAME"] if not info.has_key("BOOTPROTO"): if not info.has_key("IPADDR"): - self.useIPv4 = False - if not info.has_key("IPV6ADDR"): - self.useIPv6 = False + self.netdevices [info["DEVICE"]].set(('useIPv4', False)) + if not (info.has_key("IPV6ADDR") and info.has_key("IPV6_AUTOCONF")): + self.netdevices [info["DEVICE"]].set(('useIPv6', False)) try: f = open("/etc/resolv.conf", "r") diff --git a/ui/netpostconfig.glade b/ui/netpostconfig.glade new file mode 100644 index 000000000..7b2aae655 --- /dev/null +++ b/ui/netpostconfig.glade @@ -0,0 +1,976 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkDialog" id="net_post_config_win"> + <property name="border_width">10</property> + <property name="width_request">550</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Edit Interface</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button_cancel"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-6</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button_ok"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="configure_dev"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Description Goes Here</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.540000021458</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">4</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="hardware_address"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Hardware address: DE:AD:00:BE:EF:00</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment13"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">10</property> + <property name="bottom_padding">5</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkCheckButton" id="activate_on_boot"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Activate on boot</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">5</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkCheckButton" id="enable_ipv4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Enable IPv4 support</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">20</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkRadioButton" id="dhcp_ipv4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Dynamic IP configuration (DHCP)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">20</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkRadioButton" id="manual_ipv4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Manual configuration</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">dhcp_ipv4</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">5</property> + <property name="left_padding">40</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">3</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkEntry" id="ipv4_address"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">16</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="ipv4_prefix"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">16</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="ipv4_slash_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">/</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">5</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="ipv4_address_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">IP Address</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="ipv4_prefix_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">Prefix (Netmask)</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">5</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkCheckButton" id="enable_ipv6"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Enable IPv6 support</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">20</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkRadioButton" id="auto_ipv6"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Automatic neighbor discovery (RFC 2461)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">20</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkRadioButton" id="dhcp_ipv6"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Dynamic IP configuration (DHCP)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">auto_ipv6</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">20</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkRadioButton" id="manual_ipv6"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Manual configuration</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">auto_ipv6</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">10</property> + <property name="left_padding">40</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkTable" id="table2"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">3</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkEntry" id="ipv6_address"> + <property name="width_request">323</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">40</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="ipv6_prefix"> + <property name="width_request">30</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">3</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="ipv6_address_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">IP Address</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="ipv6_slash_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">/</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">5</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="ipv6_prefix_label"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">Prefix</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment14"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">10</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkTable" id="wireless_table"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">10</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">ESSID:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Encryption Key:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment19"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">5</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkEntry" id="enc_key"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment20"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">5</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkEntry" id="essid"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment15"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">10</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkTable" id="ptp_table"> + <property name="visible">True</property> + <property name="n_rows">1</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Point to Point (IP):</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="alignment18"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">5</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkEntry" id="ptp_ip"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> |