2 * Copyright (c) 1996-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * Author: Hartmut Brandt <harti@freebsd.org>
29 * $Begemot: libunimsg/netnatm/sig/unidef.h,v 1.9 2004/07/08 08:22:24 brandt Exp $
31 * UNI public definitions.
33 #ifndef _ATM_SIG_UNIDEF_H_
34 #define _ATM_SIG_UNIDEF_H_
37 #include <sys/stdint.h>
45 #define UNI_DEBUG_FACILITIES \
46 UNI_DEBUG_DEFINE(TIMEOUT) \
47 UNI_DEBUG_DEFINE(RESTART) \
48 UNI_DEBUG_DEFINE(SAAL) \
49 UNI_DEBUG_DEFINE(PARSE) \
50 UNI_DEBUG_DEFINE(CALL) \
51 UNI_DEBUG_DEFINE(WARN) \
52 UNI_DEBUG_DEFINE(COORD) \
53 UNI_DEBUG_DEFINE(API) \
54 UNI_DEBUG_DEFINE(MSG) \
55 UNI_DEBUG_DEFINE(ERR) \
56 UNI_DEBUG_DEFINE(VERIFY) \
59 #define UNI_DEBUG_DEFINE(D) UNI_FAC_##D,
61 #undef UNI_DEBUG_DEFINE
67 * Default timer values and repeat counts
69 #define UNI_T301_DEFAULT 180000
70 #define UNI_T303_DEFAULT 4000
71 #define UNI_T303_CNT_DEFAULT 2
72 #define UNI_T308_DEFAULT 30000
73 #define UNI_T308_CNT_DEFAULT 2
74 #define UNI_T309_DEFAULT 10000
75 #define UNI_T310U_DEFAULT 30000
76 #define UNI_T310N_DEFAULT 10000
77 #define UNI_T313_DEFAULT 4000
78 #define UNI_T316_DEFAULT 120000
79 #define UNI_T316_CNT_DEFAULT 2
80 #define UNI_T317_DEFAULT 90000
81 #define UNI_T322_DEFAULT 4000
82 #define UNI_T322_CNT_DEFAULT 2
83 #define UNI_T397_DEFAULT UNI_T301_DEFAULT
84 #define UNI_T398_DEFAULT 4000
85 #define UNI_T399U_DEFAULT (UNI_T303_DEFAULT + UNI_T310U_DEFAULT)
86 #define UNI_T399N_DEFAULT (UNI_T303_DEFAULT + UNI_T310N_DEFAULT)
92 UNIPROTO_UNI40U, /* UNI4.0 user side */
93 UNIPROTO_UNI40N, /* UNI4.0 network side */
94 UNIPROTO_PNNI10, /* PNNI1.0 */
97 UNIPROTO_GFP = 0x0001, /* enable GFP */
98 UNIPROTO_SB_TB = 0x0002, /* Coincident Sb-Tb/Tb */
100 UNIPROTO_ALLMASK = 0x0003,
107 UNIOPT_GIT_HARD = 0x0001, /* harder check of GIT IE */
108 UNIOPT_BEARER_HARD = 0x0002, /* harder check of BEARER IE */
109 UNIOPT_CAUSE_HARD = 0x0004, /* harder check of CAUSE IE */
111 UNIOPT_ALLMASK = 0x0007,
118 uint32_t proto; /* which protocol */
119 uint32_t popt; /* protocol option */
120 uint32_t option; /* other options */
121 uint32_t timer301; /* T301 */
122 uint32_t timer303; /* T303 */
123 uint32_t init303; /* T303 retransmission count */
124 uint32_t timer308; /* T308 */
125 uint32_t init308; /* T308 retransmission count */
126 uint32_t timer309; /* T309 */
127 uint32_t timer310; /* T310 */
128 uint32_t timer313; /* T313 */
129 uint32_t timer316; /* T316 */
130 uint32_t init316; /* T316 retransmission count */
131 uint32_t timer317; /* T317 */
132 uint32_t timer322; /* T322 */
133 uint32_t init322; /* T322 retransmission count */
134 uint32_t timer397; /* T397 */
135 uint32_t timer398; /* T398 */
136 uint32_t timer399; /* T399 */
138 enum uni_config_mask {
139 UNICFG_PROTO = 0x00000001,
140 UNICFG_TIMER301 = 0x00000002,
141 UNICFG_TIMER303 = 0x00000004,
142 UNICFG_INIT303 = 0x00000008,
143 UNICFG_TIMER308 = 0x00000010,
144 UNICFG_INIT308 = 0x00000020,
145 UNICFG_TIMER309 = 0x00000040,
146 UNICFG_TIMER310 = 0x00000080,
147 UNICFG_TIMER313 = 0x00000100,
148 UNICFG_TIMER316 = 0x00000200,
149 UNICFG_INIT316 = 0x00000400,
150 UNICFG_TIMER317 = 0x00000800,
151 UNICFG_TIMER322 = 0x00001000,
152 UNICFG_INIT322 = 0x00002000,
153 UNICFG_TIMER397 = 0x00004000,
154 UNICFG_TIMER398 = 0x00008000,
155 UNICFG_TIMER399 = 0x00010000,
157 UNICFG_ALLMASK = 0x0001ffff,
164 UNIAPI_ERROR = 0, /* UNI -> API */
166 UNIAPI_CALL_CREATED = 1, /* UNI -> API */
167 UNIAPI_CALL_DESTROYED = 2, /* UNI -> API */
168 UNIAPI_PARTY_CREATED = 3, /* UNI -> API */
169 UNIAPI_PARTY_DESTROYED = 4, /* UNI -> API */
171 UNIAPI_LINK_ESTABLISH_request = 5, /* API -> UNI */
172 UNIAPI_LINK_ESTABLISH_confirm = 6, /* UNI -> API */
173 UNIAPI_LINK_RELEASE_request = 7, /* API -> UNI */
174 UNIAPI_LINK_RELEASE_confirm = 8, /* UNI -> API */
176 UNIAPI_RESET_request = 9, /* API -> UNI */
177 UNIAPI_RESET_confirm = 10, /* UNI -> API */
178 UNIAPI_RESET_indication = 11, /* UNI -> API */
179 UNIAPI_RESET_ERROR_indication = 12, /* UNI -> API */
180 UNIAPI_RESET_response = 13, /* API -> UNI */
181 UNIAPI_RESET_ERROR_response = 14, /* API -> UNI */
182 UNIAPI_RESET_STATUS_indication = 15, /* UNI -> API */
184 UNIAPI_SETUP_request = 16, /* API -> UNI */
185 UNIAPI_SETUP_indication = 17, /* UNI -> API */
186 UNIAPI_SETUP_response = 18, /* API -> UNI */
187 UNIAPI_SETUP_confirm = 19, /* UNI -> API */
188 UNIAPI_SETUP_COMPLETE_indication= 20, /* U-UNI -> API */
189 UNIAPI_SETUP_COMPLETE_request = 46, /* API -> N-UNI */
190 UNIAPI_ALERTING_request = 21, /* API -> UNI */
191 UNIAPI_ALERTING_indication = 22, /* UNI -> API */
192 UNIAPI_PROCEEDING_request = 23, /* API -> UNI */
193 UNIAPI_PROCEEDING_indication = 24, /* UNI -> API */
194 UNIAPI_RELEASE_request = 25, /* API -> UNI */
195 UNIAPI_RELEASE_indication = 26, /* UNI -> API */
196 UNIAPI_RELEASE_response = 27, /* API -> UNI */
197 UNIAPI_RELEASE_confirm = 28, /* UNI -> API */
198 UNIAPI_NOTIFY_request = 29, /* API -> UNI */
199 UNIAPI_NOTIFY_indication = 30, /* UNI -> API */
200 UNIAPI_STATUS_indication = 31, /* UNI -> API */
201 UNIAPI_STATUS_ENQUIRY_request = 32, /* API -> UNI */
203 UNIAPI_ADD_PARTY_request = 33, /* API -> UNI */
204 UNIAPI_ADD_PARTY_indication = 34, /* UNI -> API */
205 UNIAPI_PARTY_ALERTING_request = 35, /* API -> UNI */
206 UNIAPI_PARTY_ALERTING_indication= 36, /* UNI -> API */
207 UNIAPI_ADD_PARTY_ACK_request = 37, /* API -> UNI */
208 UNIAPI_ADD_PARTY_ACK_indication = 38, /* UNI -> API */
209 UNIAPI_ADD_PARTY_REJ_request = 39, /* API -> UNI */
210 UNIAPI_ADD_PARTY_REJ_indication = 40, /* UNI -> API */
211 UNIAPI_DROP_PARTY_request = 41, /* API -> UNI */
212 UNIAPI_DROP_PARTY_indication = 42, /* UNI -> API */
213 UNIAPI_DROP_PARTY_ACK_request = 43, /* API -> UNI */
214 UNIAPI_DROP_PARTY_ACK_indication= 44, /* UNI -> API */
216 UNIAPI_ABORT_CALL_request = 45, /* API -> UNI */
221 struct uniapi_error {
225 /* keep this in sync with atmapi.h:enum atmerr */
227 #define UNIAPI_DEF_ERRORS(MACRO) \
228 MACRO(OK, 0, "no error") \
229 MACRO(ERROR_BAD_SIGNAL, 1, "unknown signal") \
230 MACRO(ERROR_BADCU, 2, "signal in bad co-ordinator state") \
231 MACRO(ERROR_BAD_CALLSTATE, 3, "signal in bad call state") \
232 MACRO(ERROR_BAD_EPSTATE, 4, "signal in bad endpoint state") \
233 MACRO(ERROR_BAD_ARG, 5, "bad argument") \
234 MACRO(ERROR_BAD_CALL, 6, "unknown call reference") \
235 MACRO(ERROR_BAD_PARTY, 7, "unknown party") \
236 MACRO(ERROR_BAD_CTYPE, 8, "bad type of call for signal") \
237 MACRO(ERROR_BAD_IE, 9, "bad information element") \
238 MACRO(ERROR_EPREF_INUSE, 10, "endpoint reference already in use") \
239 MACRO(ERROR_MISSING_IE, 11, "missing information element") \
240 MACRO(ERROR_ENCODING, 12, "error during message encoding") \
241 MACRO(ERROR_NOMEM, 13, "out of memory") \
242 MACRO(ERROR_BUSY, 14, "status enquiry busy")
245 #define DEF(NAME, VAL, STR) UNIAPI_##NAME = VAL,
246 UNIAPI_DEF_ERRORS(DEF)
250 struct uniapi_call_created {
251 struct uni_cref cref;
253 struct uniapi_call_destroyed {
254 struct uni_cref cref;
256 struct uniapi_party_created {
257 struct uni_cref cref;
258 struct uni_ie_epref epref;
260 struct uniapi_party_destroyed {
261 struct uni_cref cref;
262 struct uni_ie_epref epref;
264 struct uniapi_abort_call_request {
265 struct uni_cref cref;
268 struct uniapi_reset_request {
269 struct uni_ie_restart restart;
270 struct uni_ie_connid connid;
273 struct uniapi_reset_confirm {
274 struct uni_ie_restart restart;
275 struct uni_ie_connid connid;
278 struct uniapi_reset_indication {
279 struct uni_ie_restart restart;
280 struct uni_ie_connid connid;
283 struct uniapi_reset_error_indication {
284 uint32_t source; /* 0 - start, 1 - response */
288 #define UNIAPI_DEF_RESET_ERRORS(MACRO) \
289 MACRO(UNIAPI_RESET_ERROR_NO_CONFIRM, 0, \
291 MACRO(UNIAPI_RESET_ERROR_NO_RESPONSE, 1, \
293 MACRO(UNIAPI_RESET_ERROR_PEER_INCOMP_STATE, 2, \
294 "incompatible state")
296 #define DEF(NAME, VALUE, STR) NAME = VALUE,
297 UNIAPI_DEF_RESET_ERRORS(DEF)
301 struct uniapi_reset_response {
302 struct uni_ie_restart restart;
303 struct uni_ie_connid connid;
306 struct uniapi_reset_error_response {
307 struct uni_ie_cause cause;
310 struct uniapi_reset_status_indication {
311 struct uni_cref cref; /* STATUS message CREF */
312 struct uni_ie_callstate callstate;
313 struct uni_ie_cause cause;
316 struct uniapi_setup_request {
317 struct uni_setup setup;
319 struct uniapi_setup_indication {
320 struct uni_setup setup;
322 struct uniapi_setup_response {
323 struct uni_connect connect;
325 struct uniapi_setup_confirm {
326 struct uni_connect connect;
328 struct uniapi_setup_complete_indication {
329 struct uni_connect_ack connect_ack;
331 struct uniapi_setup_complete_request {
332 struct uni_connect_ack connect_ack;
335 struct uniapi_alerting_request {
336 struct uni_alerting alerting;
339 struct uniapi_alerting_indication {
340 struct uni_alerting alerting;
343 struct uniapi_proceeding_request {
344 struct uni_call_proc call_proc;
347 struct uniapi_proceeding_indication {
348 struct uni_call_proc call_proc;
352 struct uniapi_release_request {
353 struct uni_release release;
355 struct uniapi_release_indication {
356 struct uni_release release;
358 struct uniapi_release_response {
359 struct uni_release_compl release_compl;
362 * A release confirm can come from a RELEASE COMPLETE or a RELEASE.
363 * Because the IEs in a RELEASE COMPLETE are a subset of a RELEASE,
364 * use the RELEASE here.
366 struct uniapi_release_confirm {
367 struct uni_release release;
370 struct uniapi_notify_request {
371 struct uni_notify notify;
373 struct uniapi_notify_indication {
374 struct uni_notify notify;
377 struct uniapi_status_indication {
378 struct uni_cref cref;
379 enum uni_callstate my_state;
380 enum uni_cause my_cause;
381 struct uni_ie_callstate his_state;
382 struct uni_ie_cause his_cause;
383 struct uni_ie_epref epref;
384 struct uni_ie_epstate epstate;
386 struct uniapi_status_enquiry_request {
387 struct uni_cref cref;
388 struct uni_ie_epref epref;
391 struct uniapi_add_party_request {
392 struct uni_add_party add;
394 struct uniapi_add_party_indication {
395 struct uni_add_party add;
398 struct uniapi_party_alerting_request {
399 struct uni_party_alerting alert;
401 struct uniapi_party_alerting_indication {
402 struct uni_party_alerting alert;
405 struct uniapi_add_party_ack_request {
406 struct uni_add_party_ack ack;
408 struct uniapi_add_party_ack_indication {
409 struct uni_add_party_ack ack;
411 struct uniapi_add_party_rej_request {
412 struct uni_add_party_rej rej;
414 struct uniapi_add_party_rej_indication {
415 struct uni_add_party_rej rej;
418 struct uniapi_drop_party_request {
419 struct uni_drop_party drop;
421 struct uniapi_drop_party_indication {
422 struct uni_drop_party drop;
423 struct uni_ie_cause my_cause;
426 struct uniapi_drop_party_ack_request {
427 struct uni_drop_party_ack ack;
429 struct uniapi_drop_party_ack_indication {
430 struct uni_drop_party drop;
431 struct uni_ie_crankback crankback;
435 struct uniapi_error error;
436 struct uniapi_call_created call_created;
437 struct uniapi_call_destroyed call_destroyed;
438 struct uniapi_party_created party_created;
439 struct uniapi_party_destroyed party_destroyed;
440 struct uniapi_abort_call_request abort_call_request;
441 struct uniapi_reset_request reset_request;
442 struct uniapi_reset_confirm reset_confirm;
443 struct uniapi_reset_indication reset_indication;
444 struct uniapi_reset_error_indication reset_error_indication;
445 struct uniapi_reset_response reset_response;
446 struct uniapi_reset_error_response reset_error_response;
447 struct uniapi_reset_status_indication reset_status_indication;
448 struct uniapi_setup_request setup_request;
449 struct uniapi_setup_indication setup_indication;
450 struct uniapi_setup_response setup_response;
451 struct uniapi_setup_confirm setup_confirm;
452 struct uniapi_setup_complete_indication setup_complete_indication;
453 struct uniapi_setup_complete_request setup_complete_request;
454 struct uniapi_alerting_request alerting_request;
455 struct uniapi_alerting_indication alerting_indication;
456 struct uniapi_proceeding_request proceeding_request;
457 struct uniapi_proceeding_indication proceeding_indication;
458 struct uniapi_release_request release_request;
459 struct uniapi_release_indication release_indication;
460 struct uniapi_release_response release_response;
461 struct uniapi_release_confirm release_confirm;
462 struct uniapi_notify_request notify_request;
463 struct uniapi_notify_indication notify_indication;
464 struct uniapi_status_indication status_indication;
465 struct uniapi_status_enquiry_request status_enquiry_request;
466 struct uniapi_add_party_request add_party_request;
467 struct uniapi_add_party_indication add_party_indication;
468 struct uniapi_party_alerting_request party_alerting_request;
469 struct uniapi_party_alerting_indication party_alerting_indication;
470 struct uniapi_add_party_ack_request add_party_ack_request;
471 struct uniapi_add_party_ack_indication add_party_ack_indication;
472 struct uniapi_add_party_rej_request add_party_rej_request;
473 struct uniapi_add_party_rej_indication add_party_rej_indication;
474 struct uniapi_drop_party_request drop_party_request;
475 struct uniapi_drop_party_indication drop_party_indication;
476 struct uniapi_drop_party_ack_request drop_party_ack_request;
477 struct uniapi_drop_party_ack_indication drop_party_ack_indication;