Interface NtpV3Packet
- All Known Implementing Classes:
NtpV3Impl
public interface NtpV3Packet
Interface for a NtpV3Packet with get/set methods corresponding to the fields in the NTP Data Message Header described in RFC 1305.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int3static final int2static final int1static final int0static final intMode option 5.static final intMode option 3.static final intMode option 6.static final intMode option 7.static final intMode option 0.static final intMode option 4.static final intMode option 1.static final intMode option 2.static final int10static final int14static final int1static final int4static final intStandard NTP UDP portstatic final String"DAYTIME"static final String"ICMP"static final String"NTP"static final String"TIME"static final int3static final int4 -
Method Summary
Modifier and TypeMethodDescriptionGets a datagram packet with the NTP parts already filled in.intGets the leap indicator as defined in RFC-1305.intgetMode()Gets the mode as defined in RFC-1305.Gets the mode as human readable string; for example, 3=Client.Gets theoriginatetime as defined in RFC-1305.intgetPoll()Gets the poll interval as defined in RFC-1305.intGets the precision as defined in RFC-1305.Gets thereceivetime as defined in RFC-1305.intGets the reference id (32-bit code) as defined in RFC-1305.Gets the reference ID string.Gets the reference time as defined in RFC-1305.intGets the root delay as defined in RFC-1305.doubleGets root delay in milliseconds.intGets the root dispersion as defined in RFC-1305.longGets the root dispersion in milliseconds.doubleGets the root dispersion in milliseconds.intGets the stratum as defined in RFC-1305.Gets thetransmittimestamp as defined in RFC-1305.getType()Gets the type of time packet.intGets version as defined in RFC-1305.voidSets the contents of this object from the datagram packetvoidsetLeapIndicator(int li) Sets leap indicator.voidsetMode(int mode) Sets mode as defined in RFC-1305voidSets originate timestamp given NTP TimeStamp object.voidsetPoll(int poll) Sets poll interval as defined in RFC-1305.voidsetPrecision(int precision) Sets precision as defined in RFC-1305voidSets receive timestamp given NTP TimeStamp object.voidsetReferenceId(int refId) Sets reference clock identifier field.voidSets the reference timestamp given NTP TimeStamp object.voidsetRootDelay(int delay) Sets root delay as defined in RFC-1305voidsetRootDispersion(int dispersion) Sets the dispersion value.voidsetStratum(int stratum) Sets stratum as defined in RFC-1305voidSets thetransmittimestamp given NTP TimeStamp object.voidsetVersion(int version) Sets version as defined in RFC-1305
-
Field Details
-
NTP_PORT
-
LI_NO_WARNING
-
LI_LAST_MINUTE_HAS_61_SECONDS
-
LI_LAST_MINUTE_HAS_59_SECONDS
-
LI_ALARM_CONDITION
-
MODE_RESERVED
-
MODE_SYMMETRIC_ACTIVE
-
MODE_SYMMETRIC_PASSIVE
-
MODE_CLIENT
-
MODE_SERVER
-
MODE_BROADCAST
-
MODE_CONTROL_MESSAGE
-
MODE_PRIVATE
-
NTP_MINPOLL
-
NTP_MAXPOLL
-
NTP_MINCLOCK
-
NTP_MAXCLOCK
-
VERSION_3
-
VERSION_4
-
TYPE_NTP
-
TYPE_ICMP
-
TYPE_TIME
-
TYPE_DAYTIME
-
-
Method Details
-
getDatagramPacket
Gets a datagram packet with the NTP parts already filled in.- Returns:
- a datagram packet with the NTP parts already filled in.
-
getLeapIndicator
int getLeapIndicator()Gets the leap indicator as defined in RFC-1305.- Returns:
- the leap indicator as defined in RFC-1305.
-
getMode
-
getModeName
Gets the mode as human readable string; for example, 3=Client.- Returns:
- the mode as human readable string; for example, 3=Client.
-
getOriginateTimeStamp
Gets theoriginatetime as defined in RFC-1305.- Returns:
- the
originatetime as defined in RFC-1305.
-
getPoll
int getPoll()Gets the poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.- Returns:
- the poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.
-
getPrecision
int getPrecision()Gets the precision as defined in RFC-1305.- Returns:
- the precision as defined in RFC-1305.
-
getReceiveTimeStamp
Gets thereceivetime as defined in RFC-1305.- Returns:
- the
receivetime as defined in RFC-1305.
-
getReferenceId
int getReferenceId()Gets the reference id (32-bit code) as defined in RFC-1305.- Returns:
- the reference id (32-bit code) as defined in RFC-1305.
-
getReferenceIdString
-
getReferenceTimeStamp
Gets the reference time as defined in RFC-1305.- Returns:
- the reference time as defined in RFC-1305.
-
getRootDelay
int getRootDelay()Gets the root delay as defined in RFC-1305.- Returns:
- the root delay as defined in RFC-1305.
-
getRootDelayInMillisDouble
double getRootDelayInMillisDouble()Gets root delay in milliseconds.- Returns:
- root delay in milliseconds.
-
getRootDispersion
int getRootDispersion()Gets the root dispersion as defined in RFC-1305.- Returns:
- the root dispersion as defined in RFC-1305.
-
getRootDispersionInMillis
long getRootDispersionInMillis()Gets the root dispersion in milliseconds.- Returns:
- the root dispersion in milliseconds.
-
getRootDispersionInMillisDouble
double getRootDispersionInMillisDouble()Gets the root dispersion in milliseconds.- Returns:
- the root dispersion in milliseconds.
-
getStratum
int getStratum()Gets the stratum as defined in RFC-1305.- Returns:
- the stratum as defined in RFC-1305.
-
getTransmitTimeStamp
Gets thetransmittimestamp as defined in RFC-1305.- Returns:
- the
transmittimestamp as defined in RFC-1305.
-
getType
-
getVersion
-
setDatagramPacket
Sets the contents of this object from the datagram packet- Parameters:
dp- the packet
-
setLeapIndicator
-
setMode
-
setOriginateTimeStamp
Sets originate timestamp given NTP TimeStamp object.- Parameters:
ts- timestamp
-
setPoll
Sets poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.- Parameters:
poll- the interval to set
-
setPrecision
Sets precision as defined in RFC-1305- Parameters:
precision- Precision- Since:
- 3.4
-
setReceiveTimeStamp
Sets receive timestamp given NTP TimeStamp object.- Parameters:
ts- timestamp
-
setReferenceId
Sets reference clock identifier field.- Parameters:
refId- the clock id field to set
-
setReferenceTime
Sets the reference timestamp given NTP TimeStamp object.- Parameters:
ts- timestamp
-
setRootDelay
Sets root delay as defined in RFC-1305- Parameters:
delay- the delay to set- Since:
- 3.4
-
setRootDispersion
Sets the dispersion value.- Parameters:
dispersion- the value.- Since:
- 3.4
-
setStratum
Sets stratum as defined in RFC-1305- Parameters:
stratum- the stratum to set
-
setTransmitTime
Sets thetransmittimestamp given NTP TimeStamp object.- Parameters:
ts- timestamp
-
setVersion
Sets version as defined in RFC-1305- Parameters:
version- the version to set
-