YaST2 Developers Documentation: Configuration of ntp-client

Configuration of ntp-client

modules/NtpClient.ycp
Data for configuration of ntp-client, input and output functions.

This module has an unstable interface.

Representation of the configuration of ntp-client. Input and output routines.

Imports

  • Directory
  • Message
  • Mode
  • NetworkDevices
  • PackageSystem
  • Progress
  • Report
  • SLP
  • Service
  • SuSEFirewall
  • Summary

Structures

Global Variables

Global Functions

Local Variables

Local Functions

Info:

Abort function return boolean return true if abort

global modified -> boolean

Data was modified?

global write_only -> boolean

Write only, used during autoinstallation. Don't run services and SuSEconfig, it's all done at one place.

global ntp_records -> list<map<string, any> >

Read all ntp-client settings

Return value:
true on success
global run_service -> boolean

Should the daemon be started when system boots?

global service_name -> string

Service name of the NTP daemon

global run_chroot -> boolean

Should the daemon be started in chroot environment?

global config_dhcp -> boolean

NTP servers will be configured via DHCP

global original_config_dhcp -> boolean

NTP servers will be configured via DHCP - value got while reading

global selected_index -> integer

Index of the currently sellected item

global selected_record -> map<string,any>

The currently sellected item

global required_packages -> list

Required packages

global firewall_services -> list<string>

ports in firewall to open

local ntp_servers -> map<string,map<string,string> >

List of known NTP servers server -> information

local country_names -> map<string,string>

Mapping between country codes and country names ("CZ" -> "Czech Republic")

local Abort () -> boolean

Abort function

Return value:
blah blah lahjk
global GetAllKnownCountries () -> map <string, string>

Reads and returns all known countries with their country codes

Structure $[

   "CL" : "Chile",
   "FR" : "France",
   ...
 ]
Return value:
of known contries
global GetNtpServers () -> map<string, map<string,string> >

Get the list of known NTP servers

Return value:
a list of known NTP servers
global GetCountryNames () -> map<string, string>

Get the mapping between country codea and names ("CZ" -> "Czech Republic")

Return value:
a map the country codes and names mapping
global Read () -> boolean

Read all ntp-client settings

Return value:
true on success
global GetUsedNtpServers () -> list <string>

Function returns list of NTP servers used in the configuration.

Return value:
of servers
global random_pool_servers -> list <string>

List of servers defined by the pool.ntp.org to get random ntp servers

global IsRandomServersServiceEnabled () -> boolean

Checks whether all servers listed in the random_pool_servers list are used in the configuration.

Return value:
true if enabled
global DeActivateRandomPoolServersFunction () -> void

Removes all servers contained in the random_pool_servers list from the current configuration.

global ActivateRandomPoolServersFunction () -> void

Add servers needed for random_pool_servers function into the current configuration.

global Write () -> boolean

Write all ntp-client settings

Return value:
true on success
global Import (map settings) -> boolean

Get all ntp-client settings from the first parameter (For use by autoinstallation.)

Parameters:
settings The YCP structure to be imported.
Return value:
True on success
global Export () -> map

Dump the ntp-client settings to a single map (For use by autoinstallation.)

Return value:
Dumped settings (later acceptable by Import ())
global Summary () -> string

Create a textual summary and a list of unconfigured cards

Return value:
summary of the current configuration
global TestNtpServer (string server, boolean silent) -> boolean

Test if specified NTP server answers

Parameters:
server string host name or IP address of the NTP server
silent boolean don't report the result of the detection
Return value:
true if NTP server answers properly
global DetectNtpServers (symbol method) -> list<string>

Detect NTP servers present in the local network

Parameters:
method symbol method of the detection (only `slp suported ATM)
Return value:
a list of found NTP servers
global getSyncRecords () -> list<map<string,any> >

Get the list of synchronization-related records

Return value:
a list of maps with keys type (eg. "server"), address and index.
global selectSyncRecord (integer index) -> boolean

Select synchronization record

Parameters:
index integer, -1 for creating a new record
Return value:
true on success
global findSyncRecord (string type, string address) -> integer

Find index of synchronization record

Parameters:
type string record type
address string address
Return value:
index of the record if found, -1 otherwise
global storeSyncRecord () -> boolean

Store currently sellected synchronization record

Return value:
true on success
global deleteSyncRecord (integer index) -> boolean

Delete specified synchronization record

Parameters:
index integer index of record to delete
Return value:
true on success
global AutoPackages () -> map

Return required packages for auto-installation

Return value:
of packages to be installed and to be removed