summaryrefslogtreecommitdiff
path: root/net/netdev.c
diff options
context:
space:
mode:
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);