YaST2 Developers Documentation: Network configuration

Network configuration

include/network/services/dns.ycp
Hostname and DNS setup dialog

This module has an unstable interface.

Imports

  • CWM
  • DNS
  • GetInstArgs
  • Hostname
  • IP
  • Label
  • Lan
  • NetworkConfig
  • NetworkService
  • Popup

Includes

  • network/routines.ycp
  • network/widgets.ycp

Local Variables

Local Functions

local has_dhcp -> boolean

If we know that there are no interfaces with DHCP, we can disable the check boxes. Each dialog must set this variable. HostnameDialog does not know yet whether we will have DHCP so it assumes yes. DNSMainDialog can query Lan::.

local resolver_modifiable -> boolean

If there's a process modifying resolv.conf, we warn the user before letting him change things that will be overwritten anyway. See also #61000.

local hn_settings -> map

CWM buffer for both dialogs. Note that NAMESERVERS and SEARCHLIST are lists and their widgets are suffixed.

local NonEmpty (list<string> l) -> list<string>

Parameters:
l list of strings
Return value:
only non-empty items
local InitSettings () -> map

Return value:
initial settings for this dialog in one map, from DNS::
local StoreSettings (map settings) -> void

Parameters:
settings map of settings to be stored to DNS::
local InitHnWidget (string key) -> void

Default function to init the value of a widget. Used for push buttons.

Parameters:
key id of the widget
local StoreHnWidget (string key, map event) -> void

Default function to store the value of a widget.

Parameters:
key id of the widget
event the event being handled
local HandleDhcpHostname (string key, map event) -> symbol

Event handler for DHCP_HOSTNAME checkbox. enable or disable: is DHCP available?

Parameters:
key the widget receiving the event
event the event being handled
Return value:
nil so that the dialog loops on
local HandleDhcpResolv (string key, map event) -> symbol

Event handler for DHCP_RESOLV checkbox. enable or disable: is DHCP available and not used now? HUH?!

Parameters:
key the widget receiving the event
event the event being handled
Return value:
nil so that the dialog loops on
local HandleResolverData (string key, map event) -> symbol

Event handler for resolver data (nameservers, searchlist) enable or disable: is DHCP available?

Parameters:
key the widget receiving the event
event the event being handled
Return value:
nil so that the dialog loops on
local ValidateHostname (string key, map event) -> boolean

Validator for hostname, no_popup

Parameters:
key the widget being validated
event the event being handled
Return value:
whether valid
local ValidateDomain (string key, map event) -> boolean

Validator for domain name, no_popup

Parameters:
key the widget being validated
event the event being handled
Return value:
whether valid
local ValidateSearchList (string key, map event) -> boolean

Validator for the search list

Parameters:
key the widget being validated
event the event being handled
Return value:
whether valid
local ModifyResolvConfPopup () -> boolean

If there's running a process modifying resolv.conf, present a wanrning popup and return the result.

Return value:
true if resolv.conf should be modified (ie. no process running, or user decided to do so)
local DNSMainDialog (boolean standalone) -> any

Dialog for querying DNS & hostname info

Parameters:
standalone true if not run from another ycp client
Return value:
user input