524 lines
14 KiB
Plaintext
524 lines
14 KiB
Plaintext
/*
|
|
* Copyright 1991, Silicon Graphics, Inc.
|
|
* All Rights Reserved.
|
|
*
|
|
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
|
|
* the contents of this file may not be disclosed to third parties, copied or
|
|
* duplicated in any form, in whole or in part, without the prior written
|
|
* permission of Silicon Graphics, Inc.
|
|
*
|
|
* RESTRICTED RIGHTS LEGEND:
|
|
* Use, duplication or disclosure by the Government is subject to restrictions
|
|
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
|
|
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
|
|
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
|
|
* rights reserved under the Copyright Laws of the United States.
|
|
*
|
|
* $Revision: 1.8 $
|
|
*/
|
|
|
|
|
|
/*
|
|
* DEC Local Area Transport(LAT) Protocol
|
|
*/
|
|
|
|
import ether;
|
|
import llc;
|
|
|
|
little-endian
|
|
protocol lat "DEC Local Area Transport Protocol" : ether(0x6004), llc(0x6004)
|
|
{
|
|
enum rrfFlag {
|
|
OtherMessage = 0,
|
|
RunMessage = 1
|
|
};
|
|
enum masterFlag {
|
|
HostToServer = 0,
|
|
ServerToHost = 1
|
|
};
|
|
enum msgType {
|
|
Run = 0,
|
|
Start = 1,
|
|
Stop = 2,
|
|
ServiceAnnounce = 10,
|
|
Command = 12,
|
|
Status = 13,
|
|
SolicitInfo = 14,
|
|
ResponseInfo = 15
|
|
};
|
|
enum svcClass {
|
|
Class1 = 1
|
|
};
|
|
enum slotType {
|
|
DataASlot = 0,
|
|
StartSlot = 9,
|
|
DataBSlot = 10,
|
|
AttentionSlot = 11,
|
|
RejectSlot = 12,
|
|
StopSlot = 13
|
|
};
|
|
enum cmdType {
|
|
SolicitNonQd = 1,
|
|
SolicitQd = 2,
|
|
CancelEntry = 3,
|
|
EntryStatus = 4,
|
|
QueueStatus = 5,
|
|
MultipleEntryStatus = 6
|
|
};
|
|
struct parm {
|
|
u_char code "Parameter Code";
|
|
u_char len "Parameter Data Length" -v;
|
|
u_char data "Parameter Data" [len];
|
|
if (code != 0)
|
|
parm moreparms; /* recursive data structure! */
|
|
};
|
|
enum bitval {
|
|
False = 0,
|
|
True = 1
|
|
};
|
|
enum parity {
|
|
Space = 0,
|
|
Odd,
|
|
Even,
|
|
Mark
|
|
};
|
|
enum reasonCodes {
|
|
UnknownReason = 1,
|
|
UserDisconnect,
|
|
SystemShutdown,
|
|
InvalidSlot,
|
|
InvalidSvcClass,
|
|
NoResources,
|
|
ServiceInUse,
|
|
NoSuchService,
|
|
ServiceDisabled,
|
|
ServiceNotOffered,
|
|
PortNameUnknown,
|
|
InvalidPassword,
|
|
EntryNotInQueue,
|
|
AccessRejected,
|
|
AccessDenied,
|
|
CorruptRequest
|
|
};
|
|
enum prodCode {
|
|
EthernetTerminalServer = 1,
|
|
DecServer100,
|
|
VAX_VMS,
|
|
RSX11_M,
|
|
RSX11_M_PLUS,
|
|
TOPS20,
|
|
TOPS10,
|
|
ULTRIX11,
|
|
LAT11,
|
|
RSTS_E,
|
|
ULTRIX32,
|
|
ELN,
|
|
MS_DOS,
|
|
P_OS,
|
|
PCSG_LAT,
|
|
DELIX,
|
|
DECserver200,
|
|
DECserver500,
|
|
Actor
|
|
};
|
|
enum disReason {
|
|
ReasonUnknown = 1,
|
|
NoSlotsToVC,
|
|
IllegalMessage,
|
|
VCHaltFromUser,
|
|
NoProgress,
|
|
TimeExpired,
|
|
LatRetransmitLimitReached,
|
|
InsufResources,
|
|
ServerTimerOutOfRange,
|
|
VCsExceeded
|
|
};
|
|
enum pref {
|
|
DisableBellOnDiscard = 0,
|
|
EnableBellOnDiscard
|
|
};
|
|
enum stat {
|
|
UnknownError = 0,
|
|
ShortBreak,
|
|
LongBreak,
|
|
FramingError,
|
|
DataOverrun,
|
|
ParityError
|
|
};
|
|
enum mode {
|
|
Normal = 0,
|
|
EnablePassall,
|
|
EnablePassthrough
|
|
};
|
|
struct extParms {
|
|
u_char code "Parameter Code";
|
|
u_char len -v;
|
|
switch (code) {
|
|
case 1: /* Flag Word */
|
|
bitval dialline "Dialup Line" : 1;
|
|
bitval nologin "No auto Login" : 1;
|
|
u_short uflag "Unused Flag Bits" : 14 -vv expect 0;
|
|
|
|
case 2:
|
|
u_short identry "Entry ID in Queue";
|
|
|
|
case 0:
|
|
case 3:
|
|
u_short reserved "Reserved" -vvv;
|
|
|
|
case 4:
|
|
char dportname "Destination Port name" [len];
|
|
|
|
case 5:
|
|
char sportname "Source Port Name" [len];
|
|
|
|
case 6:
|
|
u_char grpcodes "Service Group Codes" [len];
|
|
|
|
case 7:
|
|
char objpass "Service Password" [len];
|
|
|
|
default: /* TBD default */
|
|
char undata "Unknown Data" [len] -vvv;
|
|
}
|
|
|
|
if (code != 0)
|
|
extParms moreext;
|
|
};
|
|
|
|
struct databParms {
|
|
u_char code "Parameter Code";
|
|
u_char len -v;
|
|
|
|
switch (code) {
|
|
case 1:
|
|
u_char reserved "Reserved" : 1 -vvv;
|
|
parity partype "Type of Parity" : 2;
|
|
bitval parenable "Parity Enabled" : 1;
|
|
u_char bps "Bits per Character" : 4;
|
|
|
|
case 2:
|
|
u_short inspeed "Input speed (bits/sec)";
|
|
|
|
case 3:
|
|
u_short outspeed "Output Speed (bits/sec)";
|
|
|
|
case 4:
|
|
pref userpref "User Preference" : 8;
|
|
|
|
case 5:
|
|
mode tranmode "Transparency Mode" : 8;
|
|
|
|
case 6:
|
|
stat status "Status Code" : 8;
|
|
switch (status) {
|
|
case 3 :
|
|
case 4 :
|
|
case 5 :
|
|
u_char byte "Image of Received Byte";
|
|
|
|
default :
|
|
u_char ignore "Ignore" -vvv;
|
|
}
|
|
}
|
|
|
|
if (code != 0)
|
|
databParms morebparms;
|
|
};
|
|
|
|
|
|
struct offersrv {
|
|
u_char srvcrating "Rating of Associated Service.";
|
|
u_char srvnamelen "Service Name Length in Bytes";
|
|
char servname "Service Name" [srvnamelen];
|
|
u_char srvdesclen "Length of Service Description";
|
|
char srvcdesc "Description of Service Offered" [srvdesclen];
|
|
};
|
|
|
|
msgType msg "Message Type" : 6;
|
|
masterFlag master "Master Flag" : 1;
|
|
rrfFlag rrf "RRF Flag" : 1;
|
|
|
|
switch (msg) {
|
|
case Run:
|
|
u_char slots "Slots";
|
|
u_short dstcirc "Destination Virtual Circuit";
|
|
u_short srccirc "Source Virtual Circuit";
|
|
u_char seq "Sequence Number";
|
|
u_char ack "Acknowledgement Number";
|
|
u_char dstslot "Destination Slot";
|
|
u_char srcslot "Source Slot";
|
|
u_char bytecount "Slot or Status Byte Count";
|
|
slotType slottype "Slot Type" : 4;
|
|
|
|
switch (slottype) {
|
|
case DataASlot:
|
|
u_char credits "Credits Being Transfered" : 4;
|
|
u_char slotdata "Slot Data" [bytecount];
|
|
if (bytecount % 2)
|
|
u_char padding "Padding " -vv;
|
|
|
|
case StartSlot:
|
|
u_char credits : 4;
|
|
svcClass svcclass "Service Class" : 8;
|
|
u_char minaslot "Minimum Attention Slot Size";
|
|
u_char mindslot "Mininmum Data Slot Size";
|
|
u_char dslen "Destination Service Name Length" -v;
|
|
char dsname "Destination Service Name" [dslen];
|
|
u_char ssvclen "Source Service Length in Bytes" -v;
|
|
char ssvcdesc "Source Service Description" [ssvclen];
|
|
|
|
/* add status field based on service class */
|
|
extParms clparms "Class 1 extension";
|
|
|
|
case DataBSlot:
|
|
u_char credits : 4;
|
|
bitval ucflag "Unused Control Flag" : 1 -vv expect 0;
|
|
bitval getport "Get Port Characteristics" : 1;
|
|
bitval setport "Set Port Characteristics" : 1;
|
|
bitval brk "Break Condition Detected" : 1;
|
|
bitval nooflow "Disable Output Flow Control" : 1;
|
|
bitval oflow "Enable Output Flow Control" : 1;
|
|
bitval noiflow "Disable Input Flow Control" : 1;
|
|
bitval inflow "Enable Input Flow Control" : 1;
|
|
|
|
char stopc "Stop Output Char";
|
|
char startc "Start Output Char";
|
|
char stopinc "Stop input Char";
|
|
char startinc "Start input Char";
|
|
|
|
databParms parameters "Data_b Parameters";
|
|
|
|
if (bytecount % 2)
|
|
u_char padding -vv;
|
|
|
|
case AttentionSlot:
|
|
u_char mbz "Must be Zero" : 4 -vv expect 0;
|
|
|
|
/* Service Class 1 extentions */
|
|
|
|
u_char ucflagh "Unused Control Flag Bits" : 2;
|
|
bitval abort "Abort Flag" : 1;
|
|
u_char ucflagl "Unused Control Flag Bits" : 5;
|
|
|
|
u_char slotdata [bytecount];
|
|
if (bytecount % 2)
|
|
u_char padding -vv;
|
|
|
|
case RejectSlot:
|
|
reasonCodes whyreject "Rejection Reason" : 4;
|
|
u_char status "Status Data" [bytecount];
|
|
if (bytecount % 2)
|
|
u_char padding -vv;
|
|
|
|
case StopSlot:
|
|
reasonCodes stopres "Stop Reason" : 4;
|
|
u_char status "Status Data" [bytecount];
|
|
if (bytecount % 2)
|
|
u_char padding -vv;
|
|
}
|
|
|
|
case Start:
|
|
u_char slots;
|
|
u_short dstcirc;
|
|
u_short srccirc;
|
|
u_char seq;
|
|
u_char ack;
|
|
u_short maxsize "Maximum LAT Message Size";
|
|
u_char version "Protocol Version";
|
|
u_char eco "Protocol ECO";
|
|
u_char maxsess "Maximum Simultaneous Sessions";
|
|
u_char extra "Extra Buffers Queued";
|
|
u_char sctimer "Server Circuit Timer (10 ms)";
|
|
u_char katimer "Keep Alive Timer (sec)";
|
|
u_short facility "Facility Number";
|
|
prodCode pcode "Product Type Code" : 8;
|
|
u_char pversion "Product Version Number";
|
|
u_char sllen "Slave Name Length" -v;
|
|
char slname "Slave Node Name" [sllen];
|
|
u_char mlen "Master Name Length" -v;
|
|
char mname "Master Node Name" [mlen];
|
|
u_char llen "Length of Location Text";
|
|
char location "Description of Location" [llen];
|
|
parm paramlist "Parameter Code, Length and Data";
|
|
|
|
case Stop:
|
|
u_char slots;
|
|
u_short dstcirc;
|
|
u_short srccirc;
|
|
u_char seq;
|
|
u_char ack;
|
|
disReason whydisc "Circuit Disconnect Reason" :8;
|
|
u_char count "Reason Byte Count";
|
|
char text "Reason Stop Message sent" [count];
|
|
|
|
case ServiceAnnounce:
|
|
u_char sctimer;
|
|
u_char hiversion "Highest Version Supported" -v;
|
|
u_char loversion "Lowest Version Supported" -v;
|
|
u_char version;
|
|
u_char eco;
|
|
u_char incar "Message Incarnation";
|
|
|
|
u_char parmchg "Other Parameter Changed" : 1,
|
|
unused "Unused" : 1 -vv,
|
|
classchg "Service Classes Changed" : 1,
|
|
descchg "Service Descriptor Changed" : 1,
|
|
ratechg "Service Rating Changed" : 1,
|
|
namechg "Service Name Changed" : 1,
|
|
nodechg "Node Descriptor Changed" : 1,
|
|
groupchg "Node Group Codes Changed" : 1;
|
|
|
|
u_short maxsize;
|
|
u_char mcrate "Minimum Node Multicast Rate (sec)";
|
|
|
|
u_char unodestat "Unused Node Status Bits" : 7 -vv expect 0;
|
|
bitval nosession "Not Accepting New Session" : 1;
|
|
u_char glen "Node Group Length" -v;
|
|
u_char groups "Node Groups" [glen];
|
|
u_char nlen "Node Name Length" -v;
|
|
char nname "Node Name" [nlen];
|
|
u_char ndlen "Node Description Field Length" -v;
|
|
char ndescr "Node Description" [ndlen];
|
|
u_char svccount "Number of Services Offered";
|
|
offersrv service "Service Names" [svccount];
|
|
u_char clen "Node Service Class Length" -v;
|
|
u_char class "Node Service Classes" [clen];
|
|
|
|
case Command:
|
|
u_char format "Protocol Format Flag";
|
|
u_char hiversion -v;
|
|
u_char loversion -v;
|
|
u_char version;
|
|
u_char eco;
|
|
u_short maxsize;
|
|
u_short rid "Request Identification";
|
|
u_short eid "Entry Identifier";
|
|
cmdType ctype "Command Type" : 8;
|
|
u_char ucmod "Unused Command Modifier Bits" : 6 -vv expect 0;
|
|
bitval qchange "Send Status on Q Depth Change" : 1;
|
|
bitval periodic "Send Status Periodically" : 1;
|
|
u_char dnlen "Destination Node Name Length" -v;
|
|
char dnname "Destination Node Name" [dnlen];
|
|
u_char sglen "Subject Group Length" -v;
|
|
u_char sgmask "Subject Group Code Mask" [sglen];
|
|
u_char snlen "Subject Node Length" -v;
|
|
char snname "Soliciting Node Name" [snlen];
|
|
u_char splen "Subject Port Length" -v;
|
|
char spname "Soliciting Node Port Name" [splen];
|
|
u_char sdlen "Subject Description Length" -v;
|
|
char sdesc "Subject Description" [sdlen];
|
|
u_char dslen "Destination Service Name Length" -v;
|
|
char dsname "Destination Service Name" [dslen];
|
|
u_char dplen "Destination Service Port Length" -v;
|
|
char dpname "Destination service Port Name" [dplen];
|
|
parm parmblock "Extensible Fields";
|
|
|
|
case Status:
|
|
u_char format;
|
|
u_char hiversion -v;
|
|
u_char loversion -v;
|
|
u_char version;
|
|
u_char eco;
|
|
u_short maxsize;
|
|
u_short retimer "Retransmit Timer";
|
|
u_char entries "Entries whose Status is Reported";
|
|
u_char snlen -v;
|
|
char snname [snlen];
|
|
u_char length "Length of Entry";
|
|
|
|
/* Entry Status */
|
|
bitval rejected "Solicitation Request Rejected" : 1;
|
|
u_char uestat : 2;
|
|
bitval noqstatus "Q-depth Status Report Not Supported" : 1;
|
|
bitval nopstatus "Periodic Status Not Supported" : 1;
|
|
bitval accepted "Accepted for Processing" : 1;
|
|
bitval queued "Request is Queued" : 1;
|
|
bitval noaddinfo "No Additional Info" : 1;
|
|
|
|
u_char entryerr "Solicitation Rejection Reason";
|
|
u_char reserved "Reserved";
|
|
u_short rid;
|
|
u_short eid;
|
|
u_short time "Elasped Time in Queue (min)";
|
|
u_short minqpos "Minimum Queue Position";
|
|
u_short maxqpos "Maximum Queue Position";
|
|
u_char svcnlen "Service Name Length" -v;
|
|
char svcname "Service Name" [svcnlen];
|
|
u_char dplen -v;
|
|
char dpname [dplen];
|
|
u_char sdlen -v;
|
|
char sdesc [sdlen];
|
|
|
|
case SolicitInfo:
|
|
u_char format;
|
|
u_char hiversion -v;
|
|
u_char loversion -v;
|
|
u_char version;
|
|
u_char eco;
|
|
u_short maxsize;
|
|
u_short solicitid;
|
|
u_short rtimer "Response Timer (sec)";
|
|
u_char dnlen -v;
|
|
char dnname [dnlen];
|
|
u_char sglen -v;
|
|
u_char sgmask [sglen];
|
|
u_char snlen -v;
|
|
char snname [snlen];
|
|
u_char svcnlen -v;
|
|
char svcname [svcnlen];
|
|
parm solparms "Parameter blocks";
|
|
|
|
case ResponseInfo:
|
|
u_char format;
|
|
u_char hiversion -v;
|
|
u_char loversion -v;
|
|
u_char version;
|
|
u_char eco;
|
|
u_short maxsize;
|
|
u_short solicitid;
|
|
|
|
/* Response Status */
|
|
|
|
u_short urstat "Unused Response Status Bits" : 14 -vv expect 0;
|
|
bitval nosvc "Service Unavailable" : 1;
|
|
bitval reserved "Reserved" : 1;
|
|
|
|
/* Source Node Status */
|
|
|
|
u_short usrcstat "Unused Source Status Bits" : 13 -vv expect 0;
|
|
bitval cmdmsg "Command Message Enabled" : 1;
|
|
bitval startmsg "Start Message Enabled" : 1;
|
|
bitval disabled "Node Disabled" : 1;
|
|
|
|
etheraddr src "Source Node Address" ;
|
|
u_short smtimer "Slave Node Multicast Timer (sec)";
|
|
u_char dnlen -v;
|
|
char dnname [dnlen];
|
|
u_char sglen -v;
|
|
u_char sgmask [sglen];
|
|
u_char srcnlen "Source Node Name Length" -v;
|
|
char srcname "Source Node Name" [srcnlen];
|
|
u_char srcdlen "Source Node Description Length" -v;
|
|
char srcdesc "Source Node Description" [srcdlen];
|
|
u_char svccnt "Service Count";
|
|
u_char srventlen "Entry Length";
|
|
u_char clen -v;
|
|
u_char class [clen];
|
|
|
|
/* Service Status */
|
|
u_char usvcstat "Unused Service Status Bits" : 6 -vv expect 0;
|
|
bitval qsupport "Service Supports Queueing" : 1;
|
|
bitval enabled "Service Enabled" : 1;
|
|
|
|
u_char rating "Service Rating";
|
|
u_char svcglen "Service Group Length" -v;
|
|
/* ??? */ u_char svcgcode "Service Group Codes" [svcglen];
|
|
u_char svcnlen -v;
|
|
char svcname [svcnlen];
|
|
u_char svcdlen "Service Description Length" -v;
|
|
char svcdesc "Service Offered" [svcdlen];
|
|
parm resparms "Parameter Block";
|
|
}
|
|
}
|