YaST2 Developers Documentation: Network configuration



functions
files
intro

Network configuration

modules/NetworkModules.ycp
Hardware config manipulation (/etc/sysconfig/hardware/hwcfg-*)
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

Includes

  • network/complex.ycp
  • network/routines.ycp

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":"onboot"]

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

global Write (string devregex) -> boolean

Write modules to files

Parameters:
devregex regular expression for the module type
Return value:
true if success
Example:
  NetworkModule::Write("eth|tr");

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

local Check (string dev) -> boolean

Check presence of the module (alias)

Parameters:
dev module identifier
Return value:
true if module is present

global Select (string name) -> boolean

Select the given module

Parameters:
name
Return value:
true if success

global Add () -> boolean

Add a new module

Return value:
true if success

global Edit (string name) -> boolean

Edit the given module

Parameters:
name
Return value:
true if success

global Delete (string name) -> boolean

Delete the given module

Parameters:
name
Return value:
true if success

local Change2 (string name, map newdev, boolean check) -> boolean

Update Modules map

Parameters:
name
newdev new module map
check if check if module already exists
Return value:
true if success

global Locate (string key, string val) -> list

Locate modules of the given type and value

Parameters:
key module key
val module value
Return value:
of modules with key=val

global LocateProvider (string provider) -> boolean

Check if any module is using the specified provider

Parameters:
provider provider identification
Return value:
true if there is any

global UpdateModemSymlink () -> boolean

Update /dev/modem symlink

Return value:
true if success

global CleanHotplugSymlink () -> boolean

Clean the hotplug modules compatibility symlink, usually ifcfg-eth-pcmcia -> ifcfg-eth-pcmcia-0.

Return value:
true if success

global List (string devregex) -> list

Get modules of the given type

Parameters:
devregex
Return value:
of found modules

YaST2 Developers Documentation