genode/repos/libports/src/app/sntp_client
Christian Helmuth 2eb8c5e21a net: move ascii_to() into Net namespace
The combination of Net::Mac_address and
Genode::ascii_to(Net::Mac_address) required shaky quirks in several
places because GCC is not able to resolve the ascii_to overload if
base/xml_node.h was included to early. The current solution moves the
several ascii_to overloads "closer" to the Net types by putting them
into the Net namespace, where GCC reliably picks them up.

Hence, co-locating the ascii_to() utility with the overload type in the
same scope/namespace is good practice.

This patch removes the now obsolete <nic/xml_node.h> header file.
2020-09-17 10:13:22 +02:00
..
config.xsd sntp_client: improve README, clean source code 2019-08-28 14:21:36 +02:00
dhcp_client.cc sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
dhcp_client.h sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
ipv4_address_prefix.cc sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
ipv4_address_prefix.h net: move ascii_to() into Net namespace 2020-09-17 10:13:22 +02:00
ipv4_config.cc sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
ipv4_config.h sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
main.cc sntp_client: improve README, clean source code 2019-08-28 14:21:36 +02:00
nic.cc sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
nic.h sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
protocol.h sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
README sntp_client: improve README, clean source code 2019-08-28 14:21:36 +02:00
target.mk sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
xml_node.cc sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
xml_node.h sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00

The 'sntp_client' component periodically requests the current time from a
given SNTP server and reports it as GMT in a format that can also be used
to re-program Genodes RTC driver.


Configuration
~~~~~~~~~~~~~

This is an example configuration of the component with a static IP config,
an individual request interval, and debugging output enabled:

! <config interface="10.0.0.72/24"
!         gateway="10.0.0.1"
!         dst_ip="10.0.0.24"
!         period_min="10"
!         verbose="yes" />


This is an example configuration of the component with DHCP:

! <config dst_ip="10.0.0.24" />


This is a short description of the tags and attributes:

:config.interface:
  Optional. Determined via DHCP if not configured. IP address and subnet of
  the component. If not set, the component requests and maintains the IP
  configuration via DHCP.

:config.gateway:
  Optional. Determined via DHCP if not configured. IP address of the gateway
  of the IP subnet.

:config.dst_ip:
  Mandatory. IP address of the SNTP server.

:config.period_min:
  Optional. Default is 60. Length of request interval in minutes.

:config.verbose:
  Optional. Default is "false". Toggles wether the component shall log
  debugging information.


Sessions
~~~~~~~~

This is an overview of the sessions required and provided by the
component apart from the environment sessions:

* One Timer session.
* One Report session with label 'set_rtc'.


Report 'set_rtc' provided by the component
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is an example content of the report:

! <set_rtc year="2018"
!          month="11"
!          day="27"
!          hour="22"
!          minute="45"
!          second="32" />

The format of the report is exactly what is expected by the Genode RTC driver.
The time is given as GMT in 24H mode, leap seconds considered, but without
taking the round trip time between SNTP server and client in account.


Examples
~~~~~~~~

An example of how to use the component can be found in the test script
'libports/run/sntp_client.run' and 'os/run/ping_nic_router.run'.