diff options
| author | Miguel <m.i@gmx.at> | 2018-09-27 11:03:00 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-27 11:03:00 +0200 |
| commit | 05d86ed530c05ba3f8648ffd7e67f4a593ae58d8 (patch) | |
| tree | df959f63050abda6d3ca4f46dfab56ba07443ca4 /net/ntp.c | |
| parent | 50ad5b31f261eceb715720fbe279a69241770554 (diff) | |
ntp
Diffstat (limited to 'net/ntp.c')
| -rw-r--r-- | net/ntp.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1,4 +1,6 @@ #include "udp.h" +#include "inet.h" +#include "net_sys.h" #include "ntp.h" uint32_t ntp_generic(struct netdev *dev, uint32_t ip, uint16_t src, uint16_t dst, uint8_t* pos,uint8_t *end) @@ -34,3 +36,11 @@ uint32_t ntp_generic(struct netdev *dev, uint32_t ip, uint16_t src, uint16_t dst return udp_generic(dev, ip, src, dst, pos,end); } +uint32_t ntp_incoming(uint8_t* start, uint8_t *pos) +{ + struct udp_v4_ntp *ntp=pos; + klog("0x%08X",ntohl(ntp->txTm_s)); // timestamp recevived + klog("google's NTP says that %d seconds elapsed since 1 jan 1970",ntohl(ntp->txTm_s)); // timestamp recevived + return 0; // all ok +} + |
