Newsgroups: comp.lang.c
Path: utzoo!utgpu!watserv1!watmath!datangua
From: datangua@watmath.waterloo.edu (David Tanguay)
Subject: Re: What breaks? (was Re: 64 bit longs?)
Organization: University of Waterloo
Date: Tue, 22 Jan 91 11:19:03 GMT
Message-ID: <1991Jan22.111903.28782@watmath.waterloo.edu>
References: <1991Jan15.202123.14223@gjetor.geac.COM> <14890@smoke.brl.mil> <1991Jan18.044948.27943@zoo.toronto.edu> <14896@smoke.brl.mil> <1991Jan21.025706.7152@zoo.toronto.edu> <1991Jan21.113942.24379@watmath.waterloo.edu> <1991Jan21.190008.1291@zoo.toronto.edu>
Lines: 15

In article <1991Jan21.190008.1291@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>The TCP header, being part of a network protocol, is defined down to the bit
>independently of any specific machine.  Its address fields, for example,
>are 32 bits.  Not 31, not 33, and certainly not 36.  32 and only 32.
>A machine with a sufficiently weird structure may have trouble declaring
>a TCP header using a C struct.

32 bits is the size of the transmitted info. Why does the C structure
representing that header have to match it exactly? Only the routines
that read and write the header should have to care about whether the
C structure matches the transmitted packet bit for bit, and adjust
accordingly.  A bitfield might be required to get proper arithmetic on
the field.
-- 
David Tanguay            Software Development Group, University of Waterloo
