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