1*6825Ssam 
2*6825Ssam /*
3*6825Ssam  * DECnet Network Services Protocol definitions,
4*6825Ssam  * per Network Services Protocol Functional Specification,
5*6825Ssam  * Version 3.2.0, October 1980.
6*6825Ssam  */
7*6825Ssam 
8*6825Ssam /*
9*6825Ssam  * NSP message types
10*6825Ssam  */
11*6825Ssam #define	NSP_DATA	0x00		/* data segment message */
12*6825Ssam #define	NSP_LS		0x10		/* link service message */
13*6825Ssam #define	NSP_INTR	0x30		/* interrupt message */
14*6825Ssam #define	NSP_DATACK	0x04		/* data segment ack */
15*6825Ssam #define	NSP_OTHACK	0x14		/* other data ack */
16*6825Ssam #define	NSP_CONACK	0x24		/* connect ack */
17*6825Ssam #define	NSP_NOP		0x08		/* no op */
18*6825Ssam #define	NSP_CI		0x18		/* connect initiate */
19*6825Ssam #define	NSP_CC		0x28		/* connect confirm */
20*6825Ssam #define	NSP_DI		0x38		/* disconnect initiate */
21*6825Ssam #define	NSP_DC		0x48		/* disconnect confirm */
22*6825Ssam 
23*6825Ssam /* flags for data segment messages */
24*6825Ssam #define	NSP_BOM		0x20		/* beginning-of-message segment */
25*6825Ssam #define	NSP_EOM		0x40		/* end-of-message segment */
26*6825Ssam 
27*6825Ssam /*
28*6825Ssam  * Data segment message
29*6825Ssam  */
30*6825Ssam struct nspd {
31*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
32*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
33*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
34*6825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
35*6825Ssam 	d_short	nsp_segnum;		/* this message's segment number */
36*6825Ssam };
37*6825Ssam 
38*6825Ssam /*
39*6825Ssam  * Interrupt message
40*6825Ssam  */
41*6825Ssam struct nspi {
42*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
43*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
44*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
45*6825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
46*6825Ssam 	d_short	nsp_segnum;		/* this message's segment number */
47*6825Ssam /* optional data follows */
48*6825Ssam };
49*6825Ssam 
50*6825Ssam /*
51*6825Ssam  * Link Service message
52*6825Ssam  */
53*6825Ssam struct nspls {
54*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
55*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
56*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
57*6825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
58*6825Ssam 	d_short	nsp_segnum;		/* this message's segment number */
59*6825Ssam 	char	nsp_lsflags;		/* link service flags */
60*6825Ssam 	char	nsp_fcval;		/* flow control change value */
61*6825Ssam };
62*6825Ssam 
63*6825Ssam #define	NSPLS_FCVALINT	0x0c		/* fcval field interpretation: */
64*6825Ssam #define	NSPLS_DATREQ	0x00		/*   data segment request */
65*6825Ssam #define	NSPLS_INTREQ	0x04		/*   interrupt request */
66*6825Ssam #define	NSPLS_FCMOD	0x03		/* flow control modification: */
67*6825Ssam #define	NSPLS_NOCHANGE	0x00		/*   no change */
68*6825Ssam #define	NSPLS_OFF	0x01		/*   do not send data */
69*6825Ssam #define	NSPLS_ON	0x02		/*   send data */
70*6825Ssam 
71*6825Ssam /*
72*6825Ssam  * Data or Other Data Ack
73*6825Ssam  */
74*6825Ssam struct nspack {
75*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
76*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
77*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
78*6825Ssam 	d_short	nsp_acknum;		/* number of ack'ed message */
79*6825Ssam };
80*6825Ssam 
81*6825Ssam #define	NSPA_ACK	0x8000		/* ack flag for acknum */
82*6825Ssam #define	NSPA_NAK	0x9000		/* nak flag for acknum */
83*6825Ssam #define	NSPA_QUAL	0xf000		/* qual field for acknum */
84*6825Ssam #define	NSPA_NUM	0x0fff		/* num field for acknum */
85*6825Ssam 
86*6825Ssam /*
87*6825Ssam  * Connect Ack
88*6825Ssam  */
89*6825Ssam struct nspcack {
90*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
91*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
92*6825Ssam };
93*6825Ssam 
94*6825Ssam /*
95*6825Ssam  * No Op message
96*6825Ssam  */
97*6825Ssam struct nspnop {
98*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
99*6825Ssam /* tstdata follows */
100*6825Ssam };
101*6825Ssam 
102*6825Ssam /*
103*6825Ssam  * Connect Initiate message
104*6825Ssam  */
105*6825Ssam struct nspci {
106*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
107*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
108*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
109*6825Ssam 	char	nsp_services;		/* flow control options */
110*6825Ssam 	char	nsp_info;		/* NSP version info */
111*6825Ssam 	d_short	nsp_segsize;		/* requested segment size */
112*6825Ssam /* connect data follows */
113*6825Ssam };
114*6825Ssam 
115*6825Ssam /*
116*6825Ssam  * Connect Confirm message
117*6825Ssam  */
118*6825Ssam struct nspcc {
119*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
120*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
121*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
122*6825Ssam 	char	nsp_services;		/* flow control options */
123*6825Ssam 	char	nsp_info;		/* NSP version info */
124*6825Ssam 	d_short	nsp_segsize;		/* requested segment size */
125*6825Ssam 	char	nsp_cnt;		/* size of optional data field */
126*6825Ssam /* optional connect data follows */
127*6825Ssam };
128*6825Ssam 
129*6825Ssam /*
130*6825Ssam  * Disconnect Initiate message
131*6825Ssam  */
132*6825Ssam struct nspdi {
133*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
134*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
135*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
136*6825Ssam 	d_short	nsp_reason;		/* reason for disconnect */
137*6825Ssam 	char	nsp_dcnt;		/* size of optional data field */
138*6825Ssam /* optional disconnect data follows */
139*6825Ssam };
140*6825Ssam 
141*6825Ssam /*
142*6825Ssam  * Disconnect Confirm message
143*6825Ssam  */
144*6825Ssam struct nspdc {
145*6825Ssam 	char	nsp_msgflg;		/* message type and flags */
146*6825Ssam 	d_short	nsp_dstaddr;		/* destination address *
147*6825Ssam 	d_short	nsp_srcaddr;		/* source address */
148*6825Ssam 	d_short	nsp_reason;		/* disconnect reason */
149*6825Ssam };
150