Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented status messages for ntpv5. #1209

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

davidv1992
Copy link
Member

Note: this is based on the current proposal from us, not yet part of the draft.

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 87 lines in your changes are missing coverage. Please review.

Comparison is base (db26b47) 85.47% compared to head (c77e1e3) 85.09%.

Files Patch % Lines
ntp-proto/src/packet/mod.rs 42.15% 59 Missing ⚠️
ntp-proto/src/packet/v5/mod.rs 24.24% 25 Missing ⚠️
ntp-proto/src/time_types.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1209      +/-   ##
==========================================
- Coverage   85.47%   85.09%   -0.39%     
==========================================
  Files          58       58              
  Lines       17077    17204     +127     
==========================================
+ Hits        14596    14639      +43     
- Misses       2481     2565      +84     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}
}
}

pub fn is_kiss(&self) -> bool {
match self.header {
NtpHeader::V3(header) => header.stratum == 0,
NtpHeader::V4(header) => header.stratum == 0,
#[cfg(feature = "ntpv5")]
// TODO NTPv5 does not have Kiss codes so we pretend everything is always fine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This todo no longer seems to apply?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the todo

NtpHeader::V3(header) => header.reference_id,
NtpHeader::V4(header) => header.reference_id,
#[cfg(feature = "ntpv5")]
// Kiss code in ntpv5 is the first four bytes of the server vookie
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: vookie -> cookie

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

@rnijveld rnijveld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things, but other than that LGTM!

Copy link
Contributor

@tdittr tdittr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, is just not DRY in some places.

ntp-proto/src/packet/mod.rs Show resolved Hide resolved
ntp-proto/src/packet/mod.rs Outdated Show resolved Hide resolved
ntp-proto/src/packet/mod.rs Show resolved Hide resolved
ntp-proto/src/packet/v5/mod.rs Outdated Show resolved Hide resolved
Note: this is based on the current proposal from us, not yet part of the
draft.
Copy link
Contributor

@tdittr tdittr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@rnijveld rnijveld added this pull request to the merge queue Nov 17, 2023
Merged via the queue into main with commit f9405df Nov 17, 2023
20 checks passed
@rnijveld rnijveld deleted the ntpv5-status-messages branch November 17, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants