From: Martin Burnicki Date: Wed, 25 Mar 2015 16:24:59 +0000 (+0100) Subject: Fixed indention and removed trailing whitespace. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df36f4b2a07960b6bfe203c9f684222abf0a97b6;p=thirdparty%2Fntp.git Fixed indention and removed trailing whitespace. bk: 5512e15bhIqe_MgHMyJHN7JyR2Q6Mg --- diff --git a/ChangeLog b/ChangeLog index 07872b1dc..4b6208782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --- + Fixed indention and removed trailing whitespace. * [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. * [Bug 2728] See if C99-style structure initialization works. * [Bug 2747] Upgrade libevent to 2.1.5-beta. diff --git a/include/ntp.h b/include/ntp.h index 0e3bc41f3..428194747 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -453,7 +453,7 @@ struct peer { #define FLAG_XB 0x2000 /* interleaved broadcast */ #define FLAG_XBOGUS 0x4000 /* interleaved bogus packet */ #ifdef OPENSSL -#define FLAG_ASSOC 0x8000 /* autokey request */ +# define FLAG_ASSOC 0x8000 /* autokey request */ #endif /* OPENSSL */ /* @@ -877,13 +877,13 @@ struct endpoint { */ #define AM_ERR -1 /* error */ #define AM_NOMATCH 0 /* no match */ -#define AM_PROCPKT 1 /* server/symmetric packet */ -#define AM_BCST 2 /* broadcast packet */ +#define AM_PROCPKT 1 /* server/symmetric packet */ +#define AM_BCST 2 /* broadcast packet */ #define AM_FXMIT 3 /* client packet */ #define AM_MANYCAST 4 /* manycast or pool */ #define AM_NEWPASS 5 /* new passive */ #define AM_NEWBCL 6 /* new broadcast */ -#define AM_POSSBCL 7 /* discard broadcast */ +#define AM_POSSBCL 7 /* discard broadcast */ /* NetInfo configuration locations */ #ifdef HAVE_NETINFO diff --git a/include/parse_conf.h b/include/parse_conf.h index f8213879e..d17d616a4 100644 --- a/include/parse_conf.h +++ b/include/parse_conf.h @@ -41,13 +41,13 @@ /* * field location structure */ -#define O_DAY 0 +#define O_DAY 0 #define O_MONTH 1 -#define O_YEAR 2 -#define O_HOUR 3 -#define O_MIN 4 -#define O_SEC 5 -#define O_WDAY 6 +#define O_YEAR 2 +#define O_HOUR 3 +#define O_MIN 4 +#define O_SEC 5 +#define O_WDAY 6 #define O_FLAGS 7 #define O_ZONE 8 #define O_UTCHOFFSET 9 diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 37c3f0325..e8b1415f4 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -245,7 +245,7 @@ transmit( /* * Update the reachability status. If not heard for * three consecutive polls, stuff infinity in the clock - * filter. + * filter. */ oreach = peer->reach; peer->outdate = current_time; @@ -290,7 +290,7 @@ transmit( * If preemptible and we have more peers than maxclock, * and this peer has the minimum score of preemptibles, * demobilize. - */ + */ if (peer->unreach >= NTP_UNREACH) { hpoll++; /* ephemeral: no FLAG_CONFIG nor FLAG_PREEMPT */ @@ -335,7 +335,7 @@ transmit( peer->retry--; /* - * Do not transmit if in broadcast client mode. + * Do not transmit if in broadcast client mode. */ if (peer->hmode != MODE_BCLIENT) peer_xmit(peer); @@ -442,7 +442,7 @@ receive( return; /* no flakeway */ } } - + /* * Version check must be after the query packets, since they * intentionally use an early version. @@ -659,7 +659,7 @@ receive( * If the signature is 20 bytes long, the last 16 of * which are zero, then this is a Microsoft client * wanting AD-style authentication of the server's - * reply. + * reply. * * This is described in Microsoft's WSPP docs, in MS-SNTP: * http://msdn.microsoft.com/en-us/library/cc212930.aspx @@ -680,7 +680,7 @@ receive( * broadcast or unicast address as appropriate. */ if (crypto_flags && skeyid > NTP_MAXKEY) { - + /* * More on the autokey dance (AKD). A cookie is * constructed from public and private values. @@ -874,7 +874,7 @@ receive( * curious and could be an intruder attempting to clog, so we * just ignore it. * - * If the packet is authentic and the manycastclient or pool + * If the packet is authentic and the manycastclient or pool * association is found, we mobilize a client association and * copy pertinent variables from the manycastclient or pool * association to the new client association. If not, just @@ -1284,7 +1284,7 @@ receive( #endif /* AUTOKEY */ return; - /* + /* * If the digest fails, the client cannot authenticate a server * reply to a client packet previously sent. The loopback check * is designed to avoid a bait-and-switch attack, which was @@ -1577,7 +1577,7 @@ process_packet( /* * If the peer was previously unreachable, raise a trap. In any * case, mark it reachable. - */ + */ if (!peer->reach) { report_event(PEVNT_REACH, peer, NULL); peer->timereachable = current_time; @@ -1644,8 +1644,8 @@ process_packet( * Interleaved broadcast mode. Use interleaved timestamps. * t1 = peer->borg, t2 = p_org, t3 = p_org, t4 = aorg */ - if (peer->flags & FLAG_XB) { - ci = p_org; /* delay */ + if (peer->flags & FLAG_XB) { + ci = p_org; /* delay */ L_SUB(&ci, &peer->aorg); LFPTOD(&ci, t34); ci = p_org; /* t2 - t1 */ @@ -1774,7 +1774,7 @@ process_packet( p_del, peer->r21 / 1e3, peer->r34 / 1e3, td); #endif - } + } #endif /* ASSYM */ /* @@ -2240,7 +2240,7 @@ clock_filter( for (i = NTP_SHIFT - 1; i >= 0; i--) { if (i != 0) peer->filter_disp[j] += dtemp; - if (peer->filter_disp[j] >= MAXDISPERSE) { + if (peer->filter_disp[j] >= MAXDISPERSE) { peer->filter_disp[j] = MAXDISPERSE; dst[i] = MAXDISPERSE; } else if (peer->update - peer->filter_epoch[j] > @@ -2255,7 +2255,7 @@ clock_filter( } /* - * If the clock has stabilized, sort the samples by distance. + * If the clock has stabilized, sort the samples by distance. */ if (freq_cnt == 0) { for (i = 1; i < NTP_SHIFT; i++) { @@ -2289,7 +2289,7 @@ clock_filter( continue; m++; } - + /* * Compute the dispersion and jitter. The dispersion is weighted * exponentially by NTP_FWEIGHT (0.5) so it is normalized close @@ -2493,9 +2493,9 @@ clock_select(void) /* * If this peer could have the orphan parent * as a synchronization ancestor, exclude it - * from selection to avoid forming a + * from selection to avoid forming a * synchronization loop within the orphan mesh, - * triggering stratum climb to infinity + * triggering stratum climb to infinity * instability. Peers at stratum higher than * the orphan stratum could have the orphan * parent in ancestry so are excluded. @@ -2603,7 +2603,7 @@ clock_select(void) for (allow = 0; 2 * allow < nlist; allow++) { /* - * Bound the interval (low, high) as the smallest + * Bound the interval (low, high) as the smallest * interval containing points from the most sources. */ n = 0; @@ -2639,7 +2639,7 @@ clock_select(void) * We assert the correct time is contained in the interval, but * the best offset estimate for the interval might not be * contained in the interval. For this purpose, a truechimer is - * defined as the midpoint of an interval that overlaps the + * defined as the midpoint of an interval that overlaps the * intersection interval. */ j = 0; @@ -2659,7 +2659,7 @@ clock_select(void) * include any of them in the cluster population. */ if (peer->flags & FLAG_PPS) { - if (typepps == NULL) + if (typepps == NULL) typepps = peer; continue; } @@ -2672,7 +2672,7 @@ clock_select(void) nlist = j; /* - * If no survivors remain at this point, check if the modem + * If no survivors remain at this point, check if the modem * driver, local driver or orphan parent in that order. If so, * nominate the first one found as the only survivor. * Otherwise, give up and leave the island to the rats. @@ -2709,7 +2709,7 @@ clock_select(void) * by root distance. Continue voting as long as there are more * than sys_minclock survivors and the select jitter of the peer * with the worst metric is greater than the minimum peer - * jitter. Stop if we are about to discard a TRUE or PREFER + * jitter. Stop if we are about to discard a TRUE or PREFER * peer, who of course have the immunity idol. */ while (1) { @@ -2815,7 +2815,7 @@ clock_select(void) typesystem = peers[speer].peer; if (osys_peer == NULL || osys_peer == typesystem) { - sys_clockhop = 0; + sys_clockhop = 0; } else if ((x = fabs(typesystem->offset - osys_peer->offset)) < sys_mindisp) { if (sys_clockhop == 0) @@ -3113,7 +3113,7 @@ peer_xmit( * the session key is generated. */ while (1) { - + /* * Allocate and initialize a keylist if not * already done. Then, use the list in inverse @@ -3165,7 +3165,7 @@ peer_xmit( break; /* - * In symmetric modes the parameter, certificate, + * In symmetric modes the parameter, certificate, * identity, cookie and autokey exchanges are * required. The leapsecond exchange is optional. But, a * peer will not believe the other peer until the other @@ -3324,7 +3324,7 @@ peer_xmit( session_key(&peer->dstadr->sin, &peer->srcadr, xkeyid, 0, 2); } - } + } #endif /* AUTOKEY */ /* @@ -3619,7 +3619,7 @@ pool_xmit( return; /* out of addresses, re-query DNS next poll */ restrict_mask = restrictions(rmtadr); if (RES_FLAGS & restrict_mask) - restrict_source(rmtadr, 0, + restrict_source(rmtadr, 0, current_time + POOL_SOLICIT_WINDOW + 1); lcladr = findinterface(rmtadr); memset(&xpkt, 0, sizeof(xpkt)); diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c index 3b0b08281..8db7677c9 100644 --- a/ntpd/refclock_parse.c +++ b/ntpd/refclock_parse.c @@ -464,23 +464,23 @@ typedef struct poll_info #define DCF_P_ID "DCFp" /* psuedo random phase shift */ #define GPS_ID "GPS" /* GPS receiver */ -#define NOCLOCK_ROOTDELAY 0.0 -#define NOCLOCK_BASEDELAY 0.0 -#define NOCLOCK_DESCRIPTION 0 +#define NOCLOCK_ROOTDELAY 0.0 +#define NOCLOCK_BASEDELAY 0.0 +#define NOCLOCK_DESCRIPTION 0 #define NOCLOCK_MAXUNSYNC 0 #define NOCLOCK_CFLAG 0 #define NOCLOCK_IFLAG 0 #define NOCLOCK_OFLAG 0 #define NOCLOCK_LFLAG 0 -#define NOCLOCK_ID "TILT" -#define NOCLOCK_POLL NO_POLL -#define NOCLOCK_INIT NO_INIT -#define NOCLOCK_END NO_END -#define NOCLOCK_DATA NO_LCLDATA -#define NOCLOCK_FORMAT "" -#define NOCLOCK_TYPE CTL_SST_TS_UNSPEC -#define NOCLOCK_SAMPLES 0 -#define NOCLOCK_KEEP 0 +#define NOCLOCK_ID "TILT" +#define NOCLOCK_POLL NO_POLL +#define NOCLOCK_INIT NO_INIT +#define NOCLOCK_END NO_END +#define NOCLOCK_DATA NO_LCLDATA +#define NOCLOCK_FORMAT "" +#define NOCLOCK_TYPE CTL_SST_TS_UNSPEC +#define NOCLOCK_SAMPLES 0 +#define NOCLOCK_KEEP 0 #define DCF_TYPE CTL_SST_TS_LF #define GPS_TYPE CTL_SST_TS_UHF @@ -4174,8 +4174,8 @@ parse_process( */ #ifdef DEBUG if (debug > 2) - { - printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n", + { + printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n", CLK_UNIT(parse->peer), prettydate(&reftime), prettydate(&rectime), @@ -4191,13 +4191,13 @@ parse_process( * pass PPS information on to PPS clock */ if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer)) - { + { parse->peer->flags |= FLAG_PPS; parse_hardpps(parse, PARSE_HARDPPS_ENABLE); } #endif } else { - parse_hardpps(parse, PARSE_HARDPPS_DISABLE); + parse_hardpps(parse, PARSE_HARDPPS_DISABLE); parse->peer->flags &= ~FLAG_PPS; }