Copyright (C) 1983, 1985 by Xerox Corporation. All rights reserved. The following program was created in 1983 but has not been published within the meaning of the copyright law, is furnished under license, and may not be used, copied and/or disclosed except in accordance with the terms of said license.
ICMP.mesa
Last Edited by: Nichols, August 15, 1983 7:16 pm
Last Edited by: Taft, January 5, 1984 5:48 pm
Hal Murray June 27, 1985 1:45:53 am PDT
John Larson, April 14, 1986 9:25:39 pm PST
DIRECTORY
IPDefs USING [Byte, Datagram, DByte, Address, InternetHeader];
ICMP: CEDAR DEFINITIONS =
BEGIN
minLength: INT = 8;
maxLength: INT = minLength+512;
DataBuffer: TYPE = PACKED ARRAY INT [minLength..maxLength) OF IPDefs.Byte;
ICMP message type codes
EchoReply: IPDefs.Byte = 0;
DestinationUnreachable: IPDefs.Byte = 3;
SourceQuench: IPDefs.Byte = 4;
Redirect: IPDefs.Byte = 5;
Echo: IPDefs.Byte = 8;
TimeExceeded: IPDefs.Byte = 11;
ParameterProblem: IPDefs.Byte = 12;
Timestamp: IPDefs.Byte = 13;
TimestampReply: IPDefs.Byte = 14;
InformationRequest: IPDefs.Byte = 15;
InformationReply: IPDefs.Byte = 16;
ICMP Redirect message subcodes
redirectForNet: INT = 0;
redirectForHost: INT = 1;
redirectForServiceAndNet: INT = 2;
redirectForServiceAndHost: INT = 3;
ID: TYPE = IPDefs.DByte; -- Beware, only contained in some types of messages
default: ID = LAST[ID];
BodyRec: TYPE = MACHINE DEPENDENT RECORD[ -- body of ICMP messages that have an ID
type (0: 0..7): IPDefs.Byte,
code (0: 8..15): IPDefs.Byte,
checksum (1): IPDefs.DByte,
id (2): ID,
sequenceNo (3): IPDefs.DByte,
data (4): DataBuffer ];
RedirectBody: TYPE = MACHINE DEPENDENT RECORD[ -- body of ICMP Redirect message
type (0: 0..7): IPDefs.Byte,
code (0: 8..15): IPDefs.Byte,
checksum (1): IPDefs.DByte,
gateway (2): IPDefs.Address,
header (4): IPDefs.InternetHeader];
Handle: TYPE = REF HandleRec;
HandleRec: TYPE = RECORD [
local: ID,
him: IPDefs.Address ];
Create: PROC [him: IPDefs.Address, local: ID ← default] RETURNS [Handle];
Destroy: PROC [Handle];
Receive: PROC [handle: Handle, timeout: INT] RETURNS [data: IPDefs.Datagram];
NIL if timeout (ms), 0 => Forever
Send: PROC [handle: Handle, data: IPDefs.Datagram, length: INT];
SendReply: PROC [data: IPDefs.Datagram];
END.