From b58e7bc7cb8ce4fc6f824761ac8ef3920e7dfcc1 Mon Sep 17 00:00:00 2001 From: Miguel Date: Tue, 25 Sep 2018 20:46:52 +0200 Subject: working on icmp ping reply --- net/netdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'net/netdev.c') 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 #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); -- cgit v1.2.3