summaryrefslogtreecommitdiffstats
path: root/sys/netatm/uni/sscop_pdu.h
blob: 9a930d0feaff72b2ff64f980518a5e7ffe0e2629 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
/*
 *
 * ===================================
 * HARP  |  Host ATM Research Platform
 * ===================================
 *
 *
 * This Host ATM Research Platform ("HARP") file (the "Software") is
 * made available by Network Computing Services, Inc. ("NetworkCS")
 * "AS IS".  NetworkCS does not provide maintenance, improvements or
 * support of any kind.
 *
 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
 * In no event shall NetworkCS be responsible for any damages, including
 * but not limited to consequential damages, arising from or relating to
 * any use of the Software or related support.
 *
 * Copyright 1994-1998 Network Computing Services, Inc.
 *
 * Copies of this Software may be made, however, the above copyright
 * notice must be reproduced on all copies.
 *
 *	@(#) $FreeBSD$
 *
 */

/*
 * ATM Forum UNI Support
 * ---------------------
 *
 * SSCOP Protocol Data Unit (PDU) definitions
 *
 */

#ifndef _UNI_SSCOP_PDU_H
#define _UNI_SSCOP_PDU_H

/*
 * SSCOP PDU Constants
 */
#define	PDU_MIN_LEN	4		/* Minimum PDU length */
#define	PDU_LEN_MASK	3		/* PDU length must be 32-bit aligned */
#define	PDU_ADDR_MASK	3		/* PDUs must be 32-bit aligned */
#define	PDU_SEQ_MASK	0x00ffffff	/* Mask for 24-bit sequence values */
#define	PDU_MAX_INFO	65528		/* Maximum length of PDU info field */
#define	PDU_MAX_UU	65524		/* Maximum length of SSCOP-UU field */
#define	PDU_MAX_STAT	65520		/* Maximum length of STAT list */
#define	PDU_MAX_ELEM	67		/* Maximum elements sent in STAT */
#define	PDU_PAD_ALIGN	4		/* I-field padding alignment */


/*
 * PDU Queueing Header
 *
 * There will be a queueing header tacked on to the front of each
 * buffer chain that is placed on any of the sscop SD PDU queues (not
 * including the SD transmission queue).  Note that this header will
 * not be included in the buffer data length/offset fields.
 */
struct pdu_hdr {
	union {
		struct pdu_hdr	*phu_pack_lk;	/* Pending ack queue link */
		struct pdu_hdr	*phu_recv_lk;	/* Receive queue link */
	} ph_u;
	struct pdu_hdr	*ph_rexmit_lk;	/* Retranmit queue link */
	sscop_seq	ph_ns;		/* SD.N(S) - SD's sequence number */
	sscop_seq	ph_nps;		/* SD.N(PS) - SD's poll sequence */
	KBuffer		*ph_buf;	/* Pointer to containing buffer */
};
#define	ph_pack_lk	ph_u.phu_pack_lk
#define	ph_recv_lk	ph_u.phu_recv_lk


/*
 * SSCOP PDU formats
 *
 * N.B. - all SSCOP PDUs are trailer oriented (don't ask me...)
 */

/*
 * PDU Type Fields
 */
#define	PT_PAD_MASK	0xc0		/* Pad length mask */
#define	PT_PAD_SHIFT	6		/* Pad byte shift count */
#define	PT_SOURCE_SSCOP	0x10		/* Source = SSCOP */
#define	PT_TYPE_MASK	0x0f		/* Type mask */
#define	PT_TYPE_MAX	0x0f		/* Maximum pdu type */
#define	PT_TYPE_SHIFT	24		/* Type word shift count */

#define	PT_BGN		0x01		/* Begin */
#define	PT_BGAK		0x02		/* Begin Acknowledge */
#define	PT_BGREJ	0x07		/* Begin Reject */
#define	PT_END		0x03		/* End */
#define	PT_ENDAK	0x04		/* End Acknowledge */
#define	PT_RS		0x05		/* Resynchronization */
#define	PT_RSAK		0x06		/* Resynchronization Acknowledge */
#define	PT_ER		0x09		/* Error Recovery */
#define	PT_ERAK		0x0f		/* Error Recovery Acknowledge */
#define	PT_SD		0x08		/* Sequenced Data */
#define	PT_SDP		0x09		/* Sequenced Data with Poll */
#define	PT_POLL		0x0a		/* Status Request */
#define	PT_STAT		0x0b		/* Solicited Status Response */
#define	PT_USTAT	0x0c		/* Unsolicited Status Response */
#define	PT_UD		0x0d		/* Unnumbered Data */
#define	PT_MD		0x0e		/* Management Data */

/*
 * Begin PDU
 */
struct bgn_pdu {
	u_char		bgn_rsvd[3];	/* Reserved */
	u_char		bgn_nsq;	/* N(SQ) */
	union {
		u_char		bgnu_type;	/* PDU type, etc */
		sscop_seq	bgnu_nmr;	/* N(MR) */
	} bgn_u;
};
#define	bgn_type	bgn_u.bgnu_type
#define	bgn_nmr		bgn_u.bgnu_nmr

/*
 * Begin Acknowledge PDU
 */
struct bgak_pdu {
	int		bgak_rsvd;	/* Reserved */
	union {
		u_char		bgaku_type;	/* PDU type, etc */
		sscop_seq	bgaku_nmr;	/* N(MR) */
	} bgak_u;
};
#define	bgak_type	bgak_u.bgaku_type
#define	bgak_nmr	bgak_u.bgaku_nmr

