2a4b80d0fbe03ad69747e148b5fd93b0ed7f3f0c
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

1) #ifndef ETHERNET_H
2) #define ETHERNET_H
3) 
Stefan Schuermans added padding of ethernet p...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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