The cl-ntp-client Reference Manual
Table of Contents
The cl-ntp-client Reference Manual
This is the cl-ntp-client Reference Manual,
generated automatically by Declt version 3.0 "Montgomery Scott"
on Mon Apr 19 15:06:11 2021 GMT+0.
1 Introduction
CL-NTP-CLIENT
A simple NTP (Network Time Protocol) client written in Common Lisp.
Does not adjust system clock, PLL drift or do any other platform specific work, nor does any statistical evaluation of time source or system clock jitter.
Usage
Instantiate an NTP
object:
(defvar o (make-intance 'ntp))
Synchronize the object with NTP server:
(synchronize o)
After that, (get-adjusted-universal-time o)
will return you a pair of NTP timestamp values: seconds and second fraction.
API
(synchronize ntp-instance &optional (server "pool.ntp.org"))
Synchronizes the application clock with remote server.
(get-adjusted-universal-time ntp-instance)
Returns application time as a pair of values, corresponding to universal time in seconds and NTP formatted 32-bit fraction of a second.
(local-stratum ntp-instance)
Returns the stratum of application clock.
2 Systems
The main system appears first, followed by any subsystem dependency.
2.1 cl-ntp-client
- Author
Eugene Zaikonnikov
- License
BSD
- Description
A simple NTP (Network Time Protocol) client in Common Lisp
- Dependencies
-
- Source
cl-ntp-client.asd (file)
- Components
-
3 Files
Files are sorted by type and then listed depth-first from the systems
components trees.
3.1 Lisp
3.1.1 cl-ntp-client.asd
- Location
cl-ntp-client.asd
- Systems
cl-ntp-client (system)
3.1.2 cl-ntp-client/package.lisp
- Parent
cl-ntp-client (system)
- Location
package.lisp
- Packages
cl-ntp-client
3.1.3 cl-ntp-client/cl-ntp-client.lisp
- Dependency
package.lisp (file)
- Parent
cl-ntp-client (system)
- Location
cl-ntp-client.lisp
- Exported Definitions
-
- Internal Definitions
-
4 Packages
Packages are listed by definition order.
4.1 cl-ntp-client
- Source
package.lisp (file)
- Nickname
ntp
- Use List
common-lisp
- Exported Definitions
-
- Internal Definitions
-
5 Definitions
Definitions are sorted by export status, category, package, and then by
lexicographic order.
5.1 Exported definitions
5.1.1 Constants
- Constant: +micros+
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Constant: +millis+
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Constant: +nanos+
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
5.1.2 Macros
- Macro: big-time VALUES
-
Convert the NTP second/fraction value pair into a (large) integer
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Macro: small-time TIME
-
Convert the integer time representation back into NTP value pair domain
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
5.1.3 Functions
- Function: fraction-to-internal FRACTION
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: fraction-to-seconds FRACTION
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: fraction-to-usec FRACTION
-
Fixed point conversion to microseconds
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: from-fraction FRACTION UNIT
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: seconds-to-fraction SECONDS
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: sub-internal FRACTION
-
Returns the remainder of ntp value less than internal-time-units-per-second
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: to-fraction TIME DIVISOR-UNIT
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: usec-to-fraction USEC
-
Fixed point conversion from microseconds
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
5.1.4 Generic functions
- Generic Function: adjusted-big-time O
-
- Package
cl-ntp-client
- Methods
- Method: adjusted-big-time (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: get-adjusted-universal-time O
-
- Package
cl-ntp-client
- Methods
- Method: get-adjusted-universal-time (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: local-stratum OBJECT
-
- Generic Function: (setf local-stratum) NEW-VALUE OBJECT
-
- Package
cl-ntp-client
- Methods
- Method: local-stratum (NTP ntp)
-
automatically generated reader method
- Source
cl-ntp-client.lisp (file)
- Method: (setf local-stratum) NEW-VALUE (NTP ntp)
-
automatically generated writer method
- Source
cl-ntp-client.lisp (file)
- Generic Function: ntp-address OBJECT
-
- Generic Function: (setf ntp-address) NEW-VALUE OBJECT
-
- Package
cl-ntp-client
- Methods
- Method: ntp-address (NTP ntp)
-
automatically generated reader method
- Source
cl-ntp-client.lisp (file)
- Method: (setf ntp-address) NEW-VALUE (NTP ntp)
-
automatically generated writer method
- Source
cl-ntp-client.lisp (file)
- Generic Function: synchronize O &optional SERVER
-
- Package
cl-ntp-client
- Methods
- Method: synchronize (O ntp) &optional SERVER
-
- Source
cl-ntp-client.lisp (file)
5.1.5 Classes
- Class: ntp ()
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Direct superclasses
standard-object (class)
- Direct methods
-
- Direct slots
- Slot: buffer
-
- Type
(quote (simple-array (unsigned-byte 8) (48)))
- Initform
(make-array 48 :element-type (quote (unsigned-byte 8)) :initial-element 0)
- Readers
buffer (generic function)
- Slot: offset
-
- Type
(quote integer)
- Initform
(- (cl-ntp-client:big-time (values (get-universal-time) 0)) (cl-ntp-client::real-big-time))
- Readers
offset (generic function)
- Writers
(setf offset) (generic function)
- Slot: local-stratum
-
- Type
(quote integer)
- Initform
8
- Readers
local-stratum (generic function)
- Writers
(setf local-stratum) (generic function)
- Slot: address
-
- Initform
:ntp-address
- Readers
ntp-address (generic function)
- Writers
(setf ntp-address) (generic function)
5.2 Internal definitions
5.2.1 Functions
- Function: delay-to-usec DELAY
-
Scaled delay to microseconds conversion
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: read32 ARRAY POS
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: real-big-time ()
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
- Function: write32 ARRAY POS VAL
-
- Package
cl-ntp-client
- Source
cl-ntp-client.lisp (file)
5.2.2 Generic functions
- Generic Function: buffer OBJECT
-
- Package
cl-ntp-client
- Methods
- Method: buffer (NTP ntp)
-
automatically generated reader method
- Source
cl-ntp-client.lisp (file)
- Generic Function: leap-indicator O
-
- Package
cl-ntp-client
- Methods
- Method: leap-indicator (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: mode O
-
- Generic Function: (setf mode) NEW-VALUE O
-
- Package
cl-ntp-client
- Methods
- Method: mode (O ntp)
-
- Method: (setf mode) NEW-VALUE (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: offset OBJECT
-
- Generic Function: (setf offset) NEW-VALUE OBJECT
-
- Package
cl-ntp-client
- Methods
- Method: offset (NTP ntp)
-
automatically generated reader method
- Source
cl-ntp-client.lisp (file)
- Method: (setf offset) NEW-VALUE (NTP ntp)
-
automatically generated writer method
- Source
cl-ntp-client.lisp (file)
- Generic Function: origtm-f O
-
- Generic Function: (setf origtm-f) STAMP O
-
- Package
cl-ntp-client
- Methods
- Method: origtm-f (O ntp)
-
- Method: (setf origtm-f) STAMP (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: origtm-s O
-
- Generic Function: (setf origtm-s) STAMP O
-
- Package
cl-ntp-client
- Methods
- Method: origtm-s (O ntp)
-
- Method: (setf origtm-s) STAMP (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: poll O
-
- Package
cl-ntp-client
- Methods
- Method: poll (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: precision O
-
- Package
cl-ntp-client
- Methods
- Method: precision (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: ref-id O
-
- Package
cl-ntp-client
- Methods
- Method: ref-id (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: reftm-f O
-
- Package
cl-ntp-client
- Methods
- Method: reftm-f (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: reftm-s O
-
- Package
cl-ntp-client
- Methods
- Method: reftm-s (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: root-delay O
-
- Package
cl-ntp-client
- Methods
- Method: root-delay (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: root-dispersion O
-
- Package
cl-ntp-client
- Methods
- Method: root-dispersion (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: run-server-exchange O ADDRESS
-
- Package
cl-ntp-client
- Methods
- Method: run-server-exchange (O ntp) ADDRESS
-
Communicates with remote server to return time offset from the local clock
- Source
cl-ntp-client.lisp (file)
- Generic Function: rxtm-f O
-
- Package
cl-ntp-client
- Methods
- Method: rxtm-f (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: rxtm-s O
-
- Package
cl-ntp-client
- Methods
- Method: rxtm-s (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: stratum O
-
- Package
cl-ntp-client
- Methods
- Method: stratum (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: txtm-f O
-
- Package
cl-ntp-client
- Methods
- Method: txtm-f (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: txtm-s O
-
- Package
cl-ntp-client
- Methods
- Method: txtm-s (O ntp)
-
- Source
cl-ntp-client.lisp (file)
- Generic Function: version-number O
-
- Generic Function: (setf version-number) NEW-VALUE O
-
- Package
cl-ntp-client
- Methods
- Method: version-number (O ntp)
-
- Method: (setf version-number) NEW-VALUE (O ntp)
-
- Source
cl-ntp-client.lisp (file)
Appendix A Indexes
A.1 Concepts
A.2 Functions
| Index Entry | | Section |
|
( | | |
| (setf local-stratum) : | | Exported generic functions |
| (setf local-stratum) : | | Exported generic functions |
| (setf mode) : | | Internal generic functions |
| (setf mode) : | | Internal generic functions |
| (setf ntp-address) : | | Exported generic functions |
| (setf ntp-address) : | | Exported generic functions |
| (setf offset) : | | Internal generic functions |
| (setf offset) : | | Internal generic functions |
| (setf origtm-f) : | | Internal generic functions |
| (setf origtm-f) : | | Internal generic functions |
| (setf origtm-s) : | | Internal generic functions |
| (setf origtm-s) : | | Internal generic functions |
| (setf version-number) : | | Internal generic functions |
| (setf version-number) : | | Internal generic functions |
|
A | | |
| adjusted-big-time : | | Exported generic functions |
| adjusted-big-time : | | Exported generic functions |
|
B | | |
| big-time : | | Exported macros |
| buffer : | | Internal generic functions |
| buffer : | | Internal generic functions |
|
D | | |
| delay-to-usec : | | Internal functions |
|
F | | |
| fraction-to-internal : | | Exported functions |
| fraction-to-seconds : | | Exported functions |
| fraction-to-usec : | | Exported functions |
| from-fraction : | | Exported functions |
| Function, delay-to-usec : | | Internal functions |
| Function, fraction-to-internal : | | Exported functions |
| Function, fraction-to-seconds : | | Exported functions |
| Function, fraction-to-usec : | | Exported functions |
| Function, from-fraction : | | Exported functions |
| Function, read32 : | | Internal functions |
| Function, real-big-time : | | Internal functions |
| Function, seconds-to-fraction : | | Exported functions |
| Function, sub-internal : | | Exported functions |
| Function, to-fraction : | | Exported functions |
| Function, usec-to-fraction : | | Exported functions |
| Function, write32 : | | Internal functions |
|
G | | |
| Generic Function, (setf local-stratum) : | | Exported generic functions |
| Generic Function, (setf mode) : | | Internal generic functions |
| Generic Function, (setf ntp-address) : | | Exported generic functions |
| Generic Function, (setf offset) : | | Internal generic functions |
| Generic Function, (setf origtm-f) : | | Internal generic functions |
| Generic Function, (setf origtm-s) : | | Internal generic functions |
| Generic Function, (setf version-number) : | | Internal generic functions |
| Generic Function, adjusted-big-time : | | Exported generic functions |
| Generic Function, buffer : | | Internal generic functions |
| Generic Function, get-adjusted-universal-time : | | Exported generic functions |
| Generic Function, leap-indicator : | | Internal generic functions |
| Generic Function, local-stratum : | | Exported generic functions |
| Generic Function, mode : | | Internal generic functions |
| Generic Function, ntp-address : | | Exported generic functions |
| Generic Function, offset : | | Internal generic functions |
| Generic Function, origtm-f : | | Internal generic functions |
| Generic Function, origtm-s : | | Internal generic functions |
| Generic Function, poll : | | Internal generic functions |
| Generic Function, precision : | | Internal generic functions |
| Generic Function, ref-id : | | Internal generic functions |
| Generic Function, reftm-f : | | Internal generic functions |
| Generic Function, reftm-s : | | Internal generic functions |
| Generic Function, root-delay : | | Internal generic functions |
| Generic Function, root-dispersion : | | Internal generic functions |
| Generic Function, run-server-exchange : | | Internal generic functions |
| Generic Function, rxtm-f : | | Internal generic functions |
| Generic Function, rxtm-s : | | Internal generic functions |
| Generic Function, stratum : | | Internal generic functions |
| Generic Function, synchronize : | | Exported generic functions |
| Generic Function, txtm-f : | | Internal generic functions |
| Generic Function, txtm-s : | | Internal generic functions |
| Generic Function, version-number : | | Internal generic functions |
| get-adjusted-universal-time : | | Exported generic functions |
| get-adjusted-universal-time : | | Exported generic functions |
|
L | | |
| leap-indicator : | | Internal generic functions |
| leap-indicator : | | Internal generic functions |
| local-stratum : | | Exported generic functions |
| local-stratum : | | Exported generic functions |
|
M | | |
| Macro, big-time : | | Exported macros |
| Macro, small-time : | | Exported macros |
| Method, (setf local-stratum) : | | Exported generic functions |
| Method, (setf mode) : | | Internal generic functions |
| Method, (setf ntp-address) : | | Exported generic functions |
| Method, (setf offset) : | | Internal generic functions |
| Method, (setf origtm-f) : | | Internal generic functions |
| Method, (setf origtm-s) : | | Internal generic functions |
| Method, (setf version-number) : | | Internal generic functions |
| Method, adjusted-big-time : | | Exported generic functions |
| Method, buffer : | | Internal generic functions |
| Method, get-adjusted-universal-time : | | Exported generic functions |
| Method, leap-indicator : | | Internal generic functions |
| Method, local-stratum : | | Exported generic functions |
| Method, mode : | | Internal generic functions |
| Method, ntp-address : | | Exported generic functions |
| Method, offset : | | Internal generic functions |
| Method, origtm-f : | | Internal generic functions |
| Method, origtm-s : | | Internal generic functions |
| Method, poll : | | Internal generic functions |
| Method, precision : | | Internal generic functions |
| Method, ref-id : | | Internal generic functions |
| Method, reftm-f : | | Internal generic functions |
| Method, reftm-s : | | Internal generic functions |
| Method, root-delay : | | Internal generic functions |
| Method, root-dispersion : | | Internal generic functions |
| Method, run-server-exchange : | | Internal generic functions |
| Method, rxtm-f : | | Internal generic functions |
| Method, rxtm-s : | | Internal generic functions |
| Method, stratum : | | Internal generic functions |
| Method, synchronize : | | Exported generic functions |
| Method, txtm-f : | | Internal generic functions |
| Method, txtm-s : | | Internal generic functions |
| Method, version-number : | | Internal generic functions |
| mode : | | Internal generic functions |
| mode : | | Internal generic functions |
|
N | | |
| ntp-address : | | Exported generic functions |
| ntp-address : | | Exported generic functions |
|
O | | |
| offset : | | Internal generic functions |
| offset : | | Internal generic functions |
| origtm-f : | | Internal generic functions |
| origtm-f : | | Internal generic functions |
| origtm-s : | | Internal generic functions |
| origtm-s : | | Internal generic functions |
|
P | | |
| poll : | | Internal generic functions |
| poll : | | Internal generic functions |
| precision : | | Internal generic functions |
| precision : | | Internal generic functions |
|
R | | |
| read32 : | | Internal functions |
| real-big-time : | | Internal functions |
| ref-id : | | Internal generic functions |
| ref-id : | | Internal generic functions |
| reftm-f : | | Internal generic functions |
| reftm-f : | | Internal generic functions |
| reftm-s : | | Internal generic functions |
| reftm-s : | | Internal generic functions |
| root-delay : | | Internal generic functions |
| root-delay : | | Internal generic functions |
| root-dispersion : | | Internal generic functions |
| root-dispersion : | | Internal generic functions |
| run-server-exchange : | | Internal generic functions |
| run-server-exchange : | | Internal generic functions |
| rxtm-f : | | Internal generic functions |
| rxtm-f : | | Internal generic functions |
| rxtm-s : | | Internal generic functions |
| rxtm-s : | | Internal generic functions |
|
S | | |
| seconds-to-fraction : | | Exported functions |
| small-time : | | Exported macros |
| stratum : | | Internal generic functions |
| stratum : | | Internal generic functions |
| sub-internal : | | Exported functions |
| synchronize : | | Exported generic functions |
| synchronize : | | Exported generic functions |
|
T | | |
| to-fraction : | | Exported functions |
| txtm-f : | | Internal generic functions |
| txtm-f : | | Internal generic functions |
| txtm-s : | | Internal generic functions |
| txtm-s : | | Internal generic functions |
|
U | | |
| usec-to-fraction : | | Exported functions |
|
V | | |
| version-number : | | Internal generic functions |
| version-number : | | Internal generic functions |
|
W | | |
| write32 : | | Internal functions |
|
A.3 Variables
A.4 Data types