summaryrefslogtreecommitdiff
path: root/net/eth.h
blob: aa4efeb5a5d3c75e5f4cd910f227bda54a40bdfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//http://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-arp/
//https://tools.ietf.org/html/rfc7414
#ifndef FOOLOS_ETH_H
#define FOOLOS_ETH_H

#include <stdint.h>

struct eth_hdr
{
    unsigned char dmac[6];	// destination mac
    unsigned char smac[6];	// source mac
    uint16_t ethertype;		// length or type
    unsigned char payload[];	// payload
} __attribute__((packed));

struct netdev;

uint32_t eth_generic(struct netdev *dev, uint32_t ip, uint16_t type, uint8_t* pos,uint32_t *end);

#endif