summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/ntpd.h
AgeCommit message (Collapse)Author
2005-08-10Propogate server's leap indicator flags to clients; ok henning@Darren Tucker
2005-07-15shrink read buffer size from 64k to 4k, this is not bgpd and we're dealingHenning Brauer
with way less data
2005-07-05Save transmit time for each peer for later use as refid for SNTPv4Darren Tucker
replies. ok henning@
2005-06-19use a #define for the time to wait on -s and clarify a log msgHenning Brauer
2005-06-19use a little state engine to keep track of delayed dns lookups and such,Henning Brauer
eases things tested by Jason Ackley <jason@ackley.net> Matthias Kilian <kili@outback.escape.de> Stephen Marley <stephen@marley.org.uk> sturm@ theo ok
2005-04-26unify shared code a bit again to make future syncs easierHenning Brauer
From: Alexander von Gernler <grunk@pestilenz.org>
2005-03-23wpos in struct buf_read and datalen in imsg_get should be size_t and notHenning Brauer
ssize_t From: Alexander von Gernler <grunk@pestilenz.org>
2005-02-03Implement simple duplicate suppression of peer errors; ok henning@Darren Tucker
2005-02-02buffer structs and API ssize_t -> size_t; from bgpdHenning Brauer
2005-01-28Simplify interval scaling and randomize query intervals; ok henning@Darren Tucker
2005-01-27Scale query interval by the overall offset not per-peer offset, so weDarren Tucker
don't query outliers more often than any other server. ok henning@
2005-01-27Delay before retrying a query on timeout; ok henning@Darren Tucker
2004-12-16Limit the number of addresses used by the 'servers' directive to 8; ok henning@Darren Tucker
2004-12-09define TRUSTLEVEL_MAX for the trustedlevel value of 10; henning@ okMichael Shalayeff
2004-12-06do not log tiny local clock drifts; w/ help from Joerg Sonnenberger ↵Michael Shalayeff
<joerg@britannica.bec.de>; henning@ ok
2004-12-06ensure the most excellent alignment in the structs; henning@ okMichael Shalayeff
2004-11-12some missing includes, from Joerg Sonnenberger <joerg@britannica.bec.de>Henning Brauer
2004-11-10ntp_adjtime() -> priv_adjtime()Henning Brauer
ntp_settime() -> priv_settime() ntp_host_dns() -> priv_host_dns()
2004-11-10const'ify conffileHenning Brauer
From: Joerg Sonnenberger <joerg@britannica.bec.de>
2004-10-22in server mode reply with stratum from the peer that we currently preferHenning Brauer
plus one
2004-10-14Have ntpd use IPTOS_LOWDELAY; ok henning@Darren Tucker
2004-09-18don't call settimeofday() when the offset is smaller than 180 seconds,Henning Brauer
adjtime() will fix that fast enough, from discussion in theo's living room ok mcbride beck
2004-09-18add a new -s option, that tells ntpd to set the time using settimeofday()Henning Brauer
once at startup. ntpd delays daemonizing until it has done the intial time setting (or ran into the timeout) in this mode to make sure stuff started later in rc is not subject to time jumps. this eleminates the need to run rdate -n beforehands. with some input from & ok ryan and bob, march music from mickey
2004-09-18do not bother overallocating and shrinking the pfd and idx2peer arrays,Henning Brauer
doesn't by us anything. discussed with ryan during dinner at original joe's
2004-09-16the "type" param to imsg_compose and imsg_create is really anHenning Brauer
enum imsg_type and not an int
2004-09-15imsg framework cleanup:Henning Brauer
-kill the _pid flavors of imsg_create and imsg_compose, and just add pid as argument to those -use imsg_create in imsg_compose instead of duplicating code -check for datalen overflow
2004-09-15remove the unused variable/macro code, ok theoHenning Brauer
2004-08-12do not try to getaddrinfo() in the unprivileged process, send an imsgHenning Brauer
asking the privileged one to do it. sends back an imsg with the resulting addresses in a bunch of struct sockaddr_storage in the data part. this should fix all remaining issues with dns (non-)availability at ntpd startup, be it due to named on localhost or something else. tested by marco@ and Chris Paul <chris.paul@sentinare.com>
2004-08-10move memory allocation for new peers into a new function, makes ID allocationHenning Brauer
easier
2004-07-29keep an ID per server we talk toHenning Brauer
2004-07-28when a dns lookup fails at parse time, do not abort but try againHenning Brauer
to resolve the hostname every 60 seconds fixes ntpd invocations before e. g. a dialup link is established and such. as we want ntpd to be a "fire and forget" background daemon it should cope with such situations. tested by many
2004-07-25remove unused functionHenning Brauer
2004-07-20wrap the heads for the linked list of addresses into a new ntp_addr_wrapHenning Brauer
which, besides the head pointer for the list of course, stores the original address as specified (i. e. as hostname instead of resolved IPs) and flags and such.
2004-07-18query interval scaling, episode IIHenning Brauer
1) base the interval calculation on the offset from the last reply, not from the last peer update. Allows us to send more queries again faster when the local clock diverges too much 2) every time we form a peer update (for which we need 8 replies) check wether we have a ready peer update for all peers that are currently trusted, and if so, calculate the total offset and call adjtime(). that means that adjtime is no longer called in fixed intervals but whenever we have enough data to reliably calculate the local clock offset. In practice, that means we call adjtime() less often, but with probably better data. 3) invalidate peer updates after beeing used. no point in re-using them - this resulted in calling adjtime() multiple times with the same offset, which doesn't make sense tested by many
2004-07-14do not do the stratum guessing dance.Henning Brauer
stratum is pretty much pointless anyway these days, and we certainly do not want to send out illegal packets (stratum=0) until synced...
2004-07-13Respond to client queries with better server statistics. We now outputAlexander Guy
a close-to-reality stratum, a real reference time, and a leap indicator that will indicate if the local clock isn't synchronized. This also means that until the server feels it's synchronized, it will tell the clients it isn't. This is normal, and correct. ok henning@
2004-07-11Start collecting the remote server state along with the calculatedAlexander Guy
offsets, in preparation for having correct server statistics in responses to client queries. ok henning@
2004-07-10KNF; ok henning@Alexander Guy
2004-07-10short fixed point <-> double conversion routines; ok henning@Alexander Guy
2004-07-10scale query interval based on local clock offset. tested by manyHenning Brauer
not as efficient as I want it to be yet, but more is coming
2004-07-09make lint a wee bit happierTheo de Raadt
2004-07-09rework dns handling with all its cosequences...Henning Brauer
we know have both a "server" and "servers" keyword. they differ when the hostname resolves to more than one IP, server picks one and servers expands to all. that means no longer stuffing a sockaddr_storage into ntp_peer but a pointer to a linked list of ntp_addr structs. in the "servers" case the list of n addresses returned by host() is expanded into n ntp_peer structs and thus n individual peers. in the "server" case the whole list is attached to ntp_peer, and whenever we do not receive a reply in time we traverse the list one further, so that hosts with both AAAA and A records are first tried with the AAAA one but we gracefully fall back to the A one. semantics with theo; hacked up on the Montreal->Frankfurt flight. again Air Canada surprised me, that older 767 hat pretty decent seats.
2004-07-08remove all handling of netmasks/prefix lengths - we don't need that in ntpd.Henning Brauer
fixes the dns resolves to v4 and v6 addresses bug found by phessler hacked on the Calgary->Montreal flight that proved that Air Canada _does_ have some modern aircrafts with good seats
2004-07-07* Convert to use the new double-based time handling functions.Alexander Guy
* Respond to the query with a reasonable received time (which will help clients get better accuracy). * Consolidate the server response code in preparation for a completely 'proper' response to the client. tips and ok from henning@
2004-07-07do not listen anywhere by default.Henning Brauer
listen on * listens, well, everywhere.
2004-07-07swicth all the host_* functions to work on a newly inventedHenning Brauer
struct ntp_addr, which just wraps a sockaddr_storage and a next pointer, so that host_dns can return more than one entry. let host_dns do exactly that, return a list of all IPs for that hostname adjust all callers in the grammar to cope with that
2004-07-07keep a "trustlevel" per peer. loose credit for loosing a packet, looseHenning Brauer
a lot of credit for not having supplied us with enough data within an adjtime run interval, and get a little credit each time we get a good reply packet. if a peer is below 20%, only send a packet occasionally to see wether it is back. send out queries much more often between 20 and 80% to (re-)sync quickly, and above 80% usethe regular interval. do not use peers < 60% for calculating teh local clock offset. designed with theo at the pho, alexander ok
2004-07-06Implement the clock filter as descirbed by David Mills:Henning Brauer
form the last 8 replied received from a peer, find the one with the lowest delay. Use that as the peer's update taken into account for calculating the local clock's offset. Invalidate that reply and all ones received earlier than it so that they do not get used again.
2004-07-05keep last 8 offset,delay pairs - we'll need them for the clock filters later.Henning Brauer
for now, average over those to adjust the local clock.
2004-07-05delay, not errorHenning Brauer