blob: 4b7391830daf80c87f3259043b140ab763aadf0d [file]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
include: [
"//src/connectivity/network/lib/net_interfaces/client.shard.cml",
"//src/lib/fuchsia-hyper/hyper.shard.cml",
"inspect/client.shard.cml",
"syslog/client.shard.cml",
],
program: {
runner: "elf",
binary: "bin/httpsdate_time_source",
},
capabilities: [
{
protocol: [
"fuchsia.time.external.PullSource",
"fuchsia.time.external.PushSource",
],
},
],
use: [
{
protocol: [ "fuchsia.metrics.MetricEventLoggerFactory" ],
from: "parent",
},
{
directory: "root-ssl-certificates",
rights: [ "r*" ],
path: "/config/ssl",
},
{
// If 'true', use a fake sampler that returns a constant time sample.
config: "fuchsia.time.config.HttpsdateUseFakeSampler",
key: "use_fake_sampler",
type: "bool",
availability: "optional",
default: false,
},
{
// The endpoint URL for querying time information. The HTTPS time source
// uses the time reported in HTTPS responses to estimate current time.
// None of the other approaches such as NTP are acceptable for Fuchsia
// products in general.
//
// URI used to obtain time samples.
config: "fuchsia.time.config.TimeSourceEndpointUrl",
key: "time_source_endpoint_url",
type: "string",
max_size: 1024,
availability: "optional",
default: "https://clients3.google.com/generate_204",
},
{
// HTTPS request is considered failed after the timeout.
//
// Currently based on a best guess.
config: "fuchsia.time.config.HttpsTimeoutSec",
key: "https_timeout_sec",
type: "uint8",
availability: "optional",
default: 10,
},
{
// The ratio between a standard deviation and a final bound size, expressed as a percentage.
config: "fuchsia.time.config.StandardDeviationBoundPercentage",
key: "standard_deviation_bound_percentage",
type: "uint8",
availability: "optional",
default: 30,
},
{
// How many times longer than a subsequent poll the first poll will take. This encapsulates
// the additional time required during the first HTTPS request to setup a TLS connection and
// is used to make a best guess for how long the second call will take.
//
// This value is based on a best guess how many times longer than a subsequent poll the first
// poll will take.
config: "fuchsia.time.config.FirstRttTimeFactor",
key: "first_rtt_time_factor",
type: "uint16",
availability: "optional",
default: 5,
},
{
// If enabled, `fuchsia.time.external.PullSource` is provided instead of
// `fuchsia.time.external.PushSource`.
config: "fuchsia.time.config.HttpsdateUsePullApi",
key: "use_pull_api",
type: "bool",
availability: "optional",
default: true,
},
{
// Max number fetch attempts for `fuchsia.time.external.Urgency.Low`.
config: "fuchsia.time.config.MaxAttemptsUrgencyLow",
key: "max_attempts_urgency_low",
type: "uint32",
availability: "optional",
default: 3,
},
{
// Number of polls per sample for `fuchsia.time.external.Urgency.Low`.
//
// As per estimations, increasing further wouldn't bring sizeable benefits.
config: "fuchsia.time.config.NumPollsUrgencyLow",
key: "num_polls_urgency_low",
type: "uint32",
availability: "optional",
default: 7,
},
{
// Max number fetch attempts for `fuchsia.time.external.Urgency.Medium`.
config: "fuchsia.time.config.MaxAttemptsUrgencyMedium",
key: "max_attempts_urgency_medium",
type: "uint32",
availability: "optional",
default: 3,
},
{
// Number of polls per sample for `fuchsia.time.external.Urgency.Medium`.
//
// Fastest sample that gives a bound size within desired target range based on a typical
// oscillator tolerance.
config: "fuchsia.time.config.NumPollsUrgencyMedium",
key: "num_polls_urgency_medium",
type: "uint32",
availability: "optional",
default: 5,
},
{
// Max number fetch attempts for `fuchsia.time.external.Urgency.High`.
config: "fuchsia.time.config.MaxAttemptsUrgencyHigh",
key: "max_attempts_urgency_high",
type: "uint32",
availability: "optional",
default: 3,
},
{
// Number of polls per sample for `fuchsia.time.external.Urgency.High`.
//
// Fastest possible sample that gives an acceptable worst case slew duration.
config: "fuchsia.time.config.NumPollsUrgencyHigh",
key: "num_polls_urgency_high",
type: "uint32",
availability: "optional",
default: 3,
},
{
// If 'true', this time source is a "monitor" that is only used to verify
// primary time source correctness. It does not escrow its inspect data.
config: "fuchsia.time.config.IsMonitorTimeSource",
key: "is_monitor_time_source",
type: "bool",
availability: "optional",
default: false,
},
],
expose: [
{
protocol: [
"fuchsia.time.external.PullSource",
"fuchsia.time.external.PushSource",
],
from: "self",
},
],
}