OpenBSD CVS

CVS log for src/usr.sbin/ntpd/sensors.c


[BACK] Up to [local] / src / usr.sbin / ntpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.54 / (download) - annotate - [select for diffs], Mon Nov 11 06:32:52 2019 UTC (4 years, 6 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, HEAD
Changes since 1.53: +3 -2 lines
Diff to previous 1.53 (colored)

Also implement "trusted" for sensors; do not do constraint validation
for these. ok deraadt@

Revision 1.53 / (download) - annotate - [select for diffs], Sun Nov 10 07:32:58 2019 UTC (4 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.52: +14 -1 lines
Diff to previous 1.52 (colored)

- validate sensor values against constraints
- do not restart settime timeout interval if something happens in the main
  event loop
- apply a tight loop protection; it can be painfull on a single
  core machine since the process runs at maximum priority. Should only
  happen when a bug is introduced while developing, but prevents having to
  machine taken over by ntpd.

Revision 1.52 / (download) - annotate - [select for diffs], Sat Sep 3 11:52:06 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.51: +4 -4 lines
Diff to previous 1.51 (colored)

Remove the oh so funny "LOSS OF MIND" from the diclaimer that was not
part of the original ISC license that we use in OpenBSD.  Done for
files were Henning is the original author.

OK henning@ deraadt@

Revision 1.51 / (download) - annotate - [select for diffs], Sat Aug 27 01:50:07 2016 UTC (7 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (colored)

Pull in <sys/time.h> for struct timespec, timeval, or clockrate

ok deraadt@

Revision 1.50 / (download) - annotate - [select for diffs], Wed May 20 13:32:39 2015 UTC (9 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.49: +1 -52 lines
Diff to previous 1.49 (colored)

Remove hotplug(4) sensor support: the code has been disabled by
henning@ 9 years ago because of an issue with the /dev/hotplug device
- it does not support multiple readers opening it.  Nobody ever cared
enough to fix it so it is time to sent the dead code to the Attic.

OK henning@ (feeling sad about it), mpi@ and others

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jan 9 07:35:37 2015 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

remove excessive/wrong use of sys/param.h
peanuts -- but all work has to start somewhere.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Jan 8 00:25:47 2015 UTC (9 years, 5 months ago) by bcook
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored)

use the correct format string for refid

ok deraadt@

Revision 1.47 / (download) - annotate - [select for diffs], Fri Oct 4 14:28:16 2013 UTC (10 years, 8 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

Add ntpctl(8), which allows us to query the locally running ntpd(8) process

diff from Mike Miller <mmiller mgm51 com> (many thanks!)

OK phessler@, henning@, todd@

Revision 1.46 / (download) - annotate - [select for diffs], Thu Sep 20 12:43:16 2012 UTC (11 years, 8 months ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.45: +7 -4 lines
Diff to previous 1.45 (colored)

Allow ntpd.conf to assign a stratum to a sensor with the syntax stratum <level>.

OK markus@ henning@ phessler@ jmc@

Revision 1.45 / (download) - annotate - [select for diffs], Tue Apr 20 20:49:36 2010 UTC (14 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.44: +18 -7 lines
Diff to previous 1.44 (colored)

Get rid of MAXSENSORDEVICES.  Gaps in sensordev lists are now handled
by returning ENXIO instead of ENOENT, to essentially indicate hotplug
sensor that has gone away.  Accessing beyond the end of the sensordev
list still returns ENOENT, so that you can see there are no further devices.
ok kettenis oga

Revision 1.44 / (download) - annotate - [select for diffs], Wed May 13 15:08:10 2009 UTC (15 years ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.43: +5 -2 lines
Diff to previous 1.43 (colored)

when using a timedelta sensor for -s, if the sensor is invalid during
the first query we will never do the settime because
SENSOR_QUERY_INTERVAL (30s) is greater than SETTIME_TIMEOUT (15s).  so
during the settime period only, be more aggressive and use
SETTIME_TIMEOUT/3 for the query interval.

ok henning@

Revision 1.43 / (download) - annotate - [select for diffs], Sun Feb 8 23:57:08 2009 UTC (15 years, 4 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

spelling in comment

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jan 27 15:21:20 2009 UTC (15 years, 4 months ago) by stevesk
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

fix printf format specification to print max len 4 for refid,
which may not be null terminated; ok henning@

Revision 1.41 / (download) - annotate - [select for diffs], Mon Jan 26 21:45:11 2009 UTC (15 years, 4 months ago) by naddy
Branch: MAIN
Changes since 1.40: +2 -3 lines
Diff to previous 1.40 (colored)

return the correct refid for a sensor; ok henning@

Revision 1.40 / (download) - annotate - [select for diffs], Tue Jun 10 03:46:09 2008 UTC (16 years ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.39: +1 -2 lines
Diff to previous 1.39 (colored)

According to the latest SNTPv4 spec in RFC4330, secondary servers
return the address of the synchronization source as reference
identification.  Remove the obsolete special casing specified in RFC2030.
ok henning@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jun 9 18:30:48 2008 UTC (16 years ago) by deraadt
Branch: MAIN
Changes since 1.38: +7 -7 lines
Diff to previous 1.38 (colored)

rename refstr to refid since it is an int32; ok henning

Revision 1.38 / (download) - annotate - [select for diffs], Mon Jun 9 18:30:03 2008 UTC (16 years ago) by deraadt
Branch: MAIN
Changes since 1.37: +5 -3 lines
Diff to previous 1.37 (colored)

do not copy up to two garbage characters from a 1 char string into a 4 char
output buffer; ok henning

Revision 1.37 / (download) - annotate - [select for diffs], Mon Jun 9 16:52:04 2008 UTC (16 years ago) by deraadt
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

spacing

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jun 9 16:37:35 2008 UTC (16 years ago) by ckuethe
Branch: MAIN
Changes since 1.35: +13 -8 lines
Diff to previous 1.35 (colored)

Allow outgoing replies from sensor-driven servers to have a
user-configurable reference ID, eg. "GPS" or "DCF"...
ok mbalmer

Revision 1.35 / (download) - annotate - [select for diffs], Sun Mar 2 20:36:42 2008 UTC (16 years, 3 months ago) by ckuethe
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored)

set the refid for v4 queries too. this allows sensor-driven ntpd to says its
reference is "HARD" (or "GPS", "UMBG", "UDCF" ... in theory) rather than
"^@^@^@^@"
"why not" henning@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Sep 12 21:08:46 2007 UTC (16 years, 8 months ago) by ckuethe
Branch: MAIN
Changes since 1.33: +6 -3 lines
Diff to previous 1.33 (colored)


Add a knob to compensate for a refclock that is early or late. Based on a
diff from Maurice Janssen. Manpage help from jmc and Maurice, other nits
from deraadt and otto.
ok deraadt, otto

Revision 1.33 / (download) - annotate - [select for diffs], Sat Aug 4 02:58:02 2007 UTC (16 years, 10 months ago) by ckuethe
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.32: +9 -4 lines
Diff to previous 1.32 (colored)

This diff makes ntpd poll for sensors more aggressively when the use of
sensors is requested, but no sensors are found.
ok henning

Revision 1.32 / (download) - annotate - [select for diffs], Tue Jan 23 17:44:38 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

Typo in fatal() message found by dunceor @ gmail dot com

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jan 15 19:58:49 2007 UTC (17 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.30: +5 -1 lines
Diff to previous 1.30 (colored)

the new sensors tre can give us the number of sensors per type.
With this patch, we give up without bothering sysctl
kern_sensors.c::sensor_find() unless we know for sure that timedelta
sensor is present.
From: "Constantine A. Murenin" <cnst+openbsd@bugmail.mojo.ru>

Revision 1.30 / (download) - annotate - [select for diffs], Mon Jan 15 08:19:11 2007 UTC (17 years, 4 months ago) by otto
Branch: MAIN
Changes since 1.29: +2 -5 lines
Diff to previous 1.29 (colored)

Although Unix compilers accept more than one definition of a global
symbol, follow the guidelines from K&R: only one definition of a
global symbol (and possibly more declarations).  Rename some vars
here and there to avoid shadowing. ok henning@

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jan 14 19:18:12 2007 UTC (17 years, 4 months ago) by otto
Branch: MAIN
Changes since 1.28: +8 -3 lines
Diff to previous 1.28 (colored)

Add some comments on the expresssion which converts sensor timedeltas
to ntp offsets; also, rewrite the expression to make it more clear
with no change in semantics.  ok henning@

Revision 1.28 / (download) - annotate - [select for diffs], Thu Dec 28 00:24:27 2006 UTC (17 years, 5 months ago) by naddy
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

forgot a dereference in the previous conversion; ok deraadt@

Revision 1.27 / (download) - annotate - [select for diffs], Sat Dec 23 17:49:53 2006 UTC (17 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.26: +39 -36 lines
Diff to previous 1.26 (colored)

adapt to new two-level sensor sysctl framework; by Constantine A. Murenin

Revision 1.26 / (download) - annotate - [select for diffs], Mon Nov 20 20:58:47 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored)

with usig the meadian offset froma number of measurements the recording
of the last sensor update time got broken, doesn't show up with gps since
it updates often (more often than we read), but naddy ran into it with dcf.
record time of last sensor datum seperately. ok naddy balmer

Revision 1.25 / (download) - annotate - [select for diffs], Fri Oct 27 12:22:41 2006 UTC (17 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.24: +5 -3 lines
Diff to previous 1.24 (colored)

use clock_gettime(CLOCK_MONOTONIC, ..) to get a monotonically increasing
time, and make ntpd use that to send the next uery to an ntp peer and the
like. this has the advantage that changes to the clock do not interfere
with the intervals. for example, when we start on machines without an
RTC and the initial settime (-s) kicks in, intervals were strange.
idea from amandal@entrisphere.com, this implementation by me
tested ckuethe, phessler, mbalmer, ok mbalmer

Revision 1.24 / (download) - annotate - [select for diffs], Tue Oct 24 12:23:39 2006 UTC (17 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.23: +46 -12 lines
Diff to previous 1.23 (colored)

timedelta sensors are usually updated very often, but we used to query
them only every 30 seconds. now query them every 5,and take the median
value from 7 queries as sensor value. this takes outliers out of the
equation and makes the overall result much better, especially for
sensors with heavy jitter (like nmea for now)

Revision 1.23 / (download) - annotate - [select for diffs], Thu Oct 12 10:41:51 2006 UTC (17 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.22: +2 -0 lines
Diff to previous 1.22 (colored)

need to call adjtime once in a while here too, otherwise sensor-only
servers never update the system clock

Revision 1.22 / (download) - annotate - [select for diffs], Thu Oct 12 10:40:45 2006 UTC (17 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored)

internally, ntpd doesn't work with absolute offsets to system time, but
takes the offset it  adjtime() is already correcting for into account
when taking the offset from a sensor, we need to correct it by the
offset between system time and ntpd view.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Aug 19 16:56:54 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.20: +6 -4 lines
Diff to previous 1.20 (colored)

make sure updates from sensors have the "synced" flag set

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jun 30 16:52:13 2006 UTC (17 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

spaces

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jun 2 21:17:01 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.18: +4 -5 lines
Diff to previous 1.18 (colored)

just ise "HARD" as refid with sensors for v3 clients

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jun 1 05:44:35 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.17: +1 -2 lines
Diff to previous 1.17 (colored)

urgs, other stuff snuck in

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jun 1 04:44:23 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.16: +6 -1 lines
Diff to previous 1.16 (colored)

do not use /dev/hotplug for now, only one reader supported yet

Revision 1.16 / (download) - annotate - [select for diffs], Mon May 29 05:20:42 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.15: +5 -3 lines
Diff to previous 1.15 (colored)

when we cannot open /dev/hotplug, donn't bail, just work without
with ckuethe

Revision 1.15 / (download) - annotate - [select for diffs], Sun May 28 20:39:16 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

allow for weight to be added to sensors or servers, so that one can
weight timedelta sensors higher than ntp peers, for example
ok deraadt mbalmer

Revision 1.14 / (download) - annotate - [select for diffs], Sun May 28 19:04:37 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.13: +5 -4 lines
Diff to previous 1.13 (colored)

get clock src id from the timedelta sensor desc.
unfortunately I still don't have any hardware to test this ;(

Revision 1.13 / (download) - annotate - [select for diffs], Sun May 28 18:48:20 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.12: +5 -2 lines
Diff to previous 1.12 (colored)

if sysctl gives ENOENT the sensor is gone and we remove it

Revision 1.12 / (download) - annotate - [select for diffs], Sun May 28 18:47:25 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.11: +12 -11 lines
Diff to previous 1.11 (colored)

let sensor_query handle removals itself

Revision 1.11 / (download) - annotate - [select for diffs], Sun May 28 16:41:40 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.10: +1 -14 lines
Diff to previous 1.10 (colored)

sensor_byid not needed any more

Revision 1.10 / (download) - annotate - [select for diffs], Sun May 28 16:40:07 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

hotplug devid will go away in a minute, so don't use it here any longer

Revision 1.9 / (download) - annotate - [select for diffs], Sun May 28 16:39:12 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.8: +1 -11 lines
Diff to previous 1.8 (colored)

do not bother with rmeoval events, we remove sensors whoch vanished or
are not a timedelta sensor any more on query on the fly anyway

Revision 1.8 / (download) - annotate - [select for diffs], Sun May 28 03:23:08 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.7: +5 -3 lines
Diff to previous 1.7 (colored)

DV_SENSORS is no more, plug workaround for the time to the real solution

Revision 1.7 / (download) - annotate - [select for diffs], Sun May 28 02:06:46 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.6: +14 -1 lines
Diff to previous 1.6 (colored)

make use of the new hotplug events for sensors showing up or vanishing

Revision 1.6 / (download) - annotate - [select for diffs], Sat May 27 22:23:49 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.5: +15 -2 lines
Diff to previous 1.5 (colored)

add sensor_byid(), return sensor by its id

Revision 1.5 / (download) - annotate - [select for diffs], Sat May 27 22:22:47 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.4: +13 -10 lines
Diff to previous 1.4 (colored)

stop passing the config around all time, just store one copy

Revision 1.4 / (download) - annotate - [select for diffs], Sat May 27 21:33:47 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.3: +20 -13 lines
Diff to previous 1.3 (colored)

factor out sensor_probe from sensor_scan so we can probe a sensors when
we know its idea without scanning all again

Revision 1.3 / (download) - annotate - [select for diffs], Sat May 27 21:27:34 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.2: +42 -1 lines
Diff to previous 1.2 (colored)

make ntpd listen on the hotplug socket and decode yadda yadda, because
new sensors showing up will be announced that way when slacking ml comes
back from food

Revision 1.2 / (download) - annotate - [select for diffs], Sat May 27 17:01:07 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.1: +10 -1 lines
Diff to previous 1.1 (colored)

config file bits for timedelta sensors, so one can specify which devices
to use. "sensors *" just uses all. untested due to lack of hardware.
hacked on the road somewhere between vancouver and calgary

Revision 1.1 / (download) - annotate - [select for diffs], Fri May 26 00:33:16 2006 UTC (18 years ago) by henning
Branch: MAIN

add support for timedelta sensors, which pretty much means udcf(4) right
now. untested due to lack of hardware, and it wouldn't have worked in the
plane anyways. work in progress, currently picks up and uses all sensors
it finds, config file bits to be added soon. theo fine with this going in

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.