mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 07:19:20 +00:00
🎉Implemented networking🎉
This commit is contained in:
39
include/net/ntp.hpp
Normal file
39
include/net/ntp.hpp
Normal file
@ -0,0 +1,39 @@
|
||||
#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__
|
Reference in New Issue
Block a user