FileDocCategorySizeDatePackage
NtpV3Packet.javaAPI DocApache Commons NET 1.4.1 API6286Sat Dec 03 10:05:48 GMT 2005org.apache.commons.net.ntp

NtpV3Packet

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.
author
Naz Irizarry, MITRE Corp
author
Jason Mathews, MITRE Corp
version
$Revision: 165675 $ $Date: 2005-05-02 15:09:55 -0500 (Mon, 02 May 2005) $

Fields Summary
public static final int
NTP_PORT
Standard NTP UDP port
public static final int
LI_NO_WARNING
public static final int
LI_LAST_MINUTE_HAS_61_SECONDS
public static final int
LI_LAST_MINUTE_HAS_59_SECONDS
public static final int
LI_ALARM_CONDITION
public static final int
MODE_RESERVED
public static final int
MODE_SYMMETRIC_ACTIVE
public static final int
MODE_SYMMETRIC_PASSIVE
public static final int
MODE_CLIENT
public static final int
MODE_SERVER
public static final int
MODE_BROADCAST
public static final int
MODE_CONTROL_MESSAGE
public static final int
MODE_PRIVATE
public static final int
NTP_MINPOLL
public static final int
NTP_MAXPOLL
public static final int
NTP_MINCLOCK
public static final int
NTP_MAXCLOCK
public static final int
VERSION_3
public static final int
VERSION_4
public static final String
TYPE_NTP
public static final String
TYPE_ICMP
public static final String
TYPE_TIME
public static final String
TYPE_DAYTIME
Constructors Summary
Methods Summary
public java.net.DatagramPacketgetDatagramPacket()

return
a datagram packet with the NTP parts already filled in

public intgetLeapIndicator()

return
leap indicator as defined in RFC-1305

public intgetMode()

return
mode as defined in RFC-1305

public java.lang.StringgetModeName()

return
mode as human readable string; e.g. 3=Client

public TimeStampgetOriginateTimeStamp()

return
the originate time as defined in RFC-1305

public intgetPoll()

return
poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.

public intgetPrecision()

return
precision as defined in RFC-1305

public TimeStampgetReceiveTimeStamp()

return
the receive time as defined in RFC-1305

public intgetReferenceId()

return
the reference id (32-bit code) as defined in RFC-1305

public java.lang.StringgetReferenceIdString()

return
the reference id string

public TimeStampgetReferenceTimeStamp()

return
the reference time as defined in RFC-1305

public intgetRootDelay()

return
root delay as defined in RFC-1305

public doublegetRootDelayInMillisDouble()

return
root delay in milliseconds

public intgetRootDispersion()

return
root dispersion as defined in RFC-1305

public longgetRootDispersionInMillis()

return
root dispersion in milliseconds

public doublegetRootDispersionInMillisDouble()

return
root dispersion in milliseconds

public intgetStratum()

return
stratum as defined in RFC-1305

public TimeStampgetTransmitTimeStamp()

return
the transmit timestamp as defined in RFC-1305

public java.lang.StringgetType()
Return type of time packet. The values (e.g. NTP, TIME, ICMP, ...) correspond to the protocol used to obtain the timing information.

return
packet type string identifier

public intgetVersion()

return
version as defined in RFC-1305

public voidsetDatagramPacket(java.net.DatagramPacket dp)
Set the contents of this object from the datagram packet

public voidsetLeapIndicator(int li)
Set leap indicator.

param
li - leap indicator code

public voidsetMode(int mode)
Set mode as defined in RFC-1305

public voidsetOriginateTimeStamp(TimeStamp ts)
Set originate timestamp given NTP TimeStamp object.

param
ts - timestamp

public voidsetPoll(int poll)
Set poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.

public voidsetReceiveTimeStamp(TimeStamp ts)
Set receive timestamp given NTP TimeStamp object.

param
ts - timestamp

public voidsetReferenceId(int refId)
Set reference clock identifier field.

param
refId

public voidsetReferenceTime(TimeStamp ts)
Set the reference timestamp given NTP TimeStamp object.

param
ts - timestamp

public voidsetStratum(int stratum)
Set stratum as defined in RFC-1305

public voidsetTransmitTime(TimeStamp ts)
Set the transmit timestamp given NTP TimeStamp object.

param
ts - timestamp

public voidsetVersion(int mode)
Set version as defined in RFC-1305