NSTypes.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
last edited by Willie-Sue, April 7, 1988 2:28:50 pm PDT
lifted from: /Idun/APilot/11.0/NS/Friends/NSTypes.mesa
(last edited by: AOF on: 13-Jun-83 9:25:46)
DIRECTORY
PacketExchange USING [ExchangeID, ExchangeClientType],
NSPilotSystem USING [NetworkAddress, NetworkNumber];
NSTypes: DEFINITIONS = BEGIN
TYPEs and definitions
WaitTime: TYPE = CARD32; -- in milliseconds
ConnectionID: TYPE = RECORD [WORD];
PacketType: TYPE = MACHINE DEPENDENT {
private(0), routingInformation(1), echo(2), error(3), packetExchange(4),
sequencedPacket(5), pupAddrTransPacket(6), ubBootPacket(7),
ubIPCPacket(8), bootServerPacket(9), electronicMailCacheFlushPacket(10),
ubDiagnosticPacket(11), pccPacket(12), oldTimeServer(123), (LAST[BYTE])};
RoutingInfoType: TYPE = MACHINE DEPENDENT {
routingInfoRequest(1), routingInfoResponse(2), (LAST[CARD16])};
EchoType: TYPE = MACHINE DEPENDENT {echoRequest(1), echoResponse(2)};
ErrorCode: TYPE = MACHINE DEPENDENT{
packet got to the destination machine, but wasn't processed
unspecifiedErrorCode(0B), badChecksumErrorCode(1B),
noSocketErrorCode(2B), resourceLimitsErrorCode(3B),
rejectedErrorCode(4B),
packet didn't get to the destination machine
unspecifiedInRouteErrorCode(1000B), inconsistentErrorCode(1001B),
cantGetThereErrorCode(1002B), excessHopsErrorCode(1003B),
tooBigErrorCode(1004B),
used by ForwardBuffer for various hacks
noErrorErrorCode(10000), connectionLimitErrorCode(10001),
(LAST[CARD16])};
TransportControl: TYPE = MACHINE DEPENDENT RECORD [
trace: BOOLEAN,
filler: [0 .. 7],
hopCount: [0 .. 17B]];
RoutingInfoTuple: TYPE = MACHINE DEPENDENT RECORD [
objectNetID: NSPilotSystem.NetworkNumber, interrouterDelay: CARD16];
Copy types from PacketExchange
ExchangeClientType: TYPE = PacketExchange.ExchangeClientType;
ExchangeID: TYPE = PacketExchange.ExchangeID;
BufferBody: TYPE = MACHINE DEPENDENT RECORD [
checksum(0): CARD16,
pktLength(1): CARD16, -- in bytes, includes header
transportControl(2: 0..7): TransportControl,
packetType(2: 8..15): PacketType,
destination(3), source(9): NSPilotSystem.NetworkAddress,
nsBody(15): SELECT OVERLAID * FROM
nsWords => [nsWords(15): ARRAY [0..0) OF WORD],
nsBytes => [nsBytes(15): PACKED ARRAY [0..0) OF BYTE],
nsChars => [nsChars(15): PACKED ARRAY [0..0) OF CHARACTER],
routingInformation => [
routingType(15): RoutingInfoType,
routingTuple(16): ARRAY [0..0) OF RoutingInfoTuple],
error => [
errorType(15): ErrorCode,
errorParameter(16): CARD16,
errorBody(17): ARRAY [0..0) OF WORD],
echo => [
echoType(15): EchoType,
echoBody(16): SELECT OVERLAID * FROM
echoWords => [echoWords(16): ARRAY [0..0) OF WORD],
echoBytes => [echoBytes(16): PACKED ARRAY [0..0) OF BYTE],
ENDCASE],
spp => [
first word of level 2 Sequenced Protocol
systemPacket(15: 0..0): BOOLEAN,
sendAck(15: 1..1): BOOLEAN,
attention(15: 2..2): BOOLEAN,
endOfMessage(15: 3..3): BOOLEAN,
unusedType(15: 4..7): [0B..17B],
subtype(15: 8..15): BYTE,
sourceConnectionID(16): ConnectionID,
destinationConnectionID(17): ConnectionID,
sequenceNumber(18): CARD16,
acknowledgeNumber(19): CARD16,
allocationNumber(20): CARD16,
sppBody(21): SELECT OVERLAID * FROM
sppWords => [sppWords(21): ARRAY [0..0) OF WORD],
sppBytes => [sppBytes(21): PACKED ARRAY [0..0) OF BYTE],
sppChars => [sppChars(21): PACKED ARRAY [0..0) OF CHARACTER],
sppString => [sppString(21): StringBody],
ENDCASE],
packetExchange => [
exchangeID(15): ExchangeID,
exchangeType(17): ExchangeClientType,
exchangeBody(18): SELECT OVERLAID * FROM
exchangeWords => [exchangeWords(18): ARRAY [0..0) OF WORD],
exchangeBytes => [exchangeBytes(18): PACKED ARRAY [0..0) OF BYTE],
exchangeChars => [exchangeChars(18): PACKED ARRAY [0..0) OF CHARACTER],
exchangeString => [exchangeString(18): StringBody],
ENDCASE],
ENDCASE];
MAGIC NUMBERS FOR THE NS COMMUNICATION (TRANSPORT) PROTOCOLS.
base: PRIVATE POINTER TO BufferBody = NIL;
IDP (LEVEL 1)
maxIDPWordsPerPacket: CARD16 = 288;
maxIDPBytesPerPacket: CARD16 = 576;
wordsPerIDPHeader: CARD16 =
LOOPHOLE[@base.nsBody, CARD16] - LOOPHOLE[base, CARD16];
bytesPerIDPHeader: CARD16 = wordsPerIDPHeader*2;
maxIDPDataWords: CARD16 = maxIDPWordsPerPacket - wordsPerIDPHeader;
maxIDPDataBytes: CARD16 = maxIDPBytesPerPacket - bytesPerIDPHeader;
SPP (LEVEL 2)
wordsPerSppHeader: CARD16 =
LOOPHOLE[@base.sppBody, CARD16] - LOOPHOLE[@base.nsBody, CARD16];
bytesPerSppHeader: CARD16 = wordsPerSppHeader*2;
maxDataWordsPerSpp: CARD16 =
maxIDPWordsPerPacket - wordsPerSppHeader - wordsPerIDPHeader;
maxDataBytesPerSpp: CARD16 =
maxIDPBytesPerPacket - bytesPerSppHeader - bytesPerIDPHeader;
PACKET EXCHANGE (LEVEL 2)
wordsPerExchangeHeader: CARD16 =
LOOPHOLE[@base.exchangeBody, CARD16] - LOOPHOLE[@base.nsBody, CARD16];
bytesPerExchangeHeader: CARD16 = wordsPerExchangeHeader*2;
maxDataWordsPerExchange: CARD16 =
maxIDPWordsPerPacket - wordsPerExchangeHeader - wordsPerIDPHeader;
maxDataBytesPerExchange: CARD16 =
maxIDPBytesPerPacket - bytesPerExchangeHeader - bytesPerIDPHeader;
ECHO (LEVEL 2)
wordsPerEchoHeader: CARD16 =
LOOPHOLE[@base.echoBody, CARD16] - LOOPHOLE[@base.nsBody, CARD16];
bytesPerEchoHeader: CARD16 = wordsPerEchoHeader*2;
maxDataWordsPerEcho: CARD16 =
maxIDPWordsPerPacket - wordsPerEchoHeader - wordsPerIDPHeader;
maxDataBytesPerEcho: CARD16 =
maxIDPBytesPerPacket - bytesPerEchoHeader - bytesPerIDPHeader;
ERROR (LEVEL 2)
wordsPerErrorHeader: CARD16 =
LOOPHOLE[@base.errorBody, CARD16] - LOOPHOLE[@base.nsBody, CARD16];
bytesPerErrorHeader: CARD16 = wordsPerErrorHeader*2;
maxDataWordsPerError: CARD16 =
maxIDPWordsPerPacket - wordsPerErrorHeader - wordsPerIDPHeader;
maxDataBytesPerError: CARD16 =
maxIDPBytesPerPacket - bytesPerErrorHeader - bytesPerIDPHeader;
ROUTING (LEVEL 2)
wordsPerRoutingHeader: CARD16 =
LOOPHOLE[@base.routingTuple, CARD16] - LOOPHOLE[@base.nsBody, CARD16];
bytesPerRoutingHeader: CARD16 = wordsPerRoutingHeader*2;
maxDataWordsPerRouting: CARD16 =
maxIDPWordsPerPacket - wordsPerRoutingHeader - wordsPerIDPHeader;
maxDataBytesPerRouting: CARD16 =
maxIDPBytesPerPacket - bytesPerRoutingHeader - bytesPerIDPHeader;
maxRoutingTuplesPerPacket: CARD16 =
maxDataWordsPerRouting / SIZE[RoutingInfoTuple];
END..
LOG
Time: 3-May-82 9:58:58 By: AOF Action: Created file from modified OISCPTypes.
Time: 14-Apr-83 14:51:13 By: AOF Action: Added PacketType[timeServer].
Time: 3-May-83 11:11:09 By: AOF Action: BufferMgr rewrite.
Time: 6-Jun-83 13:46:55 By: AOF Action: Fix and add magic constants.
Time: 13-Jun-83 9:26:12 By: AOF Action: Add pccPacket packet types.