1/* 2 * Copyright (c) 1996-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 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. 14 * 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 25 * SUCH DAMAGE. 26 * 27 * Author: Hartmut Brandt <harti@freebsd.org> 28 * 29 * $Begemot: libunimsg/netnatm/sig/unidef.h,v 1.9 2004/07/08 08:22:24 brandt Exp $ 30 * 31 * UNI public definitions. 32 */ 33#ifndef _ATM_SIG_UNIDEF_H_ 34#define _ATM_SIG_UNIDEF_H_ 35 36#ifdef _KERNEL 37#include <sys/stdint.h> 38#else 39#include <stdint.h> 40#endif 41 42/* 43 * Debug facilities 44 */ 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) \ 57 58enum uni_verb { 59#define UNI_DEBUG_DEFINE(D) UNI_FAC_##D, 60 UNI_DEBUG_FACILITIES 61#undef UNI_DEBUG_DEFINE 62 63 UNI_MAXFACILITY, 64}; 65 66/* 67 * Default timer values and repeat counts 68 */ 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) 87 88/* 89 * Protocol support 90 */ 91enum uni_proto { 92 UNIPROTO_UNI40U, /* UNI4.0 user side */ 93 UNIPROTO_UNI40N, /* UNI4.0 network side */ 94 UNIPROTO_PNNI10, /* PNNI1.0 */ 95}; 96enum uni_popt { 97 UNIPROTO_GFP = 0x0001, /* enable GFP */ 98 UNIPROTO_SB_TB = 0x0002, /* Coincident Sb-Tb/Tb */ 99 100 UNIPROTO_ALLMASK = 0x0003, 101}; 102 103/* 104 * Other options 105 */ 106enum uni_option { 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 */ 110 111 UNIOPT_ALLMASK = 0x0007, 112}; 113 114/* 115 * UNI configuration 116 */ 117struct uni_config { 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 */ 137}; 138enum 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, 156 157 UNICFG_ALLMASK = 0x0001ffff, 158}; 159 160/* 161 * API signals 162 */ 163enum uni_sig { 164 UNIAPI_ERROR = 0, /* UNI -> API */ 165 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 */ 170 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 */ 175 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 */ 183 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 */ 202 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 */ 215 216 UNIAPI_ABORT_CALL_request = 45, /* API -> UNI */ 217 218 UNIAPI_MAXSIG = 47 219}; 220 221struct uniapi_error { 222 uint32_t reason; 223 uint32_t state; 224}; 225/* keep this in sync with atmapi.h:enum atmerr */ 226 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") 243 244enum { 245#define DEF(NAME, VAL, STR) UNIAPI_##NAME = VAL, 246UNIAPI_DEF_ERRORS(DEF) 247#undef DEF 248}; 249 250struct uniapi_call_created { 251 struct uni_cref cref; 252}; 253struct uniapi_call_destroyed { 254 struct uni_cref cref; 255}; 256struct uniapi_party_created { 257 struct uni_cref cref; 258 struct uni_ie_epref epref; 259}; 260struct uniapi_party_destroyed { 261 struct uni_cref cref; 262 struct uni_ie_epref epref; 263}; 264struct uniapi_abort_call_request { 265 struct uni_cref cref; 266}; 267 268struct uniapi_reset_request { 269 struct uni_ie_restart restart; 270 struct uni_ie_connid connid; 271}; 272 273struct uniapi_reset_confirm { 274 struct uni_ie_restart restart; 275 struct uni_ie_connid connid; 276}; 277 278struct uniapi_reset_indication { 279 struct uni_ie_restart restart; 280 struct uni_ie_connid connid; 281 282}; 283struct uniapi_reset_error_indication { 284 uint32_t source; /* 0 - start, 1 - response */ 285 uint32_t reason; 286}; 287 288#define UNIAPI_DEF_RESET_ERRORS(MACRO) \ 289 MACRO(UNIAPI_RESET_ERROR_NO_CONFIRM, 0, \ 290 "no confirmation") \ 291 MACRO(UNIAPI_RESET_ERROR_NO_RESPONSE, 1, \ 292 "no response") \ 293 MACRO(UNIAPI_RESET_ERROR_PEER_INCOMP_STATE, 2, \ 294 "incompatible state") 295enum { 296#define DEF(NAME, VALUE, STR) NAME = VALUE, 297UNIAPI_DEF_RESET_ERRORS(DEF) 298#undef DEF 299}; 300 301struct uniapi_reset_response { 302 struct uni_ie_restart restart; 303 struct uni_ie_connid connid; 304}; 305 306struct uniapi_reset_error_response { 307 struct uni_ie_cause cause; 308}; 309 310struct uniapi_reset_status_indication { 311 struct uni_cref cref; /* STATUS message CREF */ 312 struct uni_ie_callstate callstate; 313 struct uni_ie_cause cause; 314}; 315 316struct uniapi_setup_request { 317 struct uni_setup setup; 318}; 319struct uniapi_setup_indication { 320 struct uni_setup setup; 321}; 322struct uniapi_setup_response { 323 struct uni_connect connect; 324}; 325struct uniapi_setup_confirm { 326 struct uni_connect connect; 327}; 328struct uniapi_setup_complete_indication { 329 struct uni_connect_ack connect_ack; 330}; 331struct uniapi_setup_complete_request { 332 struct uni_connect_ack connect_ack; 333}; 334 335struct uniapi_alerting_request { 336 struct uni_alerting alerting; 337}; 338 339struct uniapi_alerting_indication { 340 struct uni_alerting alerting; 341}; 342 343struct uniapi_proceeding_request { 344 struct uni_call_proc call_proc; 345}; 346 347struct uniapi_proceeding_indication { 348 struct uni_call_proc call_proc; 349}; 350 351 352struct uniapi_release_request { 353 struct uni_release release; 354}; 355struct uniapi_release_indication { 356 struct uni_release release; 357}; 358struct uniapi_release_response { 359 struct uni_release_compl release_compl; 360}; 361/* 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. 365 */ 366struct uniapi_release_confirm { 367 struct uni_release release; 368}; 369 370struct uniapi_notify_request { 371 struct uni_notify notify; 372}; 373struct uniapi_notify_indication { 374 struct uni_notify notify; 375}; 376 377struct 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; 385}; 386struct uniapi_status_enquiry_request { 387 struct uni_cref cref; 388 struct uni_ie_epref epref; 389}; 390 391struct uniapi_add_party_request { 392 struct uni_add_party add; 393}; 394struct uniapi_add_party_indication { 395 struct uni_add_party add; 396}; 397 398struct uniapi_party_alerting_request { 399 struct uni_party_alerting alert; 400}; 401struct uniapi_party_alerting_indication { 402 struct uni_party_alerting alert; 403}; 404 405struct uniapi_add_party_ack_request { 406 struct uni_add_party_ack ack; 407}; 408struct uniapi_add_party_ack_indication { 409 struct uni_add_party_ack ack; 410}; 411struct uniapi_add_party_rej_request { 412 struct uni_add_party_rej rej; 413}; 414struct uniapi_add_party_rej_indication { 415 struct uni_add_party_rej rej; 416}; 417 418struct uniapi_drop_party_request { 419 struct uni_drop_party drop; 420}; 421struct uniapi_drop_party_indication { 422 struct uni_drop_party drop; 423 struct uni_ie_cause my_cause; 424}; 425 426struct uniapi_drop_party_ack_request { 427 struct uni_drop_party_ack ack; 428}; 429struct uniapi_drop_party_ack_indication { 430 struct uni_drop_party drop; 431 struct uni_ie_crankback crankback; 432}; 433 434union uniapi_all { 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; 478}; 479 480#endif 481