]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
Fix multiple denial of service in ntpd.
[FreeBSD/FreeBSD.git] / contrib / ntp / scripts / calc_tickadj / calc_tickadj.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>calc_tickadj User&rsquo;s Manual</title>
7
8 <meta name="description" content="calc_tickadj User&rsquo;s Manual">
9 <meta name="keywords" content="calc_tickadj User&rsquo;s Manual">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="#Top" rel="start" title="Top">
14 <link href="dir.html#Top" rel="up" title="(dir)">
15 <style type="text/css">
16 <!--
17 a.summary-letter {text-decoration: none}
18 blockquote.indentedblock {margin-right: 0em}
19 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20 blockquote.smallquotation {font-size: smaller}
21 div.display {margin-left: 3.2em}
22 div.example {margin-left: 3.2em}
23 div.lisp {margin-left: 3.2em}
24 div.smalldisplay {margin-left: 3.2em}
25 div.smallexample {margin-left: 3.2em}
26 div.smalllisp {margin-left: 3.2em}
27 kbd {font-style: oblique}
28 pre.display {font-family: inherit}
29 pre.format {font-family: inherit}
30 pre.menu-comment {font-family: serif}
31 pre.menu-preformatted {font-family: serif}
32 pre.smalldisplay {font-family: inherit; font-size: smaller}
33 pre.smallexample {font-size: smaller}
34 pre.smallformat {font-family: inherit; font-size: smaller}
35 pre.smalllisp {font-size: smaller}
36 span.nolinebreak {white-space: nowrap}
37 span.roman {font-family: initial; font-weight: normal}
38 span.sansserif {font-family: sans-serif; font-weight: normal}
39 ul.no-bullet {list-style: none}
40 -->
41 </style>
42
43
44 </head>
45
46 <body lang="en">
47 <h1 class="settitle" align="center">calc_tickadj User&rsquo;s Manual</h1>
48
49
50
51
52 <a name="Top"></a>
53 <div class="header">
54 <p>
55 Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; </p>
56 </div>
57 <a name="calc_005ftickadj-User_0027s-Manual"></a>
58 <h1 class="top">calc_tickadj User&rsquo;s Manual</h1>
59
60 <p>This document describes the use of the NTP Project&rsquo;s <code>calc_tickadj</code> program.
61 This document applies to version 4.2.8p14 of <code>calc_tickadj</code>.
62 </p>
63 <a name="SEC_Overview"></a>
64 <h2 class="shortcontents-heading">Short Table of Contents</h2>
65
66 <div class="shortcontents">
67 <ul class="no-bullet">
68 <li><a name="stoc-Invoking-calc_005ftickadj" href="#toc-Invoking-calc_005ftickadj">1 Invoking calc_tickadj</a></li>
69 </ul>
70 </div>
71
72
73 <table class="menu" border="0" cellspacing="0">
74 <tr><td align="left" valign="top">&bull; calc_tickadj Description:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
75 </td></tr>
76 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-Invocation" accesskey="2">calc_tickadj Invocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking calc_tickadj
77 </td></tr>
78 </table>
79
80 <hr>
81 <a name="calc_005ftickadj-Invocation"></a>
82 <div class="header">
83 <p>
84 Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
85 </div>
86 <a name="Invoking-calc_005ftickadj"></a>
87 <h2 class="chapter">1 Invoking calc_tickadj</h2>
88 <a name="index-calc_005ftickadj"></a>
89 <a name="index-Calculates-_0022optimal_0022-value-for-tick-given-ntp-drift-file_002e"></a>
90
91 <p>The <code>calc_tickadj</code> script uses provided ntp drift file to generate optimal
92 tick value. Generally, ntpd can do better job if the drift value is the
93 smallest possible number. 
94 </p>
95 <p>The example output of 
96 </p><div class="example">
97 <pre class="example">$ ./calc_tickadj
98 81.699 (drift)
99 9999 usec; 9999779 nsec
100 $ cat /etc/ntp/drift
101 -23.159
102 </pre></div>
103
104 <p>means the following. If tick on that box is 10,000, by making the value 9999
105 we&rsquo;ll shift the box from its current drift of -23.159 to a drift of 81.699, and
106 in doing so we&rsquo;ll speed the clock up a little every second instead of slowing
107 the clock down a little.
108 </p>
109 <p>If &rsquo;tick&rsquo; on that box is 10,000,000 then by setting it to 9999779 the drift
110 value will be somewhere around 0.0.
111 </p>
112 <p><code>calc_tickadj</code> tries to determine the the tick value by using
113 <code>tickadj</code> program from ntp package. If this doesn&rsquo;t work you can specify
114 current tick manually on command line.
115 </p>
116
117 <p>This section was generated by <strong>AutoGen</strong>,
118 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>calc_tickadj</code> program.
119 </p>
120 <table class="menu" border="0" cellspacing="0">
121 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-usage" accesskey="1">calc_tickadj usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">calc_tickadj help/usage (<samp>--help</samp>)
122 </td></tr>
123 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-drift_002dfile" accesskey="2">calc_tickadj drift-file</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">drift-file option (-d)
124 </td></tr>
125 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-tick" accesskey="3">calc_tickadj tick</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">tick option (-t)
126 </td></tr>
127 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-exit-status" accesskey="4">calc_tickadj exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
128 </td></tr>
129 </table>
130
131 <hr>
132 <a name="calc_005ftickadj-usage"></a>
133 <div class="header">
134 <p>
135 Next: <a href="#calc_005ftickadj-drift_002dfile" accesskey="n" rel="next">calc_tickadj drift-file</a>, Up: <a href="#calc_005ftickadj-Invocation" accesskey="u" rel="up">calc_tickadj Invocation</a> &nbsp; </p>
136 </div>
137 <a name="calc_005ftickadj-help_002fusage-_0028_002d_002dhelp_0029"></a>
138 <h3 class="section">1.1 calc_tickadj help/usage (<samp>--help</samp>)</h3>
139 <a name="index-calc_005ftickadj-help"></a>
140
141 <p>This is the automatically generated usage text for calc_tickadj.
142 </p>
143 <p>The text printed is the same whether selected with the <code>help</code> option
144 (<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
145 the usage text by passing it through a pager program.
146 <code>more-help</code> is disabled on platforms without a working
147 <code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
148 used to select the program, defaulting to <samp>more</samp>.  Both will exit
149 with a status code of 0.
150 </p>
151 <div class="example">
152 <pre class="example">calc_tickadj - Calculates &quot;optimal&quot; value for tick given ntp drift file. - Ver. 4.2.8p13
153 USAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... 
154
155     -d, --drift-file=str         Ntp drift file to use
156     -t, --tick=num               Tick value of this host
157     -?, --help                   Display usage information and exit
158         --more-help              Pass the extended usage text through a pager
159
160 Options are specified by doubled hyphens and their name or by a single
161 hyphen and the flag character.
162 </pre></div>
163
164 <table class="menu" border="0" cellspacing="0">
165 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-drift_002dfile" accesskey="1">calc_tickadj drift-file</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
166 </td></tr>
167 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-tick" accesskey="2">calc_tickadj tick</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
168 </td></tr>
169 <tr><td align="left" valign="top">&bull; <a href="#calc_005ftickadj-exit-status" accesskey="3">calc_tickadj exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
170 </td></tr>
171 </table>
172
173 <hr>
174 <a name="calc_005ftickadj-drift_002dfile"></a>
175 <div class="header">
176 <p>
177 Next: <a href="#calc_005ftickadj-tick" accesskey="n" rel="next">calc_tickadj tick</a>, Previous: <a href="#calc_005ftickadj-usage" accesskey="p" rel="prev">calc_tickadj usage</a>, Up: <a href="#calc_005ftickadj-usage" accesskey="u" rel="up">calc_tickadj usage</a> &nbsp; </p>
178 </div>
179 <a name="drift_002dfile-option-_0028_002dd_0029"></a>
180 <h4 class="subsection">1.1.1 drift-file option (-d)</h4>
181 <a name="index-calc_005ftickadj_002ddrift_002dfile"></a>
182
183 <p>This is the &ldquo;ntp drift file to use&rdquo; option.
184 This option takes a string argument.
185 Use the specified drift file for calculations
186 </p><hr>
187 <a name="calc_005ftickadj-tick"></a>
188 <div class="header">
189 <p>
190 Next: <a href="#calc_005ftickadj-exit-status" accesskey="n" rel="next">calc_tickadj exit status</a>, Previous: <a href="#calc_005ftickadj-drift_002dfile" accesskey="p" rel="prev">calc_tickadj drift-file</a>, Up: <a href="#calc_005ftickadj-usage" accesskey="u" rel="up">calc_tickadj usage</a> &nbsp; </p>
191 </div>
192 <a name="tick-option-_0028_002dt_0029"></a>
193 <h4 class="subsection">1.1.2 tick option (-t)</h4>
194 <a name="index-calc_005ftickadj_002dtick"></a>
195
196 <p>This is the &ldquo;tick value of this host&rdquo; option.
197 This option takes a number argument.
198 The current tick which to adjustment will be calculated
199 </p><hr>
200 <a name="calc_005ftickadj-exit-status"></a>
201 <div class="header">
202 <p>
203 Previous: <a href="#calc_005ftickadj-tick" accesskey="p" rel="prev">calc_tickadj tick</a>, Up: <a href="#calc_005ftickadj-usage" accesskey="u" rel="up">calc_tickadj usage</a> &nbsp; </p>
204 </div>
205 <a name="calc_005ftickadj-exit-status-1"></a>
206 <h4 class="subsection">1.1.3 calc_tickadj exit status</h4>
207
208 <p>One of the following exit values will be returned:
209 </p><dl compact="compact">
210 <dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
211 <dd><p>Successful program execution.
212 </p></dd>
213 <dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
214 <dd><p>The operation failed or the command syntax was not valid.
215 </p></dd>
216 </dl>
217 <hr>
218
219
220
221 </body>
222 </html>