YaST2 Developers Documentation: Network configuration

Network configuration

include/network/complex.ycp
Summary and overview functions
  • Michal Svec

This module has an unstable interface.

Imports

  • HTML
  • NetHwDetection
  • NetworkInterfaces
  • NetworkService
  • Popup
  • Provider
  • String
  • Summary

Includes

  • network/routines.ycp
  • network/summary.ycp

Local Functions

local BuildDescription (string devtype, string devnum, map devmap, list<map> Hardware) -> string

Used for initializing the description variable (ifcfg[NAME]) The code is mostly moved from BuildSummaryDevs Take the NAME field from ifcfg If empty, identify the hardware and use its data

Parameters:
devtype
devnum
devmap
Hardware
local BuildSummaryDevs (map<string,map> Devs, list<map> Hardware, boolean split, boolean link) -> list<any>

Build textual summary

Parameters:
Devs
Hardware
split split configured and unconfigured?
link add a link to configure the device (only if !split)
Return value:
[ configured, unconfigured ] if split, [ summary, links ] otherwise
local BuildSummary (string devregex, list<map> Hardware, boolean split, boolean link) -> list<any>

Build textual summary

Parameters:
devregex
Hardware
split split configured and unconfigured?
link add a link to configure the device (only if !split)
Return value:
[ configured, unconfigured ] if split, [ summary, links ] otherwise
local CheckEmptyName (string devtype, string hwname) -> string

Fill in sensible string if the name is empty

Parameters:
devtype device type
hwname device name
Return value:
hwname if not empty, "Unknown device" otherwise
local HardwareName (list<map> Hardware, string id) -> string

Return a human readable hardware name for device with given id

Parameters:
Hardware hardware map
id id-..., bus-...-..., or unique
Return value:
hardware name
local ProviderName (string provider) -> string

Get aprovider name from the provider map

Parameters:
provider identifier
Return value:
provider name
Example
 ProviderName("tonline") -> "T-Online"
local DeviceStatus (string devtype, string devname, map devmap) -> string

Return the textual device status

Parameters:
devtype device type
devname
devmap map with devices settings
Return value:
text wth device status
local DeviceProtocol (map devmap) -> string

Return the device protocol or IP address in case of static config Or indicate that NetworkManager takes over.

Parameters:
devmap device map
Return value:
textual device protocol
local getConnMacBusDescription (map v, list<map> Hardware) -> string

Return description used for device summary dialog In case device is not connected "(not connected)" string will be added. Description also contains MAC address or BusID information.

Parameters:
v
Hardware
local BuildOverviewDevs (map<string,map> Devs, list<map> Hardware) -> list

Create overview table contents List of terms `item (`id (id), ...)

Parameters:
Devs
Hardware
Return value:
table items
local BuildOverview (string devregex, list<map> Hardware) -> list

Create overview table contents

Parameters:
devregex
Hardware
Return value:
table items
local BuildUnconfiguredCommon (list sum, string class) -> list<map<string,any> >

Convert the output of BuildSummary for inclusion in the unified device list. Called by BuildUnconfigured and BuildUnconfiguredDevs.

Parameters:
sum output of BuildSumary
class netcard modem dsl, isdn too; determines how to arrange output, yuck
Return value:
[ $[id, table_descr, rich descr] ]
local BuildUnconfiguredDevs (map<string,map> Devs, string class, list<map> Hardware) -> list<map<string,any> >

Parameters:
Devs configured devices
class netcard modem dsl, isdn too
Hardware the detected hardware
Return value:
[ $[id, table_descr, rich descr] ]
local BuildUnconfigured (string class, list<map> Hardware) -> list<map<string,any> >

Parameters:
class netcard modem dsl. not isdn because it does not use NetworkInterfaces (#103073)
Hardware the detected hardware
Return value:
[ $[id, table_descr, rich descr] ]