YaST2 Developers Documentation: Network configuration

Network configuration

modules/Provider.ycp
Provider data
  • Dan Vesely
  • Petr Blahos
  • Michal Svec

This module has an unstable interface.

Used by Modem, ISDN, DSL. The provider data is grouped by country. There are predefined ones (providers.rpm) and custom ones (/etc/sysconfig/network/providers, represented here as country = "_custom")

Imports

  • HTML
  • Language
  • Map
  • String
  • Summary

Global Variables

Global Functions

Local Variables

Local Functions

global Name -> string

Current provider name

global Current -> map

Current provider structure depends on Type. See providers.rpm

global Type -> string

Current provider type

global LastCountry -> string

Last selected country

local Supported -> list<string>

Supported provider types

local Providers -> map<string,map>

Custom providers (system ones are too many and thus read on demand)

local OriginalProviders -> map<string,map>

Custom providers (initial copy)

local Countries -> list

Countries list

local Deleted -> list<string>

Deleted providers

local operation -> symbol

Pending operation (nil = none)

local initialized -> boolean

True if providers are already read

local country -> string

Country

global Modified (string type) -> boolean

Were the providers changed?

Parameters:
type
Return value:
true if modified
global Read () -> boolean

Read providers data (custom only) and country mappings

Return value:
true if success
global GetCountry () -> string

This is a single point of dependence on the Language module of yast2-country-data

local Filter (map<string,map> providers, string type) -> map

Parameters:
providers
type
local FilterNOT (map<string,map> providers, string type) -> map

Parameters:
providers
type
local CheckType (string type) -> boolean

Parameters:
type
global Write (string type) -> boolean

Write custom providers data

Parameters:
type providers the module is working with ("all"|"modem"|"isdn"|"dsl")
Return value:
true if sucess
global Import (string type, map providers) -> map

Import data

Parameters:
type
providers providers to be imported
Return value:
true on success
global Export (string type) -> map

Export data

Parameters:
type
Return value:
dumped settings (later acceptable by Import())
global SelectSystem (path name) -> boolean

Select the given system provider

Parameters:
name SCR path to the system provider
Return value:
true if success
global Select (string name) -> boolean

Select the given provider

Parameters:
name provider to select ("" for new provider, default values)
Return value:
true if success
global Add (string type) -> boolean

Add a new provider

Parameters:
type provider type (modem|isdn|dsl)
Return value:
true if success
global Edit (string name) -> boolean

Edit the given provider

Parameters:
name provider to edit
Return value:
true if success
global Delete (string name) -> boolean

Delete the given provider

Parameters:
name provider to delete
Return value:
true if success
global Commit () -> boolean

Commit pending operation

Return value:
true if success
global Clone (string name) -> boolean

Clone the given provider

Parameters:
name provider to clone
Return value:
true if success
global CloneSystem (path name) -> boolean

Clone the given system provider

Parameters:
name SCR path to system provider to clone
Return value:
true if success
local CloneProvider () -> boolean

Clone current provider

Return value:
true if success
global Overview (string type) -> list

Create an overview table with all configured providers

Parameters:
type
Return value:
table items
global Summary (string type, boolean split) -> list

Create a textual summary and a list of unconfigured providers

Parameters:
type
split split configured and unconfigured?
Return value:
summary of the current configuration
global GetCountries () -> list

Get list of countries

Return value:
for SelectionBox
global IsUnique (string name) -> boolean

Check if provider name is unique

Parameters:
name provider name
Return value:
true if OK
global ProviderType () -> string

Return current provider type

Return value:
current provider type
local FilterProviders (list provs, string type) -> list

Filter providers based on the type

Parameters:
provs list of providers
type desired type "modem"|"isdn"|"rawip"|"syncppp"|"dsl"
Return value:
of type capable providers
local SortProviders (list provs) -> list

Sorts providers alphabeticly (non-case-sensitively) and by priority. In the first step, priority and name of each provider is obtained. List of strings built from these values is created. Item lists are: "<1-character-priority><34-characters-provider-name>" This list is sorted, result is correctly sorted, by priority and alphabeticaly. I did not use builtin sort with sort code because it uses bubble sort -- it was bloody slow.

Parameters:
provs list of providers
Return value:
sorted list of providers
global GetProviders (string type, string country, string preselect) -> list

Get providers from a group (country/other)

Parameters:
type
country we want providers from this country
preselect preselect this provider
Return value:
of items for SelectionBox