55a4ef917532453cc39576073284cfb60d9752af
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

1) #ifndef ARP_H
2) #define ARP_H
3) 
4) #include "ethernet.h"
5) 
Stefan Schuermans added padding of ethernet p...

Stefan Schuermans authored 12 years ago

6) /// header of ARP packet
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

7) struct arp_header
8) {
9)   unsigned short hw_type;
10)   unsigned short proto_type;
11)   unsigned char hw_len;
12)   unsigned char proto_len;
13)   unsigned short op;
14)   unsigned char src_mac[6];
15)   unsigned char src_ip[4];
16)   unsigned char dest_mac[6];
17)   unsigned char dest_ip[4];
18) } __attribute__((packed));
19) 
Stefan Schuermans added padding of ethernet p...

Stefan Schuermans authored 12 years ago

20) /// ARP packet
Stefan Schuermans implementation of ethernet...

Stefan Schuermans authored 12 years ago

21) struct arp_packet
22) {
23)   struct ethernet_header eth_hdr;
24)   struct arp_header arp_hdr;
25) } __attribute__((packed));
26) 
Stefan Schuermans added padding of ethernet p...

Stefan Schuermans authored 12 years ago

27) /// ARP packet with padding
28) ETHERNET_PAD(arp_packet);
29)