summaryrefslogtreecommitdiff
path: root/net/netdev.c
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/netdev.c
parent112ca29a3bb2ab38693943ed33ee51f4fd7d2d81 (diff)
working on icmp ping reply
Diffstat (limited to 'net/netdev.c')
-rw-r--r--net/netdev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/netdev.c b/net/netdev.c
index 3acd7a4..1539bd6 100644
--- a/net/netdev.c
+++ b/net/netdev.c
@@ -1,9 +1,17 @@
#include <stdint.h>
#include "inet.h"
#include "eth.h"
+#include "arp.h"
+#include "ipv4.h"
#include "netdev.h"
#include "lib/string/string.h"
+void net_incoming(struct netdev *netdev, struct eth_hdr *hdr)
+{
+ if(hdr->ethertype==htons(ETH_P_ARP))arp_incoming(netdev,hdr);
+ if(hdr->ethertype==htons(ETH_P_IPV4))ipv4_incoming(netdev,hdr);
+}
+
void netdev_transmit(struct netdev *dev, struct eth_hdr *hdr, uint16_t ethertype, int len, unsigned char *dst)
{
hdr->ethertype = htons(ethertype);