-- Checksums.mesa (last edited by: BLyon on: July 30, 1980  2:43 PM)

DIRECTORY
  BufferDefs USING [OisBuffer],
  PrincOps USING [aCHKSUM, zMISC];

Checksums: DEFINITIONS =
  BEGIN

  -- This procedure sets the checksum field of the Ois Packet.
  SetChecksum: PUBLIC PROCEDURE [b: BufferDefs.OisBuffer];

  -- This procedure checks the checksum field of the Ois Packet,
  -- and returns TRUE or FALSE.  The buffer is always a system buffer
  TestChecksum: PUBLIC PROCEDURE [b: BufferDefs.OisBuffer] RETURNS [BOOLEAN];

  -- This procedure increments the oisTransportControl field of the buffer b and 
  -- updates the checksum field to reflect the update.
  -- The buffer is always a system buffer.
  IncrOisTransportControlAndUpdateChecksum: PUBLIC PROCEDURE [
    b: BufferDefs.OisBuffer];

  -- This procedure computes the checksum.
  ComputeChecksum: PROCEDURE [cs: CARDINAL, nWords: CARDINAL, p: LONG POINTER]
    RETURNS [CARDINAL] = MACHINE CODE
    BEGIN PrincOps.zMISC, PrincOps.aCHKSUM; END;

  END.