What breaks? (was Re: 64 bit longs?)

Henry Spencer henry at zoo.toronto.edu
Wed Jan 23 05:05:38 AEST 1991


In article <1991Jan22.111903.28782 at watmath.waterloo.edu> datangua at watmath.waterloo.edu (David Tanguay) writes:
>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...

In an orthodox TCP/IP implementation, those "routines" are all of TCP.
One of the things the funny machines end up doing is putting kludge
routines in between the network representation and the internal
representation.  You still have to write those routines, however.
That can be hard; C bitfields can't span words in most implementations,
so you may end up doing shift-and-mask instead.
-- 
If the Space Shuttle was the answer,   | Henry Spencer at U of Toronto Zoology
what was the question?                 |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list