1*8407Swnj /*	nsp.h	1.3	82/10/09	*/
26825Ssam 
36825Ssam /*
46825Ssam  * DECnet Network Services Protocol definitions,
56825Ssam  * per Network Services Protocol Functional Specification,
66825Ssam  * Version 3.2.0, October 1980.
76825Ssam  */
86825Ssam 
96825Ssam /*
106825Ssam  * NSP message types
116825Ssam  */
126825Ssam #define	NSP_DATA	0x00		/* data segment message */
136825Ssam #define	NSP_LS		0x10		/* link service message */
146825Ssam #define	NSP_INTR	0x30		/* interrupt message */
156825Ssam #define	NSP_DATACK	0x04		/* data segment ack */
166825Ssam #define	NSP_OTHACK	0x14		/* other data ack */
176825Ssam #define	NSP_CONACK	0x24		/* connect ack */
186825Ssam #define	NSP_NOP		0x08		/* no op */
196825Ssam #define	NSP_CI		0x18		/* connect initiate */
206825Ssam #define	NSP_CC		0x28		/* connect confirm */
216825Ssam #define	NSP_DI		0x38		/* disconnect initiate */
226825Ssam #define	NSP_DC		0x48		/* disconnect confirm */
236825Ssam 
246825Ssam /* flags for data segment messages */
256825Ssam #define	NSP_BOM		0x20		/* beginning-of-message segment */
266825Ssam #define	NSP_EOM		0x40		/* end-of-message segment */
276825Ssam 
286825Ssam /*
296825Ssam  * Data segment message
306825Ssam  */
316825Ssam struct nspd {
326825Ssam 	char	nsp_msgflg;		/* message type and flags */
336825Ssam 	d_short	nsp_dstaddr;		/* destination address *
346825Ssam 	d_short	nsp_srcaddr;		/* source address */
356825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
366825Ssam 	d_short	nsp_segnum;		/* this message's segment number */
376825Ssam };
386825Ssam 
396825Ssam /*
406825Ssam  * Interrupt message
416825Ssam  */
426825Ssam struct nspi {
436825Ssam 	char	nsp_msgflg;		/* message type and flags */
446825Ssam 	d_short	nsp_dstaddr;		/* destination address *
456825Ssam 	d_short	nsp_srcaddr;		/* source address */
466825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
476825Ssam 	d_short	nsp_segnum;		/* this message's segment number */
486825Ssam /* optional data follows */
496825Ssam };
506825Ssam 
516825Ssam /*
526825Ssam  * Link Service message
536825Ssam  */
546825Ssam struct nspls {
556825Ssam 	char	nsp_msgflg;		/* message type and flags */
566825Ssam 	d_short	nsp_dstaddr;		/* destination address *
576825Ssam 	d_short	nsp_srcaddr;		/* source address */
586825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
596825Ssam 	d_short	nsp_segnum;		/* this message's segment number */
606825Ssam 	char	nsp_lsflags;		/* link service flags */
616825Ssam 	char	nsp_fcval;		/* flow control change value */
626825Ssam };
636825Ssam 
646825Ssam #define	NSPLS_FCVALINT	0x0c		/* fcval field interpretation: */
656825Ssam #define	NSPLS_DATREQ	0x00		/*   data segment request */
666825Ssam #define	NSPLS_INTREQ	0x04		/*   interrupt request */
676825Ssam #define	NSPLS_FCMOD	0x03		/* flow control modification: */
686825Ssam #define	NSPLS_NOCHANGE	0x00		/*   no change */
696825Ssam #define	NSPLS_OFF	0x01		/*   do not send data */
706825Ssam #define	NSPLS_ON	0x02		/*   send data */
716825Ssam 
726825Ssam /*
736825Ssam  * Data or Other Data Ack
746825Ssam  */
756825Ssam struct nspack {
766825Ssam 	char	nsp_msgflg;		/* message type and flags */
776825Ssam 	d_short	nsp_dstaddr;		/* destination address *
786825Ssam 	d_short	nsp_srcaddr;		/* source address */
796825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
806825Ssam };
816825Ssam 
826825Ssam #define	NSPA_ACK	0x8000		/* ack flag for acknum */
836825Ssam #define	NSPA_NAK	0x9000		/* nak flag for acknum */
846825Ssam #define	NSPA_QUAL	0xf000		/* qual field for acknum */
856825Ssam #define	NSPA_NUM	0x0fff		/* num field for acknum */
866825Ssam 
876825Ssam /*
886825Ssam  * Connect Ack
896825Ssam  */
906825Ssam struct nspcack {
916825Ssam 	char	nsp_msgflg;		/* message type and flags */
926825Ssam 	d_short	nsp_dstaddr;		/* destination address *
936825Ssam };
946825Ssam 
956825Ssam /*
966825Ssam  * No Op message
976825Ssam  */
986825Ssam struct nspnop {
996825Ssam 	char	nsp_msgflg;		/* message type and flags */
1006825Ssam /* tstdata follows */
1016825Ssam };
1026825Ssam 
1036825Ssam /*
1046825Ssam  * Connect Initiate message
1056825Ssam  */
1066825Ssam struct nspci {
1076825Ssam 	char	nsp_msgflg;		/* message type and flags */
1086825Ssam 	d_short	nsp_dstaddr;		/* destination address *
1096825Ssam 	d_short	nsp_srcaddr;		/* source address */
1106825Ssam 	char	nsp_services;		/* flow control options */
1116825Ssam 	char	nsp_info;		/* NSP version info */
1126825Ssam 	d_short	nsp_segsize;		/* requested segment size */
1136825Ssam /* connect data follows */
1146825Ssam };
1156825Ssam 
1166825Ssam /*
1176825Ssam  * Connect Confirm message
1186825Ssam  */
1196825Ssam struct nspcc {
1206825Ssam 	char	nsp_msgflg;		/* message type and flags */
1216825Ssam 	d_short	nsp_dstaddr;		/* destination address *
1226825Ssam 	d_short	nsp_srcaddr;		/* source address */
1236825Ssam 	char	nsp_services;		/* flow control options */
1246825Ssam 	char	nsp_info;		/* NSP version info */
1256825Ssam 	d_short	nsp_segsize;		/* requested segment size */
1266825Ssam 	char	nsp_cnt;		/* size of optional data field */
1276825Ssam /* optional connect data follows */
1286825Ssam };
1296825Ssam 
1306825Ssam /*
1316825Ssam  * Disconnect Initiate message
1326825Ssam  */
1336825Ssam struct nspdi {
1346825Ssam 	char	nsp_msgflg;		/* message type and flags */
1356825Ssam 	d_short	nsp_dstaddr;		/* destination address *
1366825Ssam 	d_short	nsp_srcaddr;		/* source address */
1376825Ssam 	d_short	nsp_reason;		/* reason for disconnect */
1386825Ssam 	char	nsp_dcnt;		/* size of optional data field */
1396825Ssam /* optional disconnect data follows */
1406825Ssam };
1416825Ssam 
1426825Ssam /*
1436825Ssam  * Disconnect Confirm message
1446825Ssam  */
1456825Ssam struct nspdc {
1466825Ssam 	char	nsp_msgflg;		/* message type and flags */
1476825Ssam 	d_short	nsp_dstaddr;		/* destination address *
1486825Ssam 	d_short	nsp_srcaddr;		/* source address */
1496825Ssam 	d_short	nsp_reason;		/* disconnect reason */
1506825Ssam };
151