I am trying to emulate the bridge, for this I need to use a ethernet packet.
In a provided template code, I saw that someone has used this definition:
1 2 3 4 5 6 7 8 9
struct packet {
char sourceMACaddr[6]; //In net order
char destiMACaddr[6]; // In net order
short type; //0 for ARP frame and 1 for IP frame
short size; // size of data in host order
char *data; // actual data
};
Now what I don't understand is, what does he mean when he says sourceMACaddr is in net order?
Why is the use of type?
What does he mean when he says size of data in host order?
Can anyone please shed some light on these questions?
Have you seen this free ebook http://beej.us/guide/bgnet/
A introduction to network coding for rookies. I downloaded it and found it is easy to read - cutting out all the crap.