MCPcopy Create free account
hub / github.com/aws/clock-bound / feed_ntp_source

Method feed_ntp_source

clock-bound/src/daemon/clock_sync_algorithm.rs:160–172  ·  view source on GitHub ↗

Feed event into ntp source

(
        ntp_sources: &mut [source::NtpSource],
        sender_address: SocketAddr,
        event: event::Ntp,
    )

Source from the content-addressed store, hash-verified

158
159 /// Feed event into ntp source
160 fn feed_ntp_source(
161 ntp_sources: &mut [source::NtpSource],
162 sender_address: SocketAddr,
163 event: event::Ntp,
164 ) -> Option<(&ClockParameters, SourceInfo)> {
165 // associated method to help borrow checker
166 let stratum = event.data().stratum;
167 ntp_sources
168 .iter_mut()
169 .find(|source| source.socket_address() == sender_address)
170 .and_then(|source| source.feed(event))
171 .map(|params| (params, SourceInfo::NtpSource(sender_address, stratum)))
172 }
173
174 /// Feed event into the phc
175 fn feed_phc(

Callers

nothing calls this directly

Calls 4

NtpSourceClass · 0.85
socket_addressMethod · 0.80
dataMethod · 0.45
feedMethod · 0.45

Tested by

no test coverage detected