from server.app.dtos.NtpExtraDetails import NtpExtraDetails
[docs]
class NtpValidation:
[docs]
@staticmethod
def is_valid(details: NtpExtraDetails) -> bool:
"""
Checks the validity of the details object.
According to ntp, the 'leap' attribute has only 2 bits and if its value is 3 (11 in binary)
then it is invalid.
Args:
details (NtpExtraDetails): The details objects to validate.
Returns:
bool: True if the provided details have a 'leap' value different from 3,
False otherwise.
"""
if details.leap == 3:
return False
return True