
functions
files
intro
|
|
Network configuration |
modules/NetworkDevices.ycp |
Interface manipulation (/etc/sysconfig/network/ifcfg-*) |
|
|
The new sysconfig naming is interface (eg. eth0) vs. device
(eg. NE2000 card), but historically yast has called them device
vs. module.
Imports
Includes
- network/complex.ycp
- network/routines.ycp
Global Variables
Global Functions
Local Variables
Local Functions
|
|
|
Current device identifier
- Example:
-
eth0, eth1:blah, lo, ...
Add, Edit and Delete copy the requested device info (via Select)
to Name and Current,
Commit puts it back |
global Current -> map<string,any>
|
|
Current device information
- Example:
-
$["BOOTPROTO":"dhcp", "STARTMODE":"onboot"] |
local Devices -> map<string,map>
|
|
Interface information:
Devices[string type, string id] is a map with the contents of
ifcfg-type-id. Separating type from id is useful because
the type determines the fields of the interface file.
Multiple addresses for an interface are nested maps
[type, id, "_aliases", aid]
(Aliases currently do not work because ":" has changed its meaning
in ifcfg file names and it clashes with yast's internal use of it)
- See:
-
local OriginalDevices -> map<string,map>
|
|
Devices information
- See:
-
local Deleted -> list<string>
|
|
Deleted devices
local initialized -> boolean
|
|
True if devices are already read
Which operation is pending?
global CardRegex -> map<string,string>
|
|
Predefined network card regular expressions
local HotplugTypes -> list<string>
|
|
Supported hotplug types
local HotplugRegex (list<string> devs) -> string
|
|
Create a list of hot-pluggable device names for the given devices
- Parameters:
global DeviceRegex -> map<string,string>
|
|
Predefined network device regular expressions
local FastestTypes -> map<integer,string>
|
|
Types in order from fastest to slowest.
- See:
-
- See:
-
global Read () -> boolean
|
|
Read devices from files
- Return value:
local Filter (map<string,map> devices, string devregex) -> map<string,map>
|
|
- Parameters:
local FilterNOT (map<string,map> devices, string devregex) -> map
|
|
- Parameters:
global Write (string devregex) -> boolean
|
|
Write devices to files
- Parameters:
devregex |
regular expression for the device type |
- Return value:
- Example:
-
NetworkDevice::Write("eth|tr"); |
global Import (string devregex, map<string,map> devices) -> boolean
|
|
Import data
- Parameters:
- Return value:
global Export (string devregex) -> map<string,map>
|
|
Export data
- Parameters:
- Return value:
|
dumped settings (later acceptable by Import()) |
global Modified (string devregex) -> boolean
|
|
Were the devices changed?
- Parameters:
- Return value:
global GetFreeDevicesOld (string type, integer num) -> list
|
|
Compute free devices
- Parameters:
type |
device type |
num |
how many free devices return |
- Return value:
- Example:
-
GetFreeDevices("eth", 2) -> [ 1, 2 ] |
global GetFreeDevice (string type) -> string
|
|
Return free device
- Parameters:
- Return value:
- Example:
-
GetFreeDevice("eth") -> "1" |
global Check (string dev) -> boolean
|
|
Check presence of the device (alias)
- Parameters:
- Return value:
|
true if device is present |
global Select (string name) -> boolean
|
|
Select the given device
- Parameters:
- Return value:
Add a new device
- Return value:
global Edit (string name) -> boolean
|
|
Edit the given device
- Parameters:
- Return value:
global Delete (string name) -> boolean
|
|
Delete the given device
- Parameters:
- Return value:
local Change2 (string name, map newdev, boolean check) -> boolean
|
|
Update Devices map
- Parameters:
name |
|
newdev |
new device map |
check |
if check if device already exists |
- Return value:
global Locate (string key, string val) -> list<string>
|
|
Locate devices of the given type and value
- Parameters:
key |
device key |
val |
device value |
- Return value:
global LocateNOT (string key, string val) -> list<string>
|
|
Locate devices of the given type and value
- Parameters:
key |
device key |
val |
device value |
- Return value:
global LocateProvider (string provider) -> boolean
|
|
Check if any device is using the specified provider
- Parameters:
provider |
provider identification |
- Return value:
global UpdateModemSymlink () -> boolean
|
|
Update /dev/modem symlink
- Return value:
global CleanHotplugSymlink () -> boolean
|
|
Clean the hotplug devices compatibility symlink,
usually ifcfg-eth-pcmcia -> ifcfg-eth-pcmcia-0.
- Return value:
global List (string devregex) -> list<string>
|
|
Get devices of the given type
- Parameters:
- Return value:
global Fastest () -> string
|
|
Find the fastest available device
global HasAliases (string name) -> boolean
|
|
Check if the given device has any virtual alias.
- Parameters:
- Return value:
|
true if there are some aliases |
DSL needs to save its config while the underlying network card is
being configured.
|