#include #include "inet.h" #include "eth.h" #include "netdev.h" #include "lib/string/string.h" void netdev_transmit(struct netdev *dev, struct eth_hdr *hdr, uint16_t ethertype, int len, unsigned char *dst) { hdr->ethertype = htons(ethertype); memcpy(hdr->smac, dev->hwaddr, 6); memcpy(hdr->dmac, dst, 6); len += sizeof(struct eth_hdr); dev->transmit(hdr,len); }