Interface manipulation (/etc/sysconfig/network/ifcfg-*)
List of Global Functions
Add - Add a new device
CanonicalizeIP - Canonicalize netmask data (#46885) Sysconfig allows: IPADDR=10.0.0.1/8 IPADDR=10.0.0.1 PREFIXLEN=8 IPADDR=10.0.0.1 NETMASK=255.0.0.0 (IPADDR overrides PREFIXLEN, NETMASK used only if prefix length unspecified) If prefix length and NETMASK are unspecified, 32 is implied. Canonicalize it to IPADDR=10.0.0.1 PREFIXLEN= NETMASK=255.0.0.0
CanonicalizeStartmode - STARTMODE: onboot, on and boot are aliases for auto
Check - Check presence of the device (alias)
CleanCacheRead - re-read all settings again from system for creating new proposal from scratch (#170558)
CleanHotplugSymlink - Clean the hotplug devices compatibility symlink, usually ifcfg-eth-pcmcia -> ifcfg-eth-pcmcia-0.
ConcealSecrets - Conceal secret information, such as WEP keys, so that the output can be passed to y2log and bugzilla. (#65741)
ConcealSecrets1 - Conceal secret information, such as WEP keys, so that the output can be passed to y2log and bugzilla.
Delete - Delete the given device
DeleteAlias - Add the alias to the list of deleted items. Called when exiting from the aliases-of-device dialog. #48191
Edit - Edit the given device
Export - Export data
Fastest - Find the fastest available device
FilterDevices - Used in BuildSummary, BuildOverview
GetDevTypeDescription - Return textual device type
GetDeviceType - Return device type in human readable form :-)
GetDeviceTypes - Return supported network device types (for type netcard) for this hardware
GetFreeDevice - Return free device
GetFreeDevicesOld - Compute free devices
GetIP - get IP addres + additional IP addresses
HasAliases - Check if the given device has any virtual alias.
Import - Import data
IsConnected - Test whether device is connected (Link:up) The info is taken from sysfs
IsHotplug - Test hotplugability of a device
List - Get devices of the given type
ListDevicesExcept - list of all devices except given one by parameter dev also loopback is ommited
Locate - Locate devices of the given type and value
LocateNOT - Locate devices of the given type and value
LocateProvider - Check if any device is using the specified provider
Modified - Were the devices changed?
Push - DSL needs to save its config while the underlying network card is being configured.
Read - Read devices from files
RealType - Return real type of the device (incl. PCMCIA, USB, ...)
Select - Select the given device
UpdateModemSymlink - Update /dev/modem symlink
ValidCharsIfcfg - #46803: forbid "/" (filename), maybe also "-" (separator) "_" (escape)
Write - Write devices to files
alias_name - Create a alias name from its type and numbers
alias_num - Return a device alias number
device_name - Create a device name from its type and number
device_num - Return a device number
device_type - Return a device type
List of Global Variables
CardRegex - Predefined network card regular expressions
Current - Current device information
DeviceRegex - Predefined network device regular expressions
Name - Current device identifier
report_every_check - False suppresses tones of logs 'NetworkInterfaces.ycp:ABC Check(eth,id-00:aa:bb:cc:dd:ee,)'
Canonicalize netmask data (#46885) Sysconfig allows: IPADDR=10.0.0.1/8 IPADDR=10.0.0.1 PREFIXLEN=8 IPADDR=10.0.0.1 NETMASK=255.0.0.0 (IPADDR overrides PREFIXLEN, NETMASK used only if prefix length unspecified) If prefix length and NETMASK are unspecified, 32 is implied. Canonicalize it to IPADDR=10.0.0.1 PREFIXLEN= NETMASK=255.0.0.0
Function parameters
map<string, any> ifcfg
Return value
map<string, any> - the map with IPADDR, NETMASK adjusted; PREFIXLEN "" others unchanged. If IPADDR is empty, return the original.
STARTMODE: onboot, on and boot are aliases for auto
Function parameters
map<string, any> ifcfg
Return value
map<string, any>
Check presence of the device (alias)
Function parameters
string dev
Return value
boolean - true if device is present
re-read all settings again from system for creating new proposal from scratch (#170558)
Return value
boolean
Clean the hotplug devices compatibility symlink, usually ifcfg-eth-pcmcia -> ifcfg-eth-pcmcia-0.
Return value
boolean - true if success
Conceal secret information, such as WEP keys, so that the output can be passed to y2log and bugzilla. (#65741)
Function parameters
map devs
Return value
map - ifcfgs with secret fields masked out
Conceal secret information, such as WEP keys, so that the output can be passed to y2log and bugzilla.
Function parameters
map<string, any> ifcfg
Return value
map - ifcfg with secret fields masked out
Delete the given device
Function parameters
string name
Return value
boolean - true if success
Add the alias to the list of deleted items. Called when exiting from the aliases-of-device dialog. #48191
Function parameters
string device
string aid
Return value
boolean
Edit the given device
Function parameters
string name
Return value
boolean - true if success
Export data
Function parameters
string devregex
Return value
map<string,map> - dumped settings (later acceptable by Import())
Used in BuildSummary, BuildOverview
Function parameters
string devregex
Return value
map<string,map>
Return textual device type
Function parameters
string type
boolean longdescr
Return value
string - textual form of device type
Example 26.
GetDevTypeDescription("eth", false) -> "Ethernet" GetDevTypeDescription("eth", true) -> "Ethernet Network Card"
Return device type in human readable form :-)
Function parameters
string dev
Return value
string - device type
Example 27.
GetDeviceType(eth-bus-pci-0000:01:07.0) -> "Network Card" GetDeviceType(modem0) -> "Modem"
Return supported network device types (for type netcard) for this hardware
Return value
list<string>
Return free device
Function parameters
string type
Return value
string - free device
Compute free devices
Function parameters
string type
integer num
Return value
list - num of free devices
get IP addres + additional IP addresses
Function parameters
string device
Return value
list<string> - of IP addresses of selected interface
Check if the given device has any virtual alias.
Function parameters
string name
Return value
boolean - true if there are some aliases
Import data
Function parameters
string devregex
map<string,map> devices
Return value
boolean - true on success
Test whether device is connected (Link:up) The info is taken from sysfs
Function parameters
string dev
Return value
boolean - true if connected
Test hotplugability of a device
Function parameters
string type
Return value
boolean - true if hotpluggable
Get devices of the given type
Function parameters
string devregex
Return value
list<string> - of found devices
list of all devices except given one by parameter dev also loopback is ommited
Function parameters
string dev
Return value
list<string>
Locate devices of the given type and value
Function parameters
string key
string val
Return value
list<string> - of devices with key=val
Locate devices of the given type and value
Function parameters
string key
string val
Return value
list<string> - of devices with key!=val
Check if any device is using the specified provider
Function parameters
string provider
Return value
boolean - true if there is any
Were the devices changed?
Function parameters
string devregex
Return value
boolean - true if modified
DSL needs to save its config while the underlying network card is being configured.
Return value
void
Return real type of the device (incl. PCMCIA, USB, ...)
Function parameters
string type
string hotplug
Return value
string - real type
Select the given device
Function parameters
string name
Return value
boolean - true if success
#46803: forbid "/" (filename), maybe also "-" (separator) "_" (escape)
Return value
string
Write devices to files
Function parameters
string devregex
Return value
boolean - true if success
Create a alias name from its type and numbers
Function parameters
string typ
string num
string anum
Return value
string - alias name
Return a device alias number
Function parameters
string dev
Return value
string - alias number
Create a device name from its type and number
Function parameters
string typ
string num
Return value
string - device name
Return a device number
Function parameters
string dev
Return value
string - device number