mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-15 01:09:18 +00:00
.github
.vscode
Architecture
Core
Execute
FileSystem
Files
GUI
Library
Network
Profiling
Recovery
SystemCalls
Tasking
Tests
include
boot
filesystem
net
arp.hpp
dhcp.hpp
eth.hpp
icmpv4.hpp
icmpv6.hpp
ipv4.hpp
ipv6.hpp
nc.hpp
net.hpp
ntp.hpp
tcp.hpp
udp.hpp
abi.h
assert.h
atomic.hpp
bitmap.hpp
cargs.h
convert.h
cpu.hpp
crc32.h
cstring
cwalk.h
debug.h
disk.hpp
display.hpp
driver.hpp
dumper.hpp
elf.h
exec.hpp
filesystem.hpp
gui.hpp
hashmap.hpp
interrupts.hpp
io.h
ipc.hpp
kconfig.hpp
limits.h
lock.hpp
md5.h
memory.hpp
msexec.h
pci.hpp
power.hpp
printf.h
rand.hpp
recovery.hpp
smartptr.hpp
smp.hpp
std.hpp
stdint.h
symbols.hpp
sys.h
syscalls.hpp
task.hpp
time.hpp
types.h
uart.hpp
vector.hpp
.gitignore
DAPI.hpp
Doxyfile
Fex.hpp
KConfig.cpp
KThread.cpp
Kernel.cpp
LICENSE
Makefile
README.md
dump.sh
kernel.h
syscalls.h
40 lines
804 B
C++
40 lines
804 B
C++
#ifndef __FENNIX_KERNEL_NTP_H__
|
|
#define __FENNIX_KERNEL_NTP_H__
|
|
|
|
#include <net/udp.hpp>
|
|
#include <types.h>
|
|
|
|
namespace NetworkNTP
|
|
{
|
|
struct NTPHeader
|
|
{
|
|
uint8_t LIv;
|
|
uint8_t VN;
|
|
uint8_t Mode;
|
|
uint8_t Stratum;
|
|
uint8_t Poll;
|
|
uint8_t Precision;
|
|
uint32_t RootDelay;
|
|
uint32_t RootDispersion;
|
|
uint32_t ReferenceID;
|
|
uint32_t ReferenceTimestamp;
|
|
uint32_t OriginateTimestamp;
|
|
uint32_t ReceiveTimestamp;
|
|
uint32_t TransmitTimestamp;
|
|
} __attribute__((packed));
|
|
|
|
class NTP : public NetworkUDP::UDPEvents
|
|
{
|
|
private:
|
|
NetworkUDP::Socket *Socket;
|
|
|
|
public:
|
|
NTP(NetworkUDP::Socket *Socket);
|
|
~NTP();
|
|
|
|
void ReadTime();
|
|
};
|
|
}
|
|
|
|
#endif // !__FENNIX_KERNEL_NTP_H__
|