org.hyperic.util.ntp
Class NtpResponse
java.lang.Object
org.hyperic.util.ntp.NtpResponse
public class NtpResponse
- extends java.lang.Object
Java representation of an NTP response as described in RFC 2030
http://www.faqs.org/rfcs/rfc2030.html
Packet format:
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Reference Timestamp (64) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Originate Timestamp (64) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Receive Timestamp (64) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Transmit Timestamp (64) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Key Identifier (optional) (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| |
| Message Digest (optional) (128) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
leapIndicator
protected byte leapIndicator
version
protected byte version
mode
protected byte mode
stratum
protected short stratum
interval
protected byte interval
precision
protected byte precision
rootDelay
protected double rootDelay
rootDispersion
protected double rootDispersion
referenceIdentifier
protected byte[] referenceIdentifier
referenceTimestamp
protected double referenceTimestamp
originateTimestamp
protected double originateTimestamp
receiveTimestamp
protected double receiveTimestamp
transmitTimestamp
protected double transmitTimestamp
roundTripDelay
protected double roundTripDelay
localClockOffset
protected double localClockOffset
getRequestBytes
public static byte[] getRequestBytes()
- Generate the NTP request
decodeResponse
public static NtpResponse decodeResponse(double ts,
byte[] data)
- Decode the NTP server response
getLocalClockOffset
public double getLocalClockOffset()
getRoundTripDelay
public double getRoundTripDelay()
getRootDelay
public double getRootDelay()
getRootDispersion
public double getRootDispersion()
Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.