summaryrefslogtreecommitdiffstats
path: root/sys/contrib/ngatm/netnatm/sig/unidef.h
blob: 7278db8b91cb0d648431809878e65be0182d9801 (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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
/*
 * Copyright (c) 1996-2003
 *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
 * 	All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * Author: Hartmut Brandt <harti@freebsd.org>
 *
 * $Begemot: libunimsg/netnatm/sig/unidef.h,v 1.9 2004/07/08 08:22:24 brandt Exp $
 *
 * UNI public definitions.
 */
#ifndef _ATM_SIG_UNIDEF_H_
#define _ATM_SIG_UNIDEF_H_

#ifdef _KERNEL
#include <sys/stdint.h>
#else
#include <stdint.h>
#endif

/*
 * Debug facilities
 */
#define UNI_DEBUG_FACILITIES		\
	UNI_DEBUG_DEFINE(TIMEOUT)	\
	UNI_DEBUG_DEFINE(RESTART)	\
	UNI_DEBUG_DEFINE(SAAL)		\
	UNI_DEBUG_DEFINE(PARSE)		\
	UNI_DEBUG_DEFINE(CALL)		\
	UNI_DEBUG_DEFINE(WARN)		\
	UNI_DEBUG_DEFINE(COORD)		\
	UNI_DEBUG_DEFINE(API)		\
	UNI_DEBUG_DEFINE(MSG)		\
	UNI_DEBUG_DEFINE(ERR)		\
	UNI_DEBUG_DEFINE(VERIFY)	\

enum uni_verb {
#define UNI_DEBUG_DEFINE(D) UNI_FAC_##D,
	UNI_DEBUG_FACILITIES
#undef UNI_DEBUG_DEFINE

	UNI_MAXFACILITY,
};

/*
 * Default timer values and repeat counts
 */
#define UNI_T301_DEFAULT	180000
#define UNI_T303_DEFAULT	4000
#define UNI_T303_CNT_DEFAULT	2
#define UNI_T308_DEFAULT	30000
#define UNI_T308_CNT_DEFAULT	2
#define UNI_T309_DEFAULT	10000
#define UNI_T310U_DEFAULT	30000
#define UNI_T310N_DEFAULT	10000
#define UNI_T313_DEFAULT	4000
#define UNI_T316_DEFAULT	120000
#define UNI_T316_CNT_DEFAULT	2
#define UNI_T317_DEFAULT	90000
#define UNI_T322_DEFAULT	4000
#define UNI_T322_CNT_DEFAULT	2
#define UNI_T397_DEFAULT	UNI_T301_DEFAULT
#define UNI_T398_DEFAULT	4000
#define UNI_T399U_DEFAULT	(UNI_T303_DEFAULT + UNI_T310U_DEFAULT)
#define UNI_T399N_DEFAULT	(UNI_T303_DEFAULT + UNI_T310N_DEFAULT)

/*
 * Protocol support
 */
enum uni_proto {
	UNIPROTO_UNI40U,	/* UNI4.0 user side */
	UNIPROTO_UNI40N,	/* UNI4.0 network side */
	UNIPROTO_PNNI10,	/* PNNI1.0 */
};
enum uni_popt {
	UNIPROTO_GFP	= 0x0001,	/* enable GFP */
	UNIPROTO_SB_TB	= 0x0002,	/* Coincident Sb-Tb/Tb */

	UNIPROTO_ALLMASK = 0x0003,
};

/*
 * Other options
 */
enum uni_option {
	UNIOPT_GIT_HARD		= 0x0001,	/* harder check of GIT IE */
	UNIOPT_BEARER_HARD	= 0x0002,	/* harder check of BEARER IE */
	UNIOPT_CAUSE_HARD	= 0x0004,	/* harder check of CAUSE IE */

	UNIOPT_ALLMASK		= 0x0007,
};

/*
 * UNI configuration
 */
struct uni_config {
	uint32_t	proto;		/* which protocol */
	uint32_t	popt;		/* protocol option */
	uint32_t	option;		/* other options */
	uint32_t	timer301;	/* T301 */
	uint32_t	timer303;	/* T303 */
	uint32_t	init303;	/* T303 retransmission count */
	uint32_t	timer308;	/* T308 */
	uint32_t	init308;	/* T308 retransmission count */
	uint32_t	timer309;	/* T309 */
	uint32_t	timer310;	/* T310 */
	uint32_t	timer313;	/* T313 */
	uint32_t	timer316;	/* T316 */
	uint32_t	init316;	/* T316 retransmission count */
	uint32_t	timer317;	/* T317 */
	uint32_t	timer322;	/* T322 */
	uint32_t	init322;	/* T322 retransmission count */
	uint32_t	timer397;	/* T397 */
	uint32_t	timer398;	/* T398 */
	uint32_t	timer399;	/* T399 */
};
enum uni_config_mask {
	UNICFG_PROTO	= 0x00000001,
	UNICFG_TIMER301	= 0x00000002,
	UNICFG_TIMER303	= 0x00000004,
	UNICFG_INIT303	= 0x00000008,
	UNICFG_TIMER308	= 0x00000010,
	UNICFG_INIT308	= 0x00000020,
	UNICFG_TIMER309	= 0x00000040,
	UNICFG_TIMER310	= 0x00000080,
	UNICFG_TIMER313	= 0x00000100,
	UNICFG_TIMER316	= 0x00000200,
	UNICFG_INIT316	= 0x00000400,
	UNICFG_TIMER317	= 0x00000800,
	UNICFG_TIMER322	= 0x00001000,
	UNICFG_INIT322	= 0x00002000,
	UNICFG_TIMER397	= 0x00004000,
	UNICFG_TIMER398	= 0x00008000,
	UNICFG_TIMER399	= 0x00010000,

	UNICFG_ALLMASK	= 0x0001ffff,
};

/*
 * API signals
 */
enum uni_sig {
	UNIAPI_ERROR			= 0,	/* UNI -> API */

	UNIAPI_CALL_CREATED		= 1,	/* UNI -> API */
	UNIAPI_CALL_DESTROYED		= 2,	/* UNI -> API */
	UNIAPI_PARTY_CREATED		= 3,	/* UNI -> API */
	UNIAPI_PARTY_DESTROYED		= 4,	/* UNI -> API */

	UNIAPI_LINK_ESTABLISH_request	= 5,	/* API -> UNI */
	UNIAPI_LINK_ESTABLISH_confirm	= 6,	/* UNI -> API */
	UNIAPI_LINK_RELEASE_request	= 7,	/* API -> UNI */
	UNIAPI_LINK_RELEASE_confirm	= 8,	/* UNI -> API */

	UNIAPI_RESET_request		= 9,	/* API -> UNI */
	UNIAPI_RESET_confirm		= 10,	/* UNI -> API */
	UNIAPI_RESET_indication		= 11,	/* UNI -> API */
	UNIAPI_RESET_ERROR_indication	= 12,	/* UNI -> API */
	UNIAPI_RESET_response		= 13,	/* API -> UNI */
	UNIAPI_RESET_ERROR_response	= 14,	/* API -> UNI */
	UNIAPI_RESET_STATUS_indication	= 15,	/* UNI -> API */

	UNIAPI_SETUP_request		= 16,	/* API -> UNI */
	UNIAPI_SETUP_indication		= 17,	/* UNI -> API */
	UNIAPI_SETUP_response		= 18,	/* API -> UNI */
	UNIAPI_SETUP_confirm		= 19,	/* UNI -> API */
	UNIAPI_SETUP_COMPLETE_indication= 20,	/* U-UNI -> API */
	UNIAPI_SETUP_COMPLETE_request	= 46,	/* API -> N-UNI */
	UNIAPI_ALERTING_request		= 21,	/* API -> UNI */
	UNIAPI_ALERTING_indication	= 22,	/* UNI -> API */
	UNIAPI_PROCEEDING_request	= 23,	/* API -> UNI */
	UNIAPI_PROCEEDING_indication	= 24,	/* UNI -> API */
	UNIAPI_RELEASE_request		= 25,	/* API -> UNI */
	UNIAPI_RELEASE_indication	= 26,	/* UNI -> API */
	UNIAPI_RELEASE_response		= 27,	/* API -> UNI */
	UNIAPI_RELEASE_confirm		= 28,	/* UNI -> API */
	UNIAPI_NOTIFY_request		= 29,	/* API -> UNI */
	UNIAPI_NOTIFY_indication	= 30,	/* UNI -> API */
	UNIAPI_STATUS_indication	= 31,	/* UNI -> API */
	UNIAPI_STATUS_ENQUIRY_request	= 32,	/* API -> UNI */

	UNIAPI_ADD_PARTY_request	= 33,	/* API -> UNI */
	UNIAPI_ADD_PARTY_indication	= 34,	/* UNI -> API */
	UNIAPI_PARTY_ALERTING_request	= 35,	/* API -> UNI */
	UNIAPI_PARTY_ALERTING_indication= 36,	/* UNI -> API */
	UNIAPI_ADD_PARTY_ACK_request	= 37,	/* API -> UNI */
	UNIAPI_ADD_PARTY_ACK_indication	= 38,	/* UNI -> API */
	UNIAPI_ADD_PARTY_REJ_request	= 39,	/* API -> UNI */
	UNIAPI_ADD_PARTY_REJ_indication	= 40,	/* UNI -> API */
	UNIAPI_DROP_PARTY_request	= 41,	/* API -> UNI */
	UNIAPI_DROP_PARTY_indication	= 42,	/* UNI -> API */
	UNIAPI_DROP_PARTY_ACK_request	= 43,	/* API -> UNI */
	UNIAPI_DROP_PARTY_ACK_indication= 44,	/* UNI -> API */

	UNIAPI_ABORT_CALL_request	= 45,	/* API -> UNI */

	UNIAPI_MAXSIG = 47
};

struct uniapi_error {
	uint32_t	reason;
	uint32_t	state;
};
/* keep this in sync with atmapi.h:enum atmerr */

#define UNIAPI_DEF_ERRORS(MACRO)					\
	MACRO(OK, 0, "no error")					\
	MACRO(ERROR_BAD_SIGNAL,	1, "unknown signal")			\
	MACRO(ERROR_BADCU,	2, "signal in bad co-ordinator state")	\
	MACRO(ERROR_BAD_CALLSTATE, 3, "signal in bad call state")	\
	MACRO(ERROR_BAD_EPSTATE, 4, "signal in bad endpoint state")	\
	MACRO(ERROR_BAD_ARG,	5, "bad argument")			\
	MACRO(ERROR_BAD_CALL,	6, "unknown call reference")		\
	MACRO(ERROR_BAD_PARTY,	7, "unknown party")			\
	MACRO(ERROR_BAD_CTYPE,	8, "bad type of call for signal")	\
	MACRO(ERROR_BAD_IE,	9, "bad information element")		\
	MACRO(ERROR_EPREF_INUSE, 10, "endpoint reference already in use") \
	MACRO(ERROR_MISSING_IE,	11, "missing information element")	\
	MACRO(ERROR_ENCODING,	12, "error during message encoding")	\
	MACRO(ERROR_NOMEM,	13, "out of memory")			\
	MACRO(ERROR_BUSY,	14, "status enquiry busy")

enum {
#define DEF(NAME, VAL, STR) UNIAPI_##NAME = VAL,
UNIAPI_DEF_ERRORS(DEF)
#undef DEF
};

struct uniapi_call_created {
	struct uni_cref		cref;
};
struct uniapi_call_destroyed {
	struct uni_cref		cref;
};
struct uniapi_party_created {
	struct uni_cref		cref;
	struct uni_ie_epref	epref;
};
struct uniapi_party_destroyed {
	struct uni_cref		cref;
	struct uni_ie_epref	epref;
};
struct uniapi_abort_call_request {
	struct uni_cref		cref;
};

struct uniapi_reset_request {
	struct uni_ie_restart	restart;
	struct uni_ie_connid	connid;
};

struct uniapi_reset_confirm {
	struct uni_ie_restart	restart;
	struct uni_ie_connid	connid;
};

struct uniapi_reset_indication {
	struct uni_ie_restart	restart;
	struct uni_ie_connid	connid;

};
struct uniapi_reset_error_indication {
	uint32_t		source;		/* 0 - start, 1 - response */
	uint32_t		reason;
};

#define UNIAPI_DEF_RESET_ERRORS(MACRO)				\
	MACRO(UNIAPI_RESET_ERROR_NO_CONFIRM,		0,	\
	    "no confirmation")					\
	MACRO(UNIAPI_RESET_ERROR_NO_RESPONSE,		1,	\
	    "no response")					\
	MACRO(UNIAPI_RESET_ERROR_PEER_INCOMP_STATE,	2,	\
	    "incompatible state")
enum {
#define DEF(NAME, VALUE, STR) NAME = VALUE,
UNIAPI_DEF_RESET_ERRORS(DEF)
#undef DEF
};

struct uniapi_reset_response {
	struct uni_ie_restart	restart;
	struct uni_ie_connid	connid;
};

struct uniapi_reset_error_response {
	struct uni_ie_cause	cause;
};

struct uniapi_reset_status_indication {
	struct uni_cref		cref;		/* STATUS message CREF */
	struct uni_ie_callstate	callstate;
	struct uni_ie_cause	cause;
};

struct uniapi_setup_request {
	struct uni_setup	setup;
};
struct uniapi_setup_indication {
	struct uni_setup	setup;
};
struct uniapi_setup_response {
	struct uni_connect	connect;
};
struct uniapi_setup_confirm {
	struct uni_connect	connect;
};
struct uniapi_setup_complete_indication {
	struct uni_connect_ack	connect_ack;
};
struct uniapi_setup_complete_request {
	struct uni_connect_ack	connect_ack;
};

struct uniapi_alerting_request {
	struct uni_alerting	alerting;
};

struct uniapi_alerting_indication {
	struct uni_alerting	alerting;
};

struct uniapi_proceeding_request {
	struct uni_call_proc	call_proc;
};

struct uniapi_proceeding_indication {
	struct uni_call_proc	call_proc;
};


struct uniapi_release_request {
	struct uni_release	release;
};
struct uniapi_release_indication {
	struct uni_release	release;
};
struct uniapi_release_response {
	struct uni_release_compl release_compl;
};
/*
 * A release confirm can come from a RELEASE COMPLETE or a RELEASE.
 * Because the IEs in a RELEASE COMPLETE are a subset of a RELEASE,
 * use the RELEASE here.
 */
struct uniapi_release_confirm {
	struct uni_release	release;
};

struct uniapi_notify_request {
	struct uni_notify	notify;
};
struct uniapi_notify_indication {
	struct uni_notify	notify;
};

struct uniapi_status_indication {
	struct uni_cref		cref;
	enum uni_callstate	my_state;
	enum uni_cause		my_cause;
	struct uni_ie_callstate	his_state;
	struct uni_ie_cause	his_cause;
	struct uni_ie_epref	epref;
	struct uni_ie_epstate	epstate;
};
struct uniapi_status_enquiry_request {
	struct uni_cref		cref;
	struct uni_ie_epref	epref;
};

struct uniapi_add_party_request {
	struct uni_add_party	add;
};
struct uniapi_add_party_indication {
	struct uni_add_party	add;
};

struct uniapi_party_alerting_request {
	struct uni_party_alerting alert;
};
struct uniapi_party_alerting_indication {
	struct uni_party_alerting alert;
};

struct uniapi_add_party_ack_request {
	struct uni_add_party_ack ack;
};
struct uniapi_add_party_ack_indication {
	struct uni_add_party_ack ack;
};
struct uniapi_add_party_rej_request {
	struct uni_add_party_rej rej;
};
struct uniapi_add_party_rej_indication {
	struct uni_add_party_rej rej;
};

struct uniapi_drop_party_request {
	struct uni_drop_party	drop;
};
struct uniapi_drop_party_indication {
	struct uni_drop_party	drop;
	struct uni_ie_cause	my_cause;
};

struct uniapi_drop_party_ack_request {
	struct uni_drop_party_ack ack;
};
struct uniapi_drop_party_ack_indication {
	struct uni_drop_party	drop;
	struct uni_ie_crankback	crankback;
};

union uniapi_all {
	struct uniapi_error			error;
	struct uniapi_call_created		call_created;
	struct uniapi_call_destroyed		call_destroyed;
	struct uniapi_party_created		party_created;
	struct uniapi_party_destroyed		party_destroyed;
	struct uniapi_abort_call_request	abort_call_request;
	struct uniapi_reset_request		reset_request;
	struct uniapi_reset_confirm		reset_confirm;
	struct uniapi_reset_indication		reset_indication;
	struct uniapi_reset_error_indication	reset_error_indication;
	struct uniapi_reset_response		reset_response;
	struct uniapi_reset_error_response	reset_error_response;
	struct uniapi_reset_status_indication	reset_status_indication;
	struct uniapi_setup_request		setup_request;
	struct uniapi_setup_indication		setup_indication;
	struct uniapi_setup_response		setup_response;
	struct uniapi_setup_confirm		setup_confirm;
	struct uniapi_setup_complete_indication	setup_complete_indication;
	struct uniapi_setup_complete_request	setup_complete_request;
	struct uniapi_alerting_request		alerting_request;
	struct uniapi_alerting_indication	alerting_indication;
	struct uniapi_proceeding_request	proceeding_request;
	struct uniapi_proceeding_indication	proceeding_indication;
	struct uniapi_release_request		release_request;
	struct uniapi_release_indication	release_indication;
	struct uniapi_release_response		release_response;
	struct uniapi_release_confirm		release_confirm;
	struct uniapi_notify_request		notify_request;
	struct uniapi_notify_indication		notify_indication;
	struct uniapi_status_indication		status_indication;
	struct uniapi_status_enquiry_request	status_enquiry_request;
	struct uniapi_add_party_request		add_party_request;
	struct uniapi_add_party_indication	add_party_indication;
	struct uniapi_party_alerting_request	party_alerting_request;
	struct uniapi_party_alerting_indication	party_alerting_indication;
	struct uniapi_add_party_ack_request	add_party_ack_request;
	struct uniapi_add_party_ack_indication	add_party_ack_indication;
	struct uniapi_add_party_rej_request	add_party_rej_request;
	struct uniapi_add_party_rej_indication	add_party_rej_indication;
	struct uniapi_drop_party_request	drop_party_request;
	struct uniapi_drop_party_indication	drop_party_indication;
	struct uniapi_drop_party_ack_request	drop_party_ack_request;
	struct uniapi_drop_party_ack_indication	drop_party_ack_indication;
};

#endif
OpenPOWER on IntegriCloud