Re: Why put the structures in a structure when assembling a TCP/IPPacket?
grocery_stocker wrote:
> Is there anykind of significance to putting a structure inside another
> stucture when assembling a TCP/IP packet by hand? In the following
> code snippet, struct iphdr and struct tcphdr are inside another
> stucture. The only thing I can think of is that it's to ensure some
> kind of memory alignmen
>
> struct tpack{
> struct iphdr ip;
> struct tcphdr tcp;
> }tpack; /*Why put the structures inside another structure?*/
Because UDP packets also begin with (identical) IP headers?
(As do lots of other protocols that can run on top of IP.)
- Logan
|