Afficher un message
Vieux 09/10/2007, 06h08   #5
Logan Shaw
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
 
Page generated in 0,05250 seconds with 9 queries