1 /*
2  * libpri: An implementation of Primary Rate ISDN
3  *
4  * Copyright (C) 2009 Digium, Inc.
5  *
6  * Richard Mudgett <rmudgett@digium.com>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2 as published by the
16  * Free Software Foundation. See the LICENSE file included with
17  * this program for more details.
18  *
19  * In addition, when this program is distributed with Asterisk in
20  * any form that would qualify as a 'combined work' or as a
21  * 'derivative work' (but not mere aggregation), you can redistribute
22  * and/or modify the combination under the terms of the license
23  * provided with that copy of Asterisk, instead of the license
24  * terms granted here.
25  */
26 
27 /*!
28  * \file
29  * \brief ROSE definitions and prototypes
30  *
31  * \details
32  * This file contains all of the data structures and definitions needed
33  * for ROSE component encoding and decoding.
34  *
35  * ROSE - Remote Operations Service Element
36  * ASN.1 - Abstract Syntax Notation 1
37  * APDU - Application Protocol Data Unit
38  *
39  * \author Richard Mudgett <rmudgett@digium.com>
40  */
41 
42 #ifndef _LIBPRI_ROSE_H
43 #define _LIBPRI_ROSE_H
44 
45 #include <string.h>
46 #include <sys/types.h>
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /* ------------------------------------------------------------------- */
53 
54 
55 /* Northern Telecom DMS-100 RLT related operations */
56 #define ROSE_DMS100_RLT_SERVICE_ID		0x3e
57 #define ROSE_DMS100_RLT_OPERATION_IND	0x01
58 #define ROSE_DMS100_RLT_THIRD_PARTY		0x02
59 
60 /*! \brief ROSE operation-value function code */
61 enum rose_operation {
62 	/*! \brief No ROSE operation */
63 	ROSE_None,
64 	/*! \brief Unknown OID/localValue operation-value code */
65 	ROSE_Unknown,
66 
67 /* *INDENT-OFF* */
68 	/* ETSI Diversion-Operations */
69 	ROSE_ETSI_ActivationDiversion,          /*!< Invoke/Result */
70 	ROSE_ETSI_DeactivationDiversion,        /*!< Invoke/Result */
71 	ROSE_ETSI_ActivationStatusNotificationDiv,/*!< Invoke only */
72 	ROSE_ETSI_DeactivationStatusNotificationDiv,/*!< Invoke only */
73 	ROSE_ETSI_InterrogationDiversion,       /*!< Invoke/Result */
74 	ROSE_ETSI_DiversionInformation,         /*!< Invoke only */
75 	ROSE_ETSI_CallDeflection,               /*!< Invoke/Result */
76 	ROSE_ETSI_CallRerouting,                /*!< Invoke/Result */
77 	ROSE_ETSI_InterrogateServedUserNumbers, /*!< Invoke/Result */
78 	ROSE_ETSI_DivertingLegInformation1,     /*!< Invoke only */
79 	ROSE_ETSI_DivertingLegInformation2,     /*!< Invoke only */
80 	ROSE_ETSI_DivertingLegInformation3,     /*!< Invoke only */
81 
82 	/*
83 	 * ETSI Advice-of-Charge-Operations
84 	 *
85 	 * Advice-Of-Charge-at-call-Setup(AOCS)
86 	 * Advice-Of-Charge-During-the-call(AOCD)
87 	 * Advice-Of-Charge-at-the-End-of-the-call(AOCE)
88 	 */
89 	ROSE_ETSI_ChargingRequest,              /*!< Invoke/Result */
90 	ROSE_ETSI_AOCSCurrency,                 /*!< Invoke only */
91 	ROSE_ETSI_AOCSSpecialArr,               /*!< Invoke only */
92 	ROSE_ETSI_AOCDCurrency,                 /*!< Invoke only */
93 	ROSE_ETSI_AOCDChargingUnit,             /*!< Invoke only */
94 	ROSE_ETSI_AOCECurrency,                 /*!< Invoke only */
95 	ROSE_ETSI_AOCEChargingUnit,             /*!< Invoke only */
96 
97 	/* ETSI Explicit-Call-Transfer-Operations-and-Errors */
98 	ROSE_ETSI_EctExecute,                   /*!< Invoke/Result */
99 	ROSE_ETSI_ExplicitEctExecute,           /*!< Invoke/Result */
100 	ROSE_ETSI_RequestSubaddress,            /*!< Invoke only */
101 	ROSE_ETSI_SubaddressTransfer,           /*!< Invoke only */
102 	ROSE_ETSI_EctLinkIdRequest,             /*!< Invoke/Result */
103 	ROSE_ETSI_EctInform,                    /*!< Invoke only */
104 	ROSE_ETSI_EctLoopTest,                  /*!< Invoke/Result */
105 
106 	/* ETSI Status-Request-Procedure */
107 	ROSE_ETSI_StatusRequest,                /*!< Invoke/Result */
108 
109 	/* ETSI CCBS-Operations-and-Errors */
110 	ROSE_ETSI_CallInfoRetain,               /*!< Invoke only */
111 	ROSE_ETSI_CCBSRequest,                  /*!< Invoke/Result */
112 	ROSE_ETSI_CCBSDeactivate,               /*!< Invoke/Result */
113 	ROSE_ETSI_CCBSInterrogate,              /*!< Invoke/Result */
114 	ROSE_ETSI_CCBSErase,                    /*!< Invoke only */
115 	ROSE_ETSI_CCBSRemoteUserFree,           /*!< Invoke only */
116 	ROSE_ETSI_CCBSCall,                     /*!< Invoke only */
117 	ROSE_ETSI_CCBSStatusRequest,            /*!< Invoke/Result */
118 	ROSE_ETSI_CCBSBFree,                    /*!< Invoke only */
119 	ROSE_ETSI_EraseCallLinkageID,           /*!< Invoke only */
120 	ROSE_ETSI_CCBSStopAlerting,             /*!< Invoke only */
121 
122 	/* ETSI CCBS-private-networks-Operations-and-Errors */
123 	ROSE_ETSI_CCBS_T_Request,               /*!< Invoke/Result */
124 	ROSE_ETSI_CCBS_T_Call,                  /*!< Invoke only */
125 	ROSE_ETSI_CCBS_T_Suspend,               /*!< Invoke only */
126 	ROSE_ETSI_CCBS_T_Resume,                /*!< Invoke only */
127 	ROSE_ETSI_CCBS_T_RemoteUserFree,        /*!< Invoke only */
128 	ROSE_ETSI_CCBS_T_Available,             /*!< Invoke only */
129 
130 	/* ETSI CCNR-Operations-and-Errors */
131 	ROSE_ETSI_CCNRRequest,                  /*!< Invoke/Result */
132 	ROSE_ETSI_CCNRInterrogate,              /*!< Invoke/Result */
133 
134 	/* ETSI CCNR-private-networks-Operations-and-Errors */
135 	ROSE_ETSI_CCNR_T_Request,               /*!< Invoke/Result */
136 
137 	/* ETSI MCID-Operations */
138 	ROSE_ETSI_MCIDRequest,                  /*!< Invoke/Result */
139 
140 	/* ETSI MWI-Operations-and-Errors */
141 	ROSE_ETSI_MWIActivate,                  /*!< Invoke/Result */
142 	ROSE_ETSI_MWIDeactivate,                /*!< Invoke/Result */
143 	ROSE_ETSI_MWIIndicate,                  /*!< Invoke only */
144 
145 	/* Q.SIG Name-Operations */
146 	ROSE_QSIG_CallingName,                  /*!< Invoke only */
147 	ROSE_QSIG_CalledName,                   /*!< Invoke only */
148 	ROSE_QSIG_ConnectedName,                /*!< Invoke only */
149 	ROSE_QSIG_BusyName,                     /*!< Invoke only */
150 
151 	/* Q.SIG SS-AOC-Operations */
152 	ROSE_QSIG_ChargeRequest,                /*!< Invoke/Result */
153 	ROSE_QSIG_GetFinalCharge,               /*!< Invoke only */
154 	ROSE_QSIG_AocFinal,                     /*!< Invoke only */
155 	ROSE_QSIG_AocInterim,                   /*!< Invoke only */
156 	ROSE_QSIG_AocRate,                      /*!< Invoke only */
157 	ROSE_QSIG_AocComplete,                  /*!< Invoke/Result */
158 	ROSE_QSIG_AocDivChargeReq,              /*!< Invoke only */
159 
160 	/* Q.SIG Call-Transfer-Operations (CT) */
161 	ROSE_QSIG_CallTransferIdentify,         /*!< Invoke/Result */
162 	ROSE_QSIG_CallTransferAbandon,          /*!< Invoke only */
163 	ROSE_QSIG_CallTransferInitiate,         /*!< Invoke/Result */
164 	ROSE_QSIG_CallTransferSetup,            /*!< Invoke/Result */
165 	ROSE_QSIG_CallTransferActive,           /*!< Invoke only */
166 	ROSE_QSIG_CallTransferComplete,         /*!< Invoke only */
167 	ROSE_QSIG_CallTransferUpdate,           /*!< Invoke only */
168 	ROSE_QSIG_SubaddressTransfer,           /*!< Invoke only */
169 
170 	ROSE_QSIG_PathReplacement,              /*!< Invoke only */
171 
172 	/* Q.SIG Call-Diversion-Operations */
173 	ROSE_QSIG_ActivateDiversionQ,           /*!< Invoke/Result */
174 	ROSE_QSIG_DeactivateDiversionQ,         /*!< Invoke/Result */
175 	ROSE_QSIG_InterrogateDiversionQ,        /*!< Invoke/Result */
176 	ROSE_QSIG_CheckRestriction,             /*!< Invoke/Result */
177 	ROSE_QSIG_CallRerouting,                /*!< Invoke/Result */
178 	ROSE_QSIG_DivertingLegInformation1,     /*!< Invoke only */
179 	ROSE_QSIG_DivertingLegInformation2,     /*!< Invoke only */
180 	ROSE_QSIG_DivertingLegInformation3,     /*!< Invoke only */
181 	ROSE_QSIG_CfnrDivertedLegFailed,        /*!< Invoke only */
182 
183 	/* Q.SIG SS-CC-Operations */
184 	ROSE_QSIG_CcbsRequest,                  /*!< Invoke/Result */
185 	ROSE_QSIG_CcnrRequest,                  /*!< Invoke/Result */
186 	ROSE_QSIG_CcCancel,                     /*!< Invoke only */
187 	ROSE_QSIG_CcExecPossible,               /*!< Invoke only */
188 	ROSE_QSIG_CcPathReserve,                /*!< Invoke/Result */
189 	ROSE_QSIG_CcRingout,                    /*!< Invoke only */
190 	ROSE_QSIG_CcSuspend,                    /*!< Invoke only */
191 	ROSE_QSIG_CcResume,                     /*!< Invoke only */
192 
193 	/* Q.SIG SS-MWI-Operations */
194 	ROSE_QSIG_MWIActivate,                  /*!< Invoke/Result */
195 	ROSE_QSIG_MWIDeactivate,                /*!< Invoke/Result */
196 	ROSE_QSIG_MWIInterrogate,               /*!< Invoke/Result */
197 
198 	/* Northern Telecom DMS-100 RLT related operations */
199 	/*! Invoke/Result: Must set invokeId to ROSE_DMS100_RLT_OPERATION_IND */
200 	ROSE_DMS100_RLT_OperationInd,
201 	/*! Invoke/Result: Must set invokeId to ROSE_DMS100_RLT_THIRD_PARTY */
202 	ROSE_DMS100_RLT_ThirdParty,
203 
204 	ROSE_NI2_InformationFollowing,          /*!< Invoke only? */
205 	ROSE_NI2_InitiateTransfer,              /*!< Invoke only? Is this correct operation name? */
206 
207 	ROSE_Num_Operation_Codes                /*!< Must be last in the enumeration */
208 /* *INDENT-ON* */
209 };
210 
211 enum rose_error_code {
212 	/*! \brief No error occurred */
213 	ROSE_ERROR_None,
214 	/*! \brief Unknown OID/localValue error-value code */
215 	ROSE_ERROR_Unknown,
216 
217 	/* General-Errors (ETS 300 196) and General-Error-List(Q.950) */
218 	ROSE_ERROR_Gen_NotSubscribed,	/*!< also: UserNotSubscribed */
219 	ROSE_ERROR_Gen_NotAvailable,
220 	ROSE_ERROR_Gen_NotImplemented,	/*!< Not in Q.950 */
221 	ROSE_ERROR_Gen_InvalidServedUserNr,
222 	ROSE_ERROR_Gen_InvalidCallState,
223 	ROSE_ERROR_Gen_BasicServiceNotProvided,
224 	ROSE_ERROR_Gen_NotIncomingCall,
225 	ROSE_ERROR_Gen_SupplementaryServiceInteractionNotAllowed,
226 	ROSE_ERROR_Gen_ResourceUnavailable,
227 
228 	/* Additional General-Error-List(Q.950) */
229 	ROSE_ERROR_Gen_RejectedByNetwork,
230 	ROSE_ERROR_Gen_RejectedByUser,
231 	ROSE_ERROR_Gen_InsufficientInformation,
232 	ROSE_ERROR_Gen_CallFailure,
233 	ROSE_ERROR_Gen_ProceduralError,
234 
235 	/* ETSI Diversion-Operations */
236 	ROSE_ERROR_Div_InvalidDivertedToNr,
237 	ROSE_ERROR_Div_SpecialServiceNr,
238 	ROSE_ERROR_Div_DiversionToServedUserNr,
239 	ROSE_ERROR_Div_IncomingCallAccepted,
240 	ROSE_ERROR_Div_NumberOfDiversionsExceeded,
241 	ROSE_ERROR_Div_NotActivated,
242 	ROSE_ERROR_Div_RequestAlreadyAccepted,
243 
244 	/* ETSI Advice-of-Charge-Operations */
245 	ROSE_ERROR_AOC_NoChargingInfoAvailable,
246 
247 	/* ETSI Explicit-Call-Transfer-Operations-and-Errors */
248 	ROSE_ERROR_ECT_LinkIdNotAssignedByNetwork,
249 
250 	/* ETSI CCBS-Operations-and-Errors */
251 	ROSE_ERROR_CCBS_InvalidCallLinkageID,
252 	ROSE_ERROR_CCBS_InvalidCCBSReference,
253 	ROSE_ERROR_CCBS_LongTermDenial,
254 	ROSE_ERROR_CCBS_ShortTermDenial,
255 	ROSE_ERROR_CCBS_IsAlreadyActivated,
256 	ROSE_ERROR_CCBS_AlreadyAccepted,
257 	ROSE_ERROR_CCBS_OutgoingCCBSQueueFull,
258 	ROSE_ERROR_CCBS_CallFailureReasonNotBusy,
259 	ROSE_ERROR_CCBS_NotReadyForCall,
260 
261 	/* ETSI CCBS-private-networks-Operations-and-Errors */
262 	ROSE_ERROR_CCBS_T_LongTermDenial,
263 	ROSE_ERROR_CCBS_T_ShortTermDenial,
264 
265 	/* ETSI MWI-Operations-and-Errors */
266 	ROSE_ERROR_MWI_InvalidReceivingUserNr,
267 	ROSE_ERROR_MWI_ReceivingUserNotSubscribed,
268 	ROSE_ERROR_MWI_ControllingUserNotRegistered,
269 	ROSE_ERROR_MWI_IndicationNotDelivered,
270 	ROSE_ERROR_MWI_MaxNumOfControllingUsersReached,
271 	ROSE_ERROR_MWI_MaxNumOfActiveInstancesReached,
272 
273 	/* Q.SIG from various specifications */
274 	ROSE_ERROR_QSIG_Unspecified,
275 
276 	/* Q.SIG SS-AOC-Operations */
277 	ROSE_ERROR_QSIG_AOC_FreeOfCharge,
278 
279 	/* Q.SIG Call-Transfer-Operations (CT) */
280 	ROSE_ERROR_QSIG_CT_InvalidReroutingNumber,
281 	ROSE_ERROR_QSIG_CT_UnrecognizedCallIdentity,
282 	ROSE_ERROR_QSIG_CT_EstablishmentFailure,
283 
284 	/* Q.SIG Call-Diversion-Operations (Additional Q.SIG specific errors) */
285 	ROSE_ERROR_QSIG_Div_TemporarilyUnavailable,
286 	ROSE_ERROR_QSIG_Div_NotAuthorized,
287 
288 	/* Q.SIG SS-CC-Operations */
289 	ROSE_ERROR_QSIG_ShortTermRejection,
290 	ROSE_ERROR_QSIG_LongTermRejection,
291 	ROSE_ERROR_QSIG_RemoteUserBusyAgain,
292 	ROSE_ERROR_QSIG_FailureToMatch,
293 	ROSE_ERROR_QSIG_FailedDueToInterworking,
294 
295 	/* Q.SIG SS-MWI-Operations */
296 	ROSE_ERROR_QSIG_InvalidMsgCentreId,
297 
298 	/* Northern Telecom DMS-100 RLT related operations */
299 	ROSE_ERROR_DMS100_RLT_BridgeFail,
300 	ROSE_ERROR_DMS100_RLT_CallIDNotFound,
301 	ROSE_ERROR_DMS100_RLT_NotAllowed,
302 	ROSE_ERROR_DMS100_RLT_SwitchEquipCongs,
303 
304 	ROSE_ERROR_Num_Codes		/*!< Must be last in the enumeration */
305 };
306 
307 #define ROSE_REJECT_BASE(base)		((base) * 0x100)
308 enum rose_reject_base {
309 	ROSE_REJECT_BASE_General,
310 	ROSE_REJECT_BASE_Invoke,
311 	ROSE_REJECT_BASE_Result,
312 	ROSE_REJECT_BASE_Error,
313 
314 	/*! \brief Must be last in the list */
315 	ROSE_REJECT_BASE_Last
316 };
317 
318 /*!
319  * \brief From Facility-Information-Element-Components
320  * {itu-t identified-organization etsi(0) 196 facility-information-element-component(3)}
321  */
322 enum rose_reject_code {
323 	/*! \brief Not rejected */
324 	ROSE_REJECT_None = -1,
325 	/*! \brief Unknown reject code */
326 	ROSE_REJECT_Unknown = -2,
327 
328 /* *INDENT-OFF* */
329 	ROSE_REJECT_Gen_UnrecognizedComponent       = ROSE_REJECT_BASE(ROSE_REJECT_BASE_General) + 0,
330 	ROSE_REJECT_Gen_MistypedComponent           = ROSE_REJECT_BASE(ROSE_REJECT_BASE_General) + 1,
331 	ROSE_REJECT_Gen_BadlyStructuredComponent    = ROSE_REJECT_BASE(ROSE_REJECT_BASE_General) + 2,
332 
333 	ROSE_REJECT_Inv_DuplicateInvocation         = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 0,
334 	ROSE_REJECT_Inv_UnrecognizedOperation       = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 1,
335 	ROSE_REJECT_Inv_MistypedArgument            = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 2,
336 	ROSE_REJECT_Inv_ResourceLimitation          = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 3,
337 	ROSE_REJECT_Inv_InitiatorReleasing          = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 4,
338 	ROSE_REJECT_Inv_UnrecognizedLinkedID        = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 5,
339 	ROSE_REJECT_Inv_LinkedResponseUnexpected    = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 6,
340 	ROSE_REJECT_Inv_UnexpectedChildOperation    = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 7,
341 
342 	ROSE_REJECT_Res_UnrecognizedInvocation      = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Result) + 0,
343 	ROSE_REJECT_Res_ResultResponseUnexpected    = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Result) + 1,
344 	ROSE_REJECT_Res_MistypedResult              = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Result) + 2,
345 
346 	ROSE_REJECT_Err_UnrecognizedInvocation      = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 0,
347 	ROSE_REJECT_Err_ErrorResponseUnexpected     = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 1,
348 	ROSE_REJECT_Err_UnrecognizedError           = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 2,
349 	ROSE_REJECT_Err_UnexpectedError             = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 3,
350 	ROSE_REJECT_Err_MistypedParameter           = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 4,
351 /* *INDENT-ON* */
352 };
353 
354 
355 /* ------------------------------------------------------------------- */
356 
357 
358 /*
359  * Q931InformationElement ::= [APPLICATION 0] IMPLICIT OCTET STRING
360  */
361 struct roseQ931ie {
362 	/*!
363 	 * \brief The Q.931 ie is present if length is nonzero.
364 	 * (If this field is optional in the message.)
365 	 */
366 	u_int8_t length;
367 
368 	/*!
369 	 * \brief We mostly just need to store the contents so we will defer
370 	 * decoding/encoding.
371 	 *
372 	 * \note To reduce the size of the structure, the memory for the
373 	 * ie contents is "allocated" after the structure.
374 	 * \note Remember the "allocated" memory needs to have room for a
375 	 * null terminator.
376 	 */
377 	unsigned char contents[0];
378 };
379 
380 enum {
381 	/*! Bearer Capability has a max length of 12. */
382 	ROSE_Q931_MAX_BC = 12,
383 	/*! High Layer Compatibility has a max length of 5. */
384 	ROSE_Q931_MAX_HLC = 5,
385 	/*! Low Layer Compatibility has a max length of 18. */
386 	ROSE_Q931_MAX_LLC = 18,
387 	/*!
388 	 * User-User Information has a network dependent maximum.
389 	 * The network dependent maximum is either 35 or 131 octets
390 	 * in non-USER-INFORMATION messages.
391 	 */
392 	ROSE_Q931_MAX_USER = 131,
393 	/*!
394 	 * Progress Indicator has a max length of 4.
395 	 * There can be multiple progress indicator ies.
396 	 * Q.SIG allows up to 3.
397 	 * ITU-T allows up to 2.
398 	 */
399 	ROSE_Q931_MAX_PROGRESS = 3 * 4,
400 };
401 
402 
403 /* ------------------------------------------------------------------- */
404 
405 
406 /*
407  * Comment obtained from ECMA-242 ASN.1 source.
408  * a VisibleString containing:
409  *   - the (local) date in 8 digits (YYYYMMDD),
410  *   - followed by (local) time of day in 4 or 6 digits (HHMM[SS]),
411  *   - optionally followed by the letter "Z" or
412  *     by a local time differential in 5 digits ("+"HHMM or "-"HHMM);
413  *     this date and time representation follows ISO 8601
414  * Examples:
415  * 1) 19970621194530, meaning 21 June 1997, 19:45:30;
416  * 2) 19970621194530Z, meaning the same as 1);
417  * 3) 19970621194530-0500, meaning the same as 1),
418  *      5 hours retarded in relation to UTC time
419  *
420  * GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString
421  */
422 struct roseGeneralizedTime {
423 	/*! GeneralizedTime (SIZE (12..19)) */
424 	unsigned char str[19 + 1];
425 };
426 
427 
428 /* ------------------------------------------------------------------- */
429 
430 
431 /*
432  * PartyNumber ::= CHOICE {
433  *     -- the numbering plan is the default numbering plan of
434  *     -- the network. It is recommended that this value is
435  *     -- used.
436  *     unknownPartyNumber          [0] IMPLICIT NumberDigits,
437  *
438  *     -- the numbering plan is according to
439  *     -- ITU-T Recommendation E.164.
440  *     publicPartyNumber           [1] IMPLICIT PublicPartyNumber,
441  *
442  *     -- ATM endsystem address encoded as an NSAP address.
443  *     nsapEncodedNumber           [2] IMPLICIT NsapEncodedNumber,
444  *
445  *     -- not used, value reserved.
446  *     dataPartyNumber             [3] IMPLICIT NumberDigits,
447  *
448  *     -- not used, value reserved.
449  *     telexPartyNumber            [4] IMPLICIT NumberDigits,
450  *     privatePartyNumber          [5] IMPLICIT PrivatePartyNumber,
451  *
452  *     -- not used, value reserved.
453  *     nationalStandardPartyNumber [8] IMPLICIT NumberDigits
454  * }
455  */
456 struct rosePartyNumber {
457 	/*!
458 	 * \brief Party numbering plan
459 	 * \details
460 	 * unknown(0),
461 	 * public(1) - The numbering plan is according to ITU-T E.164,
462 	 * nsapEncoded(2),
463 	 * data(3) - Reserved,
464 	 * telex(4) - Reserved,
465 	 * private(5),
466 	 * nationalStandard(8) - Reserved
467 	 */
468 	u_int8_t plan;
469 
470 	/*!
471 	 * \brief Type-Of-Number valid for public and private party number plans
472 	 * \details
473 	 * public:
474 	 *  unknown(0),
475 	 *  internationalNumber(1),
476 	 *  nationalNumber(2),
477 	 *  networkSpecificNumber(3) - Reserved,
478 	 *  subscriberNumber(4) - Reserved,
479 	 *  abbreviatedNumber(6)
480 	 * \details
481 	 * private:
482 	 *  unknown(0),
483 	 *  level2RegionalNumber(1),
484 	 *  level1RegionalNumber(2),
485 	 *  pTNSpecificNumber/pISNSpecificNumber(3),
486 	 *  localNumber(4),
487 	 *  abbreviatedNumber(6)
488 	 */
489 	u_int8_t ton;
490 
491 	/*! \brief Number present if length is nonzero. */
492 	u_int8_t length;
493 
494 	/*! \brief Number string data. */
495 	unsigned char str[20 + 1];
496 };
497 
498 /*
499  * NumberScreened ::= SEQUENCE {
500  *     partyNumber           PartyNumber,
501  *     screeningIndicator    ScreeningIndicator
502  * }
503  */
504 struct roseNumberScreened {
505 	struct rosePartyNumber number;
506 
507 	/*!
508 	 * \details
509 	 * userProvidedNotScreened(0),
510 	 * userProvidedVerifiedAndPassed(1),
511 	 * userProvidedVerifiedAndFailed(2) (Not used, value reserved),
512 	 * networkProvided(3)
513 	 */
514 	u_int8_t screening_indicator;
515 };
516 
517 /*
518  * PartySubaddress ::= CHOICE {
519  *     -- not recommended
520  *     UserSpecifiedSubaddress,
521  *
522  *     -- according to ITU-T Recommendation X.213
523  *     NSAPSubaddress
524  * }
525  *
526  * UserSpecifiedSubaddress ::= SEQUENCE {
527  *     SubaddressInformation,
528  *
529  *     -- used when the coding of subaddress is BCD
530  *     oddCountIndicator BOOLEAN OPTIONAL
531  * }
532  *
533  * -- specified according to ITU-T Recommendation X.213. Some
534  * -- networks may limit the subaddress value to some other
535  * -- length, e.g. 4 octets
536  * NSAPSubaddress ::= OCTET STRING (SIZE(1..20))
537  *
538  * -- coded according to user requirements. Some networks may
539  * -- limit the subaddress value to some other length,
540  * -- e.g. 4 octets
541  * SubaddressInformation ::= OCTET STRING (SIZE(1..20))
542  */
543 struct rosePartySubaddress {
544 	/*! \brief Subaddress type UserSpecified(0), NSAP(1) */
545 	u_int8_t type;
546 
547 	/*! \brief Subaddress present if length is nonzero */
548 	u_int8_t length;
549 
550 	union {
551 		/*! \brief Specified according to ITU-T Recommendation X.213 */
552 		unsigned char nsap[20 + 1];
553 
554 		/*! \brief Use of this formatting is not recommended */
555 		struct {
556 			/*! \brief TRUE if OddCount present */
557 			u_int8_t odd_count_present;
558 
559 			/*!
560 			 * \brief TRUE if odd number of BCD digits (optional)
561 			 * \note Used when the coding of subaddress is BCD.
562 			 */
563 			u_int8_t odd_count;
564 			unsigned char information[20 + 1];
565 		} user_specified;
566 	} u;
567 };
568 
569 /*
570  * Address ::= SEQUENCE {
571  *     PartyNumber,
572  *     PartySubaddress OPTIONAL
573  * }
574  */
575 struct roseAddress {
576 	struct rosePartyNumber number;
577 
578 	/*! \brief Subaddress (Optional) */
579 	struct rosePartySubaddress subaddress;
580 };
581 
582 /*
583  * AddressScreened ::= SEQUENCE {
584  *     PartyNumber,
585  *     ScreeningIndicator,
586  *     PartySubaddress OPTIONAL
587  * }
588  */
589 struct roseAddressScreened {
590 	struct rosePartyNumber number;
591 
592 	/*! \brief Subaddress (Optional) */
593 	struct rosePartySubaddress subaddress;
594 
595 	/*!
596 	 * \details
597 	 * userProvidedNotScreened(0),
598 	 * userProvidedVerifiedAndPassed(1),
599 	 * userProvidedVerifiedAndFailed(2) (Not used, value reserved),
600 	 * networkProvided(3)
601 	 */
602 	u_int8_t screening_indicator;
603 };
604 
605 /*
606  * PresentedNumberUnscreened ::= CHOICE {
607  *     presentationAllowedNumber           [0] EXPLICIT PartyNumber,
608  *     presentationRestricted              [1] IMPLICIT NULL,
609  *     numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
610  *     presentationRestrictedNumber        [3] EXPLICIT PartyNumber
611  * }
612  */
613 struct rosePresentedNumberUnscreened {
614 	struct rosePartyNumber number;
615 	/*!
616 	 * \brief Number presentation type
617 	 * \details
618 	 * presentationAllowedNumber(0),
619 	 * presentationRestricted(1),
620 	 * numberNotAvailableDueToInterworking(2),
621 	 * presentationRestrictedNumber(3)
622 	 */
623 	u_int8_t presentation;
624 };
625 
626 /*
627  * PresentedNumberScreened ::= CHOICE {
628  *     presentationAllowedNumber           [0] IMPLICIT NumberScreened,
629  *     presentationRestricted              [1] IMPLICIT NULL,
630  *     numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
631  *     presentationRestrictedNumber        [3] IMPLICIT NumberScreened
632  * }
633  */
634 struct rosePresentedNumberScreened {
635 	/*! \brief Screened number */
636 	struct roseNumberScreened screened;
637 	/*!
638 	 * \brief Number presentation type
639 	 * \details
640 	 * presentationAllowedNumber(0),
641 	 * presentationRestricted(1),
642 	 * numberNotAvailableDueToInterworking(2),
643 	 * presentationRestrictedNumber(3)
644 	 */
645 	u_int8_t presentation;
646 };
647 
648 /*
649  * PresentedAddressScreened ::= CHOICE {
650  *     presentationAllowedAddress          [0] IMPLICIT AddressScreened,
651  *     presentationRestricted              [1] IMPLICIT NULL,
652  *     numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
653  *     presentationRestrictedAddress       [3] IMPLICIT AddressScreened
654  * }
655  */
656 struct rosePresentedAddressScreened {
657 	/*! \breif Screened address */
658 	struct roseAddressScreened screened;
659 	/*!
660 	 * \brief Address presentation type
661 	 * \details
662 	 * presentationAllowedAddress(0),
663 	 * presentationRestricted(1),
664 	 * numberNotAvailableDueToInterworking(2),
665 	 * presentationRestrictedAddress(3)
666 	 */
667 	u_int8_t presentation;
668 };
669 
670 
671 /* ------------------------------------------------------------------- */
672 
673 
674 /*
675  * Time ::= SEQUENCE {
676  *     lengthOfTimeUnit [1] IMPLICIT LengthOfTimeUnit,
677  *     scale            [2] IMPLICIT Scale
678  * }
679  */
680 struct roseEtsiAOCTime {
681 	/*! LengthOfTimeUnit ::= INTEGER (0..16777215) -- 24 bit number */
682 	u_int32_t length;
683 	/*!
684 	 * \details
685 	 * oneHundredthSecond(0),
686 	 * oneTenthSecond(1),
687 	 * oneSecond(2),
688 	 * tenSeconds(3),
689 	 * oneMinute(4),
690 	 * oneHour(5),
691 	 * twentyFourHours(6)
692 	 */
693 	u_int8_t scale;
694 };
695 
696 /*
697  * Amount ::= SEQUENCE {
698  *     currencyAmount [1] IMPLICIT CurrencyAmount,
699  *     multiplier     [2] IMPLICIT Multiplier
700  * }
701  */
702 struct roseEtsiAOCAmount {
703 	/*! CurrencyAmount ::= INTEGER (0..16777215) -- 24 bit number */
704 	u_int32_t currency;
705 	/*!
706 	 * \details
707 	 * oneThousandth(0),
708 	 * oneHundredth(1),
709 	 * oneTenth(2),
710 	 * one(3),
711 	 * ten(4),
712 	 * hundred(5),
713 	 * thousand(6)
714 	 */
715 	u_int8_t multiplier;
716 };
717 
718 /*
719  * DurationCurrency ::= SEQUENCE {
720  *     dCurrency       [1] IMPLICIT Currency,
721  *     dAmount         [2] IMPLICIT Amount,
722  *     dChargingType   [3] IMPLICIT ChargingType,
723  *     dTime           [4] IMPLICIT Time,
724  *     dGranularity    [5] IMPLICIT Time OPTIONAL
725  * }
726  */
727 struct roseEtsiAOCDurationCurrency {
728 	struct roseEtsiAOCAmount amount;
729 	struct roseEtsiAOCTime time;
730 	/*! \breif dGranularity (optional) */
731 	struct roseEtsiAOCTime granularity;
732 	/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
733 	unsigned char currency[10 + 1];
734 	/*!
735 	 * \details
736 	 * continuousCharging(0),
737 	 * stepFunction(1)
738 	 */
739 	u_int8_t charging_type;
740 	/*! TRUE if granularity time is present */
741 	u_int8_t granularity_present;
742 };
743 
744 /*
745  * FlatRateCurrency ::= SEQUENCE {
746  *     fRCurrency      [1] IMPLICIT Currency,
747  *     fRAmount        [2] IMPLICIT Amount
748  * }
749  */
750 struct roseEtsiAOCFlatRateCurrency {
751 	struct roseEtsiAOCAmount amount;
752 	/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
753 	unsigned char currency[10 + 1];
754 };
755 
756 /*
757  * VolumeRateCurrency ::= SEQUENCE {
758  *     vRCurrency      [1] IMPLICIT Currency,
759  *     vRAmount        [2] IMPLICIT Amount,
760  *     vRVolumeUnit    [3] IMPLICIT VolumeUnit
761  * }
762  */
763 struct roseEtsiAOCVolumeRateCurrency {
764 	struct roseEtsiAOCAmount amount;
765 	/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
766 	unsigned char currency[10 + 1];
767 	/*!
768 	 * \brief Volume rate volume unit
769 	 * \details
770 	 * octet(0),
771 	 * segment(1),
772 	 * message(2)
773 	 */
774 	u_int8_t unit;
775 };
776 
777 /*
778  * AOCSCurrencyInfo ::= SEQUENCE {
779  *     chargedItem ChargedItem,
780  *     CHOICE {
781  *         specialChargingCode      SpecialChargingCode,
782  *         durationCurrency         [1] IMPLICIT DurationCurrency,
783  *         flatRateCurrency         [2] IMPLICIT FlatRateCurrency,
784  *         volumeRateCurrency       [3] IMPLICIT VolumeRateCurrency
785  *         freeOfCharge             [4] IMPLICIT NULL,
786  *         currencyInfoNotAvailable [5] IMPLICIT NULL
787  *     }
788  * }
789  */
790 struct roseEtsiAOCSCurrencyInfo {
791 	union {
792 		struct roseEtsiAOCDurationCurrency duration;
793 		struct roseEtsiAOCFlatRateCurrency flat_rate;
794 		struct roseEtsiAOCVolumeRateCurrency volume_rate;
795 		/*! SpecialChargingCode ::= INTEGER (1..10) */
796 		u_int8_t special_charging_code;
797 	} u;
798 	/*!
799 	 * \brief Determine what is stored in the union.
800 	 * \details
801 	 * specialChargingCode(0),
802 	 * durationCurrency(1),
803 	 * flatRateCurrency(2),
804 	 * volumeRateCurrency(3),
805 	 * freeOfCharge(4),
806 	 * currencyInfoNotAvailable(5),
807 	 */
808 	u_int8_t currency_type;
809 	/*!
810 	 * \brief What service is being billed.
811 	 * \details
812 	 * basicCommunication(0),
813 	 * callAttempt(1),
814 	 * callSetup(2),
815 	 * userToUserInfo(3),
816 	 * operationOfSupplementaryServ(4)
817 	 */
818 	u_int8_t charged_item;
819 };
820 
821 /*
822  * AOCSCurrencyInfoList ::= SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo
823  */
824 struct roseEtsiAOCSCurrencyInfoList {
825 	/*! \brief SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo */
826 	struct roseEtsiAOCSCurrencyInfo list[10];
827 
828 	/*! \brief Number of AOCSCurrencyInfo records present */
829 	u_int8_t num_records;
830 };
831 
832 /*
833  * RecordedCurrency ::= SEQUENCE {
834  *     rCurrency       [1] IMPLICIT Currency,
835  *     rAmount         [2] IMPLICIT Amount
836  * }
837  */
838 struct roseEtsiAOCRecordedCurrency {
839 	/*! Amount of currency involved. */
840 	struct roseEtsiAOCAmount amount;
841 	/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
842 	unsigned char currency[10 + 1];
843 };
844 
845 /*
846  * RecordedUnits ::= SEQUENCE {
847  *     CHOICE {
848  *         recordedNumberOfUnits NumberOfUnits,
849  *         notAvailable          NULL
850  *     },
851  *     recordedTypeOfUnits TypeOfUnit OPTIONAL
852  * }
853  */
854 struct roseEtsiAOCRecordedUnits {
855 	/*! \brief recordedNumberOfUnits INTEGER (0..16777215) -- 24 bit number */
856 	u_int32_t number_of_units;
857 	/*! \brief TRUE if number_of_units is not available (not present) */
858 	u_int8_t not_available;
859 	/*! \brief recordedTypeOfUnits INTEGER (1..16) (optional) */
860 	u_int8_t type_of_unit;
861 	/*! \brief TRUE if type_of_unit is present */
862 	u_int8_t type_of_unit_present;
863 };
864 
865 /*
866  * RecordedUnitsList ::= SEQUENCE SIZE (1..32) OF RecordedUnits
867  */
868 struct roseEtsiAOCRecordedUnitsList {
869 	/*! \brief SEQUENCE SIZE (1..32) OF RecordedUnits */
870 	struct roseEtsiAOCRecordedUnits list[32];
871 
872 	/*! \brief Number of RecordedUnits records present */
873 	u_int8_t num_records;
874 };
875 
876 /*
877  * ChargingAssociation ::= CHOICE {
878  *     chargedNumber     [0] EXPLICIT PartyNumber,
879  *     chargeIdentifier  ChargeIdentifier
880  * }
881  */
882 struct roseEtsiAOCChargingAssociation {
883 	/*! chargeIdentifier: INTEGER (-32768..32767) -- 16 bit number */
884 	int16_t id;
885 	/*! chargedNumber */
886 	struct rosePartyNumber number;
887 	/*!
888 	 * \details
889 	 * charge_identifier(0),
890 	 * charged_number(1)
891 	 */
892 	u_int8_t type;
893 };
894 
895 /*
896  * AOCECurrencyInfo ::= SEQUENCE {
897  *     CHOICE {
898  *         freeOfCharge [1] IMPLICIT NULL,
899  *         specificCurrency SEQUENCE {
900  *             recordedCurrency    [1] IMPLICIT RecordedCurrency,
901  *             aOCEBillingId       [2] IMPLICIT AOCEBillingId OPTIONAL
902  *         }
903  *     },
904  *     chargingAssociation ChargingAssociation OPTIONAL
905  * }
906  */
907 struct roseEtsiAOCECurrencyInfo {
908 	struct {
909 		/*! \brief recorded currency */
910 		struct roseEtsiAOCRecordedCurrency recorded;
911 		/*!
912 		 * \brief AOCEBillingId (optional)
913 		 * \details
914 		 * normalCharging(0),
915 		 * reverseCharging(1),
916 		 * creditCardCharging(2),
917 		 * callForwardingUnconditional(3),
918 		 * callForwardingBusy(4),
919 		 * callForwardingNoReply(5),
920 		 * callDeflection(6),
921 		 * callTransfer(7)
922 		 */
923 		u_int8_t billing_id;
924 		/*! \brief TRUE if billing id is present */
925 		u_int8_t billing_id_present;
926 	} specific;
927 
928 	/*! \brief chargingAssociation (optional) */
929 	struct roseEtsiAOCChargingAssociation charging_association;
930 
931 	/*! \brief TRUE if charging_association is present */
932 	u_int8_t charging_association_present;
933 
934 	/*!
935 	 * \brief TRUE if this is free of charge.
936 	 * \note When TRUE, the contents of specific are not valid.
937 	 */
938 	u_int8_t free_of_charge;
939 };
940 
941 /*
942  * AOCEChargingUnitInfo ::= SEQUENCE {
943  *     CHOICE {
944  *         freeOfCharge [1] IMPLICIT NULL,
945  *         specificChargingUnits SEQUENCE
946  *         {
947  *             recordedUnitsList [1] IMPLICIT RecordedUnitsList,
948  *             aOCEBillingId     [2] IMPLICIT AOCEBillingId OPTIONAL
949  *         }
950  *     },
951  *     chargingAssociation ChargingAssociation OPTIONAL
952  * }
953  */
954 struct roseEtsiAOCEChargingUnitInfo {
955 	/*! \brief Not valid if free_of_charge is TRUE */
956 	struct {
957 		/*! \brief RecordedUnitsList */
958 		struct roseEtsiAOCRecordedUnitsList recorded;
959 		/*!
960 		 * \brief AOCEBillingId (optional)
961 		 * \details
962 		 * normalCharging(0),
963 		 * reverseCharging(1),
964 		 * creditCardCharging(2),
965 		 * callForwardingUnconditional(3),
966 		 * callForwardingBusy(4),
967 		 * callForwardingNoReply(5),
968 		 * callDeflection(6),
969 		 * callTransfer(7)
970 		 */
971 		u_int8_t billing_id;
972 		/*! \brief TRUE if billing id is present */
973 		u_int8_t billing_id_present;
974 	} specific;
975 
976 	/*! \brief chargingAssociation (optional) */
977 	struct roseEtsiAOCChargingAssociation charging_association;
978 
979 	/*! \brief TRUE if charging_association is present */
980 	u_int8_t charging_association_present;
981 
982 	/*!
983 	 * \brief TRUE if this is free of charge.
984 	 * \note When TRUE, the contents of specific are not valid.
985 	 */
986 	u_int8_t free_of_charge;
987 };
988 
989 /*
990  * ARGUMENT ChargingCase
991  */
992 struct roseEtsiChargingRequest_ARG {
993 	/*!
994 	 * \details
995 	 * chargingInformationAtCallSetup(0),
996 	 * chargingDuringACall(1),
997 	 * chargingAtTheEndOfACall(2)
998 	 */
999 	u_int8_t charging_case;
1000 };
1001 
1002 /*
1003  * RESULT CHOICE {
1004  *     AOCSCurrencyInfoList,
1005  *     AOCSSpecialArrInfo,
1006  *     chargingInfoFollows NULL
1007  * }
1008  */
1009 struct roseEtsiChargingRequest_RES {
1010 	union {
1011 		struct roseEtsiAOCSCurrencyInfoList currency_info;
1012 
1013 		/*! AOCSSpecialArrInfo ::= INTEGER (1..10) */
1014 		u_int8_t special_arrangement;
1015 	} u;
1016 	/*!
1017 	 * \details
1018 	 * currency_info_list(0),
1019 	 * special_arrangement_info(1),
1020 	 * charging_info_follows(2)
1021 	 */
1022 	u_int8_t type;
1023 };
1024 
1025 /*
1026  * ARGUMENT CHOICE {
1027  *     chargeNotAvailable NULL,
1028  *     AOCSCurrencyInfoList
1029  * }
1030  */
1031 struct roseEtsiAOCSCurrency_ARG {
1032 	struct roseEtsiAOCSCurrencyInfoList currency_info;
1033 	/*!
1034 	 * \details
1035 	 * charge_not_available(0),
1036 	 * currency_info_list(1)
1037 	 */
1038 	u_int8_t type;
1039 };
1040 
1041 /*
1042  * ARGUMENT CHOICE {
1043  *     chargeNotAvailable NULL,
1044  *     AOCSSpecialArrInfo
1045  * }
1046  */
1047 struct roseEtsiAOCSSpecialArr_ARG {
1048 	/*!
1049 	 * \details
1050 	 * charge_not_available(0),
1051 	 * special_arrangement_info(1)
1052 	 */
1053 	u_int8_t type;
1054 	/*! AOCSSpecialArrInfo ::= INTEGER (1..10) */
1055 	u_int8_t special_arrangement;
1056 };
1057 
1058 /*
1059  * ARGUMENT CHOICE {
1060  *     chargeNotAvailable NULL,
1061  *     aOCDCurrencyInfo CHOICE {
1062  *         freeOfCharge [1] IMPLICIT NULL,
1063  *         specificCurrency SEQUENCE {
1064  *             recordedCurrency   [1] IMPLICIT RecordedCurrency,
1065  *             typeOfChargingInfo [2] IMPLICIT TypeOfChargingInfo,
1066  *             aOCDBillingId      [3] IMPLICIT AOCDBillingId OPTIONAL
1067  *         }
1068  *     }
1069  * }
1070  */
1071 struct roseEtsiAOCDCurrency_ARG {
1072 	struct {
1073 		/*! \brief recorded currency */
1074 		struct roseEtsiAOCRecordedCurrency recorded;
1075 		/*!
1076 		 * \brief Type of recorded charging information.
1077 		 * \details
1078 		 * subTotal(0),
1079 		 * total(1)
1080 		 */
1081 		u_int8_t type_of_charging_info;
1082 		/*!
1083 		 * \brief AOCDBillingId (optional)
1084 		 * \details
1085 		 * normalCharging(0),
1086 		 * reverseCharging(1),
1087 		 * creditCardCharging(2)
1088 		 */
1089 		u_int8_t billing_id;
1090 		/*! \brief TRUE if billing id is present */
1091 		u_int8_t billing_id_present;
1092 	} specific;
1093 	/*!
1094 	 * \details
1095 	 * charge_not_available(0),
1096 	 * free_of_charge(1),
1097 	 * specific_currency(2)
1098 	 */
1099 	u_int8_t type;
1100 };
1101 
1102 /*
1103  * ARGUMENT CHOICE {
1104  *     chargeNotAvailable NULL,
1105  *     aOCDChargingUnitInfo CHOICE {
1106  *         freeOfCharge    [1] IMPLICIT NULL,
1107  *         specificChargingUnits SEQUENCE {
1108  *             recordedUnitsList  [1] IMPLICIT RecordedUnitsList,
1109  *             typeOfChargingInfo [2] IMPLICIT TypeOfChargingInfo,
1110  *             aOCDBillingId      [3] IMPLICIT AOCDBillingId OPTIONAL
1111  *         }
1112  *     }
1113  * }
1114  */
1115 struct roseEtsiAOCDChargingUnit_ARG {
1116 	struct {
1117 		/*! \brief RecordedUnitsList */
1118 		struct roseEtsiAOCRecordedUnitsList recorded;
1119 		/*!
1120 		 * \brief Type of recorded charging information.
1121 		 * \details
1122 		 * subTotal(0),
1123 		 * total(1)
1124 		 */
1125 		u_int8_t type_of_charging_info;
1126 		/*!
1127 		 * \brief AOCDBillingId (optional)
1128 		 * \details
1129 		 * normalCharging(0),
1130 		 * reverseCharging(1),
1131 		 * creditCardCharging(2)
1132 		 */
1133 		u_int8_t billing_id;
1134 		/*! \brief TRUE if billing id is present */
1135 		u_int8_t billing_id_present;
1136 	} specific;
1137 	/*!
1138 	 * \details
1139 	 * charge_not_available(0),
1140 	 * free_of_charge(1),
1141 	 * specific_charging_units(2)
1142 	 */
1143 	u_int8_t type;
1144 };
1145 
1146 /*
1147  * ARGUMENT CHOICE {
1148  *     chargeNotAvailable NULL,
1149  *     AOCECurrencyInfo
1150  * }
1151  */
1152 struct roseEtsiAOCECurrency_ARG {
1153 	struct roseEtsiAOCECurrencyInfo currency_info;
1154 	/*!
1155 	 * \details
1156 	 * charge_not_available(0),
1157 	 * currency_info(1)
1158 	 */
1159 	u_int8_t type;
1160 };
1161 
1162 /*
1163  * ARGUMENT CHOICE {
1164  *     chargeNotAvailable NULL,
1165  *     AOCEChargingUnitInfo
1166  * }
1167  */
1168 struct roseEtsiAOCEChargingUnit_ARG {
1169 	struct roseEtsiAOCEChargingUnitInfo charging_unit;
1170 	/*!
1171 	 * \details
1172 	 * charge_not_available(0),
1173 	 * charging_unit(1)
1174 	 */
1175 	u_int8_t type;
1176 };
1177 
1178 
1179 /* ------------------------------------------------------------------- */
1180 
1181 
1182 /*
1183  * ARGUMENT SEQUENCE {
1184  *     procedure           Procedure,
1185  *     basicService        BasicService,
1186  *     forwardedToAddress  Address,
1187  *     servedUserNr        ServedUserNr
1188  * }
1189  */
1190 struct roseEtsiActivationDiversion_ARG {
1191 	/*! \brief Forwarded to address */
1192 	struct roseAddress forwarded_to;
1193 
1194 	/*! \brief Forward all numbers if not present (Number length is zero). */
1195 	struct rosePartyNumber served_user_number;
1196 
1197 	/*! \details cfu(0), cfb(1), cfnr(2) */
1198 	u_int8_t procedure;
1199 
1200 	/*!
1201 	 * \details
1202 	 * allServices(0),
1203 	 * speech(1),
1204 	 * unrestrictedDigitalInformation(2),
1205 	 * audio3k1Hz(3),
1206 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
1207 	 * multirate(5),
1208 	 * telephony3k1Hz(32),
1209 	 * teletex(33),
1210 	 * telefaxGroup4Class1(34),
1211 	 * videotexSyntaxBased(35),
1212 	 * videotelephony(36),
1213 	 * telefaxGroup2-3(37),
1214 	 * telephony7kHz(38),
1215 	 * euroFileTransfer(39),
1216 	 * fileTransferAndAccessManagement(40),
1217 	 * videoconference(41),
1218 	 * audioGraphicConference(42)
1219 	 */
1220 	u_int8_t basic_service;
1221 };
1222 
1223 
1224 /*
1225  * ARGUMENT SEQUENCE {
1226  *     procedure           Procedure,
1227  *     basicService        BasicService,
1228  *     servedUserNr        ServedUserNr
1229  * }
1230  */
1231 struct roseEtsiDeactivationDiversion_ARG {
1232 	/*! \brief Forward all numbers if not present (Number length is zero). */
1233 	struct rosePartyNumber served_user_number;
1234 
1235 	/*! \details cfu(0), cfb(1), cfnr(2) */
1236 	u_int8_t procedure;
1237 
1238 	/*!
1239 	 * \details
1240 	 * allServices(0),
1241 	 * speech(1),
1242 	 * unrestrictedDigitalInformation(2),
1243 	 * audio3k1Hz(3),
1244 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
1245 	 * multirate(5),
1246 	 * telephony3k1Hz(32),
1247 	 * teletex(33),
1248 	 * telefaxGroup4Class1(34),
1249 	 * videotexSyntaxBased(35),
1250 	 * videotelephony(36),
1251 	 * telefaxGroup2-3(37),
1252 	 * telephony7kHz(38),
1253 	 * euroFileTransfer(39),
1254 	 * fileTransferAndAccessManagement(40),
1255 	 * videoconference(41),
1256 	 * audioGraphicConference(42)
1257 	 */
1258 	u_int8_t basic_service;
1259 };
1260 
1261 
1262 /*
1263  * ARGUMENT SEQUENCE {
1264  *     procedure           Procedure,
1265  *     basicService        BasicService,
1266  *     forwardedToAddresss Address,
1267  *     servedUserNr        ServedUserNr
1268  * }
1269  */
1270 struct roseEtsiActivationStatusNotificationDiv_ARG {
1271 	/*! \brief Forwarded to address */
1272 	struct roseAddress forwarded_to;
1273 
1274 	/*! \brief Forward all numbers if not present (Number length is zero). */
1275 	struct rosePartyNumber served_user_number;
1276 
1277 	/*! \details cfu(0), cfb(1), cfnr(2) */
1278 	u_int8_t procedure;
1279 
1280 	/*!
1281 	 * \details
1282 	 * allServices(0),
1283 	 * speech(1),
1284 	 * unrestrictedDigitalInformation(2),
1285 	 * audio3k1Hz(3),
1286 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
1287 	 * multirate(5),
1288 	 * telephony3k1Hz(32),
1289 	 * teletex(33),
1290 	 * telefaxGroup4Class1(34),
1291 	 * videotexSyntaxBased(35),
1292 	 * videotelephony(36),
1293 	 * telefaxGroup2-3(37),
1294 	 * telephony7kHz(38),
1295 	 * euroFileTransfer(39),
1296 	 * fileTransferAndAccessManagement(40),
1297 	 * videoconference(41),
1298 	 * audioGraphicConference(42)
1299 	 */
1300 	u_int8_t basic_service;
1301 };
1302 
1303 /*
1304  * ARGUMENT SEQUENCE {
1305  *     procedure           Procedure,
1306  *     basicService        BasicService,
1307  *     servedUserNr        ServedUserNr
1308  * }
1309  */
1310 struct roseEtsiDeactivationStatusNotificationDiv_ARG {
1311 	/*! \brief Forward all numbers if not present (Number length is zero). */
1312 	struct rosePartyNumber served_user_number;
1313 
1314 	/*! \details cfu(0), cfb(1), cfnr(2) */
1315 	u_int8_t procedure;
1316 
1317 	/*!
1318 	 * \details
1319 	 * allServices(0),
1320 	 * speech(1),
1321 	 * unrestrictedDigitalInformation(2),
1322 	 * audio3k1Hz(3),
1323 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
1324 	 * multirate(5),
1325 	 * telephony3k1Hz(32),
1326 	 * teletex(33),
1327 	 * telefaxGroup4Class1(34),
1328 	 * videotexSyntaxBased(35),
1329 	 * videotelephony(36),
1330 	 * telefaxGroup2-3(37),
1331 	 * telephony7kHz(38),
1332 	 * euroFileTransfer(39),
1333 	 * fileTransferAndAccessManagement(40),
1334 	 * videoconference(41),
1335 	 * audioGraphicConference(42)
1336 	 */
1337 	u_int8_t basic_service;
1338 };
1339 
1340 
1341 /*
1342  * ARGUMENT SEQUENCE {
1343  *     procedure           Procedure,
1344  *     basicService        BasicService DEFAULT allServices,
1345  *     servedUserNr        ServedUserNr
1346  * }
1347  */
1348 struct roseEtsiInterrogationDiversion_ARG {
1349 	/*! \brief Forward all numbers if not present (Number length is zero). */
1350 	struct rosePartyNumber served_user_number;
1351 
1352 	/*! \details cfu(0), cfb(1), cfnr(2) */
1353 	u_int8_t procedure;
1354 
1355 	/*!
1356 	 * \details
1357 	 * DEFAULT allServices
1358 	 *
1359 	 * \details
1360 	 * allServices(0),
1361 	 * speech(1),
1362 	 * unrestrictedDigitalInformation(2),
1363 	 * audio3k1Hz(3),
1364 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
1365 	 * multirate(5),
1366 	 * telephony3k1Hz(32),
1367 	 * teletex(33),
1368 	 * telefaxGroup4Class1(34),
1369 	 * videotexSyntaxBased(35),
1370 	 * videotelephony(36),
1371 	 * telefaxGroup2-3(37),
1372 	 * telephony7kHz(38),
1373 	 * euroFileTransfer(39),
1374 	 * fileTransferAndAccessManagement(40),
1375 	 * videoconference(41),
1376 	 * audioGraphicConference(42)
1377 	 */
1378 	u_int8_t basic_service;
1379 };
1380 
1381 /*
1382  * IntResult ::= SEQUENCE {
1383  *     servedUserNr        ServedUserNr,
1384  *     basicService        BasicService,
1385  *     procedure           Procedure,
1386  *     forwardedToAddress  Address
1387  * }
1388  */
1389 struct roseEtsiForwardingRecord {
1390 	/*! \brief Forwarded to address */
1391 	struct roseAddress forwarded_to;
1392 
1393 	/*! \brief Forward all numbers if not present (Number length is zero). */
1394 	struct rosePartyNumber served_user_number;
1395 
1396 	/*! \details cfu(0), cfb(1), cfnr(2) */
1397 	u_int8_t procedure;
1398 
1399 	/*!
1400 	 * \details
1401 	 * allServices(0),
1402 	 * speech(1),
1403 	 * unrestrictedDigitalInformation(2),
1404 	 * audio3k1Hz(3),
1405 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
1406 	 * multirate(5),
1407 	 * telephony3k1Hz(32),
1408 	 * teletex(33),
1409 	 * telefaxGroup4Class1(34),
1410 	 * videotexSyntaxBased(35),
1411 	 * videotelephony(36),
1412 	 * telefaxGroup2-3(37),
1413 	 * telephony7kHz(38),
1414 	 * euroFileTransfer(39),
1415 	 * fileTransferAndAccessManagement(40),
1416 	 * videoconference(41),
1417 	 * audioGraphicConference(42)
1418 	 */
1419 	u_int8_t basic_service;
1420 };
1421 
1422 /*
1423  * roseInterrogationDiversion_RES
1424  * IntResultList ::= SET SIZE (0..29) OF IntResult
1425  */
1426 struct roseEtsiForwardingList {
1427 	/*!
1428 	 * \brief SET SIZE (0..29) OF Forwarding Records
1429 	 * \note Reduced the size of the array to conserve
1430 	 * potential stack usage.
1431 	 */
1432 	struct roseEtsiForwardingRecord list[10];
1433 
1434 	/*! \brief Number of Forwarding records present */
1435 	u_int8_t num_records;
1436 };
1437 
1438 /*
1439  * ARGUMENT SEQUENCE {
1440  *     diversionReason         DiversionReason,
1441  *     basicService            BasicService,
1442  *     servedUserSubaddress    PartySubaddress OPTIONAL,
1443  *     callingAddress          [0] EXPLICIT PresentedAddressScreened OPTIONAL,
1444  *     originalCalledNr        [1] EXPLICIT PresentedNumberUnscreened OPTIONAL,
1445  *     lastDivertingNr         [2] EXPLICIT PresentedNumberUnscreened OPTIONAL,
1446  *     lastDivertingReason     [3] EXPLICIT DiversionReason OPTIONAL,
1447  *
1448  *     -- The User-user information element, as specified
1449  *     -- in ETS 300 102-1 [11], subclause 4.5.29, shall
1450  *     -- be embedded in the userInfo parameter.
1451  *     userInfo                Q931InformationElement OPTIONAL
1452  * }
1453  */
1454 struct roseEtsiDiversionInformation_ARG {
1455 	/*! \brief Served user subaddress (Optional) */
1456 	struct rosePartySubaddress served_user_subaddress;
1457 
1458 	/*! \brief Calling address (Optional) */
1459 	struct rosePresentedAddressScreened calling;
1460 
1461 	/*! \brief Original called number (Optional) */
1462 	struct rosePresentedNumberUnscreened original_called;
1463 
1464 	/*! \brief Last diverting number (Optional) */
1465 	struct rosePresentedNumberUnscreened last_diverting;
1466 
1467 	/*! \brief User-User information embedded in Q.931 IE (Optional) */
1468 	struct roseQ931ie q931ie;
1469 	/*! \brief q931ie.contents "allocated" after the stucture. */
1470 	unsigned char q931ie_contents[ROSE_Q931_MAX_USER + 1];
1471 
1472 	/*!
1473 	 * \brief Last diverting reason (Optional)
1474 	 *
1475 	 * \details
1476 	 * unknown(0),
1477 	 * cfu(1),
1478 	 * cfb(2),
1479 	 * cfnr(3),
1480 	 * cdAlerting(4),
1481 	 * cdImmediate(5)
1482 	 */
1483 	u_int8_t last_diverting_reason;
1484 
1485 	/*! \brief TRUE if CallingAddress is present */
1486 	u_int8_t calling_present;
1487 
1488 	/*! \brief TRUE if OriginalCalled is present */
1489 	u_int8_t original_called_present;
1490 
1491 	/*! \brief TRUE if LastDiverting is present */
1492 	u_int8_t last_diverting_present;
1493 
1494 	/*! \brief TRUE if LastDivertingReason is present */
1495 	u_int8_t last_diverting_reason_present;
1496 
1497 	/*!
1498 	 * \details
1499 	 * unknown(0),
1500 	 * cfu(1),
1501 	 * cfb(2),
1502 	 * cfnr(3),
1503 	 * cdAlerting(4),
1504 	 * cdImmediate(5)
1505 	 */
1506 	u_int8_t diversion_reason;
1507 
1508 	/*!
1509 	 * \details
1510 	 * allServices(0),
1511 	 * speech(1),
1512 	 * unrestrictedDigitalInformation(2),
1513 	 * audio3k1Hz(3),
1514 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
1515 	 * multirate(5),
1516 	 * telephony3k1Hz(32),
1517 	 * teletex(33),
1518 	 * telefaxGroup4Class1(34),
1519 	 * videotexSyntaxBased(35),
1520 	 * videotelephony(36),
1521 	 * telefaxGroup2-3(37),
1522 	 * telephony7kHz(38),
1523 	 * euroFileTransfer(39),
1524 	 * fileTransferAndAccessManagement(40),
1525 	 * videoconference(41),
1526 	 * audioGraphicConference(42)
1527 	 */
1528 	u_int8_t basic_service;
1529 };
1530 
1531 
1532 /*
1533  * ARGUMENT SEQUENCE {
1534  *     deflectionAddress                 Address,
1535  *     presentationAllowedDivertedToUser PresentationAllowedIndicator OPTIONAL
1536  * }
1537  */
1538 struct roseEtsiCallDeflection_ARG {
1539 	/*! \brief Deflection address (Deflected-To address) */
1540 	struct roseAddress deflection;
1541 
1542 	/*! \brief TRUE if PresentationAllowedToDivertedToUser is present */
1543 	u_int8_t presentation_allowed_to_diverted_to_user_present;
1544 
1545 	/*! \brief TRUE if presentation is allowed (Optional) */
1546 	u_int8_t presentation_allowed_to_diverted_to_user;
1547 };
1548 
1549 
1550 /*
1551  * ARGUMENT SEQUENCE {
1552  *     reroutingReason         DiversionReason,
1553  *     calledAddress           Address,
1554  *     reroutingCounter        DiversionCounter,
1555  *
1556  *     -- The User-user information element (optional),
1557  *     -- High layer compatibility information element (optional),
1558  *     -- Bearer capability information element
1559  *     -- and Low layer compatibility information element (optional)
1560  *     -- as specified in ETS 300 102-1 [11] subclause 4.5 shall be
1561  *     -- embedded in the q931InfoElement.
1562  *     q931InfoElement         Q931InformationElement,
1563  *     lastReroutingNr         [1] EXPLICIT PresentedNumberUnscreened,
1564  *     subscriptionOption      [2] EXPLICIT SubscriptionOption DEFAULT noNotification,
1565  *     callingPartySubaddress  [3] EXPLICIT PartySubaddress OPTIONAL
1566  * }
1567  */
1568 struct roseEtsiCallRerouting_ARG {
1569 	struct roseAddress called_address;
1570 
1571 	/*! \brief The BC, HLC (optional), LLC (optional), and User-user (optional) information */
1572 	struct roseQ931ie q931ie;
1573 	/*! \brief q931ie.contents "allocated" after the stucture. */
1574 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
1575 		ROSE_Q931_MAX_LLC + ROSE_Q931_MAX_USER + 1];
1576 
1577 	/*! \brief Last rerouting number */
1578 	struct rosePresentedNumberUnscreened last_rerouting;
1579 
1580 	/*! \brief Calling party subaddress (Optional) */
1581 	struct rosePartySubaddress calling_subaddress;
1582 
1583 	/*!
1584 	 * \details
1585 	 * unknown(0),
1586 	 * cfu(1),
1587 	 * cfb(2),
1588 	 * cfnr(3),
1589 	 * cdAlerting(4),
1590 	 * cdImmediate(5)
1591 	 */
1592 	u_int8_t rerouting_reason;
1593 
1594 	/*! \brief Range 1-5 */
1595 	u_int8_t rerouting_counter;
1596 
1597 	/*!
1598 	 * \details
1599 	 * DEFAULT noNotification
1600 	 *
1601 	 * \details
1602 	 * noNotification(0),
1603 	 * notificationWithoutDivertedToNr(1),
1604 	 * notificationWithDivertedToNr(2)
1605 	 */
1606 	u_int8_t subscription_option;
1607 };
1608 
1609 
1610 /*
1611  * roseInterrogateServedUserNumbers_RES
1612  * ServedUserNumberList ::= SET SIZE (0..99) OF PartyNumber
1613  */
1614 struct roseEtsiServedUserNumberList {
1615 	/*!
1616 	 * \brief SET SIZE (0..99) OF Served user numbers
1617 	 * \note Reduced the size of the array to conserve
1618 	 * potential stack usage.
1619 	 */
1620 	struct rosePartyNumber number[20];
1621 
1622 	/*! \brief Number of Served user numbers present */
1623 	u_int8_t num_records;
1624 };
1625 
1626 
1627 /*
1628  * ARGUMENT SEQUENCE {
1629  *     diversionReason     DiversionReason,
1630  *     subscriptionOption  SubscriptionOption,
1631  *     divertedToNumber    PresentedNumberUnscreened OPTIONAL
1632  * }
1633  */
1634 struct roseEtsiDivertingLegInformation1_ARG {
1635 	/*! \brief Diverted to number (Optional) */
1636 	struct rosePresentedNumberUnscreened diverted_to;
1637 
1638 	/*! \brief TRUE if DivertedTo is present */
1639 	u_int8_t diverted_to_present;
1640 
1641 	/*!
1642 	 * \details
1643 	 * unknown(0),
1644 	 * cfu(1),
1645 	 * cfb(2),
1646 	 * cfnr(3),
1647 	 * cdAlerting(4),
1648 	 * cdImmediate(5)
1649 	 */
1650 	u_int8_t diversion_reason;
1651 
1652 	/*!
1653 	 * \details
1654 	 * noNotification(0),
1655 	 * notificationWithoutDivertedToNr(1),
1656 	 * notificationWithDivertedToNr(2)
1657 	 */
1658 	u_int8_t subscription_option;
1659 };
1660 
1661 /*
1662  * ARGUMENT SEQUENCE {
1663  *     diversionCounter    DiversionCounter,
1664  *     diversionReason     DiversionReason,
1665  *     divertingNr         [1] EXPLICIT PresentedNumberUnscreened OPTIONAL,
1666  *     originalCalledNr    [2] EXPLICIT PresentedNumberUnscreened OPTIONAL
1667  * }
1668  */
1669 struct roseEtsiDivertingLegInformation2_ARG {
1670 	/*! \brief Diverting number (Optional) */
1671 	struct rosePresentedNumberUnscreened diverting;
1672 
1673 	/*! \brief Original called number (Optional) */
1674 	struct rosePresentedNumberUnscreened original_called;
1675 
1676 	/*! \brief TRUE if Diverting number is present */
1677 	u_int8_t diverting_present;
1678 
1679 	/*! \brief TRUE if OriginalCalled is present */
1680 	u_int8_t original_called_present;
1681 
1682 	/*!
1683 	 * \details
1684 	 * unknown(0),
1685 	 * cfu(1),
1686 	 * cfb(2),
1687 	 * cfnr(3),
1688 	 * cdAlerting(4),
1689 	 * cdImmediate(5)
1690 	 */
1691 	u_int8_t diversion_reason;
1692 
1693 	/*! \brief Range 1-5 */
1694 	u_int8_t diversion_counter;
1695 };
1696 
1697 /*
1698  * ARGUMENT presentationAllowedIndicator PresentationAllowedIndicator
1699  */
1700 struct roseEtsiDivertingLegInformation3_ARG {
1701 	/*! \brief TRUE if presentation is allowed */
1702 	u_int8_t presentation_allowed_indicator;
1703 };
1704 
1705 
1706 /* ------------------------------------------------------------------- */
1707 
1708 
1709 /*
1710  * ARGUMENT LinkId
1711  */
1712 struct roseEtsiExplicitEctExecute_ARG {
1713 	int16_t link_id;
1714 };
1715 
1716 /*
1717  * ARGUMENT transferredToSubaddress PartySubaddress
1718  */
1719 struct roseEtsiSubaddressTransfer_ARG {
1720 	/*! \brief Transferred to subaddress */
1721 	struct rosePartySubaddress subaddress;
1722 };
1723 
1724 
1725 /*
1726  * RESULT LinkId
1727  */
1728 struct roseEtsiEctLinkIdRequest_RES {
1729 	int16_t link_id;
1730 };
1731 
1732 
1733 /*
1734  * ARGUMENT SEQUENCE {
1735  *     ENUMERATED {
1736  *         alerting (0),
1737  *         active   (1)
1738  *     },
1739  *     redirectionNumber PresentedNumberUnscreened OPTIONAL
1740  * }
1741  */
1742 struct roseEtsiEctInform_ARG {
1743 	/*! \brief Redirection Number (Optional) */
1744 	struct rosePresentedNumberUnscreened redirection;
1745 
1746 	/*! \brief TRUE if the Redirection Number is present */
1747 	u_int8_t redirection_present;
1748 
1749 	/*! \details alerting(0), active(1) */
1750 	u_int8_t status;
1751 };
1752 
1753 
1754 /*
1755  * ARGUMENT CallTransferIdentity
1756  */
1757 struct roseEtsiEctLoopTest_ARG {
1758 	int8_t call_transfer_id;
1759 };
1760 
1761 /*
1762  * RESULT LoopResult
1763  */
1764 struct roseEtsiEctLoopTest_RES {
1765 	/*!
1766 	 * \details
1767 	 * insufficientInformation(0),
1768 	 * noLoopExists(1),
1769 	 * simultaneousTransfer(2)
1770 	 */
1771 	u_int8_t loop_result;
1772 };
1773 
1774 
1775 /* ------------------------------------------------------------------- */
1776 
1777 
1778 /*
1779  * ARGUMENT SEQUENCE {
1780  *     compatibilityMode CompatibilityMode,
1781  *
1782  *     -- The BC, HLC (optional) and LLC (optional) information
1783  *     -- elements shall be embedded in q931InfoElement
1784  *     q931InformationElement Q931InformationElement
1785  * }
1786  */
1787 struct roseEtsiStatusRequest_ARG {
1788 	/*! \brief The BC, HLC (optional) and LLC (optional) information */
1789 	struct roseQ931ie q931ie;
1790 	/*! \brief q931ie.contents "allocated" after the stucture. */
1791 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
1792 		ROSE_Q931_MAX_LLC + 1];
1793 
1794 	/*! \details allBasicServices(0), oneOrMoreBasicServices(1) */
1795 	u_int8_t compatibility_mode;
1796 };
1797 
1798 /*
1799  * RESULT StatusResult
1800  */
1801 struct roseEtsiStatusRequest_RES {
1802 	/*! \details compatibleAndFree(0), compatibleAndBusy(1), incompatible(2) */
1803 	u_int8_t status;
1804 };
1805 
1806 
1807 /* ------------------------------------------------------------------- */
1808 
1809 
1810 /*
1811  * CallLinkageID ::= INTEGER (0..127)
1812  * CCBSReference ::= INTEGER (0..127)
1813  */
1814 
1815 /*
1816  * ARGUMENT callLinkageID CallLinkageID
1817  */
1818 struct roseEtsiCallInfoRetain_ARG {
1819 	/*! \brief Call Linkage Record ID */
1820 	u_int8_t call_linkage_id;
1821 };
1822 
1823 /*
1824  * ARGUMENT callLinkageID CallLinkageID
1825  */
1826 struct roseEtsiEraseCallLinkageID_ARG {
1827 	/*! \brief Call Linkage Record ID */
1828 	u_int8_t call_linkage_id;
1829 };
1830 
1831 
1832 /*
1833  * ARGUMENT callLinkageID CallLinkageID
1834  */
1835 struct roseEtsiCCBSRequest_ARG {
1836 	/*! \brief Call Linkage Record ID */
1837 	u_int8_t call_linkage_id;
1838 };
1839 
1840 /*
1841  * RESULT SEQUENCE {
1842  *     recallMode          RecallMode,
1843  *     cCBSReference       CCBSReference
1844  * }
1845  */
1846 struct roseEtsiCCBSRequest_RES {
1847 	/*! \details globalRecall(0), specificRecall(1) */
1848 	u_int8_t recall_mode;
1849 
1850 	/*! \brief CCBS Record ID */
1851 	u_int8_t ccbs_reference;
1852 };
1853 
1854 
1855 /*
1856  * ARGUMENT cCBSReference CCBSReference
1857  */
1858 struct roseEtsiCCBSDeactivate_ARG {
1859 	/*! \brief CCBS Record ID */
1860 	u_int8_t ccbs_reference;
1861 };
1862 
1863 
1864 /*
1865  * ARGUMENT SEQUENCE {
1866  *     cCBSReference       CCBSReference OPTIONAL,
1867  *     partyNumberOfA      PartyNumber OPTIONAL
1868  * }
1869  */
1870 struct roseEtsiCCBSInterrogate_ARG {
1871 	/*! \brief Party A number (Optional) */
1872 	struct rosePartyNumber a_party_number;
1873 
1874 	/*! \brief TRUE if CCBSReference present */
1875 	u_int8_t ccbs_reference_present;
1876 
1877 	/*! \brief CCBS Record ID (optional) */
1878 	u_int8_t ccbs_reference;
1879 };
1880 
1881 /*
1882  * -- The Bearer capability, High layer compatibility (optional)
1883  * -- and Low layer compatibility (optional) information elements
1884  * -- shall be embedded in q931InfoElement.
1885  * CallInformation ::= SEQUENCE {
1886  *     addressOfB          Address,
1887  *     q931InfoElement     Q931InformationElement,
1888  *     cCBSReference       CCBSReference,
1889  *     subAddressOfA       PartySubaddress OPTIONAL
1890  * }
1891  */
1892 struct roseEtsiCallInformation {
1893 	/*! \brief The BC, HLC (optional) and LLC (optional) information */
1894 	struct roseQ931ie q931ie;
1895 	/*! \brief q931ie.contents "allocated" after the stucture. */
1896 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
1897 		ROSE_Q931_MAX_LLC + 1];
1898 
1899 	/*! \brief Address of B */
1900 	struct roseAddress address_of_b;
1901 
1902 	/*! \brief Subaddress of A (Optional) */
1903 	struct rosePartySubaddress subaddress_of_a;
1904 
1905 	/*! \brief CCBS Record ID */
1906 	u_int8_t ccbs_reference;
1907 };
1908 
1909 /*
1910  * CallDetails ::= SEQUENCE SIZE(1..5) OF CallInformation
1911  */
1912 struct roseEtsiCallDetailsList {
1913 	struct roseEtsiCallInformation list[5];
1914 
1915 	/*! \brief Number of CallDetails records present */
1916 	u_int8_t num_records;
1917 };
1918 
1919 /*
1920  * RESULT SEQUENCE {
1921  *     recallMode          RecallMode,
1922  *     callDetails         CallDetails OPTIONAL
1923  * }
1924  */
1925 struct roseEtsiCCBSInterrogate_RES {
1926 	struct roseEtsiCallDetailsList call_details;
1927 
1928 	/*! \details globalRecall(0), specificRecall(1) */
1929 	u_int8_t recall_mode;
1930 };
1931 
1932 
1933 /*
1934  * ARGUMENT SEQUENCE {
1935  *     recallMode          RecallMode,
1936  *     cCBSReference       CCBSReference,
1937  *     addressOfB          Address,
1938  *     q931InfoElement     Q931InformationElement,
1939  *     eraseReason         CCBSEraseReason
1940  * }
1941  */
1942 struct roseEtsiCCBSErase_ARG {
1943 	/*! \brief The BC, HLC (optional) and LLC (optional) information */
1944 	struct roseQ931ie q931ie;
1945 	/*! \brief q931ie.contents "allocated" after the stucture. */
1946 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
1947 		ROSE_Q931_MAX_LLC + 1];
1948 
1949 	/*! \brief Address of B */
1950 	struct roseAddress address_of_b;
1951 
1952 	/*! \details globalRecall(0), specificRecall(1) */
1953 	u_int8_t recall_mode;
1954 
1955 	/*! \brief CCBS Record ID */
1956 	u_int8_t ccbs_reference;
1957 
1958 	/*!
1959 	 * \brief CCBS Erase reason
1960 	 * \details
1961 	 * normal-unspecified(0),
1962 	 * t-CCBS2-timeout(1),
1963 	 * t-CCBS3-timeout(2),
1964 	 * basic-call-failed(3)
1965 	 */
1966 	u_int8_t reason;
1967 };
1968 
1969 /*
1970  * ARGUMENT SEQUENCE {
1971  *     recallMode          RecallMode,
1972  *     cCBSReference       CCBSReference,
1973  *     addressOfB          Address,
1974  *     q931InfoElement     Q931InformationElement
1975  * }
1976  */
1977 struct roseEtsiCCBSRemoteUserFree_ARG {
1978 	/*! \brief The BC, HLC (optional) and LLC (optional) information */
1979 	struct roseQ931ie q931ie;
1980 	/*! \brief q931ie.contents "allocated" after the stucture. */
1981 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
1982 		ROSE_Q931_MAX_LLC + 1];
1983 
1984 	/*! \brief Address of B */
1985 	struct roseAddress address_of_b;
1986 
1987 	/*! \details globalRecall(0), specificRecall(1) */
1988 	u_int8_t recall_mode;
1989 
1990 	/*! \brief CCBS Record ID */
1991 	u_int8_t ccbs_reference;
1992 };
1993 
1994 /*
1995  * ARGUMENT cCBSReference CCBSReference
1996  */
1997 struct roseEtsiCCBSCall_ARG {
1998 	/*! \brief CCBS Record ID */
1999 	u_int8_t ccbs_reference;
2000 };
2001 
2002 
2003 /*
2004  * ARGUMENT SEQUENCE {
2005  *     recallMode          RecallMode,
2006  *     cCBSReference       CCBSReference,
2007  *     q931InfoElement     Q931InformationElement
2008  * }
2009  */
2010 struct roseEtsiCCBSStatusRequest_ARG {
2011 	/*! \brief The BC, HLC (optional) and LLC (optional) information */
2012 	struct roseQ931ie q931ie;
2013 	/*! \brief q931ie.contents "allocated" after the stucture. */
2014 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
2015 		ROSE_Q931_MAX_LLC + 1];
2016 
2017 	/*! \details globalRecall(0), specificRecall(1) */
2018 	u_int8_t recall_mode;
2019 
2020 	/*! \brief CCBS Record ID */
2021 	u_int8_t ccbs_reference;
2022 };
2023 
2024 /*
2025  * RESULT BOOLEAN -- free=TRUE, busy=FALSE
2026  */
2027 struct roseEtsiCCBSStatusRequest_RES {
2028 	/*! \brief TRUE if User A is free */
2029 	u_int8_t free;
2030 };
2031 
2032 
2033 /*
2034  * ARGUMENT SEQUENCE {
2035  *     recallMode          RecallMode,
2036  *     cCBSReference       CCBSReference,
2037  *     addressOfB          Address,
2038  *     q931InfoElement     Q931InformationElement
2039  * }
2040  */
2041 struct roseEtsiCCBSBFree_ARG {
2042 	/*! \brief The BC, HLC (optional) and LLC (optional) information */
2043 	struct roseQ931ie q931ie;
2044 	/*! \brief q931ie.contents "allocated" after the stucture. */
2045 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
2046 		ROSE_Q931_MAX_LLC + 1];
2047 
2048 	/*! \brief Address of B */
2049 	struct roseAddress address_of_b;
2050 
2051 	/*! \details globalRecall(0), specificRecall(1) */
2052 	u_int8_t recall_mode;
2053 
2054 	/*! \brief CCBS Record ID */
2055 	u_int8_t ccbs_reference;
2056 };
2057 
2058 /*
2059  * ARGUMENT cCBSReference CCBSReference
2060  */
2061 struct roseEtsiCCBSStopAlerting_ARG {
2062 	/*! \brief CCBS Record ID */
2063 	u_int8_t ccbs_reference;
2064 };
2065 
2066 
2067 /* ------------------------------------------------------------------- */
2068 
2069 
2070 /*
2071  * ARGUMENT SEQUENCE {
2072  *     destinationAddress           Address,
2073  *
2074  *     -- contains HLC, LLC and BC information
2075  *     q931InfoElement              Q931InformationElement,
2076  *
2077  *     retentionSupported           [1] IMPLICIT BOOLEAN DEFAULT FALSE,
2078  *
2079  *     -- The use of this parameter is specified in
2080  *     -- EN 300 195-1 for interaction of CCBS with CLIP
2081  *     presentationAllowedIndicator [2] IMPLICIT BOOLEAN OPTIONAL,
2082  *
2083  *     -- The use of this parameter is specified in
2084  *     -- EN 300 195-1 for interaction of CCBS with CLIP
2085  *     originatingAddress           Address OPTIONAL
2086  * }
2087  */
2088 struct roseEtsiCCBS_T_Request_ARG {
2089 	/*! \brief The BC, HLC (optional) and LLC (optional) information */
2090 	struct roseQ931ie q931ie;
2091 	/*! \brief q931ie.contents "allocated" after the stucture. */
2092 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
2093 		ROSE_Q931_MAX_LLC + 1];
2094 
2095 	/*! \brief Address of B */
2096 	struct roseAddress destination;
2097 
2098 	/*! \brief Caller-ID Address (Present if Originating.Party.LengthOfNumber is nonzero) */
2099 	struct roseAddress originating;
2100 
2101 	/*! \brief TRUE if the PresentationAllowedIndicator is present */
2102 	u_int8_t presentation_allowed_indicator_present;
2103 
2104 	/*! \brief TRUE if presentation is allowed for the originating address (optional) */
2105 	u_int8_t presentation_allowed_indicator;
2106 
2107 	/*! \brief TRUE if User A's CCBS request is continued if user B is busy again. */
2108 	u_int8_t retention_supported;
2109 };
2110 
2111 /*
2112  * RESULT retentionSupported BOOLEAN   -- Default False
2113  */
2114 struct roseEtsiCCBS_T_Request_RES {
2115 	/*! \brief TRUE if User A's CCBS request is continued if user B is busy again. */
2116 	u_int8_t retention_supported;
2117 };
2118 
2119 
2120 /* ------------------------------------------------------------------- */
2121 
2122 
2123 /*
2124  * MessageID ::= SEQUENCE {
2125  *     messageRef  MessageRef,
2126  *     status      MessageStatus
2127  * }
2128  */
2129 struct roseEtsiMessageID {
2130 	/*! \brief Message reference number. (INTEGER (0..65535)) */
2131 	u_int16_t reference_number;
2132 	/*!
2133 	 * \brief Message status
2134 	 * \details
2135 	 * added_message(0),
2136 	 * removed_message(1)
2137 	 */
2138 	u_int8_t status;
2139 };
2140 
2141 /*
2142  * ARGUMENT SEQUENCE {
2143  *     receivingUserNr             PartyNumber,
2144  *     basicService                BasicService,
2145  *     controllingUserNr           [1] EXPLICIT PartyNumber     OPTIONAL,
2146  *     numberOfMessages            [2] EXPLICIT MessageCounter  OPTIONAL,
2147  *     controllingUserProvidedNr   [3] EXPLICIT PartyNumber     OPTIONAL,
2148  *     time                        [4] EXPLICIT GeneralizedTime OPTIONAL,
2149  *     messageId                   [5] EXPLICIT MessageID       OPTIONAL,
2150  *     mode                        [6] EXPLICIT InvocationMode  OPTIONAL
2151  * }
2152  */
2153 struct roseEtsiMWIActivate_ARG {
2154 	/*! \brief Number of messages in mailbox. (INTEGER (0..65535)) (Optional) */
2155 	u_int16_t number_of_messages;
2156 
2157 	/*! \brief Message ID (Status of this message) (Optional)*/
2158 	struct roseEtsiMessageID message_id;
2159 
2160 	/*! \brief Receiving user number (Who the message is for.) */
2161 	struct rosePartyNumber receiving_user_number;
2162 	/*! \brief Controlling user number (Mailbox number) (Optional) */
2163 	struct rosePartyNumber controlling_user_number;
2164 	/*! \brief Controlling user provided number (Caller-ID of party leaving message) (Optional) */
2165 	struct rosePartyNumber controlling_user_provided_number;
2166 
2167 	/*! \brief When message left. (optional) */
2168 	struct roseGeneralizedTime time;
2169 
2170 	/*!
2171 	 * \brief Type of call leaving message.
2172 	 * \details
2173 	 * allServices(0),
2174 	 * speech(1),
2175 	 * unrestrictedDigitalInformation(2),
2176 	 * audio3k1Hz(3),
2177 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
2178 	 * multirate(5),
2179 	 * telephony3k1Hz(32),
2180 	 * teletex(33),
2181 	 * telefaxGroup4Class1(34),
2182 	 * videotexSyntaxBased(35),
2183 	 * videotelephony(36),
2184 	 * telefaxGroup2-3(37),
2185 	 * telephony7kHz(38),
2186 	 * euroFileTransfer(39),
2187 	 * fileTransferAndAccessManagement(40),
2188 	 * videoconference(41),
2189 	 * audioGraphicConference(42)
2190 	 */
2191 	u_int8_t basic_service;
2192 	/*!
2193 	 * \brief Invocation mode (When it should be delivered.) (Optional)
2194 	 * \details
2195 	 * deferred(0),
2196 	 * immediate(1),
2197 	 * combined(2)
2198 	 */
2199 	u_int8_t mode;
2200 
2201 	/*! \brief TRUE if NumberOfMessages present */
2202 	u_int8_t number_of_messages_present;
2203 	/*! \brief TRUE if time present */
2204 	u_int8_t time_present;
2205 	/*! \brief TRUE if MessageId present */
2206 	u_int8_t message_id_present;
2207 	/*! \brief TRUE if invocation mode present */
2208 	u_int8_t mode_present;
2209 };
2210 
2211 /*
2212  * ARGUMENT SEQUENCE {
2213  *     receivingUserNr     PartyNumber,
2214  *     basicService        BasicService,
2215  *     controllingUserNr   PartyNumber    OPTIONAL,
2216  *     mode                InvocationMode OPTIONAL
2217  * }
2218  */
2219 struct roseEtsiMWIDeactivate_ARG {
2220 	/*! \brief Receiving user number (Who the message is for.) */
2221 	struct rosePartyNumber receiving_user_number;
2222 	/*! \brief Controlling user number (Mailbox number) (Optional) */
2223 	struct rosePartyNumber controlling_user_number;
2224 
2225 	/*!
2226 	 * \brief Type of call leaving message.
2227 	 * \details
2228 	 * allServices(0),
2229 	 * speech(1),
2230 	 * unrestrictedDigitalInformation(2),
2231 	 * audio3k1Hz(3),
2232 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
2233 	 * multirate(5),
2234 	 * telephony3k1Hz(32),
2235 	 * teletex(33),
2236 	 * telefaxGroup4Class1(34),
2237 	 * videotexSyntaxBased(35),
2238 	 * videotelephony(36),
2239 	 * telefaxGroup2-3(37),
2240 	 * telephony7kHz(38),
2241 	 * euroFileTransfer(39),
2242 	 * fileTransferAndAccessManagement(40),
2243 	 * videoconference(41),
2244 	 * audioGraphicConference(42)
2245 	 */
2246 	u_int8_t basic_service;
2247 
2248 	/*!
2249 	 * \brief Invocation mode (When it should be delivered.) (Optional)
2250 	 * \details
2251 	 * deferred(0),
2252 	 * immediate(1),
2253 	 * combined(2)
2254 	 */
2255 	u_int8_t mode;
2256 
2257 	/*! \brief TRUE if invocation mode present */
2258 	u_int8_t mode_present;
2259 };
2260 
2261 /*
2262  * ARGUMENT SEQUENCE {
2263  *     controllingUserNr           [1] EXPLICIT PartyNumber     OPTIONAL,
2264  *     basicService                [2] EXPLICIT BasicService    OPTIONAL,
2265  *     numberOfMessages            [3] EXPLICIT MessageCounter  OPTIONAL,
2266  *     controllingUserProvidedNr   [4] EXPLICIT PartyNumber     OPTIONAL,
2267  *     time                        [5] EXPLICIT GeneralizedTime OPTIONAL,
2268  *     messageId                   [6] EXPLICIT MessageID       OPTIONAL
2269  * }
2270  */
2271 struct roseEtsiMWIIndicate_ARG {
2272 	/*! \brief Number of messages in mailbox. (INTEGER (0..65535)) (Optional) */
2273 	u_int16_t number_of_messages;
2274 
2275 	/*! \brief Message ID (Status of this message) (Optional)*/
2276 	struct roseEtsiMessageID message_id;
2277 
2278 	/*! \brief Controlling user number (Mailbox number) (Optional) */
2279 	struct rosePartyNumber controlling_user_number;
2280 	/*! \brief Controlling user provided number (Caller-ID of party leaving message) (Optional) */
2281 	struct rosePartyNumber controlling_user_provided_number;
2282 
2283 	/*! \brief When message left. (optional) */
2284 	struct roseGeneralizedTime time;
2285 
2286 	/*!
2287 	 * \brief Type of call leaving message.
2288 	 * \details
2289 	 * allServices(0),
2290 	 * speech(1),
2291 	 * unrestrictedDigitalInformation(2),
2292 	 * audio3k1Hz(3),
2293 	 * unrestrictedDigitalInformationWithTonesAndAnnouncements(4),
2294 	 * multirate(5),
2295 	 * telephony3k1Hz(32),
2296 	 * teletex(33),
2297 	 * telefaxGroup4Class1(34),
2298 	 * videotexSyntaxBased(35),
2299 	 * videotelephony(36),
2300 	 * telefaxGroup2-3(37),
2301 	 * telephony7kHz(38),
2302 	 * euroFileTransfer(39),
2303 	 * fileTransferAndAccessManagement(40),
2304 	 * videoconference(41),
2305 	 * audioGraphicConference(42)
2306 	 */
2307 	u_int8_t basic_service;
2308 
2309 	/*! \brief TRUE if basic_service present */
2310 	u_int8_t basic_service_present;
2311 	/*! \brief TRUE if NumberOfMessages present */
2312 	u_int8_t number_of_messages_present;
2313 	/*! \brief TRUE if time present */
2314 	u_int8_t time_present;
2315 	/*! \brief TRUE if MessageId present */
2316 	u_int8_t message_id_present;
2317 };
2318 
2319 
2320 /* ------------------------------------------------------------------- */
2321 
2322 
2323 /*
2324  * Name ::= CHOICE {
2325  *     -- iso8859-1 is implied in namePresentationAllowedSimple.
2326  *     namePresentationAllowedSimple   [0] IMPLICIT NameData,
2327  *     namePresentationAllowedExtended [1] IMPLICIT NameSet,
2328  *
2329  *     -- iso8859-1 is implied in namePresentationRestrictedSimple.
2330  *     namePresentationRestrictedSimple    [2] IMPLICIT NameData,
2331  *     namePresentationRestrictedExtended  [3] IMPLICIT NameSet,
2332  *
2333  *     -- namePresentationRestrictedNull shall only be used in the
2334  *     -- case of interworking where the other network provides an
2335  *     -- indication that the name is restricted without the name itself.
2336  *     namePresentationRestrictedNull      [7] IMPLICIT NULL,
2337  *
2338  *     nameNotAvailable [4] IMPLICIT NULL
2339  * }
2340  *
2341  * NameSet ::= SEQUENCE {
2342  *     nameData        NameData,
2343  *
2344  *     -- If characterSet is not included, iso8859-1 is implied.
2345  *     characterSet    CharacterSet OPTIONAL -- DEFAULT iso8859-1
2346  * }
2347  *
2348  * -- The maximum allowed size of the name field is 50 octets.
2349  * -- The minimum required size of the name field is 1 octet.
2350  * NameData ::= OCTET STRING (SIZE (1..50))
2351  */
2352 struct roseQsigName {
2353 	/*!
2354 	 * \details
2355 	 * optional_name_not_present(0),
2356 	 * presentation_allowed(1),
2357 	 * presentation_restricted(2),
2358 	 * presentation_restricted_null(3),
2359 	 * name_not_available(4)
2360 	 */
2361 	u_int8_t presentation;
2362 
2363 	/*!
2364 	 * \details
2365 	 * Set to iso8859-1 if not present in the encoding.
2366 	 *
2367 	 * \details
2368 	 * unknown(0),
2369 	 * iso8859-1(1),
2370 	 * enum-value-withdrawn-by-ITU-T(2)
2371 	 * iso8859-2(3),
2372 	 * iso8859-3(4),
2373 	 * iso8859-4(5),
2374 	 * iso8859-5(6),
2375 	 * iso8859-7(7),
2376 	 * iso10646-BmpString(8),
2377 	 * iso10646-utf-8String(9)
2378 	 */
2379 	u_int8_t char_set;
2380 
2381 	/*! \brief Length of name data */
2382 	u_int8_t length;
2383 
2384 	/*! \brief Name string data */
2385 	unsigned char data[50 + 1];
2386 };
2387 
2388 /*
2389  * NOTE: We are not going to record the Extension information
2390  * since it is manufacturer specific.
2391  *
2392  * ARGUMENT CHOICE {
2393  *     Name,
2394  *     SEQUENCE {
2395  *         Name,
2396  *         CHOICE {
2397  *             [5] IMPLICIT Extension,
2398  *             [6] IMPLICIT SEQUENCE OF Extension
2399  *         } OPTIONAL
2400  *     }
2401  * }
2402  */
2403 struct roseQsigPartyName_ARG {
2404 	struct roseQsigName name;
2405 };
2406 
2407 
2408 /* ------------------------------------------------------------------- */
2409 
2410 
2411 /*
2412  * Time ::= SEQUENCE {
2413  *     lengthOfTimeUnit [1] IMPLICIT LengthOfTimeUnit,
2414  *     scale            [2] IMPLICIT Scale
2415  * }
2416  */
2417 struct roseQsigAOCTime {
2418 	/*! LengthOfTimeUnit ::= INTEGER (0..16777215) -- 24 bit number */
2419 	u_int32_t length;
2420 	/*!
2421 	 * \details
2422 	 * oneHundredthSecond(0),
2423 	 * oneTenthSecond(1),
2424 	 * oneSecond(2),
2425 	 * tenSeconds(3),
2426 	 * oneMinute(4),
2427 	 * oneHour(5),
2428 	 * twentyFourHours(6)
2429 	 */
2430 	u_int8_t scale;
2431 };
2432 
2433 /*
2434  * Amount ::= SEQUENCE {
2435  *     currencyAmount [1] IMPLICIT CurrencyAmount,
2436  *     multiplier     [2] IMPLICIT Multiplier
2437  * }
2438  */
2439 struct roseQsigAOCAmount {
2440 	/*! CurrencyAmount ::= INTEGER (0..16777215) -- 24 bit number */
2441 	u_int32_t currency;
2442 	/*!
2443 	 * \details
2444 	 * oneThousandth(0),
2445 	 * oneHundredth(1),
2446 	 * oneTenth(2),
2447 	 * one(3),
2448 	 * ten(4),
2449 	 * hundred(5),
2450 	 * thousand(6)
2451 	 */
2452 	u_int8_t multiplier;
2453 };
2454 
2455 /*
2456  * DurationCurrency ::= SEQUENCE {
2457  *     dCurrency       [1] IMPLICIT Currency,
2458  *     dAmount         [2] IMPLICIT Amount,
2459  *     dChargingType   [3] IMPLICIT ChargingType,
2460  *     dTime           [4] IMPLICIT Time,
2461  *     dGranularity    [5] IMPLICIT Time OPTIONAL
2462  * }
2463  */
2464 struct roseQsigAOCDurationCurrency {
2465 	struct roseQsigAOCAmount amount;
2466 	struct roseQsigAOCTime time;
2467 	/*! \brief dGranularity (optional) */
2468 	struct roseQsigAOCTime granularity;
2469 	/*!
2470 	 * \brief Name of currency
2471 	 * \details
2472 	 * Currency ::= IA5String (SIZE (0..10))
2473 	 * \note The empty string is the default currency for the network.
2474 	 */
2475 	unsigned char currency[10 + 1];
2476 	/*!
2477 	 * \details
2478 	 * continuousCharging(0),
2479 	 * stepFunction(1)
2480 	 */
2481 	u_int8_t charging_type;
2482 	/*! TRUE if granularity time is present */
2483 	u_int8_t granularity_present;
2484 };
2485 
2486 /*
2487  * FlatRateCurrency ::= SEQUENCE {
2488  *     fRCurrency      [1] IMPLICIT Currency,
2489  *     fRAmount        [2] IMPLICIT Amount
2490  * }
2491  */
2492 struct roseQsigAOCFlatRateCurrency {
2493 	struct roseQsigAOCAmount amount;
2494 	/*!
2495 	 * \brief Name of currency
2496 	 * \details
2497 	 * Currency ::= IA5String (SIZE (0..10))
2498 	 * \note The empty string is the default currency for the network.
2499 	 */
2500 	unsigned char currency[10 + 1];
2501 };
2502 
2503 /*
2504  * VolumeRateCurrency ::= SEQUENCE {
2505  *     vRCurrency      [1] IMPLICIT Currency,
2506  *     vRAmount        [2] IMPLICIT Amount,
2507  *     vRVolumeUnit    [3] IMPLICIT VolumeUnit
2508  * }
2509  */
2510 struct roseQsigAOCVolumeRateCurrency {
2511 	struct roseQsigAOCAmount amount;
2512 	/*!
2513 	 * \brief Name of currency
2514 	 * \details
2515 	 * Currency ::= IA5String (SIZE (0..10))
2516 	 * \note The empty string is the default currency for the network.
2517 	 */
2518 	unsigned char currency[10 + 1];
2519 	/*!
2520 	 * \brief Volume rate volume unit
2521 	 * \details
2522 	 * octet(0),
2523 	 * segment(1),
2524 	 * message(2)
2525 	 */
2526 	u_int8_t unit;
2527 };
2528 
2529 /*
2530  * AOCSCurrencyInfo ::= SEQUENCE {
2531  *     chargedItem                     ChargedItem,
2532  *     rateType CHOICE {
2533  *         durationCurrency            [1] IMPLICIT DurationCurrency,
2534  *         flatRateCurrency            [2] IMPLICIT FlatRateCurrency,
2535  *         volumeRateCurrency          [3] IMPLICIT VolumeRateCurrency,
2536  *         specialChargingCode         SpecialChargingCode,
2537  *         freeOfCharge                [4] IMPLICIT NULL,
2538  *         currencyInfoNotAvailable    [5] IMPLICIT NULL,
2539  *         freeOfChargefromBeginning   [6] IMPLICIT NULL
2540  *     }
2541  * }
2542  */
2543 struct roseQsigAOCSCurrencyInfo {
2544 	union {
2545 		struct roseQsigAOCDurationCurrency duration;
2546 		struct roseQsigAOCFlatRateCurrency flat_rate;
2547 		struct roseQsigAOCVolumeRateCurrency volume_rate;
2548 		/*! SpecialChargingCode ::= INTEGER (1..10) */
2549 		u_int8_t special_charging_code;
2550 	} u;
2551 	/*!
2552 	 * \brief Determine what is stored in the union.
2553 	 * \details
2554 	 * specialChargingCode(0),
2555 	 * durationCurrency(1),
2556 	 * flatRateCurrency(2),
2557 	 * volumeRateCurrency(3),
2558 	 * freeOfCharge(4),
2559 	 * currencyInfoNotAvailable(5),
2560 	 * freeOfChargeFromBeginning(6)
2561 	 */
2562 	u_int8_t currency_type;
2563 	/*!
2564 	 * \brief What service is being billed.
2565 	 * \details
2566 	 * basicCommunication(0),
2567 	 * callAttempt(1),
2568 	 * callSetup(2),
2569 	 * userToUserInfo(3),
2570 	 * operationOfSupplementaryServ(4)
2571 	 */
2572 	u_int8_t charged_item;
2573 };
2574 
2575 /*
2576  * AOCSCurrencyInfoList ::= SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo
2577  */
2578 struct roseQsigAOCSCurrencyInfoList {
2579 	/*! \brief SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo */
2580 	struct roseQsigAOCSCurrencyInfo list[10];
2581 
2582 	/*! \brief Number of AOCSCurrencyInfo records present */
2583 	u_int8_t num_records;
2584 };
2585 
2586 /*
2587  * RecordedCurrency ::= SEQUENCE {
2588  *     rCurrency       [1] IMPLICIT Currency,
2589  *     rAmount         [2] IMPLICIT Amount
2590  * }
2591  */
2592 struct roseQsigAOCRecordedCurrency {
2593 	/*! Amount of currency involved. */
2594 	struct roseQsigAOCAmount amount;
2595 	/*!
2596 	 * \brief Name of currency
2597 	 * \details
2598 	 * Currency ::= IA5String (SIZE (0..10))
2599 	 * \note The empty string is the default currency for the network.
2600 	 */
2601 	unsigned char currency[10 + 1];
2602 };
2603 
2604 /*
2605  * ChargingAssociation ::= CHOICE {
2606  *     chargedNumber     [0] EXPLICIT PartyNumber,
2607  *     chargeIdentifier  ChargeIdentifier
2608  * }
2609  */
2610 struct roseQsigAOCChargingAssociation {
2611 	/*! chargeIdentifier: INTEGER (-32768..32767) -- 16 bit number */
2612 	int16_t id;
2613 	/*! chargedNumber */
2614 	struct rosePartyNumber number;
2615 	/*!
2616 	 * \details
2617 	 * charge_identifier(0)
2618 	 * charged_number(1),
2619 	 */
2620 	u_int8_t type;
2621 };
2622 
2623 /*
2624  * AocRateArg ::= SEQUENCE {
2625  *     aocRate CHOICE
2626  *     {
2627  *         chargeNotAvailable      NULL,
2628  *         aocSCurrencyInfoList    AOCSCurrencyInfoList
2629  *     },
2630  *     rateArgExtension CHOICE {
2631  *         extension               [1] IMPLICIT Extension,
2632  *         multipleExtension       [2] IMPLICIT SEQUENCE OF Extension
2633  *     } OPTIONAL
2634  * }
2635  */
2636 struct roseQsigAocRateArg_ARG {
2637 	struct roseQsigAOCSCurrencyInfoList currency_info;
2638 	/*!
2639 	 * \details
2640 	 * charge_not_available(0),
2641 	 * currency_info_list(1)
2642 	 */
2643 	u_int8_t type;
2644 };
2645 
2646 /*
2647  * AocInterimArg ::= SEQUENCE {
2648  *     interimCharge CHOICE {
2649  *         chargeNotAvailable      [0] IMPLICIT NULL,
2650  *         freeOfCharge            [1] IMPLICIT NULL,
2651  *         specificCurrency        SEQUENCE {
2652  *             recordedCurrency    [1] IMPLICIT RecordedCurrency,
2653  *             interimBillingId    [2] IMPLICIT InterimBillingId OPTIONAL
2654  *         }
2655  *     },
2656  *     interimArgExtension CHOICE {
2657  *         extension           [1] IMPLICIT Extension,
2658  *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
2659  *     } OPTIONAL
2660  * }
2661  */
2662 struct roseQsigAocInterimArg_ARG {
2663 	struct {
2664 		/*! \brief recorded currency */
2665 		struct roseQsigAOCRecordedCurrency recorded;
2666 		/*!
2667 		 * \brief InterimBillingId (optional)
2668 		 * \details
2669 		 * normalCharging(0),
2670 		 * creditCardCharging(2)
2671 		 */
2672 		u_int8_t billing_id;
2673 		/*! \brief TRUE if billing id is present */
2674 		u_int8_t billing_id_present;
2675 	} specific;
2676 	/*!
2677 	 * \details
2678 	 * charge_not_available(0),
2679 	 * free_of_charge(1),
2680 	 * specific_currency(2)
2681 	 */
2682 	u_int8_t type;
2683 };
2684 
2685 /*
2686  * AocFinalArg ::= SEQUENCE {
2687  *     finalCharge CHOICE {
2688  *         chargeNotAvailable      [0] IMPLICIT NULL,
2689  *         freeOfCharge            [1] IMPLICIT NULL,
2690  *         specificCurrency        SEQUENCE {
2691  *             recordedCurrency    [1] IMPLICIT RecordedCurrency,
2692  *             finalBillingId      [2] IMPLICIT FinalBillingId OPTIONAL
2693  *         }
2694  *     },
2695  *     chargingAssociation ChargingAssociation OPTIONAL,
2696  *     finalArgExtension   CHOICE {
2697  *         extension           [1] IMPLICIT Extension,
2698  *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
2699  *     } OPTIONAL
2700  * }
2701  */
2702 struct roseQsigAocFinalArg_ARG {
2703 	struct {
2704 		/*! \brief recorded currency */
2705 		struct roseQsigAOCRecordedCurrency recorded;
2706 		/*!
2707 		 * \brief FinalBillingId (optional)
2708 		 * \details
2709 		 * normalCharging(0),
2710 		 * creditCardCharging(2),
2711 		 * callForwardingUnconditional(3),
2712 		 * callForwardingBusy(4),
2713 		 * callForwardingNoReply(5),
2714 		 * callDeflection(6),
2715 		 * callTransfer(7)
2716 		 */
2717 		u_int8_t billing_id;
2718 		/*! \brief TRUE if billing id is present */
2719 		u_int8_t billing_id_present;
2720 	} specific;
2721 
2722 	/*! \brief chargingAssociation (optional) */
2723 	struct roseQsigAOCChargingAssociation charging_association;
2724 
2725 	/*! \brief TRUE if charging_association is present */
2726 	u_int8_t charging_association_present;
2727 
2728 	/*!
2729 	 * \details
2730 	 * charge_not_available(0),
2731 	 * free_of_charge(1),
2732 	 * specific_currency(2)
2733 	 */
2734 	u_int8_t type;
2735 };
2736 
2737 /*
2738  * ChargeRequestArg ::= SEQUENCE {
2739  *     adviceModeCombinations  SEQUENCE SIZE(0..7) OF AdviceModeCombination,
2740  *     chargeReqArgExtension   CHOICE {
2741  *         extension           [1] IMPLICIT Extension,
2742  *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
2743  *     } OPTIONAL
2744  * }
2745  */
2746 struct roseQsigChargeRequestArg_ARG {
2747 	/*!
2748 	 * \brief SEQUENCE SIZE(0..7) OF AdviceModeCombination
2749 	 * \details
2750 	 * rate(0) <charge rate provision>,
2751 	 * rateInterim(1) <charge rate and interim charge provision>,
2752 	 * rateFinal(2) <charge rate and final charge provision>,
2753 	 * interim(3) <interim charge provision>,
2754 	 * final(4) <final charge provision>,
2755 	 * interimFinal(5) <interim charge and final charge provision>,
2756 	 * rateInterimFinal(6) <charge rate, interim charge and final charge provision>
2757 	 */
2758 	u_int8_t advice_mode_combinations[7];
2759 
2760 	/*! \brief Number of AdviceModeCombination values present */
2761 	u_int8_t num_records;
2762 };
2763 
2764 /*
2765  * ChargeRequestRes ::= SEQUENCE {
2766  *     adviceModeCombination   AdviceModeCombination,
2767  *     chargeReqResExtension   CHOICE {
2768  *         extension           [1] IMPLICIT Extension,
2769  *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
2770  *     } OPTIONAL
2771  * }
2772  */
2773 struct roseQsigChargeRequestRes_RES {
2774 	/*!
2775 	 * \details
2776 	 * rate(0) <charge rate provision>,
2777 	 * rateInterim(1) <charge rate and interim charge provision>,
2778 	 * rateFinal(2) <charge rate and final charge provision>,
2779 	 * interim(3) <interim charge provision>,
2780 	 * final(4) <final charge provision>,
2781 	 * interimFinal(5) <interim charge and final charge provision>,
2782 	 * rateInterimFinal(6) <charge rate, interim charge and final charge provision>
2783 	 */
2784 	u_int8_t advice_mode_combination;
2785 };
2786 
2787 /*
2788  * AocCompleteArg ::= SEQUENCE {
2789  *     chargedUser             PartyNumber,
2790  *     chargingAssociation     ChargingAssociation OPTIONAL,
2791  *     completeArgExtension    CHOICE {
2792  *         extension           [1] IMPLICIT Extension,
2793  *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
2794  *     } OPTIONAL
2795  * }
2796  */
2797 struct roseQsigAocCompleteArg_ARG {
2798 	/*! \brief chargingAssociation (optional) */
2799 	struct roseQsigAOCChargingAssociation charging_association;
2800 
2801 	struct rosePartyNumber charged_user_number;
2802 
2803 	/*! \brief TRUE if charging_association is present */
2804 	u_int8_t charging_association_present;
2805 };
2806 
2807 /*
2808  * AocCompleteRes ::= SEQUENCE {
2809  *     chargingOption          ChargingOption,
2810  *     completeResExtension    CHOICE {
2811  *         extension           [1] IMPLICIT Extension,
2812  *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
2813  *     } OPTIONAL
2814  * }
2815  */
2816 struct roseQsigAocCompleteRes_RES {
2817 	/*!
2818 	 * \details
2819 	 * aocFreeOfCharge(0),
2820 	 * aocContinueCharging(1),
2821 	 * aocStopCharging(2)
2822 	 */
2823 	u_int8_t charging_option;
2824 };
2825 
2826 /*
2827  * AocDivChargeReqArg ::= SEQUENCE {
2828  *     divertingUser           PartyNumber,
2829  *     chargingAssociation     ChargingAssociation OPTIONAL,
2830  *     diversionType           DiversionType,
2831  *     aocDivChargeReqArgExt   CHOICE {
2832  *         extension           [1] IMPLICIT Extension,
2833  *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
2834  *     } OPTIONAL
2835  * }
2836  */
2837 struct roseQsigAocDivChargeReqArg_ARG {
2838 	/*! \brief chargingAssociation (optional) */
2839 	struct roseQsigAOCChargingAssociation charging_association;
2840 
2841 	struct rosePartyNumber diverting_user_number;
2842 
2843 	/*! \brief TRUE if charging_association is present */
2844 	u_int8_t charging_association_present;
2845 
2846 	/*!
2847 	 * \details
2848 	 * callForwardingUnconditional(0),
2849 	 * callForwardingBusy(1),
2850 	 * callForwardingNoReply(2),
2851 	 * callDeflection(3)
2852 	 */
2853 	u_int8_t diversion_type;
2854 };
2855 
2856 
2857 /* ------------------------------------------------------------------- */
2858 
2859 
2860 /*
2861  * CTIdentifyRes ::= SEQUENCE {
2862  *     callIdentity        CallIdentity,
2863  *     reroutingNumber     PartyNumber,
2864  *     resultExtension     CHOICE {
2865  *         [6] IMPLICIT Extension,
2866  *         [7] IMPLICIT SEQUENCE OF Extension
2867  *     } OPTIONAL
2868  * }
2869  */
2870 struct roseQsigCTIdentifyRes_RES {
2871 	struct rosePartyNumber rerouting_number;
2872 
2873 	/*! \brief CallIdentity ::= NumericString (SIZE (1..4)) */
2874 	unsigned char call_id[4 + 1];
2875 };
2876 
2877 /*
2878  * CTInitiateArg ::= SEQUENCE {
2879  *     callIdentity        CallIdentity,
2880  *     reroutingNumber     PartyNumber,
2881  *     argumentExtension   CHOICE {
2882  *         [6] IMPLICIT Extension,
2883  *         [7] IMPLICIT SEQUENCE OF Extension
2884  *     } OPTIONAL
2885  * }
2886  */
2887 struct roseQsigCTInitiateArg_ARG {
2888 	struct rosePartyNumber rerouting_number;
2889 
2890 	/*! \brief CallIdentity ::= NumericString (SIZE (1..4)) */
2891 	unsigned char call_id[4 + 1];
2892 };
2893 
2894 /*
2895  * CTSetupArg ::= SEQUENCE {
2896  *     callIdentity        CallIdentity,
2897  *     argumentExtension   CHOICE {
2898  *         [0] IMPLICIT Extension,
2899  *         [1] IMPLICIT SEQUENCE OF Extension
2900  *     } OPTIONAL
2901  * }
2902  */
2903 struct roseQsigCTSetupArg_ARG {
2904 	/*! \brief CallIdentity ::= NumericString (SIZE (1..4)) */
2905 	unsigned char call_id[4 + 1];
2906 };
2907 
2908 /*
2909  * CTActiveArg ::= SEQUENCE {
2910  *     connectedAddress        PresentedAddressScreened,
2911  *
2912  *     -- ISO/IEC 11572 information elements Party
2913  *     -- category and Progress indicator are conveyed
2914  *     basicCallInfoElements   PSS1InformationElement OPTIONAL,
2915  *     connectedName           Name OPTIONAL,
2916  *     argumentExtension       CHOICE {
2917  *         [9] IMPLICIT Extension,
2918  *         [10] IMPLICIT SEQUENCE OF Extension
2919  *     } OPTIONAL
2920  * }
2921  */
2922 struct roseQsigCTActiveArg_ARG {
2923 	/*! \brief connectedAddress */
2924 	struct rosePresentedAddressScreened connected;
2925 
2926 	/*! \brief basicCallInfoElements (optional) */
2927 	struct roseQ931ie q931ie;
2928 	/*! \brief q931ie.contents "allocated" after the stucture. */
2929 	unsigned char q931ie_contents[ROSE_Q931_MAX_PROGRESS + 1];
2930 
2931 	/*! \brief connectedName (optional) */
2932 	struct roseQsigName connected_name;
2933 
2934 	/*! \brief TRUE if connected_name is present */
2935 	u_int8_t connected_name_present;
2936 };
2937 
2938 /*
2939  * CTCompleteArg ::= SEQUENCE {
2940  *     endDesignation          EndDesignation,
2941  *     redirectionNumber       PresentedNumberScreened,
2942  *
2943  *     -- ISO/IEC 11572 information elements Party
2944  *     -- category and Progress indicator are conveyed
2945  *     basicCallInfoElements   PSS1InformationElement OPTIONAL,
2946  *     redirectionName         Name OPTIONAL,
2947  *     callStatus              CallStatus DEFAULT answered,
2948  *     argumentExtension       CHOICE {
2949  *         [9] IMPLICIT Extension,
2950  *         [10] IMPLICIT SEQUENCE OF Extension
2951  *     } OPTIONAL
2952  * }
2953  */
2954 struct roseQsigCTCompleteArg_ARG {
2955 	/*! \brief redirectionNumber */
2956 	struct rosePresentedNumberScreened redirection;
2957 
2958 	/*! \brief basicCallInfoElements (optional) */
2959 	struct roseQ931ie q931ie;
2960 	/*! \brief q931ie.contents "allocated" after the stucture. */
2961 	unsigned char q931ie_contents[ROSE_Q931_MAX_PROGRESS + 1];
2962 
2963 	/*! \brief redirectionName (optional) */
2964 	struct roseQsigName redirection_name;
2965 
2966 	/*! \brief TRUE if redirection_name is present */
2967 	u_int8_t redirection_name_present;
2968 
2969 	/*!
2970 	 * \brief endDesignation
2971 	 * \details
2972 	 * primaryEnd(0),
2973 	 * secondaryEnd(1)
2974 	 */
2975 	u_int8_t end_designation;
2976 
2977 	/*!
2978 	 * \brief callStatus
2979 	 * \details
2980 	 * DEFAULT answered
2981 	 *
2982 	 * \details
2983 	 * answered(0),
2984 	 * alerting(1)
2985 	 */
2986 	u_int8_t call_status;
2987 };
2988 
2989 /*
2990  * CTUpdateArg ::= SEQUENCE {
2991  *     redirectionNumber       PresentedNumberScreened,
2992  *     redirectionName         Name OPTIONAL,
2993  *
2994  *     -- ISO/IEC 11572 information elements Party
2995  *     -- category and Progress indicator are conveyed
2996  *     basicCallInfoElements   PSS1InformationElement OPTIONAL,
2997  *     argumentExtension       CHOICE {
2998  *         [9] IMPLICIT Extension,
2999  *         [10] IMPLICIT SEQUENCE OF Extension
3000  *     } OPTIONAL
3001  * }
3002  */
3003 struct roseQsigCTUpdateArg_ARG {
3004 	/*! \brief redirectionNumber */
3005 	struct rosePresentedNumberScreened redirection;
3006 
3007 	/*! \brief basicCallInfoElements (optional) */
3008 	struct roseQ931ie q931ie;
3009 	/*! \brief q931ie.contents "allocated" after the stucture. */
3010 	unsigned char q931ie_contents[ROSE_Q931_MAX_PROGRESS + 1];
3011 
3012 	/*! \brief redirectionName (optional) */
3013 	struct roseQsigName redirection_name;
3014 
3015 	/*! \brief TRUE if redirection_name is present */
3016 	u_int8_t redirection_name_present;
3017 };
3018 
3019 /*
3020  * SubaddressTransferArg ::= SEQUENCE {
3021  *     redirectionSubaddress   PartySubaddress,
3022  *     argumentExtension       CHOICE {
3023  *         [0] IMPLICIT Extension,
3024  *         [1] IMPLICIT SEQUENCE OF Extension
3025  *     } OPTIONAL
3026  * }
3027  */
3028 struct roseQsigSubaddressTransferArg_ARG {
3029 	struct rosePartySubaddress redirection_subaddress;
3030 };
3031 
3032 
3033 /* ------------------------------------------------------------------- */
3034 
3035 
3036 /*
3037  * IntResult ::= SEQUENCE {
3038  *     servedUserNr        PartyNumber,
3039  *     basicService        BasicService,
3040  *     procedure           Procedure,
3041  *     divertedToAddress   Address,
3042  *     remoteEnabled       BOOLEAN DEFAULT FALSE,
3043  *     extension           CHOICE {
3044  *         [1] IMPLICIT Extension,
3045  *         [2] IMPLICIT SEQUENCE OF Extension
3046  *     } OPTIONAL
3047  * }
3048  */
3049 struct roseQsigForwardingRecord {
3050 	/*! \brief Diverted to address */
3051 	struct roseAddress diverted_to;
3052 
3053 	struct rosePartyNumber served_user_number;
3054 
3055 	/*!
3056 	 * \details
3057 	 * allServices(0),
3058 	 * speech(1),
3059 	 * unrestrictedDigitalInformation(2),
3060 	 * audio3100Hz(3),
3061 	 * telephony(32),
3062 	 * teletex(33),
3063 	 * telefaxGroup4Class1(34),
3064 	 * videotexSyntaxBased(35),
3065 	 * videotelephony(36)
3066 	 */
3067 	u_int8_t basic_service;
3068 
3069 	/*! \details cfu(0), cfb(1), cfnr(2) */
3070 	u_int8_t procedure;
3071 
3072 	/*! \brief remoteEnabled BOOLEAN DEFAULT FALSE */
3073 	u_int8_t remote_enabled;
3074 };
3075 
3076 /*
3077  * roseQsigInterrogateDiversionQ_REQ
3078  * IntResultList ::= SET SIZE (0..29) OF IntResult
3079  */
3080 struct roseQsigForwardingList {
3081 	/*!
3082 	 * \brief SET SIZE (0..29) OF Forwarding Records
3083 	 * \note Reduced the size of the array to conserve
3084 	 * potential stack usage.
3085 	 */
3086 	struct roseQsigForwardingRecord list[10];
3087 
3088 	/*! \brief Number of Forwarding records present */
3089 	u_int8_t num_records;
3090 };
3091 
3092 /*
3093  * ARGUMENT SEQUENCE {
3094  *     procedure           Procedure,
3095  *     basicService        BasicService,
3096  *     divertedToAddress   Address,
3097  *     servedUserNr        PartyNumber,
3098  *     activatingUserNr    PartyNumber,
3099  *     extension           CHOICE {
3100  *         [1] IMPLICIT Extension,
3101  *         [2] IMPLICIT SEQUENCE OF Extension
3102  *     } OPTIONAL
3103  * }
3104  */
3105 struct roseQsigActivateDiversionQ_ARG {
3106 	/*! \brief divertedToAddress */
3107 	struct roseAddress diverted_to;
3108 
3109 	struct rosePartyNumber served_user_number;
3110 	struct rosePartyNumber activating_user_number;
3111 
3112 	/*! \details cfu(0), cfb(1), cfnr(2) */
3113 	u_int8_t procedure;
3114 
3115 	/*!
3116 	 * \details
3117 	 * allServices(0),
3118 	 * speech(1),
3119 	 * unrestrictedDigitalInformation(2),
3120 	 * audio3100Hz(3),
3121 	 * telephony(32),
3122 	 * teletex(33),
3123 	 * telefaxGroup4Class1(34),
3124 	 * videotexSyntaxBased(35),
3125 	 * videotelephony(36)
3126 	 */
3127 	u_int8_t basic_service;
3128 };
3129 
3130 /*
3131  * ARGUMENT SEQUENCE {
3132  *     procedure           Procedure,
3133  *     basicService        BasicService,
3134  *     servedUserNr        PartyNumber,
3135  *     deactivatingUserNr  PartyNumber,
3136  *     extension           CHOICE {
3137  *         [1] IMPLICIT Extension,
3138  *         [2] IMPLICIT SEQUENCE OF Extension
3139  *     } OPTIONAL
3140  * }
3141  */
3142 struct roseQsigDeactivateDiversionQ_ARG {
3143 	struct rosePartyNumber served_user_number;
3144 	struct rosePartyNumber deactivating_user_number;
3145 
3146 	/*! \details cfu(0), cfb(1), cfnr(2) */
3147 	u_int8_t procedure;
3148 
3149 	/*!
3150 	 * \details
3151 	 * allServices(0),
3152 	 * speech(1),
3153 	 * unrestrictedDigitalInformation(2),
3154 	 * audio3100Hz(3),
3155 	 * telephony(32),
3156 	 * teletex(33),
3157 	 * telefaxGroup4Class1(34),
3158 	 * videotexSyntaxBased(35),
3159 	 * videotelephony(36)
3160 	 */
3161 	u_int8_t basic_service;
3162 };
3163 
3164 /*
3165  * ARGUMENT SEQUENCE {
3166  *     procedure           Procedure,
3167  *     basicService        BasicService DEFAULT allServices,
3168  *     servedUserNr        PartyNumber,
3169  *     interrogatingUserNr PartyNumber,
3170  *     extension           CHOICE {
3171  *         [1] IMPLICIT Extension,
3172  *         [2] IMPLICIT SEQUENCE OF Extension
3173  *     } OPTIONAL
3174  * }
3175  */
3176 struct roseQsigInterrogateDiversionQ_ARG {
3177 	struct rosePartyNumber served_user_number;
3178 	struct rosePartyNumber interrogating_user_number;
3179 
3180 	/*! \details cfu(0), cfb(1), cfnr(2) */
3181 	u_int8_t procedure;
3182 
3183 	/*!
3184 	 * \details
3185 	 * DEFAULT allServices
3186 	 *
3187 	 * \details
3188 	 * allServices(0),
3189 	 * speech(1),
3190 	 * unrestrictedDigitalInformation(2),
3191 	 * audio3100Hz(3),
3192 	 * telephony(32),
3193 	 * teletex(33),
3194 	 * telefaxGroup4Class1(34),
3195 	 * videotexSyntaxBased(35),
3196 	 * videotelephony(36)
3197 	 */
3198 	u_int8_t basic_service;
3199 };
3200 
3201 /*
3202  * ARGUMENT SEQUENCE {
3203  *     servedUserNr        PartyNumber,
3204  *     basicService        BasicService,
3205  *     divertedToNr        PartyNumber,
3206  *     extension           CHOICE {
3207  *         [1] IMPLICIT Extension,
3208  *         [2] IMPLICIT SEQUENCE OF Extension
3209  *     } OPTIONAL
3210  * }
3211  */
3212 struct roseQsigCheckRestriction_ARG {
3213 	struct rosePartyNumber served_user_number;
3214 	struct rosePartyNumber diverted_to_number;
3215 
3216 	/*!
3217 	 * \details
3218 	 * allServices(0),
3219 	 * speech(1),
3220 	 * unrestrictedDigitalInformation(2),
3221 	 * audio3100Hz(3),
3222 	 * telephony(32),
3223 	 * teletex(33),
3224 	 * telefaxGroup4Class1(34),
3225 	 * videotexSyntaxBased(35),
3226 	 * videotelephony(36)
3227 	 */
3228 	u_int8_t basic_service;
3229 };
3230 
3231 /*
3232  * ARGUMENT SEQUENCE {
3233  *     reroutingReason             DiversionReason,
3234  *     originalReroutingReason     [0] IMPLICIT DiversionReason OPTIONAL,
3235  *     calledAddress               Address,
3236  *     diversionCounter            INTEGER (1..15),
3237  *
3238  *     -- The basic call information elements Bearer capability,
3239  *     -- High layer compatibility, Low layer compatibity
3240  *     -- and Progress indicator can be embedded in the
3241  *     -- pSS1InfoElement in accordance with 6.5.3.1.5.
3242  *     pSS1InfoElement             PSS1InformationElement,
3243  *     lastReroutingNr             [1] EXPLICIT PresentedNumberUnscreened,
3244  *     subscriptionOption          [2] IMPLICIT SubscriptionOption,
3245  *     callingPartySubaddress      [3] EXPLICIT PartySubaddress OPTIONAL,
3246  *     callingNumber               [4] EXPLICIT PresentedNumberScreened,
3247  *     callingName                 [5] EXPLICIT Name OPTIONAL,
3248  *     originalCalledNr            [6] EXPLICIT PresentedNumberUnscreened OPTIONAL,
3249  *     redirectingName             [7] EXPLICIT Name OPTIONAL,
3250  *     originalCalledName          [8] EXPLICIT Name OPTIONAL,
3251  *     extension                   CHOICE {
3252  *         [9] IMPLICIT Extension,
3253  *         [10] IMPLICIT SEQUENCE OF Extension
3254  *     } OPTIONAL
3255  * }
3256  */
3257 struct roseQsigCallRerouting_ARG {
3258 	/*! \brief calledAddress */
3259 	struct roseAddress called;
3260 
3261 	/*! \brief lastReroutingNr */
3262 	struct rosePresentedNumberUnscreened last_rerouting;
3263 
3264 	/*! \brief originalCalledNr (optional) */
3265 	struct rosePresentedNumberUnscreened original_called;
3266 
3267 	/*!
3268 	 * \brief callingPartySubaddress (optional)
3269 	 * The subaddress is present if the length is nonzero.
3270 	 */
3271 	struct rosePartySubaddress calling_subaddress;
3272 
3273 	/*! \brief callingNumber */
3274 	struct rosePresentedNumberScreened calling;
3275 
3276 	/*! \brief callingName (optional) */
3277 	struct roseQsigName calling_name;
3278 
3279 	/*! \brief redirectingName (optional) */
3280 	struct roseQsigName redirecting_name;
3281 
3282 	/*! \brief originalCalledName (optional) */
3283 	struct roseQsigName original_called_name;
3284 
3285 	/*!
3286 	 * \brief The BC, HLC (optional), LLC (optional),
3287 	 * and progress indicator(s) information.
3288 	 */
3289 	struct roseQ931ie q931ie;
3290 	/*! \brief q931ie.contents "allocated" after the stucture. */
3291 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
3292 		ROSE_Q931_MAX_LLC + ROSE_Q931_MAX_PROGRESS + 1];
3293 
3294 	/*! \brief TRUE if calling_name is present */
3295 	u_int8_t calling_name_present;
3296 
3297 	/*! \brief TRUE if redirecting_name is present */
3298 	u_int8_t redirecting_name_present;
3299 
3300 	/*! \brief TRUE if original_called_name is present */
3301 	u_int8_t original_called_name_present;
3302 
3303 	/*! \brief TRUE if original_called number is present */
3304 	u_int8_t original_called_present;
3305 
3306 	/*!
3307 	 * \details
3308 	 * unknown(0),
3309 	 * cfu(1),
3310 	 * cfb(2),
3311 	 * cfnr(3)
3312 	 *
3313 	 * \note The value unknown is only used if received from
3314 	 * another network when interworking.
3315 	 */
3316 	u_int8_t rerouting_reason;
3317 
3318 	/*!
3319 	 * \brief originalReroutingReason (optional)
3320 	 *
3321 	 * \details
3322 	 * unknown(0),
3323 	 * cfu(1),
3324 	 * cfb(2),
3325 	 * cfnr(3)
3326 	 *
3327 	 * \note The value unknown is only used if received from
3328 	 * another network when interworking.
3329 	 */
3330 	u_int8_t original_rerouting_reason;
3331 
3332 	/*! \brief TRUE if original_rerouting_reason is present */
3333 	u_int8_t original_rerouting_reason_present;
3334 
3335 	/*! \brief diversionCounter INTEGER (1..15) */
3336 	u_int8_t diversion_counter;
3337 
3338 	/*!
3339 	 * \brief subscriptionOption
3340 	 *
3341 	 * \details
3342 	 * noNotification(0),
3343 	 * notificationWithoutDivertedToNr(1),
3344 	 * notificationWithDivertedToNr(2)
3345 	 */
3346 	u_int8_t subscription_option;
3347 };
3348 
3349 /*
3350  * ARGUMENT SEQUENCE {
3351  *     diversionReason     DiversionReason,
3352  *     subscriptionOption  SubscriptionOption,
3353  *     nominatedNr         PartyNumber,
3354  *     extension           CHOICE {
3355  *         [9] IMPLICIT Extension,
3356  *         [10] IMPLICIT SEQUENCE OF Extension
3357  *     } OPTIONAL
3358  * }
3359  */
3360 struct roseQsigDivertingLegInformation1_ARG {
3361 	struct rosePartyNumber nominated_number;
3362 
3363 	/*!
3364 	 * \details
3365 	 * unknown(0),
3366 	 * cfu(1),
3367 	 * cfb(2),
3368 	 * cfnr(3)
3369 	 *
3370 	 * \note The value unknown is only used if received from
3371 	 * another network when interworking.
3372 	 */
3373 	u_int8_t diversion_reason;
3374 
3375 	/*!
3376 	 * \brief subscriptionOption
3377 	 *
3378 	 * \details
3379 	 * noNotification(0),
3380 	 * notificationWithoutDivertedToNr(1),
3381 	 * notificationWithDivertedToNr(2)
3382 	 */
3383 	u_int8_t subscription_option;
3384 };
3385 
3386 /*
3387  * ARGUMENT SEQUENCE {
3388  *     diversionCounter             INTEGER (1..15),
3389  *     diversionReason              DiversionReason,
3390  *     originalDiversionReason      [0] IMPLICIT DiversionReason OPTIONAL,
3391  *
3392  *     -- The divertingNr element is mandatory except in the case
3393  *     -- of interworking.
3394  *     divertingNr                  [1] EXPLICIT PresentedNumberUnscreened OPTIONAL,
3395  *     originalCalledNr             [2] EXPLICIT PresentedNumberUnscreened OPTIONAL,
3396  *     redirectingName              [3] EXPLICIT Name OPTIONAL,
3397  *     originalCalledName           [4] EXPLICIT Name OPTIONAL,
3398  *     extension                    CHOICE {
3399  *         [5] IMPLICIT Extension,
3400  *         [6] IMPLICIT SEQUENCE OF Extension
3401  *     } OPTIONAL
3402  * }
3403  */
3404 struct roseQsigDivertingLegInformation2_ARG {
3405 	/*! \brief divertingNr (optional) */
3406 	struct rosePresentedNumberUnscreened diverting;
3407 
3408 	/*! \brief originalCalledNr (optional) */
3409 	struct rosePresentedNumberUnscreened original_called;
3410 
3411 	/*! \brief redirectingName (optional) */
3412 	struct roseQsigName redirecting_name;
3413 
3414 	/*! \brief originalCalledName (optional) */
3415 	struct roseQsigName original_called_name;
3416 
3417 	/*! \brief diversionCounter INTEGER (1..15) */
3418 	u_int8_t diversion_counter;
3419 
3420 	/*!
3421 	 * \details
3422 	 * unknown(0),
3423 	 * cfu(1),
3424 	 * cfb(2),
3425 	 * cfnr(3)
3426 	 *
3427 	 * \note The value unknown is only used if received from
3428 	 * another network when interworking.
3429 	 */
3430 	u_int8_t diversion_reason;
3431 
3432 	/*!
3433 	 * \brief originalDiversionReason (optional)
3434 	 *
3435 	 * \details
3436 	 * unknown(0),
3437 	 * cfu(1),
3438 	 * cfb(2),
3439 	 * cfnr(3)
3440 	 *
3441 	 * \note The value unknown is only used if received from
3442 	 * another network when interworking.
3443 	 */
3444 	u_int8_t original_diversion_reason;
3445 
3446 	/*! \brief TRUE if original_diversion_reason is present */
3447 	u_int8_t original_diversion_reason_present;
3448 
3449 	/*! \brief TRUE if diverting number is present */
3450 	u_int8_t diverting_present;
3451 
3452 	/*! \brief TRUE if original_called number is present */
3453 	u_int8_t original_called_present;
3454 
3455 	/*! \brief TRUE if redirecting_name is present */
3456 	u_int8_t redirecting_name_present;
3457 
3458 	/*! \brief TRUE if original_called_name is present */
3459 	u_int8_t original_called_name_present;
3460 };
3461 
3462 /*
3463  * ARGUMENT SEQUENCE {
3464  *     presentationAllowedIndicator    PresentationAllowedIndicator, -- BOOLEAN
3465  *     redirectionName                 [0] EXPLICIT Name OPTIONAL,
3466  *     extension                       CHOICE {
3467  *         [1] IMPLICIT Extension,
3468  *         [2] IMPLICIT SEQUENCE OF Extension
3469  *     } OPTIONAL
3470  * }
3471  */
3472 struct roseQsigDivertingLegInformation3_ARG {
3473 	/*! \brief redirectionName (optional) */
3474 	struct roseQsigName redirection_name;
3475 
3476 	/*! \brief TRUE if redirection_name is present */
3477 	u_int8_t redirection_name_present;
3478 
3479 	/*! \brief TRUE if presentation is allowed */
3480 	u_int8_t presentation_allowed_indicator;
3481 };
3482 
3483 
3484 /* ------------------------------------------------------------------- */
3485 
3486 
3487 /*
3488  * CcExtension ::= CHOICE {
3489  *     none        NULL,
3490  *     single      [14] IMPLICIT Extension,
3491  *     multiple    [15] IMPLICIT SEQUENCE OF Extension
3492  * }
3493  */
3494 
3495 /*
3496  * CcRequestArg ::= SEQUENCE {
3497  *     numberA                 PresentedNumberUnscreened,
3498  *     numberB                 PartyNumber,
3499  *
3500  *     -- permitted information elements are:
3501  *     -- Bearer capability;
3502  *     -- Low layer compatibility;
3503  *     -- High layer compatibility
3504  *     service                 PSS1InformationElement,
3505  *     subaddrA                [10] EXPLICIT PartySubaddress OPTIONAL,
3506  *     subaddrB                [11] EXPLICIT PartySubaddress OPTIONAL,
3507  *     can-retain-service      [12] IMPLICIT BOOLEAN DEFAULT FALSE,
3508  *
3509  *     -- TRUE: signalling connection to be retained;
3510  *     -- FALSE: signalling connection to be released;
3511  *     -- omission: release or retain signalling connection
3512  *     retain-sig-connection   [13] IMPLICIT BOOLEAN OPTIONAL,
3513  *     extension               CcExtension OPTIONAL
3514  * }
3515  */
3516 struct roseQsigCcRequestArg {
3517 	struct rosePresentedNumberUnscreened number_a;
3518 	struct rosePartyNumber number_b;
3519 
3520 	/*!
3521 	 * \brief subaddrA (optional)
3522 	 * The subaddress is present if the length is nonzero.
3523 	 */
3524 	struct rosePartySubaddress subaddr_a;
3525 
3526 	/*!
3527 	 * \brief subaddrB (optional)
3528 	 * The subaddress is present if the length is nonzero.
3529 	 */
3530 	struct rosePartySubaddress subaddr_b;
3531 
3532 	/*!
3533 	 * \brief The BC, HLC (optional) and LLC (optional) information.
3534 	 * \note The ASN.1 field name is service.
3535 	 */
3536 	struct roseQ931ie q931ie;
3537 	/*! \brief q931ie.contents "allocated" after the stucture. */
3538 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
3539 		ROSE_Q931_MAX_LLC + 1];
3540 
3541 	/*! \brief TRUE if can retain service (DEFAULT FALSE) */
3542 	u_int8_t can_retain_service;
3543 
3544 	/*!
3545 	 * \brief TRUE if retain_sig_connection present
3546 	 * \note If not present then the signaling connection could be
3547 	 * released or retained.
3548 	 */
3549 	u_int8_t retain_sig_connection_present;
3550 
3551 	/*!
3552 	 * \brief Determine if the signalling connection should be retained.
3553 	 * \note TRUE if signalling connection to be retained.
3554 	 * \note FALSE if signalling connection to be released.
3555 	 */
3556 	u_int8_t retain_sig_connection;
3557 };
3558 
3559 /*
3560  * CcRequestRes ::= SEQUENCE {
3561  *     no-path-reservation     [0] IMPLICIT BOOLEAN DEFAULT FALSE,
3562  *     retain-service          [1] IMPLICIT BOOLEAN DEFAULT FALSE,
3563  *     extension               CcExtension OPTIONAL
3564  * }
3565  */
3566 struct roseQsigCcRequestRes {
3567 	/*! \brief TRUE if no path reservation. (DEFAULT FALSE) */
3568 	u_int8_t no_path_reservation;
3569 
3570 	/*! \brief TRUE if agree to retain service (DEFAULT FALSE) */
3571 	u_int8_t retain_service;
3572 };
3573 
3574 /*
3575  * CcOptionalArg ::= CHOICE {
3576  *     fullArg                 [0] IMPLICIT SEQUENCE {
3577  *         numberA             PartyNumber,
3578  *         numberB             PartyNumber,
3579  *
3580  *         -- permitted information elements are:
3581  *         -- Bearer capability;
3582  *         -- Low layer compatibility;
3583  *         -- High layer compatibility.
3584  *         service             PSS1InformationElement,
3585  *         subaddrA            [10] EXPLICIT PartySubaddress OPTIONAL,
3586  *         subaddrB            [11] EXPLICIT PartySubaddress OPTIONAL,
3587  *         extension           CcExtension OPTIONAL
3588  *     },
3589  *     extArg                  CcExtension
3590  * }
3591  */
3592 struct roseQsigCcOptionalArg {
3593 #if 1	/* The conditional is here to indicate fullArg values grouping. */
3594 	struct rosePartyNumber number_a;
3595 	struct rosePartyNumber number_b;
3596 
3597 	/*!
3598 	 * \brief subaddrA (optional)
3599 	 * The subaddress is present if the length is nonzero.
3600 	 */
3601 	struct rosePartySubaddress subaddr_a;
3602 
3603 	/*!
3604 	 * \brief subaddrB (optional)
3605 	 * The subaddress is present if the length is nonzero.
3606 	 */
3607 	struct rosePartySubaddress subaddr_b;
3608 
3609 	/*!
3610 	 * \brief The BC, HLC (optional) and LLC (optional) information.
3611 	 * \note The ASN.1 field name is service.
3612 	 */
3613 	struct roseQ931ie q931ie;
3614 	/*! \brief q931ie.contents "allocated" after the stucture. */
3615 	unsigned char q931ie_contents[ROSE_Q931_MAX_BC + ROSE_Q931_MAX_HLC +
3616 		ROSE_Q931_MAX_LLC + 1];
3617 #endif	/* end fullArg values */
3618 
3619 	/*! \brief TRUE if the fullArg values are present. */
3620 	u_int8_t full_arg_present;
3621 };
3622 
3623 
3624 /* ------------------------------------------------------------------- */
3625 
3626 
3627 /*
3628  * MsgCentreId ::= CHOICE {
3629  *     integer         [0] IMPLICIT INTEGER (0..65535),
3630  *
3631  *     -- The party number must be a complete number as required
3632  *     -- for routing purposes.
3633  *     partyNumber     [1] EXPLICIT PartyNumber,
3634  *     numericString   [2] IMPLICIT NumericString (SIZE (1..10))
3635  * }
3636  */
3637 struct roseQsigMsgCentreId {
3638 	union {
3639 		/*! \brief INTEGER (0..65535) */
3640 		u_int16_t integer;
3641 
3642 		/*!
3643 		 * \note The party number must be a complete number as required
3644 		 * for routing purposes.
3645 		 */
3646 		struct rosePartyNumber number;
3647 
3648 		/*! \brief NumericString (SIZE (1..10)) */
3649 		unsigned char str[10 + 1];
3650 	} u;
3651 
3652 	/*!
3653 	 * \details
3654 	 * integer(0),
3655 	 * partyNumber(1),
3656 	 * numericString(2)
3657 	 */
3658 	u_int8_t type;
3659 };
3660 
3661 /*
3662  * MWIActivateArg ::= SEQUENCE {
3663  *     servedUserNr            PartyNumber,
3664  *     basicService            BasicService,
3665  *     msgCentreId             MsgCentreId OPTIONAL,
3666  *     nbOfMessages            [3] IMPLICIT NbOfMessages OPTIONAL,
3667  *     originatingNr           [4] EXPLICIT PartyNumber OPTIONAL,
3668  *     timestamp               TimeStamp OPTIONAL,
3669  *
3670  *     -- The value 0 means the highest priority and 9 the lowest
3671  *     priority                [5] IMPLICIT INTEGER (0..9) OPTIONAL,
3672  *     argumentExt             CHOICE {
3673  *         extension           [6] IMPLICIT Extension,
3674  *         multipleExtension   [7] IMPLICIT SEQUENCE OF Extension
3675  *     } OPTIONAL
3676  * }
3677  */
3678 struct roseQsigMWIActivateArg {
3679 	/*! \brief NbOfMessages ::= INTEGER (0..65535) (optional) */
3680 	u_int16_t number_of_messages;
3681 
3682 	/*! \brief msgCentreId (optional) */
3683 	struct roseQsigMsgCentreId msg_centre_id;
3684 
3685 	struct rosePartyNumber served_user_number;
3686 
3687 	/*! \brief originatingNr (optional) (Number present if length is nonzero) */
3688 	struct rosePartyNumber originating_number;
3689 
3690 	/*! \brief GeneralizedTime (SIZE (12..19)) (optional) */
3691 	struct roseGeneralizedTime timestamp;
3692 
3693 	/*!
3694 	 * \details
3695 	 * allServices(0),
3696 	 * speech(1),
3697 	 * unrestrictedDigitalInformation(2),
3698 	 * audio3100Hz(3),
3699 	 * telephony(32),
3700 	 * teletex(33),
3701 	 * telefaxGroup4Class1(34),
3702 	 * videotextSyntaxBased(35),
3703 	 * videotelephony(36),
3704 	 * telefaxGroup2-3(37),
3705 	 * reservedNotUsed1(38),
3706 	 * reservedNotUsed2(39),
3707 	 * reservedNotUsed3(40),
3708 	 * reservedNotUsed4(41),
3709 	 * reservedNotUsed5(42),
3710 	 * email(51),
3711 	 * video(52),
3712 	 * fileTransfer(53),
3713 	 * shortMessageService(54),
3714 	 * speechAndVideo(55),
3715 	 * speechAndFax(56),
3716 	 * speechAndEmail(57),
3717 	 * videoAndFax(58),
3718 	 * videoAndEmail(59),
3719 	 * faxAndEmail(60),
3720 	 * speechVideoAndFax(61),
3721 	 * speechVideoAndEmail(62),
3722 	 * speechFaxAndEmail(63),
3723 	 * videoFaxAndEmail(64),
3724 	 * speechVideoFaxAndEmail(65),
3725 	 * multimediaUnknown(66),
3726 	 * serviceUnknown(67),
3727 	 * futureReserve1(68),
3728 	 * futureReserve2(69),
3729 	 * futureReserve3(70),
3730 	 * futureReserve4(71),
3731 	 * futureReserve5(72),
3732 	 * futureReserve6(73),
3733 	 * futureReserve7(74),
3734 	 * futureReserve8(75)
3735 	 */
3736 	u_int8_t basic_service;
3737 
3738 	/*!
3739 	 * \brief INTEGER (0..9) (optional)
3740 	 * \note The value 0 means the highest priority and 9 the lowest.
3741 	 */
3742 	u_int8_t priority;
3743 
3744 	/*! \brief TRUE if msg_centre_id is present */
3745 	u_int8_t msg_centre_id_present;
3746 
3747 	/*! \brief TRUE if number_of_messages is present */
3748 	u_int8_t number_of_messages_present;
3749 
3750 	/*! \brief TRUE if timestamp is present */
3751 	u_int8_t timestamp_present;
3752 
3753 	/*! \brief TRUE if priority is present */
3754 	u_int8_t priority_present;
3755 };
3756 
3757 /*
3758  * MWIDeactivateArg ::= SEQUENCE {
3759  *     servedUserNr            PartyNumber,
3760  *     basicService            BasicService,
3761  *     msgCentreId             MsgCentreId OPTIONAL,
3762  *     argumentExt             CHOICE {
3763  *         extension           [3] IMPLICIT Extension,
3764  *         multipleExtension   [4] IMPLICIT SEQUENCE OF Extension
3765  *     } OPTIONAL
3766  * }
3767  */
3768 struct roseQsigMWIDeactivateArg {
3769 	/*! \brief msgCentreId (optional) */
3770 	struct roseQsigMsgCentreId msg_centre_id;
3771 
3772 	struct rosePartyNumber served_user_number;
3773 
3774 	/*!
3775 	 * \details
3776 	 * allServices(0),
3777 	 * speech(1),
3778 	 * unrestrictedDigitalInformation(2),
3779 	 * audio3100Hz(3),
3780 	 * telephony(32),
3781 	 * teletex(33),
3782 	 * telefaxGroup4Class1(34),
3783 	 * videotextSyntaxBased(35),
3784 	 * videotelephony(36),
3785 	 * telefaxGroup2-3(37),
3786 	 * reservedNotUsed1(38),
3787 	 * reservedNotUsed2(39),
3788 	 * reservedNotUsed3(40),
3789 	 * reservedNotUsed4(41),
3790 	 * reservedNotUsed5(42),
3791 	 * email(51),
3792 	 * video(52),
3793 	 * fileTransfer(53),
3794 	 * shortMessageService(54),
3795 	 * speechAndVideo(55),
3796 	 * speechAndFax(56),
3797 	 * speechAndEmail(57),
3798 	 * videoAndFax(58),
3799 	 * videoAndEmail(59),
3800 	 * faxAndEmail(60),
3801 	 * speechVideoAndFax(61),
3802 	 * speechVideoAndEmail(62),
3803 	 * speechFaxAndEmail(63),
3804 	 * videoFaxAndEmail(64),
3805 	 * speechVideoFaxAndEmail(65),
3806 	 * multimediaUnknown(66),
3807 	 * serviceUnknown(67),
3808 	 * futureReserve1(68),
3809 	 * futureReserve2(69),
3810 	 * futureReserve3(70),
3811 	 * futureReserve4(71),
3812 	 * futureReserve5(72),
3813 	 * futureReserve6(73),
3814 	 * futureReserve7(74),
3815 	 * futureReserve8(75)
3816 	 */
3817 	u_int8_t basic_service;
3818 
3819 	/*! \brief TRUE if msg_centre_id is present */
3820 	u_int8_t msg_centre_id_present;
3821 };
3822 
3823 /*
3824  * MWIInterrogateArg ::= SEQUENCE {
3825  *     servedUserNr            PartyNumber,
3826  *     basicService            BasicService,
3827  *     msgCentreId             MsgCentreId OPTIONAL,
3828  *     argumentExt             CHOICE {
3829  *         extension           [3] IMPLICIT Extension,
3830  *         multipleExtension   [4] IMPLICIT SEQUENCE OF Extension
3831  *     } OPTIONAL
3832  * }
3833  */
3834 struct roseQsigMWIInterrogateArg {
3835 	/*! \brief msgCentreId (optional) */
3836 	struct roseQsigMsgCentreId msg_centre_id;
3837 
3838 	struct rosePartyNumber served_user_number;
3839 
3840 	/*!
3841 	 * \details
3842 	 * allServices(0),
3843 	 * speech(1),
3844 	 * unrestrictedDigitalInformation(2),
3845 	 * audio3100Hz(3),
3846 	 * telephony(32),
3847 	 * teletex(33),
3848 	 * telefaxGroup4Class1(34),
3849 	 * videotextSyntaxBased(35),
3850 	 * videotelephony(36),
3851 	 * telefaxGroup2-3(37),
3852 	 * reservedNotUsed1(38),
3853 	 * reservedNotUsed2(39),
3854 	 * reservedNotUsed3(40),
3855 	 * reservedNotUsed4(41),
3856 	 * reservedNotUsed5(42),
3857 	 * email(51),
3858 	 * video(52),
3859 	 * fileTransfer(53),
3860 	 * shortMessageService(54),
3861 	 * speechAndVideo(55),
3862 	 * speechAndFax(56),
3863 	 * speechAndEmail(57),
3864 	 * videoAndFax(58),
3865 	 * videoAndEmail(59),
3866 	 * faxAndEmail(60),
3867 	 * speechVideoAndFax(61),
3868 	 * speechVideoAndEmail(62),
3869 	 * speechFaxAndEmail(63),
3870 	 * videoFaxAndEmail(64),
3871 	 * speechVideoFaxAndEmail(65),
3872 	 * multimediaUnknown(66),
3873 	 * serviceUnknown(67),
3874 	 * futureReserve1(68),
3875 	 * futureReserve2(69),
3876 	 * futureReserve3(70),
3877 	 * futureReserve4(71),
3878 	 * futureReserve5(72),
3879 	 * futureReserve6(73),
3880 	 * futureReserve7(74),
3881 	 * futureReserve8(75)
3882 	 */
3883 	u_int8_t basic_service;
3884 
3885 	/*! \brief TRUE if msg_centre_id is present */
3886 	u_int8_t msg_centre_id_present;
3887 };
3888 
3889 /*
3890  * MWIInterrogateResElt ::= SEQUENCE {
3891  *     basicService            BasicService,
3892  *     msgCentreId             MsgCentreId OPTIONAL,
3893  *     nbOfMessages            [3] IMPLICIT NbOfMessages OPTIONAL,
3894  *     originatingNr           [4] EXPLICIT PartyNumber OPTIONAL,
3895  *     timestamp               TimeStamp OPTIONAL,
3896  *
3897  *     -- The value 0 means the highest priority and 9 the lowest
3898  *     priority                [5] IMPLICIT INTEGER (0..9) OPTIONAL,
3899  *     argumentExt             CHOICE {
3900  *         extension           [6] IMPLICIT Extension,
3901  *         multipleExtension   [7] IMPLICIT SEQUENCE OF Extension
3902  *     } OPTIONAL
3903  * }
3904  */
3905 struct roseQsigMWIInterrogateResElt {
3906 	/*! \brief NbOfMessages ::= INTEGER (0..65535) (optional) */
3907 	u_int16_t number_of_messages;
3908 
3909 	/*! \brief msgCentreId (optional) */
3910 	struct roseQsigMsgCentreId msg_centre_id;
3911 
3912 	/*! \brief originatingNr (optional) (Number present if length is nonzero) */
3913 	struct rosePartyNumber originating_number;
3914 
3915 	/*! \brief GeneralizedTime (SIZE (12..19)) (optional) */
3916 	struct roseGeneralizedTime timestamp;
3917 
3918 	/*!
3919 	 * \details
3920 	 * allServices(0),
3921 	 * speech(1),
3922 	 * unrestrictedDigitalInformation(2),
3923 	 * audio3100Hz(3),
3924 	 * telephony(32),
3925 	 * teletex(33),
3926 	 * telefaxGroup4Class1(34),
3927 	 * videotextSyntaxBased(35),
3928 	 * videotelephony(36),
3929 	 * telefaxGroup2-3(37),
3930 	 * reservedNotUsed1(38),
3931 	 * reservedNotUsed2(39),
3932 	 * reservedNotUsed3(40),
3933 	 * reservedNotUsed4(41),
3934 	 * reservedNotUsed5(42),
3935 	 * email(51),
3936 	 * video(52),
3937 	 * fileTransfer(53),
3938 	 * shortMessageService(54),
3939 	 * speechAndVideo(55),
3940 	 * speechAndFax(56),
3941 	 * speechAndEmail(57),
3942 	 * videoAndFax(58),
3943 	 * videoAndEmail(59),
3944 	 * faxAndEmail(60),
3945 	 * speechVideoAndFax(61),
3946 	 * speechVideoAndEmail(62),
3947 	 * speechFaxAndEmail(63),
3948 	 * videoFaxAndEmail(64),
3949 	 * speechVideoFaxAndEmail(65),
3950 	 * multimediaUnknown(66),
3951 	 * serviceUnknown(67),
3952 	 * futureReserve1(68),
3953 	 * futureReserve2(69),
3954 	 * futureReserve3(70),
3955 	 * futureReserve4(71),
3956 	 * futureReserve5(72),
3957 	 * futureReserve6(73),
3958 	 * futureReserve7(74),
3959 	 * futureReserve8(75)
3960 	 */
3961 	u_int8_t basic_service;
3962 
3963 	/*!
3964 	 * \brief INTEGER (0..9) (optional)
3965 	 * \note The value 0 means the highest priority and 9 the lowest.
3966 	 */
3967 	u_int8_t priority;
3968 
3969 	/*! \brief TRUE if msg_centre_id is present */
3970 	u_int8_t msg_centre_id_present;
3971 
3972 	/*! \brief TRUE if number_of_messages is present */
3973 	u_int8_t number_of_messages_present;
3974 
3975 	/*! \brief TRUE if timestamp is present */
3976 	u_int8_t timestamp_present;
3977 
3978 	/*! \brief TRUE if priority is present */
3979 	u_int8_t priority_present;
3980 };
3981 
3982 /*
3983  * MWIInterrogateRes ::= SEQUENCE SIZE(1..10) OF MWIInterrogateResElt
3984  */
3985 struct roseQsigMWIInterrogateRes {
3986 	/*! \brief SEQUENCE SIZE(1..10) OF MWIInterrogateResElt */
3987 	struct roseQsigMWIInterrogateResElt list[10];
3988 
3989 	/*! \brief Number of MWIInterrogateResElt records present */
3990 	u_int8_t num_records;
3991 };
3992 
3993 
3994 /* ------------------------------------------------------------------- */
3995 
3996 
3997 /*
3998  * Northern Telecom DMS-100 transfer ability result
3999  *
4000  * callId [0] IMPLICIT INTEGER (0..16777215) -- 24 bit number
4001  */
4002 struct roseDms100RLTOperationInd_RES {
4003 	/*! INTEGER (0..16777215) -- 24 bit number */
4004 	u_int32_t call_id;
4005 };
4006 
4007 /*
4008  * Northern Telecom DMS-100 transfer invoke
4009  *
4010  * ARGUMENT SEQUENCE {
4011  *     callId [0] IMPLICIT INTEGER (0..16777215), -- 24 bit number
4012  *     reason [1] IMPLICIT INTEGER
4013  * }
4014  */
4015 struct roseDms100RLTThirdParty_ARG {
4016 	/*! INTEGER (0..16777215) -- 24 bit number */
4017 	u_int32_t call_id;
4018 
4019 	/*! Reason for redirect */
4020 	u_int8_t reason;
4021 };
4022 
4023 
4024 /* ------------------------------------------------------------------- */
4025 
4026 
4027 /* ARGUMENT ENUMERATED */
4028 struct roseNi2InformationFollowing_ARG {
4029 	u_int8_t value;				/*!< Unknown enumerated value */
4030 };
4031 
4032 /*
4033  * ARGUMENT SEQUENCE {
4034  *     callReference INTEGER -- 16 bit number
4035  * }
4036  */
4037 struct roseNi2InitiateTransfer_ARG {
4038 	u_int16_t call_reference;
4039 };
4040 
4041 
4042 /* ------------------------------------------------------------------- */
4043 
4044 
4045 /*! \brief Facility ie invoke etsi messages with arguments. */
4046 union rose_msg_invoke_etsi_args {
4047 	/* ETSI Advice Of Charge (AOC) */
4048 	struct roseEtsiChargingRequest_ARG ChargingRequest;
4049 	struct roseEtsiAOCSCurrency_ARG AOCSCurrency;
4050 	struct roseEtsiAOCSSpecialArr_ARG AOCSSpecialArr;
4051 	struct roseEtsiAOCDCurrency_ARG AOCDCurrency;
4052 	struct roseEtsiAOCDChargingUnit_ARG AOCDChargingUnit;
4053 	struct roseEtsiAOCECurrency_ARG AOCECurrency;
4054 	struct roseEtsiAOCEChargingUnit_ARG AOCEChargingUnit;
4055 
4056 	/* ETSI Call Diversion */
4057 	struct roseEtsiActivationDiversion_ARG ActivationDiversion;
4058 	struct roseEtsiDeactivationDiversion_ARG DeactivationDiversion;
4059 	struct roseEtsiActivationStatusNotificationDiv_ARG ActivationStatusNotificationDiv;
4060 	struct roseEtsiDeactivationStatusNotificationDiv_ARG
4061 		DeactivationStatusNotificationDiv;
4062 	struct roseEtsiInterrogationDiversion_ARG InterrogationDiversion;
4063 	struct roseEtsiDiversionInformation_ARG DiversionInformation;
4064 	struct roseEtsiCallDeflection_ARG CallDeflection;
4065 	struct roseEtsiCallRerouting_ARG CallRerouting;
4066 	struct roseEtsiDivertingLegInformation1_ARG DivertingLegInformation1;
4067 	struct roseEtsiDivertingLegInformation2_ARG DivertingLegInformation2;
4068 	struct roseEtsiDivertingLegInformation3_ARG DivertingLegInformation3;
4069 
4070 	/* ETSI Explicit Call Transfer (ECT) */
4071 	struct roseEtsiExplicitEctExecute_ARG ExplicitEctExecute;
4072 	struct roseEtsiSubaddressTransfer_ARG SubaddressTransfer;
4073 	struct roseEtsiEctInform_ARG EctInform;
4074 	struct roseEtsiEctLoopTest_ARG EctLoopTest;
4075 
4076 	/* ETSI Status Request (CCBS/CCNR support) */
4077 	struct roseEtsiStatusRequest_ARG StatusRequest;
4078 
4079 	/* ETSI CCBS/CCNR support */
4080 	struct roseEtsiCallInfoRetain_ARG CallInfoRetain;
4081 	struct roseEtsiEraseCallLinkageID_ARG EraseCallLinkageID;
4082 	struct roseEtsiCCBSDeactivate_ARG CCBSDeactivate;
4083 	struct roseEtsiCCBSErase_ARG CCBSErase;
4084 	struct roseEtsiCCBSRemoteUserFree_ARG CCBSRemoteUserFree;
4085 	struct roseEtsiCCBSCall_ARG CCBSCall;
4086 	struct roseEtsiCCBSStatusRequest_ARG CCBSStatusRequest;
4087 	struct roseEtsiCCBSBFree_ARG CCBSBFree;
4088 	struct roseEtsiCCBSStopAlerting_ARG CCBSStopAlerting;
4089 
4090 	/* ETSI CCBS */
4091 	struct roseEtsiCCBSRequest_ARG CCBSRequest;
4092 	struct roseEtsiCCBSInterrogate_ARG CCBSInterrogate;
4093 
4094 	/* ETSI CCNR */
4095 	struct roseEtsiCCBSRequest_ARG CCNRRequest;
4096 	struct roseEtsiCCBSInterrogate_ARG CCNRInterrogate;
4097 
4098 	/* ETSI CCBS-T */
4099 	struct roseEtsiCCBS_T_Request_ARG CCBS_T_Request;
4100 
4101 	/* ETSI CCNR-T */
4102 	struct roseEtsiCCBS_T_Request_ARG CCNR_T_Request;
4103 
4104 	/* ETSI Message Waiting Indication (MWI) */
4105 	struct roseEtsiMWIActivate_ARG MWIActivate;
4106 	struct roseEtsiMWIDeactivate_ARG MWIDeactivate;
4107 	struct roseEtsiMWIIndicate_ARG MWIIndicate;
4108 };
4109 
4110 /*! \brief Facility ie result etsi messages with arguments. */
4111 union rose_msg_result_etsi_args {
4112 	/* ETSI Advice Of Charge (AOC) */
4113 	struct roseEtsiChargingRequest_RES ChargingRequest;
4114 
4115 	/* ETSI Call Diversion */
4116 	struct roseEtsiForwardingList InterrogationDiversion;
4117 	struct roseEtsiServedUserNumberList InterrogateServedUserNumbers;
4118 
4119 	/* ETSI Explicit Call Transfer (ECT) */
4120 	struct roseEtsiEctLinkIdRequest_RES EctLinkIdRequest;
4121 	struct roseEtsiEctLoopTest_RES EctLoopTest;
4122 
4123 	/* ETSI Status Request (CCBS/CCNR support) */
4124 	struct roseEtsiStatusRequest_RES StatusRequest;
4125 
4126 	/* ETSI CCBS/CCNR support */
4127 	struct roseEtsiCCBSStatusRequest_RES CCBSStatusRequest;
4128 
4129 	/* ETSI CCBS */
4130 	struct roseEtsiCCBSRequest_RES CCBSRequest;
4131 	struct roseEtsiCCBSInterrogate_RES CCBSInterrogate;
4132 
4133 	/* ETSI CCNR */
4134 	struct roseEtsiCCBSRequest_RES CCNRRequest;
4135 	struct roseEtsiCCBSInterrogate_RES CCNRInterrogate;
4136 
4137 	/* ETSI CCBS-T */
4138 	struct roseEtsiCCBS_T_Request_RES CCBS_T_Request;
4139 
4140 	/* ETSI CCNR-T */
4141 	struct roseEtsiCCBS_T_Request_RES CCNR_T_Request;
4142 };
4143 
4144 /*! \brief Facility ie invoke qsig messages with arguments. */
4145 union rose_msg_invoke_qsig_args {
4146 	/* Q.SIG Name-Operations */
4147 	struct roseQsigPartyName_ARG CallingName;
4148 	struct roseQsigPartyName_ARG CalledName;
4149 	struct roseQsigPartyName_ARG ConnectedName;
4150 	struct roseQsigPartyName_ARG BusyName;
4151 
4152 	/* Q.SIG SS-AOC-Operations */
4153 	struct roseQsigChargeRequestArg_ARG ChargeRequest;
4154 	struct roseQsigAocFinalArg_ARG AocFinal;
4155 	struct roseQsigAocInterimArg_ARG AocInterim;
4156 	struct roseQsigAocRateArg_ARG AocRate;
4157 	struct roseQsigAocCompleteArg_ARG AocComplete;
4158 	struct roseQsigAocDivChargeReqArg_ARG AocDivChargeReq;
4159 
4160 	/* Q.SIG Call-Transfer-Operations */
4161 	struct roseQsigCTInitiateArg_ARG CallTransferInitiate;
4162 	struct roseQsigCTSetupArg_ARG CallTransferSetup;
4163 	struct roseQsigCTActiveArg_ARG CallTransferActive;
4164 	struct roseQsigCTCompleteArg_ARG CallTransferComplete;
4165 	struct roseQsigCTUpdateArg_ARG CallTransferUpdate;
4166 	struct roseQsigSubaddressTransferArg_ARG SubaddressTransfer;
4167 
4168 	/* Q.SIG Call-Diversion-Operations */
4169 	struct roseQsigActivateDiversionQ_ARG ActivateDiversionQ;
4170 	struct roseQsigDeactivateDiversionQ_ARG DeactivateDiversionQ;
4171 	struct roseQsigInterrogateDiversionQ_ARG InterrogateDiversionQ;
4172 	struct roseQsigCheckRestriction_ARG CheckRestriction;
4173 	struct roseQsigCallRerouting_ARG CallRerouting;
4174 	struct roseQsigDivertingLegInformation1_ARG DivertingLegInformation1;
4175 	struct roseQsigDivertingLegInformation2_ARG DivertingLegInformation2;
4176 	struct roseQsigDivertingLegInformation3_ARG DivertingLegInformation3;
4177 
4178 	/* Q.SIG SS-CC-Operations */
4179 	struct roseQsigCcRequestArg CcbsRequest;
4180 	struct roseQsigCcRequestArg CcnrRequest;
4181 	struct roseQsigCcOptionalArg CcCancel;
4182 	struct roseQsigCcOptionalArg CcExecPossible;
4183 
4184 	/* Q.SIG SS-MWI-Operations */
4185 	struct roseQsigMWIActivateArg MWIActivate;
4186 	struct roseQsigMWIDeactivateArg MWIDeactivate;
4187 	struct roseQsigMWIInterrogateArg MWIInterrogate;
4188 };
4189 
4190 /*! \brief Facility ie result qsig messages with arguments. */
4191 union rose_msg_result_qsig_args {
4192 	/* Q.SIG SS-AOC-Operations */
4193 	struct roseQsigChargeRequestRes_RES ChargeRequest;
4194 	struct roseQsigAocCompleteRes_RES AocComplete;
4195 
4196 	/* Q.SIG Call-Transfer-Operations */
4197 	struct roseQsigCTIdentifyRes_RES CallTransferIdentify;
4198 
4199 	/* Q.SIG Call-Diversion-Operations */
4200 	struct roseQsigForwardingList InterrogateDiversionQ;
4201 
4202 	/* Q.SIG SS-CC-Operations */
4203 	struct roseQsigCcRequestRes CcbsRequest;
4204 	struct roseQsigCcRequestRes CcnrRequest;
4205 
4206 	/* Q.SIG SS-MWI-Operations */
4207 	struct roseQsigMWIInterrogateRes MWIInterrogate;
4208 };
4209 
4210 /*! \brief Facility ie invoke DMS-100 messages with arguments. */
4211 union rose_msg_invoke_dms100_args {
4212 	struct roseDms100RLTThirdParty_ARG RLT_ThirdParty;
4213 };
4214 
4215 /*! \brief Facility ie result DMS-100 messages with arguments. */
4216 union rose_msg_result_dms100_args {
4217 	struct roseDms100RLTOperationInd_RES RLT_OperationInd;
4218 };
4219 
4220 /*! \brief Facility ie invoke NI2 messages with arguments. */
4221 union rose_msg_invoke_ni2_args {
4222 	struct roseNi2InformationFollowing_ARG InformationFollowing;
4223 	struct roseNi2InitiateTransfer_ARG InitiateTransfer;
4224 };
4225 
4226 /*! \brief Facility ie result NI2 messages with arguments. */
4227 union rose_msg_result_ni2_args {
4228 	int dummy;					/*!< place holder until there are results with parameters */
4229 };
4230 
4231 /*! \brief Facility ie invoke messages with arguments. */
4232 union rose_msg_invoke_args {
4233 	union rose_msg_invoke_etsi_args etsi;
4234 	union rose_msg_invoke_qsig_args qsig;
4235 	union rose_msg_invoke_dms100_args dms100;
4236 	union rose_msg_invoke_ni2_args ni2;
4237 };
4238 
4239 /*! \brief Facility ie result messages with arguments. */
4240 union rose_msg_result_args {
4241 	union rose_msg_result_etsi_args etsi;
4242 	union rose_msg_result_qsig_args qsig;
4243 	union rose_msg_result_dms100_args dms100;
4244 	union rose_msg_result_ni2_args ni2;
4245 };
4246 
4247 /*! \brief Facility ie error messages with parameters. */
4248 union rose_msg_error_args {
4249 	int dummy;					/*!< place holder until there are errors with parameters */
4250 };
4251 
4252 struct rose_msg_invoke {
4253 	/*! \brief Invoke ID (-32768..32767) */
4254 	int16_t invoke_id;
4255 	/*! \brief Linked ID (-32768..32767) (optional) */
4256 	int16_t linked_id;
4257 	/*! \brief library encoded operation-value */
4258 	enum rose_operation operation;
4259 	/*! \brief TRUE if the Linked ID is present */
4260 	u_int8_t linked_id_present;
4261 	union rose_msg_invoke_args args;
4262 };
4263 
4264 struct rose_msg_result {
4265 	/*! \brief Invoke ID (-32768..32767) */
4266 	int16_t invoke_id;
4267 	/*!
4268 	 * \brief library encoded operation-value
4269 	 * \note Set to ROSE_None if the operation sequence is not present.
4270 	 * \note ETSI and Q.SIG imply that if a return result does not have
4271 	 * any arguments then you must rely upon the invokeId value to
4272 	 * distinguish between return results because the operation-value is
4273 	 * not present.
4274 	 */
4275 	enum rose_operation operation;
4276 	union rose_msg_result_args args;
4277 };
4278 
4279 struct rose_msg_error {
4280 	/*! \brief Invoke ID (-32768..32767) */
4281 	int16_t invoke_id;
4282 	/*! \brief library encoded error-value */
4283 	enum rose_error_code code;
4284 	union rose_msg_error_args args;
4285 };
4286 
4287 struct rose_msg_reject {
4288 	/*! \brief Invoke ID (-32768..32767) (optional) */
4289 	int16_t invoke_id;
4290 	/*! \brief TRUE if the Invoke ID is present */
4291 	u_int8_t invoke_id_present;
4292 	/*! \brief library encoded problem-value */
4293 	enum rose_reject_code code;
4294 };
4295 
4296 enum rose_component_type {
4297 	ROSE_COMP_TYPE_INVALID,
4298 	ROSE_COMP_TYPE_INVOKE,
4299 	ROSE_COMP_TYPE_RESULT,
4300 	ROSE_COMP_TYPE_ERROR,
4301 	ROSE_COMP_TYPE_REJECT
4302 };
4303 
4304 struct rose_message {
4305 	/*! \brief invoke, result, error, reject */
4306 	enum rose_component_type type;
4307 	union {
4308 		struct rose_msg_invoke invoke;
4309 		struct rose_msg_result result;
4310 		struct rose_msg_error error;
4311 		struct rose_msg_reject reject;
4312 	} component;
4313 };
4314 
4315 /*
4316  * NetworkFacilityExtension ::= [10] IMPLICIT SEQUENCE {
4317  *     sourceEntity                [0] IMPLICIT EntityType,
4318  *     sourceEntityAddress         [1] EXPLICIT AddressInformation OPTIONAL,
4319  *     destinationEntity           [2] IMPLICIT EntityType,
4320  *     destinationEntityAddress    [3] EXPLICIT AddressInformation OPTIONAL
4321  * }
4322  *
4323  * AddressInformation ::= PartyNumber
4324  */
4325 struct facNetworkFacilityExtension {
4326 	/*! \brief sourceEntityAddress (optional) (Number present if length is nonzero) */
4327 	struct rosePartyNumber source_number;
4328 	/*! \brief destinationEntityAddress (optional) (Number present if length is nonzero) */
4329 	struct rosePartyNumber destination_number;
4330 
4331 	/*!
4332 	 * \details
4333 	 * endPINX(0),
4334 	 * anyTypeOfPINX(1)
4335 	 */
4336 	u_int8_t source_entity;
4337 
4338 	/*!
4339 	 * \details
4340 	 * endPINX(0),
4341 	 * anyTypeOfPINX(1)
4342 	 */
4343 	u_int8_t destination_entity;
4344 };
4345 
4346 /*
4347  * The network extensions header is a sequence of the following components:
4348  *
4349  * nfe NetworkFacilityExtension OPTIONAL,
4350  * npp NetworkProtocolProfile OPTIONAL,
4351  * interpretation InterpretationApdu OPTIONAL
4352  *
4353  * NetworkProtocolProfile ::= [18] IMPLICIT INTEGER (0..254)
4354  *
4355  * InterpretationApdu ::= [11] IMPLICIT ENUMERATED {
4356  *     discardAnyUnrecognisedInvokePdu(0),
4357  *
4358  *     -- this value also applies to Call independent signalling connections
4359  *     -- see clause 8.1.2 (ECMA-165)
4360  *     clearCallIfAnyInvokePduNotRecognised(1),
4361  *
4362  *     -- this coding is implied by the absence of an
4363  *     -- interpretation APDU.
4364  *     rejectAnyUnrecognisedInvokePdu(2)
4365  * }
4366  */
4367 struct fac_extension_header {
4368 	/*! \brief Network Facility Extension component */
4369 	struct facNetworkFacilityExtension nfe;
4370 
4371 	/*! \brief Network Protocol Profile component */
4372 	u_int8_t npp;
4373 
4374 	/*!
4375 	 * \brief interpretation component
4376 	 *
4377 	 * \details
4378 	 * discardAnyUnrecognisedInvokePdu(0),
4379 	 * clearCallIfAnyInvokePduNotRecognised(1),
4380 	 * rejectAnyUnrecognisedInvokePdu(2)
4381 	 */
4382 	u_int8_t interpretation;
4383 
4384 	/*! \brief TRUE if nfe is present */
4385 	u_int8_t nfe_present;
4386 
4387 	/*! \brief TRUE if npp is present */
4388 	u_int8_t npp_present;
4389 
4390 	/*! \brief TRUE if interpretation is present */
4391 	u_int8_t interpretation_present;
4392 };
4393 
4394 const char *rose_operation2str(enum rose_operation operation);
4395 const char *rose_error2str(enum rose_error_code code);
4396 const char *rose_reject2str(enum rose_reject_code code);
4397 
4398 unsigned char *rose_encode_invoke(struct pri *ctrl, unsigned char *pos,
4399 	unsigned char *end, const struct rose_msg_invoke *msg);
4400 unsigned char *rose_encode_result(struct pri *ctrl, unsigned char *pos,
4401 	unsigned char *end, const struct rose_msg_result *msg);
4402 unsigned char *rose_encode_error(struct pri *ctrl, unsigned char *pos,
4403 	unsigned char *end, const struct rose_msg_error *msg);
4404 unsigned char *rose_encode_reject(struct pri *ctrl, unsigned char *pos,
4405 	unsigned char *end, const struct rose_msg_reject *msg);
4406 
4407 unsigned char *rose_encode(struct pri *ctrl, unsigned char *pos, unsigned char *end,
4408 	const struct rose_message *msg);
4409 const unsigned char *rose_decode(struct pri *ctrl, const unsigned char *pos,
4410 	const unsigned char *end, struct rose_message *msg);
4411 
4412 unsigned char *fac_enc_extension_header(struct pri *ctrl, unsigned char *pos,
4413 	unsigned char *end, const struct fac_extension_header *header);
4414 unsigned char *facility_encode_header(struct pri *ctrl, unsigned char *pos,
4415 	unsigned char *end, const struct fac_extension_header *header);
4416 
4417 const unsigned char *fac_dec_extension_header(struct pri *ctrl, const unsigned char *pos,
4418 	const unsigned char *end, struct fac_extension_header *header);
4419 const unsigned char *facility_decode_header(struct pri *ctrl, const unsigned char *pos,
4420 	const unsigned char *end, struct fac_extension_header *header);
4421 
4422 void facility_decode_dump(struct pri *ctrl, const unsigned char *buf, size_t length);
4423 
4424 /* ------------------------------------------------------------------- */
4425 
4426 #ifdef __cplusplus
4427 }
4428 #endif
4429 
4430 #endif	/* _LIBPRI_ROSE_H */
4431 /* ------------------------------------------------------------------- */
4432 /* end rose.h */
4433