DIRECTORY ArpaBuf USING[Hdr, maxBodyBytes], Basics USING [FWORD, HWORD], CommBuffer USING [Overhead]; ArpaTCPBuf: CEDAR DEFINITIONS ~ { HWORD: TYPE ~ Basics.HWORD; FWORD: TYPE ~ Basics.FWORD; maxBytes: CARDINAL ~ ArpaBuf.maxBodyBytes; Port: TYPE ~ HWORD; nullPort: Port ~ [0, 0]; Pair: TYPE = MACHINE DEPENDENT RECORD [a, b: CARDINAL]; -- used for word swap Hdr: TYPE ~ TCPHeader; TCPHeader: TYPE = MACHINE DEPENDENT RECORD [ sourcePort (0): Port, -- source port number dstnPort (1): Port, -- destination port number seqNumber (2): Pair, -- sequence number ackNumber (4): Pair, -- acknowledgement number dataWordOffset (6: 0..3): INT [0..15], -- size of header in 32-bit words unused (6: 4..9): INT [0..63] _ 0, urg (6: 10..10): BOOL _ FALSE, -- control flags, urgent ack (6: 11..11): BOOL _ FALSE, -- acknowledgement psh (6: 12..12): BOOL _ FALSE, -- push rst (6: 13..13): BOOL _ FALSE, -- reset syn (6: 14..14): BOOL _ FALSE, -- syn (first packet on connection) fin (6: 15..15): BOOL _ FALSE, -- fin (last packet on connection) window (7): Basics.HWORD, -- window of packets to send checksum (8): Basics.HWORD, -- for header and pseudo header urgentPtr (9): Basics.HWORD _ [0,0] -- ptr to byte following urgent data ]; hdrBytes: CARDINAL ~ BYTES[Hdr]; Body: TYPE ~ MACHINE DEPENDENT RECORD [ SELECT OVERLAID * FROM bytes => [bytes: PACKED ARRAY [0..maxBodyBytes) OF BYTE], chars => [chars: PACKED ARRAY [0..maxBodyChars) OF CHAR], hWords => [hWords: PACKED ARRAY [0..maxBodyHWords) OF HWORD], fWords => [fWords: PACKED ARRAY [0..maxBodyFWords) OF FWORD] ENDCASE ]; maxBodyBytes: CARDINAL ~ maxBytes - hdrBytes; maxBodyChars: CARDINAL ~ maxBodyBytes; maxBodyHWords: CARDINAL ~ maxBodyBytes/BYTES[HWORD]; maxBodyFWords: CARDINAL ~ maxBodyBytes/BYTES[FWORD]; Packet: TYPE ~ REF PacketObject; PacketObject: TYPE ~ MACHINE DEPENDENT RECORD [ hdr: Hdr, body: Body]; Buffer: TYPE ~ REF BufferObject; BufferObject: TYPE ~ MACHINE DEPENDENT RECORD [ ovh: CommBuffer.Overhead, hdr1: ArpaBuf.Hdr, hdr2: Hdr, body: Body]; }. ΚArpaTCPBuf.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Demers, July 24, 1987 7:41:42 pm PDT Doug Terry, August 28, 1987 11:38:55 am PDT Format for Arpa TCP packets. Header options are in CommDriver.BufferObject.spaceForOptions. Body Packet Buffer All buffers start out as Driver.Buffer's. Clients may SmashType between Driver.Buffer and ArpaBuf.Buffer, so the "right" module gets to do finalization. This is VERY delicate. ΚŒ˜codešœ™Kšœ Οmœ1™