|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.service.time.ntptime.NtpHeader
public class NtpHeader
This class encapsulates the header of a NtpDatagram. See rfc2030 for more details. 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |LI | VN |Mode | Stratum | Poll | Precision | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Root Delay | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Root Dispersion | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reference Identifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field Summary | |
|---|---|
static NtpHeader |
defaultHeader
The default header for a client datagram. |
static byte[] |
defaultHeaderData
The default header data for a client datagram. |
| Constructor Summary | |
|---|---|
NtpHeader(byte[] data)
Construct a NtpHeader from a 16 byte array. |
|
NtpHeader(int offset,
byte[] data)
Construct a NtpHeader from a byte array and offset |
|
| Method Summary | |
|---|---|
byte[] |
getHeaderData()
Gets the 16 byte array constituting the header. |
int |
getLeapIndicator()
Gets leap indicator |
int |
getMode()
Gets mode |
int |
getPollInterval()
Gets poll interval |
double |
getPrecision()
Gets precision in milliseconds |
String |
getReferenceID()
Gets ReferenceID using the stratum and version number of the packet. |
String |
getReferenceID(int stratumVal,
int versionVal)
Gets ReferenceID with the given stratum and version number. |
double |
getRootDelay()
Gets root delay in milliseconds. |
double |
getRootDispersion()
Gets root dispersion. |
int |
getStratum()
Gets stratum |
int |
getVersionNumber()
Gets version number |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte[] defaultHeaderData
public static final NtpHeader defaultHeader
| Constructor Detail |
|---|
public NtpHeader(byte[] data)
public NtpHeader(int offset,
byte[] data)
| Method Detail |
|---|
public byte[] getHeaderData()
public int getLeapIndicator()
public int getMode()
public int getPollInterval()
public double getPrecision()
public String getReferenceID(int stratumVal,
int versionVal)
stratumVal - stratum value of the serverversionVal - version number of the packet
public String getReferenceID()
public double getRootDelay()
public double getRootDispersion()
public int getStratum()
public int getVersionNumber()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||