c2b040193a777c09bdc595c95492b57a2521db87
Stefan Schuermans added file headers

Stefan Schuermans authored 12 years ago

1) /* MIPS I system
2)  * Copyright 2011-2012 Stefan Schuermans <stefan@schuermans.info>
3)  * Copyleft GNU public license V2 or later
4)  *          http://www.gnu.org/copyleft/gpl.html
5)  */
6) 
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

7) #ifndef ETHERNET_H
8) #define ETHERNET_H
9) 
Stefan Schuermans added padding of ethernet p...

Stefan Schuermans authored 12 years ago

10) /// header of ethernet packet
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

11) struct ethernet_header
12) {
13)   unsigned char dest[6];
14)   unsigned char src[6];
15)   unsigned short type;
16) } __attribute__((packed));
17) 
18) /// ethernet packet
19) struct ethernet_packet
20) {
21)   struct ethernet_header eth_hdr;
22) } __attribute__((packed));
23) 
24) /**
25)  * @brief process a received ethernet packet
26)  * @param[in] ptr pointer to data of packet
27)  * @param[in] sz size of packet
28)  */
29) void ethernet_recv(void *ptr, unsigned int sz);
30) 
31) /**
32)  * @brief send an ethernet packet
33)  * @param[in] ptr pointer to data of packet
34)  * @param[in] sz size of packet
35)  *
Stefan Schuermans handle padding to minimum e...

Stefan Schuermans authored 12 years ago

36)  * ptr must point to a ethernet_packet
Stefan Schuermans implemented IP + ICMP, fixe...

Stefan Schuermans authored 12 years ago

37)  * with eth_hdr.dest and eth_hdr.type already initialized