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/inet.c | |
| parent | 50ad5b31f261eceb715720fbe279a69241770554 (diff) | |
ntp
Diffstat (limited to 'net/inet.c')
| -rw-r--r-- | net/inet.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -8,11 +8,18 @@ uint16_t ntohs(uint16_t val) { return val<<8|val>>8; } + uint16_t htons(uint16_t val) { return val<<8|val>>8; } +uint32_t ntohl(uint32_t val) +{ + return val<<24|val>>24|((0x00ff0000&val)>>8)|((0x0000ff00&val)<<8); +} + + uint16_t checksum(void *addr, int count) { /* Compute Internet Checksum for "count" bytes |
