[][src]Struct ntpd::NtpPacket

pub struct NtpPacket {
    pub header: Header,
    pub root_delay: ShortTimestamp,
    pub root_dispersion: ShortTimestamp,
    pub ref_id: RefIdentifier,
    pub ref_timestamp: Timestamp,
    pub origin_timestamp: Timestamp,
    pub receive_timestamp: Timestamp,
    pub transmit_timestamp: Timestamp,
}

Ntp package format:

 0                   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 ID                          |
+--------------+---------------+---------------+----------------+
|                                                               |
+                   Reference Timestamp (64)                    +
|                                                               |
+--------------+---------------+---------------+----------------+
|                                                               |
+                     Origin Timestamp (64)                     +
|                                                               |
+--------------+---------------+---------------+----------------+
|                                                               |
+                    Receive Timestamp (64)                     +
|                                                               |
+--------------+---------------+---------------+----------------+
|                                                               |
+                    Transmit Timestamp (64)                    +
|                                                               |
+--------------+---------------+---------------+----------------+
|                                                               |
.                                                               .
.                    Extension Field 1 (variable)               .
.                                                               .
|                                                               |
+--------------+---------------+---------------+----------------+
|                                                               |
.                                                               .
.                    Extension Field 2 (variable)               .
.                                                               .
|                                                               |
+--------------+---------------+---------------+----------------+
|                        Key Identifier                         |
+--------------+---------------+---------------+----------------+
|                                                               |
|                          dgst (128)                           |
|                                                               |
+--------------+---------------+---------------+----------------+

Fields

header: Headerroot_delay: ShortTimestamproot_dispersion: ShortTimestampref_id: RefIdentifierref_timestamp: Timestamporigin_timestamp: Timestampreceive_timestamp: Timestamptransmit_timestamp: Timestamp

Methods

impl NtpPacket[src]

pub fn new() -> NtpPacket[src]

Trait Implementations

impl BinLen for NtpPacket[src]

impl Clone for NtpPacket[src]

impl Copy for NtpPacket[src]

impl Debug for NtpPacket[src]

impl Default for NtpPacket[src]

impl Eq for NtpPacket[src]

impl Hash for NtpPacket[src]

impl PartialEq<NtpPacket> for NtpPacket[src]

impl StructuralEq for NtpPacket[src]

impl StructuralPartialEq for NtpPacket[src]

impl ToNetPacket for NtpPacket[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.