/*
 * Begin Reject PDU
 */
struct bgrej_pdu {
	int		bgrej_rsvd2;	/* Reserved */
	u_char		bgrej_type;	/* PDU type, etc */
	u_char		bgrej_rsvd1[3];	/* Reserved */
};

/*
 * End PDU
 */
struct end_pdu {
	int		end_rsvd2;	/* Reserved */
	u_char		end_type;	/* PDU type, etc */
	u_char		end_rsvd1[3];	/* Reserved */
};

/*
 * End Acknowledge PDU (Q.2110)
 */
struct endak_q2110_pdu {
	int		endak_rsvd2;	/* Reserved */
	u_char		endak_type;	/* PDU type, etc */
	u_char		endak_rsvd1[3];	/* Reserved */
};

/*
 * End Acknowledge PDU (Q.SAAL)
 */
struct endak_qsaal_pdu {
	u_char		endak_type;	/* PDU type, etc */
	u_char		endak_rsvd[3];	/* Reserved */
};

/*
 * Resynchronization PDU
 */
struct rs_pdu {
	char		rs_rsvd[3];	/* Reserved */
	u_char		rs_nsq;		/* N(SQ) */
	union {
		u_char		rsu_type;	/* PDU type, etc */
		sscop_seq	rsu_nmr;	/* N(MR) */
	} rs_u;
};
#define	rs_type		rs_u.rsu_type
#define	rs_nmr		rs_u.rsu_nmr

/*
 * Resynchronization Acknowledge PDU (Q.2110)
 */
struct rsak_q2110_pdu {
	int		rsak_rsvd;	/* Reserved */
	union {
		u_char		rsaku_type;	/* PDU type, etc */
		sscop_seq	rsaku_nmr;	/* N(MR) */
	} rsak_u;
};
#define	rsak2_type	rsak_u.rsaku_type
#define	rsak_nmr	rsak_u.rsaku_nmr

/*
 * Resynchronization Acknowledge PDU (Q.SAAL)
 */
struct rsak_qsaal_pdu {
	u_char		rsaks_type;	/* PDU type, etc */
	u_char		rsak_rsvd[3];	/* Reserved */
};

/*
 * Error Recovery PDU
 */
struct er_pdu {
	char		er_rsvd[3];	/* Reserved */
	u_char		er_nsq;		/* N(SQ) */
	union {
		u_char		eru_type;	/* PDU type, etc */
		sscop_seq	eru_nmr;	/* N(MR) */
	} er_u;
};
#define	er_type		er_u.eru_type
#define	er_nmr		er_u.eru_nmr

/*
 * Error Recovery Acknowledge PDU
 */
struct erak_pdu {
	int		erak_rsvd;	/* Reserved */
	union {
		u_char		eraku_type;	/* PDU type, etc */
		sscop_seq	eraku_nmr;	/* N(MR) */
	} erak_u;
};
#define	erak_type	erak_u.eraku_type
#define	erak_nmr	erak_u.eraku_nmr

/*
 * Sequenced Data PDU
 */
struct sd_pdu {
	union {
		u_char		sdu_type;	/* PDU type, etc */
		sscop_seq	sdu_ns;		/* N(S) */
	} sd_u;
};
#define	sd_type		sd_u.sdu_type
#define	sd_ns		sd_u.sdu_ns

/*
 * Sequenced Data with Poll PDU
 */
struct sdp_pdu {
	sscop_seq	sdp_nps;	/* N(PS) */
	union {
		u_char		sdpu_type;	/* PDU type, etc */
		sscop_seq	sdpu_ns;	/* N(S) */
	} sdp_u;
};
#define	sdp_type	sdp_u.sdpu_type
#define	sdp_ns		sdp_u.sdpu_ns

/*
 * Poll PDU
 */
struct poll_pdu {
	sscop_seq	poll_nps;	/* N(PS) */
	union {
		u_char		pollu_type;	/* PDU type, etc */
		sscop_seq	pollu_ns;	/* N(S) */
	} poll_u;
};
#define	poll_type	poll_u.pollu_type
#define	poll_ns		poll_u.pollu_ns

/*
 * Solicited Status PDU
 */
struct stat_pdu {
	sscop_seq	stat_nps;	/* N(PS) */
	sscop_seq	stat_nmr;	/* N(MR) */
	union {
		u_char		statu_type;	/* PDU type, etc */
		sscop_seq	statu_nr;	/* N(R) */
	} stat_u;
};
#define	stat_type	stat_u.statu_type
#define	stat_nr		stat_u.statu_nr

/*
 * Unsolicited Status PDU
 */
struct ustat_pdu {
	sscop_seq	ustat_le1;	/* List element 1 */
	sscop_seq	ustat_le2;	/* List element 2 */
	sscop_seq	ustat_nmr;	/* N(MR) */
	union {
		u_char		ustatu_type;	/* PDU type, etc */
		sscop_seq	ustatu_nr;	/* N(R) */
	} ustat_u;
};
#define	ustat_type	ustat_u.ustatu_type
#define	ustat_nr	ustat_u.ustatu_nr

/*
 * Unit Data PDU
 */
struct ud_pdu {
	u_char		ud_type;	/* PDU type, etc */
	u_char		ud_rsvd[3];	/* Reserved */
};

/*
 * Management Data PDU
 */
struct md_pdu {
	u_char		md_type;	/* PDU type, etc */
	u_char		md_rsvd[3];	/* Reserved */
};

#endif	/* _UNI_SSCOP_PDU_H */
OpenPOWER on IntegriCloud