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 Q.SIG ROSE SS-CC-Operations (CC)
30  *
31  * SS-CC-Operations ECMA-186 Annex F Table F.1
32  *
33  * \author Richard Mudgett <rmudgett@digium.com>
34  */
35 
36 
37 #include "compat.h"
38 #include "libpri.h"
39 #include "pri_internal.h"
40 #include "rose.h"
41 #include "rose_internal.h"
42 #include "asn1.h"
43 
44 
45 /* ------------------------------------------------------------------- */
46 
47 /*!
48  * \internal
49  * \brief Encode the CcExtension type.
50  *
51  * \param ctrl D channel controller for diagnostic messages or global options.
52  * \param pos Starting position to encode ASN.1 component.
53  * \param end End of ASN.1 encoding data buffer.
54  *
55  * \retval Start of the next ASN.1 component to encode on success.
56  * \retval NULL on error.
57  *
58  * \details
59  * CcExtension ::= CHOICE {
60  *     none        NULL,
61  *     single      [14] IMPLICIT Extension,
62  *     multiple    [15] IMPLICIT SEQUENCE OF Extension
63  * }
64  */
rose_enc_qsig_CcExtension(struct pri * ctrl,unsigned char * pos,unsigned char * end)65 static unsigned char *rose_enc_qsig_CcExtension(struct pri *ctrl, unsigned char *pos,
66 	unsigned char *end)
67 {
68 	return asn1_enc_null(pos, end, ASN1_TYPE_NULL);
69 }
70 
71 /*!
72  * \internal
73  * \brief Encode the CcRequestArg type.
74  *
75  * \param ctrl D channel controller for diagnostic messages or global options.
76  * \param pos Starting position to encode ASN.1 component.
77  * \param end End of ASN.1 encoding data buffer.
78  * \param tag Component tag to identify the encoded component.
79  *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
80  *   tags it otherwise.
81  * \param cc_request_arg Call-completion request arguments to encode.
82  *
83  * \retval Start of the next ASN.1 component to encode on success.
84  * \retval NULL on error.
85  */
rose_enc_qsig_CcRequestArg(struct pri * ctrl,unsigned char * pos,unsigned char * end,unsigned tag,const struct roseQsigCcRequestArg * cc_request_arg)86 static unsigned char *rose_enc_qsig_CcRequestArg(struct pri *ctrl, unsigned char *pos,
87 	unsigned char *end, unsigned tag, const struct roseQsigCcRequestArg *cc_request_arg)
88 {
89 	unsigned char *seq_len;
90 	unsigned char *exp_len;
91 
92 	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
93 
94 	ASN1_CALL(pos, rose_enc_PresentedNumberUnscreened(ctrl, pos, end,
95 		&cc_request_arg->number_a));
96 	ASN1_CALL(pos, rose_enc_PartyNumber(ctrl, pos, end, &cc_request_arg->number_b));
97 	ASN1_CALL(pos, rose_enc_Q931ie(ctrl, pos, end, ASN1_CLASS_APPLICATION | 0,
98 		&cc_request_arg->q931ie));
99 
100 	if (cc_request_arg->subaddr_a.length) {
101 		/* EXPLICIT tag */
102 		ASN1_CONSTRUCTED_BEGIN(exp_len, pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 10);
103 		ASN1_CALL(pos, rose_enc_PartySubaddress(ctrl, pos, end,
104 			&cc_request_arg->subaddr_a));
105 		ASN1_CONSTRUCTED_END(exp_len, pos, end);
106 	}
107 
108 	if (cc_request_arg->subaddr_b.length) {
109 		/* EXPLICIT tag */
110 		ASN1_CONSTRUCTED_BEGIN(exp_len, pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 11);
111 		ASN1_CALL(pos, rose_enc_PartySubaddress(ctrl, pos, end,
112 			&cc_request_arg->subaddr_b));
113 		ASN1_CONSTRUCTED_END(exp_len, pos, end);
114 	}
115 
116 	if (cc_request_arg->can_retain_service) {
117 		/* Not the DEFAULT value */
118 		ASN1_CALL(pos, asn1_enc_boolean(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 12,
119 			cc_request_arg->can_retain_service));
120 	}
121 
122 	if (cc_request_arg->retain_sig_connection_present) {
123 		ASN1_CALL(pos, asn1_enc_boolean(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 13,
124 			cc_request_arg->retain_sig_connection));
125 	}
126 
127 	/* No extension to encode */
128 
129 	ASN1_CONSTRUCTED_END(seq_len, pos, end);
130 
131 	return pos;
132 }
133 
134 /*!
135  * \brief Encode the Q.SIG CcbsRequest invoke facility ie arguments.
136  *
137  * \param ctrl D channel controller for diagnostic messages or global options.
138  * \param pos Starting position to encode ASN.1 component.
139  * \param end End of ASN.1 encoding data buffer.
140  * \param args Arguments to encode in the buffer.
141  *
142  * \retval Start of the next ASN.1 component to encode on success.
143  * \retval NULL on error.
144  */
rose_enc_qsig_CcbsRequest_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)145 unsigned char *rose_enc_qsig_CcbsRequest_ARG(struct pri *ctrl, unsigned char *pos,
146 	unsigned char *end, const union rose_msg_invoke_args *args)
147 {
148 	return rose_enc_qsig_CcRequestArg(ctrl, pos, end, ASN1_TAG_SEQUENCE,
149 		&args->qsig.CcbsRequest);
150 }
151 
152 /*!
153  * \brief Encode the Q.SIG CcnrRequest invoke facility ie arguments.
154  *
155  * \param ctrl D channel controller for diagnostic messages or global options.
156  * \param pos Starting position to encode ASN.1 component.
157  * \param end End of ASN.1 encoding data buffer.
158  * \param args Arguments to encode in the buffer.
159  *
160  * \retval Start of the next ASN.1 component to encode on success.
161  * \retval NULL on error.
162  */
rose_enc_qsig_CcnrRequest_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)163 unsigned char *rose_enc_qsig_CcnrRequest_ARG(struct pri *ctrl, unsigned char *pos,
164 	unsigned char *end, const union rose_msg_invoke_args *args)
165 {
166 	return rose_enc_qsig_CcRequestArg(ctrl, pos, end, ASN1_TAG_SEQUENCE,
167 		&args->qsig.CcnrRequest);
168 }
169 
170 /*!
171  * \internal
172  * \brief Encode the CcRequestRes type.
173  *
174  * \param ctrl D channel controller for diagnostic messages or global options.
175  * \param pos Starting position to encode ASN.1 component.
176  * \param end End of ASN.1 encoding data buffer.
177  * \param tag Component tag to identify the encoded component.
178  *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
179  *   tags it otherwise.
180  * \param cc_request_res Call-completion request result to encode.
181  *
182  * \retval Start of the next ASN.1 component to encode on success.
183  * \retval NULL on error.
184  */
rose_enc_qsig_CcRequestRes(struct pri * ctrl,unsigned char * pos,unsigned char * end,unsigned tag,const struct roseQsigCcRequestRes * cc_request_res)185 static unsigned char *rose_enc_qsig_CcRequestRes(struct pri *ctrl, unsigned char *pos,
186 	unsigned char *end, unsigned tag, const struct roseQsigCcRequestRes *cc_request_res)
187 {
188 	unsigned char *seq_len;
189 
190 	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
191 
192 	if (cc_request_res->no_path_reservation) {
193 		/* Not the DEFAULT value */
194 		ASN1_CALL(pos, asn1_enc_boolean(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 0,
195 			cc_request_res->no_path_reservation));
196 	}
197 
198 	if (cc_request_res->retain_service) {
199 		/* Not the DEFAULT value */
200 		ASN1_CALL(pos, asn1_enc_boolean(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 1,
201 			cc_request_res->retain_service));
202 	}
203 
204 	/* No extension to encode */
205 
206 	ASN1_CONSTRUCTED_END(seq_len, pos, end);
207 
208 	return pos;
209 }
210 
211 /*!
212  * \brief Encode the Q.SIG CcbsRequest result facility ie arguments.
213  *
214  * \param ctrl D channel controller for diagnostic messages or global options.
215  * \param pos Starting position to encode ASN.1 component.
216  * \param end End of ASN.1 encoding data buffer.
217  * \param args Arguments to encode in the buffer.
218  *
219  * \retval Start of the next ASN.1 component to encode on success.
220  * \retval NULL on error.
221  */
rose_enc_qsig_CcbsRequest_RES(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_result_args * args)222 unsigned char *rose_enc_qsig_CcbsRequest_RES(struct pri *ctrl, unsigned char *pos,
223 	unsigned char *end, const union rose_msg_result_args *args)
224 {
225 	return rose_enc_qsig_CcRequestRes(ctrl, pos, end, ASN1_TAG_SEQUENCE,
226 		&args->qsig.CcbsRequest);
227 }
228 
229 /*!
230  * \brief Encode the Q.SIG CcnrRequest result facility ie arguments.
231  *
232  * \param ctrl D channel controller for diagnostic messages or global options.
233  * \param pos Starting position to encode ASN.1 component.
234  * \param end End of ASN.1 encoding data buffer.
235  * \param args Arguments to encode in the buffer.
236  *
237  * \retval Start of the next ASN.1 component to encode on success.
238  * \retval NULL on error.
239  */
rose_enc_qsig_CcnrRequest_RES(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_result_args * args)240 unsigned char *rose_enc_qsig_CcnrRequest_RES(struct pri *ctrl, unsigned char *pos,
241 	unsigned char *end, const union rose_msg_result_args *args)
242 {
243 	return rose_enc_qsig_CcRequestRes(ctrl, pos, end, ASN1_TAG_SEQUENCE,
244 		&args->qsig.CcnrRequest);
245 }
246 
247 /*!
248  * \internal
249  * \brief Encode the CcOptionalArg type.
250  *
251  * \param ctrl D channel controller for diagnostic messages or global options.
252  * \param pos Starting position to encode ASN.1 component.
253  * \param end End of ASN.1 encoding data buffer.
254  * \param cc_optional_arg Call-completion optional arguments to encode.
255  *
256  * \retval Start of the next ASN.1 component to encode on success.
257  * \retval NULL on error.
258  */
rose_enc_qsig_CcOptionalArg(struct pri * ctrl,unsigned char * pos,unsigned char * end,const struct roseQsigCcOptionalArg * cc_optional_arg)259 static unsigned char *rose_enc_qsig_CcOptionalArg(struct pri *ctrl, unsigned char *pos,
260 	unsigned char *end, const struct roseQsigCcOptionalArg *cc_optional_arg)
261 {
262 	unsigned char *seq_len;
263 	unsigned char *exp_len;
264 
265 	if (!cc_optional_arg->full_arg_present) {
266 		return rose_enc_qsig_CcExtension(ctrl, pos, end);
267 	}
268 
269 	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 0);
270 
271 	ASN1_CALL(pos, rose_enc_PartyNumber(ctrl, pos, end, &cc_optional_arg->number_a));
272 	ASN1_CALL(pos, rose_enc_PartyNumber(ctrl, pos, end, &cc_optional_arg->number_b));
273 	ASN1_CALL(pos, rose_enc_Q931ie(ctrl, pos, end, ASN1_CLASS_APPLICATION | 0,
274 		&cc_optional_arg->q931ie));
275 
276 	if (cc_optional_arg->subaddr_a.length) {
277 		/* EXPLICIT tag */
278 		ASN1_CONSTRUCTED_BEGIN(exp_len, pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 10);
279 		ASN1_CALL(pos, rose_enc_PartySubaddress(ctrl, pos, end,
280 			&cc_optional_arg->subaddr_a));
281 		ASN1_CONSTRUCTED_END(exp_len, pos, end);
282 	}
283 
284 	if (cc_optional_arg->subaddr_b.length) {
285 		/* EXPLICIT tag */
286 		ASN1_CONSTRUCTED_BEGIN(exp_len, pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 11);
287 		ASN1_CALL(pos, rose_enc_PartySubaddress(ctrl, pos, end,
288 			&cc_optional_arg->subaddr_b));
289 		ASN1_CONSTRUCTED_END(exp_len, pos, end);
290 	}
291 
292 	/* No extension to encode */
293 
294 	ASN1_CONSTRUCTED_END(seq_len, pos, end);
295 
296 	return pos;
297 }
298 
299 /*!
300  * \brief Encode the Q.SIG CcCancel invoke facility ie arguments.
301  *
302  * \param ctrl D channel controller for diagnostic messages or global options.
303  * \param pos Starting position to encode ASN.1 component.
304  * \param end End of ASN.1 encoding data buffer.
305  * \param args Arguments to encode in the buffer.
306  *
307  * \retval Start of the next ASN.1 component to encode on success.
308  * \retval NULL on error.
309  */
rose_enq_qsig_CcCancel_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)310 unsigned char *rose_enq_qsig_CcCancel_ARG(struct pri *ctrl, unsigned char *pos,
311 	unsigned char *end, const union rose_msg_invoke_args *args)
312 {
313 	return rose_enc_qsig_CcOptionalArg(ctrl, pos, end, &args->qsig.CcCancel);
314 }
315 
316 /*!
317  * \brief Encode the Q.SIG CcExecPossible invoke facility ie arguments.
318  *
319  * \param ctrl D channel controller for diagnostic messages or global options.
320  * \param pos Starting position to encode ASN.1 component.
321  * \param end End of ASN.1 encoding data buffer.
322  * \param args Arguments to encode in the buffer.
323  *
324  * \retval Start of the next ASN.1 component to encode on success.
325  * \retval NULL on error.
326  */
rose_enq_qsig_CcExecPossible_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)327 unsigned char *rose_enq_qsig_CcExecPossible_ARG(struct pri *ctrl, unsigned char *pos,
328 	unsigned char *end, const union rose_msg_invoke_args *args)
329 {
330 	return rose_enc_qsig_CcOptionalArg(ctrl, pos, end, &args->qsig.CcExecPossible);
331 }
332 
333 /*!
334  * \brief Encode the Q.SIG CcPathReserve invoke facility ie arguments.
335  *
336  * \param ctrl D channel controller for diagnostic messages or global options.
337  * \param pos Starting position to encode ASN.1 component.
338  * \param end End of ASN.1 encoding data buffer.
339  * \param args Arguments to encode in the buffer.
340  *
341  * \retval Start of the next ASN.1 component to encode on success.
342  * \retval NULL on error.
343  */
rose_enc_qsig_CcPathReserve_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)344 unsigned char *rose_enc_qsig_CcPathReserve_ARG(struct pri *ctrl, unsigned char *pos,
345 	unsigned char *end, const union rose_msg_invoke_args *args)
346 {
347 	return rose_enc_qsig_CcExtension(ctrl, pos, end);
348 }
349 
350 /*!
351  * \brief Encode the Q.SIG CcPathReserve result facility ie arguments.
352  *
353  * \param ctrl D channel controller for diagnostic messages or global options.
354  * \param pos Starting position to encode ASN.1 component.
355  * \param end End of ASN.1 encoding data buffer.
356  * \param args Arguments to encode in the buffer.
357  *
358  * \retval Start of the next ASN.1 component to encode on success.
359  * \retval NULL on error.
360  */
rose_enc_qsig_CcPathReserve_RES(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_result_args * args)361 unsigned char *rose_enc_qsig_CcPathReserve_RES(struct pri *ctrl, unsigned char *pos,
362 	unsigned char *end, const union rose_msg_result_args *args)
363 {
364 	return rose_enc_qsig_CcExtension(ctrl, pos, end);
365 }
366 
367 /*!
368  * \brief Encode the Q.SIG CcRingout invoke facility ie arguments.
369  *
370  * \param ctrl D channel controller for diagnostic messages or global options.
371  * \param pos Starting position to encode ASN.1 component.
372  * \param end End of ASN.1 encoding data buffer.
373  * \param args Arguments to encode in the buffer.
374  *
375  * \retval Start of the next ASN.1 component to encode on success.
376  * \retval NULL on error.
377  */
rose_enc_qsig_CcRingout_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)378 unsigned char *rose_enc_qsig_CcRingout_ARG(struct pri *ctrl, unsigned char *pos,
379 	unsigned char *end, const union rose_msg_invoke_args *args)
380 {
381 	return rose_enc_qsig_CcExtension(ctrl, pos, end);
382 }
383 
384 /*!
385  * \brief Encode the Q.SIG CcSuspend invoke facility ie arguments.
386  *
387  * \param ctrl D channel controller for diagnostic messages or global options.
388  * \param pos Starting position to encode ASN.1 component.
389  * \param end End of ASN.1 encoding data buffer.
390  * \param args Arguments to encode in the buffer.
391  *
392  * \retval Start of the next ASN.1 component to encode on success.
393  * \retval NULL on error.
394  */
rose_enc_qsig_CcSuspend_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)395 unsigned char *rose_enc_qsig_CcSuspend_ARG(struct pri *ctrl, unsigned char *pos,
396 	unsigned char *end, const union rose_msg_invoke_args *args)
397 {
398 	return rose_enc_qsig_CcExtension(ctrl, pos, end);
399 }
400 
401 /*!
402  * \brief Encode the Q.SIG CcResume invoke facility ie arguments.
403  *
404  * \param ctrl D channel controller for diagnostic messages or global options.
405  * \param pos Starting position to encode ASN.1 component.
406  * \param end End of ASN.1 encoding data buffer.
407  * \param args Arguments to encode in the buffer.
408  *
409  * \retval Start of the next ASN.1 component to encode on success.
410  * \retval NULL on error.
411  */
rose_enc_qsig_CcResume_ARG(struct pri * ctrl,unsigned char * pos,unsigned char * end,const union rose_msg_invoke_args * args)412 unsigned char *rose_enc_qsig_CcResume_ARG(struct pri *ctrl, unsigned char *pos,
413 	unsigned char *end, const union rose_msg_invoke_args *args)
414 {
415 	return rose_enc_qsig_CcExtension(ctrl, pos, end);
416 }
417 
418 /*!
419  * \internal
420  * \brief Decode the CcExtension argument parameters.
421  *
422  * \param ctrl D channel controller for any diagnostic messages.
423  * \param name Field name
424  * \param tag Component tag that identified this production.
425  * \param pos Starting position of the ASN.1 component length.
426  * \param end End of ASN.1 decoding data buffer.
427  *
428  * \retval Start of the next ASN.1 component on success.
429  * \retval NULL on error.
430  *
431  * \details
432  * CcExtension ::= CHOICE {
433  *     none        NULL,
434  *     single      [14] IMPLICIT Extension,
435  *     multiple    [15] IMPLICIT SEQUENCE OF Extension
436  * }
437  */
rose_dec_qsig_CcExtension(struct pri * ctrl,const char * name,unsigned tag,const unsigned char * pos,const unsigned char * end)438 static const unsigned char *rose_dec_qsig_CcExtension(struct pri *ctrl, const char *name,
439 	unsigned tag, const unsigned char *pos, const unsigned char *end)
440 {
441 	int length;
442 	int ext_offset;
443 	const unsigned char *ext_end;
444 
445 	if (ctrl->debug & PRI_DEBUG_APDU) {
446 		pri_message(ctrl, "  %s CcExtension\n", name);
447 	}
448 	switch (tag & ~ASN1_PC_MASK) {
449 	case ASN1_TYPE_NULL:
450 		/* Must not be constructed but we will not check for it for simplicity. */
451 		return asn1_dec_null(ctrl, "none", tag, pos, end);
452 	case ASN1_CLASS_CONTEXT_SPECIFIC | 14:
453 		name = "single";
454 		break;
455 	case ASN1_CLASS_CONTEXT_SPECIFIC | 15:
456 		name = "multiple";
457 		break;
458 	default:
459 		ASN1_DID_NOT_EXPECT_TAG(ctrl, tag);
460 		return NULL;
461 	}
462 
463 	if (ctrl->debug & PRI_DEBUG_APDU) {
464 		pri_message(ctrl, "  %s %s\n", name, asn1_tag2str(tag));
465 	}
466 	ASN1_CALL(pos, asn1_dec_length(pos, end, &length));
467 	ASN1_END_SETUP(ext_end, ext_offset, length, pos, end);
468 
469 	/* Fixup will skip over the manufacturer extension information */
470 	ASN1_END_FIXUP(ctrl, pos, ext_offset, ext_end, end);
471 
472 	return pos;
473 }
474 
475 /*!
476  * \internal
477  * \brief Decode the CcRequestArg argument parameters.
478  *
479  * \param ctrl D channel controller for any diagnostic messages.
480  * \param name Field name
481  * \param tag Component tag that identified this production.
482  * \param pos Starting position of the ASN.1 component length.
483  * \param end End of ASN.1 decoding data buffer.
484  * \param cc_request_arg Parameter storage to fill.
485  *
486  * \retval Start of the next ASN.1 component on success.
487  * \retval NULL on error.
488  */
rose_dec_qsig_CcRequestArg(struct pri * ctrl,const char * name,unsigned tag,const unsigned char * pos,const unsigned char * end,struct roseQsigCcRequestArg * cc_request_arg)489 static const unsigned char *rose_dec_qsig_CcRequestArg(struct pri *ctrl,
490 	const char *name, unsigned tag, const unsigned char *pos, const unsigned char *end,
491 	struct roseQsigCcRequestArg *cc_request_arg)
492 {
493 	int32_t value;
494 	int length;
495 	int seq_offset;
496 	int explicit_offset;
497 	const unsigned char *explicit_end;
498 	const unsigned char *seq_end;
499 	const unsigned char *save_pos;
500 
501 	if (ctrl->debug & PRI_DEBUG_APDU) {
502 		pri_message(ctrl, "  %s CcRequestArg %s\n", name, asn1_tag2str(tag));
503 	}
504 	ASN1_CALL(pos, asn1_dec_length(pos, end, &length));
505 	ASN1_END_SETUP(seq_end, seq_offset, length, pos, end);
506 
507 	ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
508 	ASN1_CALL(pos, rose_dec_PresentedNumberUnscreened(ctrl, "numberA", tag, pos, seq_end,
509 		&cc_request_arg->number_a));
510 
511 	ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
512 	ASN1_CALL(pos, rose_dec_PartyNumber(ctrl, "numberB", tag, pos, seq_end,
513 		&cc_request_arg->number_b));
514 
515 	ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
516 	ASN1_CHECK_TAG(ctrl, tag, tag & ~ASN1_PC_MASK, ASN1_CLASS_APPLICATION | 0);
517 	ASN1_CALL(pos, rose_dec_Q931ie(ctrl, "service", tag, pos, seq_end,
518 		&cc_request_arg->q931ie, sizeof(cc_request_arg->q931ie_contents)));
519 
520 	/*
521 	 * A sequence specifies an ordered list of component types.
522 	 * However, for simplicity we are not checking the order of
523 	 * the remaining optional components.
524 	 */
525 	cc_request_arg->subaddr_a.length = 0;
526 	cc_request_arg->subaddr_b.length = 0;
527 	cc_request_arg->can_retain_service = 0;	/* DEFAULT FALSE */
528 	cc_request_arg->retain_sig_connection_present = 0;
529 	while (pos < seq_end && *pos != ASN1_INDEF_TERM) {
530 		save_pos = pos;
531 		ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
532 		switch (tag) {
533 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 10:
534 			/* Remove EXPLICIT tag */
535 			if (ctrl->debug & PRI_DEBUG_APDU) {
536 				pri_message(ctrl, "  Explicit %s\n", asn1_tag2str(tag));
537 			}
538 			ASN1_CALL(pos, asn1_dec_length(pos, seq_end, &length));
539 			ASN1_END_SETUP(explicit_end, explicit_offset, length, pos, seq_end);
540 
541 			ASN1_CALL(pos, asn1_dec_tag(pos, explicit_end, &tag));
542 			ASN1_CALL(pos, rose_dec_PartySubaddress(ctrl, "subaddrA", tag, pos,
543 				explicit_end, &cc_request_arg->subaddr_a));
544 
545 			ASN1_END_FIXUP(ctrl, pos, explicit_offset, explicit_end, seq_end);
546 			break;
547 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 11:
548 			/* Remove EXPLICIT tag */
549 			if (ctrl->debug & PRI_DEBUG_APDU) {
550 				pri_message(ctrl, "  Explicit %s\n", asn1_tag2str(tag));
551 			}
552 			ASN1_CALL(pos, asn1_dec_length(pos, seq_end, &length));
553 			ASN1_END_SETUP(explicit_end, explicit_offset, length, pos, seq_end);
554 
555 			ASN1_CALL(pos, asn1_dec_tag(pos, explicit_end, &tag));
556 			ASN1_CALL(pos, rose_dec_PartySubaddress(ctrl, "subaddrB", tag, pos,
557 				explicit_end, &cc_request_arg->subaddr_b));
558 
559 			ASN1_END_FIXUP(ctrl, pos, explicit_offset, explicit_end, seq_end);
560 			break;
561 		case ASN1_CLASS_CONTEXT_SPECIFIC | 12:
562 			ASN1_CALL(pos, asn1_dec_boolean(ctrl, "can-retain-service", tag, pos,
563 				seq_end, &value));
564 			cc_request_arg->can_retain_service = value;
565 			break;
566 		case ASN1_CLASS_CONTEXT_SPECIFIC | 13:
567 			ASN1_CALL(pos, asn1_dec_boolean(ctrl, "retain-sig-connection", tag, pos,
568 				seq_end, &value));
569 			cc_request_arg->retain_sig_connection = value;
570 			cc_request_arg->retain_sig_connection_present = 1;
571 			break;
572 		case ASN1_TYPE_NULL:
573 		case ASN1_CLASS_CONTEXT_SPECIFIC | 14:
574 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 14:
575 		case ASN1_CLASS_CONTEXT_SPECIFIC | 15:
576 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 15:
577 			ASN1_CALL(pos, rose_dec_qsig_CcExtension(ctrl, "extension", tag, pos,
578 				seq_end));
579 			break;
580 		default:
581 			pos = save_pos;
582 			goto cancel_options;
583 		}
584 	}
585 cancel_options:;
586 
587 	ASN1_END_FIXUP(ctrl, pos, seq_offset, seq_end, end);
588 
589 	return pos;
590 }
591 
592 /*!
593  * \brief Decode the Q.SIG CcbsRequest invoke argument parameters.
594  *
595  * \param ctrl D channel controller for diagnostic messages or global options.
596  * \param tag Component tag that identified this structure.
597  * \param pos Starting position of the ASN.1 component length.
598  * \param end End of ASN.1 decoding data buffer.
599  * \param args Arguments to fill in from the decoded buffer.
600  *
601  * \retval Start of the next ASN.1 component on success.
602  * \retval NULL on error.
603  */
rose_dec_qsig_CcbsRequest_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)604 const unsigned char *rose_dec_qsig_CcbsRequest_ARG(struct pri *ctrl, unsigned tag,
605 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
606 {
607 	ASN1_CHECK_TAG(ctrl, tag, tag, ASN1_TAG_SEQUENCE);
608 	return rose_dec_qsig_CcRequestArg(ctrl, "CcbsRequest", tag, pos, end,
609 		&args->qsig.CcbsRequest);
610 }
611 
612 /*!
613  * \brief Decode the Q.SIG CcnrRequest invoke argument parameters.
614  *
615  * \param ctrl D channel controller for diagnostic messages or global options.
616  * \param tag Component tag that identified this structure.
617  * \param pos Starting position of the ASN.1 component length.
618  * \param end End of ASN.1 decoding data buffer.
619  * \param args Arguments to fill in from the decoded buffer.
620  *
621  * \retval Start of the next ASN.1 component on success.
622  * \retval NULL on error.
623  */
rose_dec_qsig_CcnrRequest_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)624 const unsigned char *rose_dec_qsig_CcnrRequest_ARG(struct pri *ctrl, unsigned tag,
625 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
626 {
627 	ASN1_CHECK_TAG(ctrl, tag, tag, ASN1_TAG_SEQUENCE);
628 	return rose_dec_qsig_CcRequestArg(ctrl, "CcnrRequest", tag, pos, end,
629 		&args->qsig.CcnrRequest);
630 }
631 
632 /*!
633  * \internal
634  * \brief Decode the CcRequestRes argument parameters.
635  *
636  * \param ctrl D channel controller for any diagnostic messages.
637  * \param name Field name
638  * \param tag Component tag that identified this production.
639  * \param pos Starting position of the ASN.1 component length.
640  * \param end End of ASN.1 decoding data buffer.
641  * \param cc_request_res Parameter storage to fill.
642  *
643  * \retval Start of the next ASN.1 component on success.
644  * \retval NULL on error.
645  */
rose_dec_qsig_CcRequestRes(struct pri * ctrl,const char * name,unsigned tag,const unsigned char * pos,const unsigned char * end,struct roseQsigCcRequestRes * cc_request_res)646 static const unsigned char *rose_dec_qsig_CcRequestRes(struct pri *ctrl,
647 	const char *name, unsigned tag, const unsigned char *pos, const unsigned char *end,
648 	struct roseQsigCcRequestRes *cc_request_res)
649 {
650 	int32_t value;
651 	int length;
652 	int seq_offset;
653 	const unsigned char *seq_end;
654 	const unsigned char *save_pos;
655 
656 	if (ctrl->debug & PRI_DEBUG_APDU) {
657 		pri_message(ctrl, "  %s CcRequestRes %s\n", name, asn1_tag2str(tag));
658 	}
659 	ASN1_CALL(pos, asn1_dec_length(pos, end, &length));
660 	ASN1_END_SETUP(seq_end, seq_offset, length, pos, end);
661 
662 	/*
663 	 * A sequence specifies an ordered list of component types.
664 	 * However, for simplicity we are not checking the order of
665 	 * the remaining optional components.
666 	 */
667 	cc_request_res->no_path_reservation = 0;	/* DEFAULT FALSE */
668 	cc_request_res->retain_service = 0;	/* DEFAULT FALSE */
669 	while (pos < seq_end && *pos != ASN1_INDEF_TERM) {
670 		save_pos = pos;
671 		ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
672 		switch (tag) {
673 		case ASN1_CLASS_CONTEXT_SPECIFIC | 0:
674 			ASN1_CALL(pos, asn1_dec_boolean(ctrl, "no-path-reservation", tag, pos,
675 				seq_end, &value));
676 			cc_request_res->no_path_reservation = value;
677 			break;
678 		case ASN1_CLASS_CONTEXT_SPECIFIC | 1:
679 			ASN1_CALL(pos, asn1_dec_boolean(ctrl, "retain-service", tag, pos, seq_end,
680 				&value));
681 			cc_request_res->retain_service = value;
682 			break;
683 		case ASN1_TYPE_NULL:
684 		case ASN1_CLASS_CONTEXT_SPECIFIC | 14:
685 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 14:
686 		case ASN1_CLASS_CONTEXT_SPECIFIC | 15:
687 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 15:
688 			ASN1_CALL(pos, rose_dec_qsig_CcExtension(ctrl, "extension", tag, pos,
689 				seq_end));
690 			break;
691 		default:
692 			pos = save_pos;
693 			goto cancel_options;
694 		}
695 	}
696 cancel_options:;
697 
698 	ASN1_END_FIXUP(ctrl, pos, seq_offset, seq_end, end);
699 
700 	return pos;
701 }
702 
703 /*!
704  * \brief Decode the Q.SIG CcbsRequest result argument parameters.
705  *
706  * \param ctrl D channel controller for diagnostic messages or global options.
707  * \param tag Component tag that identified this structure.
708  * \param pos Starting position of the ASN.1 component length.
709  * \param end End of ASN.1 decoding data buffer.
710  * \param args Arguments to fill in from the decoded buffer.
711  *
712  * \retval Start of the next ASN.1 component on success.
713  * \retval NULL on error.
714  */
rose_dec_qsig_CcbsRequest_RES(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_result_args * args)715 const unsigned char *rose_dec_qsig_CcbsRequest_RES(struct pri *ctrl, unsigned tag,
716 	const unsigned char *pos, const unsigned char *end, union rose_msg_result_args *args)
717 {
718 	ASN1_CHECK_TAG(ctrl, tag, tag, ASN1_TAG_SEQUENCE);
719 	return rose_dec_qsig_CcRequestRes(ctrl, "CcbsRequest", tag, pos, end,
720 		&args->qsig.CcbsRequest);
721 }
722 
723 /*!
724  * \brief Decode the Q.SIG CcnrRequest result argument parameters.
725  *
726  * \param ctrl D channel controller for diagnostic messages or global options.
727  * \param tag Component tag that identified this structure.
728  * \param pos Starting position of the ASN.1 component length.
729  * \param end End of ASN.1 decoding data buffer.
730  * \param args Arguments to fill in from the decoded buffer.
731  *
732  * \retval Start of the next ASN.1 component on success.
733  * \retval NULL on error.
734  */
rose_dec_qsig_CcnrRequest_RES(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_result_args * args)735 const unsigned char *rose_dec_qsig_CcnrRequest_RES(struct pri *ctrl, unsigned tag,
736 	const unsigned char *pos, const unsigned char *end, union rose_msg_result_args *args)
737 {
738 	ASN1_CHECK_TAG(ctrl, tag, tag, ASN1_TAG_SEQUENCE);
739 	return rose_dec_qsig_CcRequestRes(ctrl, "CcnrRequest", tag, pos, end,
740 		&args->qsig.CcnrRequest);
741 }
742 
743 /*!
744  * \internal
745  * \brief Decode the CcOptionalArg argument parameters.
746  *
747  * \param ctrl D channel controller for any diagnostic messages.
748  * \param name Field name
749  * \param tag Component tag that identified this production.
750  * \param pos Starting position of the ASN.1 component length.
751  * \param end End of ASN.1 decoding data buffer.
752  * \param cc_optional_arg Parameter storage to fill.
753  *
754  * \retval Start of the next ASN.1 component on success.
755  * \retval NULL on error.
756  */
rose_dec_qsig_CcOptionalArg(struct pri * ctrl,const char * name,unsigned tag,const unsigned char * pos,const unsigned char * end,struct roseQsigCcOptionalArg * cc_optional_arg)757 static const unsigned char *rose_dec_qsig_CcOptionalArg(struct pri *ctrl,
758 	const char *name, unsigned tag, const unsigned char *pos, const unsigned char *end,
759 	struct roseQsigCcOptionalArg *cc_optional_arg)
760 {
761 	int length;
762 	int seq_offset;
763 	int explicit_offset;
764 	const unsigned char *explicit_end;
765 	const unsigned char *seq_end;
766 	const unsigned char *save_pos;
767 
768 	if (ctrl->debug & PRI_DEBUG_APDU) {
769 		pri_message(ctrl, "  %s CcOptionalArg\n", name);
770 	}
771 	if (tag != (ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 0)) {
772 		cc_optional_arg->full_arg_present = 0;
773 		return rose_dec_qsig_CcExtension(ctrl, "extArg", tag, pos, end);
774 	}
775 	cc_optional_arg->full_arg_present = 1;
776 
777 	if (ctrl->debug & PRI_DEBUG_APDU) {
778 		pri_message(ctrl, "  fullArg %s\n", asn1_tag2str(tag));
779 	}
780 	ASN1_CALL(pos, asn1_dec_length(pos, end, &length));
781 	ASN1_END_SETUP(seq_end, seq_offset, length, pos, end);
782 
783 	ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
784 	ASN1_CALL(pos, rose_dec_PartyNumber(ctrl, "numberA", tag, pos, seq_end,
785 		&cc_optional_arg->number_a));
786 
787 	ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
788 	ASN1_CALL(pos, rose_dec_PartyNumber(ctrl, "numberB", tag, pos, seq_end,
789 		&cc_optional_arg->number_b));
790 
791 	ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
792 	ASN1_CHECK_TAG(ctrl, tag, tag & ~ASN1_PC_MASK, ASN1_CLASS_APPLICATION | 0);
793 	ASN1_CALL(pos, rose_dec_Q931ie(ctrl, "service", tag, pos, seq_end,
794 		&cc_optional_arg->q931ie, sizeof(cc_optional_arg->q931ie_contents)));
795 
796 	/*
797 	 * A sequence specifies an ordered list of component types.
798 	 * However, for simplicity we are not checking the order of
799 	 * the remaining optional components.
800 	 */
801 	cc_optional_arg->subaddr_a.length = 0;
802 	cc_optional_arg->subaddr_b.length = 0;
803 	while (pos < seq_end && *pos != ASN1_INDEF_TERM) {
804 		save_pos = pos;
805 		ASN1_CALL(pos, asn1_dec_tag(pos, seq_end, &tag));
806 		switch (tag) {
807 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 10:
808 			/* Remove EXPLICIT tag */
809 			if (ctrl->debug & PRI_DEBUG_APDU) {
810 				pri_message(ctrl, "  Explicit %s\n", asn1_tag2str(tag));
811 			}
812 			ASN1_CALL(pos, asn1_dec_length(pos, seq_end, &length));
813 			ASN1_END_SETUP(explicit_end, explicit_offset, length, pos, seq_end);
814 
815 			ASN1_CALL(pos, asn1_dec_tag(pos, explicit_end, &tag));
816 			ASN1_CALL(pos, rose_dec_PartySubaddress(ctrl, "subaddrA", tag, pos,
817 				explicit_end, &cc_optional_arg->subaddr_a));
818 
819 			ASN1_END_FIXUP(ctrl, pos, explicit_offset, explicit_end, seq_end);
820 			break;
821 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 11:
822 			/* Remove EXPLICIT tag */
823 			if (ctrl->debug & PRI_DEBUG_APDU) {
824 				pri_message(ctrl, "  Explicit %s\n", asn1_tag2str(tag));
825 			}
826 			ASN1_CALL(pos, asn1_dec_length(pos, seq_end, &length));
827 			ASN1_END_SETUP(explicit_end, explicit_offset, length, pos, seq_end);
828 
829 			ASN1_CALL(pos, asn1_dec_tag(pos, explicit_end, &tag));
830 			ASN1_CALL(pos, rose_dec_PartySubaddress(ctrl, "subaddrB", tag, pos,
831 				explicit_end, &cc_optional_arg->subaddr_b));
832 
833 			ASN1_END_FIXUP(ctrl, pos, explicit_offset, explicit_end, seq_end);
834 			break;
835 		case ASN1_TYPE_NULL:
836 		case ASN1_CLASS_CONTEXT_SPECIFIC | 14:
837 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 14:
838 		case ASN1_CLASS_CONTEXT_SPECIFIC | 15:
839 		case ASN1_CLASS_CONTEXT_SPECIFIC | ASN1_PC_CONSTRUCTED | 15:
840 			ASN1_CALL(pos, rose_dec_qsig_CcExtension(ctrl, "extension", tag, pos,
841 				seq_end));
842 			break;
843 		default:
844 			pos = save_pos;
845 			goto cancel_options;
846 		}
847 	}
848 cancel_options:;
849 
850 	ASN1_END_FIXUP(ctrl, pos, seq_offset, seq_end, end);
851 
852 	return pos;
853 }
854 
855 /*!
856  * \brief Decode the Q.SIG CcCancel invoke argument parameters.
857  *
858  * \param ctrl D channel controller for diagnostic messages or global options.
859  * \param tag Component tag that identified this structure.
860  * \param pos Starting position of the ASN.1 component length.
861  * \param end End of ASN.1 decoding data buffer.
862  * \param args Arguments to fill in from the decoded buffer.
863  *
864  * \retval Start of the next ASN.1 component on success.
865  * \retval NULL on error.
866  */
rose_dec_qsig_CcCancel_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)867 const unsigned char *rose_dec_qsig_CcCancel_ARG(struct pri *ctrl, unsigned tag,
868 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
869 {
870 	return rose_dec_qsig_CcOptionalArg(ctrl, "CcCancel", tag, pos, end,
871 		&args->qsig.CcCancel);
872 }
873 
874 /*!
875  * \brief Decode the Q.SIG CcExecPossible invoke argument parameters.
876  *
877  * \param ctrl D channel controller for diagnostic messages or global options.
878  * \param tag Component tag that identified this structure.
879  * \param pos Starting position of the ASN.1 component length.
880  * \param end End of ASN.1 decoding data buffer.
881  * \param args Arguments to fill in from the decoded buffer.
882  *
883  * \retval Start of the next ASN.1 component on success.
884  * \retval NULL on error.
885  */
rose_dec_qsig_CcExecPossible_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)886 const unsigned char *rose_dec_qsig_CcExecPossible_ARG(struct pri *ctrl, unsigned tag,
887 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
888 {
889 	return rose_dec_qsig_CcOptionalArg(ctrl, "CcExecPossible", tag, pos, end,
890 		&args->qsig.CcCancel);
891 }
892 
893 /*!
894  * \brief Decode the Q.SIG CcPathReserve invoke argument parameters.
895  *
896  * \param ctrl D channel controller for diagnostic messages or global options.
897  * \param tag Component tag that identified this structure.
898  * \param pos Starting position of the ASN.1 component length.
899  * \param end End of ASN.1 decoding data buffer.
900  * \param args Arguments to fill in from the decoded buffer.
901  *
902  * \retval Start of the next ASN.1 component on success.
903  * \retval NULL on error.
904  */
rose_dec_qsig_CcPathReserve_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)905 const unsigned char *rose_dec_qsig_CcPathReserve_ARG(struct pri *ctrl, unsigned tag,
906 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
907 {
908 	return rose_dec_qsig_CcExtension(ctrl, "CcPathReserve", tag, pos, end);
909 }
910 
911 /*!
912  * \brief Decode the Q.SIG CcPathReserve result argument parameters.
913  *
914  * \param ctrl D channel controller for diagnostic messages or global options.
915  * \param tag Component tag that identified this structure.
916  * \param pos Starting position of the ASN.1 component length.
917  * \param end End of ASN.1 decoding data buffer.
918  * \param args Arguments to fill in from the decoded buffer.
919  *
920  * \retval Start of the next ASN.1 component on success.
921  * \retval NULL on error.
922  */
rose_dec_qsig_CcPathReserve_RES(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_result_args * args)923 const unsigned char *rose_dec_qsig_CcPathReserve_RES(struct pri *ctrl, unsigned tag,
924 	const unsigned char *pos, const unsigned char *end, union rose_msg_result_args *args)
925 {
926 	return rose_dec_qsig_CcExtension(ctrl, "CcPathReserve", tag, pos, end);
927 }
928 
929 /*!
930  * \brief Decode the Q.SIG CcRingout invoke argument parameters.
931  *
932  * \param ctrl D channel controller for diagnostic messages or global options.
933  * \param tag Component tag that identified this structure.
934  * \param pos Starting position of the ASN.1 component length.
935  * \param end End of ASN.1 decoding data buffer.
936  * \param args Arguments to fill in from the decoded buffer.
937  *
938  * \retval Start of the next ASN.1 component on success.
939  * \retval NULL on error.
940  */
rose_dec_qsig_CcRingout_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)941 const unsigned char *rose_dec_qsig_CcRingout_ARG(struct pri *ctrl, unsigned tag,
942 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
943 {
944 	return rose_dec_qsig_CcExtension(ctrl, "CcRingout", tag, pos, end);
945 }
946 
947 /*!
948  * \brief Decode the Q.SIG CcSuspend invoke argument parameters.
949  *
950  * \param ctrl D channel controller for diagnostic messages or global options.
951  * \param tag Component tag that identified this structure.
952  * \param pos Starting position of the ASN.1 component length.
953  * \param end End of ASN.1 decoding data buffer.
954  * \param args Arguments to fill in from the decoded buffer.
955  *
956  * \retval Start of the next ASN.1 component on success.
957  * \retval NULL on error.
958  */
rose_dec_qsig_CcSuspend_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)959 const unsigned char *rose_dec_qsig_CcSuspend_ARG(struct pri *ctrl, unsigned tag,
960 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
961 {
962 	return rose_dec_qsig_CcExtension(ctrl, "CcSuspend", tag, pos, end);
963 }
964 
965 /*!
966  * \brief Decode the Q.SIG CcResume invoke argument parameters.
967  *
968  * \param ctrl D channel controller for diagnostic messages or global options.
969  * \param tag Component tag that identified this structure.
970  * \param pos Starting position of the ASN.1 component length.
971  * \param end End of ASN.1 decoding data buffer.
972  * \param args Arguments to fill in from the decoded buffer.
973  *
974  * \retval Start of the next ASN.1 component on success.
975  * \retval NULL on error.
976  */
rose_dec_qsig_CcResume_ARG(struct pri * ctrl,unsigned tag,const unsigned char * pos,const unsigned char * end,union rose_msg_invoke_args * args)977 const unsigned char *rose_dec_qsig_CcResume_ARG(struct pri *ctrl, unsigned tag,
978 	const unsigned char *pos, const unsigned char *end, union rose_msg_invoke_args *args)
979 {
980 	return rose_dec_qsig_CcExtension(ctrl, "CcResume", tag, pos, end);
981 }
982 
983 /* ------------------------------------------------------------------- */
984 /* end rose_qsig_cc.c */
985