YaST2 Developers Documentation: Network configuration

Network configuration

modules/Host.ycp
Hosts data (/etc/hosts)
  • Michal Svec

This module has an unstable interface.

Imports

  • Hostname
  • String
  • Summary

Includes

  • network/routines.ycp

Global Variables

Global Functions

Local Variables

global hosts -> map<string, list<string> >

All hosts See hosts(5) keys: IPs, (But #35671 suggests that repeating IPs is valid) values: names, the first one is the canonical one

global modified -> boolean

Data was modified?

local hosts_init -> map<string,any>

All hosts read at the start

local hosts_file -> string

"hosts" file location

global write_only -> boolean

Only write configuration

global Read () -> boolean

Read hosts settings

Return value:
true if success
global Write () -> boolean

Write hosts settings and apply changes

Return value:
true if success
global Import (map settings) -> boolean

Get all the Hosts configuration from a map. When called by hosts_auto (preparing autoinstallation data) the map may be empty.

Parameters:
settings autoinstallation settings
Return value:
true if success
global Export () -> map

Dump the Hosts settings to a map, for autoinstallation use.

Return value:
autoinstallation settings
global GetSystemHosts () -> list

Return "system" predefined hosts (should be present all the time)

Return value:
of system hosts
global Update (string oldhn, string newhn, list<string> iplist) -> boolean

Update hosts according to the current hostname (only one hostname, assigned to all IPs)

Parameters:
oldhn
newhn
iplist localhost IP addresses
Return value:
true if success
global Summary () -> string

Create summary

Return value:
summary text
global GetModified () -> boolean

Function which returns if the settings were modified

Return value:
settings were modified
global SetModified () -> void

Function sets internal variable, which indicates, that any settings were modified, to "true"