summaryrefslogtreecommitdiff
path: root/src/ntp.c
AgeCommit message (Collapse)AuthorFilesLines
2015-08-07Base Code merged to SPIN 2.4submit/tizen/20150810.034432hyunuktak1-0/+2
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com> Change-Id: I84a42375b5c59739e4caca1f726699ea7647ef17
2014-07-17Imported Upstream version 1.24upstream/1.24Zhang zhengguang1-24/+61
2012-10-01ntp: Calculate transmit time from receive time and monotonic deltaPatrik Flykt1-6/+13
Calculate transmit time used in NTP as the reception time minus the delta of the monotonic receive and transmit times. When calculated this way, it does not matter if the time happens to be set to something else between the sending and receiving of the NTP packet. On sending the added monotonic time and the previous transmit time are saved at the same point in time. On reception the monotonic time is evaluated after the packet has been received by ConnMan. This is in contrast to the actual reception wall clock time which is added by the kernel. The difference between the reception times on a normal system is about 100µs, which is neglible.
2012-07-17ntp: Retry a given server address multiple times before falling backGrant Erickson1-21/+45
This patch causes the internal NTP client to retry a given server address up to three times (four total attempts) at a two second interval before falling back to another server name or server address.
2012-07-17ntp: Use mnemonic when specifying the request precisionGrant Erickson1-0/+7
This patch uses a mnemonic to specify the request precision and also adds a comment how a future implementation might pass along the actual system wall clock precision.
2012-07-17ntp: Add mnemonics for common clock precisionsGrant Erickson1-0/+7
2012-07-17ntp: Use mnemonics when checking reply flagsGrant Erickson1-1/+13
Use mnemonics when checking reply flags and print out information in debug mode about why the reply flags were rejected.
2012-07-17ntp: Specify leap-not-in-sync in flagsGrant Erickson1-1/+1
This patch sets the non-in-sync flag of the leap subfield of the packet flags field. This reflects behavior implemented by ntpdate or ntpd in one-shot mode.
2012-07-17ntp: Send a transmit time value that reflects current system timeGrant Erickson1-2/+3
This sets the ntp request packet transmit time to the current system time to reflect behavior implemented by ntpdate and ntpd in one-shot mode.
2012-07-17ntp: Use mnemonics rather than magic numbersGrant Erickson1-1/+1
Convert a magic number into equivalent mnemonics for the flags (leap, version, mode) packet field.
2012-07-17ntp: Add mnemonics for the flags (leap, version, mode) packet fieldGrant Erickson1-0/+30
2012-07-16ntp: If the server cannot be contacted, try next oneJukka Rissanen1-1/+6
This could happen if the network routes are not yet setup so the sendto() could fail. In this case try next address and hope for the best. This is a rare issue but I have seen it couple of times.
2012-05-31ntp: Log the time slew deltaGrant Erickson1-0/+2
2012-04-29core: Update copyright informationMarcel Holtmann1-1/+1
2012-04-05ntp: Shorten NTP failure delayAlok Barsode1-2/+2
If the NTP server failed to respond, NTP client wait for 16 seconds before trying the next server. But since now we have the default gateway as a possible candidate for NTP (which has higher priority over global timeaservers), there might be a chance that it might fail to respond to a NTP query (e.g a wifi router without ntp support). We have to wait for 16 sec, untill NTP switches to the next server. This seems like a long period, especially if you made timezone changes and you want the NTP sync to happen asap. Hence reducing this timeout to 5 seconds.
2012-02-04ntp: Add timeserver switch logicAlok Barsode1-1/+28
Add a timeout mechanism to switch to next system timeserver if the current one does not respond or is a bogus one.
2012-02-04Add __connman_timerserver_sync() to resolve a list of timeserversAlok Barsode1-1/+1
__connman_timerserver_sync() resolves system timeservers one at a time and queries the resolved server or the 1st of the resolved servers for time correction. If the resolution fails it resolves the next one. __connman_timerserver_sync_next() resolves the next system timeserver. __connman_timerserver_stop() stops this query.If the user modifies the system timeserver list, we restart the ntp process.
2012-02-04ntp: NTP Query a Timeserver server IPAlok Barsode1-74/+56
__connman_ntp_start() takes a NTP server IP, and starts querying it for time correction.If a timeserver responds, we continue to query it every "Poll Interval" seconds for time corrections. __connman_ntp_stop() stops the polling process.
2011-10-25core: Add SOCK_CLOEXEC to socket()Daniel Wagner1-1/+1
Make sure all file descriptor are closed.
2011-09-19ntp: Add skeleton for Simple NTP supportMarcel Holtmann1-0/+382