mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-23 23:30:25 +08:00
优化NTP时钟自动同步
This commit is contained in:
21
internal/utils/clock/ntp_packet.go
Normal file
21
internal/utils/clock/ntp_packet.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package clock
|
||||
|
||||
type NTPPacket struct {
|
||||
Settings uint8 // leap yr indicator, ver number, and mode
|
||||
Stratum uint8 // stratum of local clock
|
||||
Poll int8 // poll exponent
|
||||
Precision int8 // precision exponent
|
||||
RootDelay uint32 // root delay
|
||||
RootDispersion uint32 // root dispersion
|
||||
ReferenceID uint32 // reference id
|
||||
RefTimeSec uint32 // reference timestamp sec
|
||||
RefTimeFrac uint32 // reference timestamp fractional
|
||||
OrigTimeSec uint32 // origin time secs
|
||||
OrigTimeFrac uint32 // origin time fractional
|
||||
RxTimeSec uint32 // receive time secs
|
||||
RxTimeFrac uint32 // receive time frac
|
||||
TxTimeSec uint32 // transmit time secs
|
||||
TxTimeFrac uint32 // transmit time frac
|
||||
}
|
||||
Reference in New Issue
Block a user