Services
Business logic for the API
Methods used for calculating data from the timestamps
Methods used for validating an NTP measurement
- class server.app.services.NtpValidation.NtpValidation[source]
Bases:
object
- static is_valid(details)[source]
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.
- Parameters:
details (NtpExtraDetails) – The details objects to validate.
- Returns:
- True if the provided details have a ‘leap’ value different from 3,
False otherwise.
- Return type:
bool