YaST2 Developers Documentation: Network configuration

Network configuration

modules/NetworkModules.ycp
Hardware config manipulation (/etc/sysconfig/hardware/hwcfg-*)

This module has an unstable interface.

The new sysconfig naming is interface (eg. eth0) vs. device (eg. NE2000 card), but historically yast has called them device vs. module. This module is a big mess because originally it was intended to have similar structure to NetworkDevices, with config files categorized in two levels [type, id], but now there is just one level. Lots of code is just copied and unused.

Imports

  • Arch
  • Map
  • NetworkDevices
  • String

Global Variables

Global Functions

Local Variables

Local Functions

Info:

Current module identifier

Example
 eth0, eth1:blah, lo, ...
global Alias -> string

Alias means Driver here (think of modules.conf)

global Current -> map

Current module information

Example
 $["BOOTPROTO":"dhcp", "STARTMODE":"auto"]
local Modules -> map<string,map>

Modules information

See
ReadModules
local OriginalModules -> map<string,map>

Modules information

See
ReadModules
local Deleted -> list<string>

Deleted modules

local initialized -> boolean

True if modules are already read

global Read () -> boolean

Read modules from files

Return value:
true if sucess
local Filter (map<string,map> modules, string devregex) -> map

Parameters:
modules
devregex
local FilterNOT (map<string,map> modules, string devregex) -> map

Parameters:
modules
devregex
local MapMinus (map left, map right) -> list

One-way difference of two maps. Take away the identical items.

Parameters:
left left map
right right map
Return value:
the keys of left which are not in right or whose values are not equal in the two maps.
global Write (string devregex) -> boolean

Write modules to files And also do hwdown before and hwup after, on changed ones (#44794)

Parameters:
devregex regular expression for the module type
Return value:
true if success
Example
 NetworkModule::Write("eth|tr");
global ChangeM (string name) -> boolean

Commit data to Modules[name]

Parameters:
name hwcfg name
global Import (string devregex, map<string,map> modules) -> boolean

Import data

Parameters:
devregex
modules
Return value:
true on success
global Export (string devregex) -> map<string,map>

Export data

Parameters:
devregex
Return value:
dumped settings (later acceptable by Import())
global Modified (string devregex) -> boolean

Were the modules changed?

Parameters:
devregex
Return value:
true if modified
global List (string devregex) -> list

Get modules of the given type

Parameters:
devregex
Return value:
of found modules
global HwUp () -> boolean

Call HwUp for hardware that is not handled by hotplug (#44626) Probably obsoleted by the code in Write

global ValidCharsHwcfg () -> string

#46803: forbid "/" (filename), maybe also "-" (separator) "_" (escape)