NDEVR
API Documentation
NtpPacket.h
1#pragma once
2
3#include <QtCore/QtGlobal>
4
5#include <NDEVR/NtpTimestamp.h>
6namespace NDEVR
7{
13 unsigned char mode : 3;
14
16 unsigned char versionNumber : 3;
17
20 unsigned char leapIndicator : 2;
21 };
22 static_assert(sizeof(NtpPacketFlags) == 1);
23
24#pragma pack(push, 1)
63 static_assert(sizeof(NtpPacket) == 48);
64
70 quint32 keyId;
71
73 quint8 messageDigest[16];
74 };
75 static_assert(sizeof(NtpAuthenticationInfo) == 20);
76
84 static_assert(sizeof(NtpFullPacket) == 68);
85
86#pragma pack(pop)
87}
The primary namespace for the NDEVR SDK.
Optional authentication extension of an NTP packet.
Definition NtpPacket.h:68
quint32 keyId
Key identifier.
Definition NtpPacket.h:70
quint8 messageDigest[16]
Message Digest.
Definition NtpPacket.h:73
Full NTP packet combining mandatory fields and optional authentication.
Definition NtpPacket.h:80
NtpPacket basic
The mandatory NTP packet fields.
Definition NtpPacket.h:81
NtpAuthenticationInfo auth
The optional authentication information.
Definition NtpPacket.h:82
NTP packet flags stored in the first byte of the packet.
Definition NtpPacket.h:11
unsigned char versionNumber
Version number of the protocol (3 or 4).
Definition NtpPacket.h:16
unsigned char mode
Mode.
Definition NtpPacket.h:13
unsigned char leapIndicator
Warns of an impending leap second to be inserted/deleted in the last minute of the current day.
Definition NtpPacket.h:20
Mandatory part of an NTP packet, containing all required fields.
Definition NtpPacket.h:29
qint8 poll
Maximum interval between successive messages, in log2 seconds.
Definition NtpPacket.h:37
quint8 stratum
Stratum of the clock.
Definition NtpPacket.h:34
NtpTimestamp referenceTimestamp
The time at which the clock was last set or corrected.
Definition NtpPacket.h:52
qint32 rootDispersion
Nominal error relative to the primary reference source.
Definition NtpPacket.h:46
qint8 precision
Precision of the clock, in log2 seconds.
Definition NtpPacket.h:40
qint32 rootDelay
Round trip time to the primary reference source, in NTP short format.
Definition NtpPacket.h:43
NtpPacketFlags flags
Flags.
Definition NtpPacket.h:31
NtpTimestamp transmitTimestamp
The time at which the reply departed the server for client.
Definition NtpPacket.h:61
qint8 referenceID[4]
Reference identifier (either a 4 character string or an IP address).
Definition NtpPacket.h:49
NtpTimestamp originateTimestamp
The time at which the request departed the client for the server.
Definition NtpPacket.h:55
NtpTimestamp receiveTimestamp
The time at which the request arrived at the server.
Definition NtpPacket.h:58
A 64-bit NTP timestamp with seconds and fractional parts since Jan 1, 1900.