YaST2 Developers Documentation: Configuration of ntp-client

Configuration of ntp-client

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

This module has an unstable interface.

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

Imports

  • Directory
  • FileChanges
  • FileUtils
  • Language
  • Message
  • Mode
  • NetworkInterfaces
  • PackageSystem
  • Popup
  • Progress
  • Report
  • SLPAPI
  • Service
  • Stage
  • String
  • 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 synchronize_time -> boolean

Should the time synchronized periodicaly?

global sync_interval -> integer

The interval of synchronization in minutes.

global cron_file -> string

The cron file name for the synchronization.

global service_name -> string

Service name of the NTP daemon

global run_chroot -> boolean

Should the daemon be started in chroot environment?

global ntp_policy -> string

Netconfig policy: for merging and prioritizing static and DHCP config. FIXME get a public URL https://svn.suse.de/svn/sysconfig/branches/mt/dhcp6-netconfig/netconfig/doc/README

global selected_index -> integer

Index of the currently sellected item

global selected_record -> map<string,any>

The currently sellected item

global ad_controller -> string

Active Directory controller

global change_firewall -> boolean

Should the firewall settings be changed?

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 address -> information address: the key repeated country: CC (uppercase) location: for displaying ...: (others are unused)

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 GetCurrentLanguageCode () -> string

Read current language (RC_LANG from sysconfig)

Return value:
two-letter language code (cs_CZ.UTF-8 -> CZ)
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 GetNtpServersByCountry (string country, boolean terse_output) -> list

Get list of public NTP servers for a country

Parameters:
country two-letter country code
terse_output display additional data (location etc.)
Return value:
of servers (usable as combo-box items)
global ProcessNtpConf () -> boolean

Read and parse /etc.ntp.conf

Return value:
true on success
global ReadSynchronization () -> boolean

Read the synchronization status, fill synchronize_time and sync_interval variables Return updated value of synchronize_time

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

See
http://www.pool.ntp.org/
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, symbol verbosity) -> boolean

Test if specified NTP server answers

Parameters:
server string host name or IP address of the NTP server
verbosity `no_ui: ..., `transient_popup: pop up while scanning, `result_popup: also final pop up about the result
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 enableOptionInSyncRecord (string option) -> void

Ensure that selected_record["options"] contains the option. (A set operation in a string)

Parameters:
option
global AutoPackages () -> map

Return required packages for auto-installation

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