summaryrefslogtreecommitdiff
path: root/net/inet.h
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-25 20:46:52 +0200
committerMiguel <m.i@gmx.at>2018-09-25 20:46:52 +0200
commitb58e7bc7cb8ce4fc6f824761ac8ef3920e7dfcc1 (patch)
treed760847e65ac231e5a18a9051af15eac12ff071d /net/inet.h
parent112ca29a3bb2ab38693943ed33ee51f4fd7d2d81 (diff)
working on icmp ping reply
Diffstat (limited to 'net/inet.h')
-rw-r--r--net/inet.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/net/inet.h b/net/inet.h
index a2e8dd8..75ab6db 100644
--- a/net/inet.h
+++ b/net/inet.h
@@ -8,13 +8,16 @@
#define ARP_IPV4 0x800
#define ARP_REPLY 2
#define ARP_REQUEST 1
+
#define ETH_P_ARP 0x0806
+#define ETH_P_IPV4 0x0800
+
+#define IPV4_P_ICMP 0x1
+
+#define ICMP_ECHO_REPLY 0
+#define ICMP_UNREACHABLE 3
+#define ICMP_ECHO_REQUEST 8
-static uint16_t ntohs(uint16_t val)
-{
- return val<<8|val>>8;
-}
-static uint16_t htons(uint16_t val)
-{
- return val<<8|val>>8;
-}
+uint16_t checksum(void *addr, int count);
+uint16_t ntohs(uint16_t val);
+uint16_t htons(uint16_t val);