5 * "TBL" ASN.1 module encode/decode/print/free C src.
7 * This file was generated by snacc on Tue Mar 19 07:24:47 2002
9 * UBC snacc written by Mike Sample
11 * NOTE: This is a machine generated file - editing not recommended
21 BEncTBLRangeContent
PARAMS ((b
, v
),
30 itemLen
= BEncAsnIntContent (b
, (&v
->to
));
31 BEncDefLenTo127 (b
, itemLen
);
33 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 1);
37 itemLen
= BEncAsnIntContent (b
, (&v
->from
));
38 BEncDefLenTo127 (b
, itemLen
);
40 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 0);
46 } /* BEncTBLRangeContent */
49 BDecTBLRangeContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
54 AsnLen
*bytesDecoded _AND_
58 AsnLen totalElmtsLen1
= 0;
61 int mandatoryElmtCount1
= 0;
64 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
66 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 0))))
68 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
69 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->from
), &totalElmtsLen1
, env
);
70 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
76 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 1))))
78 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
79 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->to
), &totalElmtsLen1
, env
);
81 if (elmtLen0
== INDEFINITE_LEN
)
82 BDecEoc (b
, &totalElmtsLen1
, env
);
83 else if (totalElmtsLen1
!= elmtLen0
)
93 (*bytesDecoded
) += totalElmtsLen1
;
94 } /* BDecTBLRangeContent */
97 PrintTBLRange
PARAMS ((f
, v
, indent
),
100 unsigned short int indent
)
105 fprintf (f
,"{ -- SEQUENCE --\n");
107 Indent (f
, indent
+ stdIndentG
);
109 PrintAsnInt (f
, (&v
->from
), indent
+ stdIndentG
);
111 Indent (f
, indent
+ stdIndentG
);
113 PrintAsnInt (f
, (&v
->to
), indent
+ stdIndentG
);
117 } /* PrintTBLRange */
120 FreeTBLRange
PARAMS ((v
),
126 FreeAsnInt ((&v
->from
));
128 FreeAsnInt ((&v
->to
));
136 BEncTBLNamedNumberContent
PARAMS ((b
, v
),
145 itemLen
= BEncAsnIntContent (b
, (&v
->value
));
146 BEncDefLenTo127 (b
, itemLen
);
148 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 1);
152 itemLen
= BEncPrintableStringContent (b
, (&v
->name
));
153 itemLen
+= BEncDefLen (b
, itemLen
);
154 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 0);
160 } /* BEncTBLNamedNumberContent */
163 BDecTBLNamedNumberContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
166 AsnLen elmtLen0 _AND_
167 TBLNamedNumber
*v _AND_
168 AsnLen
*bytesDecoded _AND_
172 AsnLen totalElmtsLen1
= 0;
175 int mandatoryElmtCount1
= 0;
178 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
180 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 0)) ||
181 (tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 0))))
183 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
184 BDecPrintableStringContent (b
, tagId1
, elmtLen1
, (&v
->name
), &totalElmtsLen1
, env
);
185 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
191 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 1))))
193 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
194 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->value
), &totalElmtsLen1
, env
);
196 if (elmtLen0
== INDEFINITE_LEN
)
197 BDecEoc (b
, &totalElmtsLen1
, env
);
198 else if (totalElmtsLen1
!= elmtLen0
)
208 (*bytesDecoded
) += totalElmtsLen1
;
209 } /* BDecTBLNamedNumberContent */
212 PrintTBLNamedNumber
PARAMS ((f
, v
, indent
),
214 TBLNamedNumber
*v _AND_
215 unsigned short int indent
)
220 fprintf (f
,"{ -- SEQUENCE --\n");
222 Indent (f
, indent
+ stdIndentG
);
224 PrintPrintableString (f
, (&v
->name
), indent
+ stdIndentG
);
226 Indent (f
, indent
+ stdIndentG
);
227 fprintf (f
,"value ");
228 PrintAsnInt (f
, (&v
->value
), indent
+ stdIndentG
);
232 } /* PrintTBLNamedNumber */
235 FreeTBLNamedNumber
PARAMS ((v
),
241 FreePrintableString ((&v
->name
));
243 FreeAsnInt ((&v
->value
));
245 } /* FreeTBLNamedNumber */
251 BEncTBLNamedNumberListContent
PARAMS ((b
, v
),
253 TBLNamedNumberList
*v
)
261 FOR_EACH_LIST_ELMT_RVS (component
, v
)
264 itemLen
= BEncTBLNamedNumberContent (b
, component
);
265 itemLen
+= BEncConsLen (b
, itemLen
);
266 itemLen
+= BEncTag1 (b
, UNIV
, CONS
, 16);
272 } /* BEncTBLNamedNumberListContent */
275 BDecTBLNamedNumberListContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
278 AsnLen elmtLen0 _AND_
279 TBLNamedNumberList
*v _AND_
280 AsnLen
*bytesDecoded _AND_
284 AsnLen totalElmtsLen1
= 0;
287 int mandatoryElmtCount1
= 0;
290 for (totalElmtsLen1
= 0; (totalElmtsLen1
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
);)
292 TBLNamedNumber
**tmpVar
;
293 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
295 if ((tagId1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
297 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
298 break; /* got EOC so can exit this SET OF/SEQ OF's for loop*/
300 if ((tagId1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
302 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
303 tmpVar
= (TBLNamedNumber
**) AsnListAppend (v
);
304 (*tmpVar
) = (TBLNamedNumber
*) Asn1Alloc (sizeof (TBLNamedNumber
));
305 CheckAsn1Alloc ((*tmpVar
), env
);
306 BDecTBLNamedNumberContent (b
, tagId1
, elmtLen1
, (*tmpVar
), &totalElmtsLen1
, env
);
307 } /* end of tag check if */
310 Asn1Error ("Unexpected Tag\n");
315 (*bytesDecoded
) += totalElmtsLen1
;
316 } /* BDecTBLNamedNumberListContent */
319 PrintTBLNamedNumberList
PARAMS ((f
, v
, indent
),
321 TBLNamedNumberList
*v _AND_
322 unsigned short int indent
)
327 fprintf (f
,"{ -- SEQUENCE OF -- \n");
328 FOR_EACH_LIST_ELMT (tmp
, v
)
330 Indent (f
, indent
+ stdIndentG
);
331 PrintTBLNamedNumber (f
, tmp
, indent
+ stdIndentG
);
332 if (tmp
!= (TBLNamedNumber
*)LAST_LIST_ELMT (v
))
338 } /* PrintTBLNamedNumberList */
341 FreeTBLNamedNumberList
PARAMS ((v
),
342 TBLNamedNumberList
*v
)
349 for (l
= FIRST_LIST_NODE (v
); l
!= NULL
; )
351 FreeTBLNamedNumber ((l
->data
));
357 } /* FreeTBLNamedNumberList */
363 BEncTBLTypeRefContent
PARAMS ((b
, v
),
372 itemLen
= BEncAsnBoolContent (b
, (&v
->implicit
));
373 BEncDefLenTo127 (b
, itemLen
);
375 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 1);
379 itemLen
= BEncTBLTypeDefIdContent (b
, (&v
->typeDef
));
380 BEncDefLenTo127 (b
, itemLen
);
382 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
388 } /* BEncTBLTypeRefContent */
391 BDecTBLTypeRefContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
394 AsnLen elmtLen0 _AND_
396 AsnLen
*bytesDecoded _AND_
400 AsnLen totalElmtsLen1
= 0;
403 int mandatoryElmtCount1
= 0;
406 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
408 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
410 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
411 BDecTBLTypeDefIdContent (b
, tagId1
, elmtLen1
, (&v
->typeDef
), &totalElmtsLen1
, env
);
412 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
418 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, BOOLEAN_TAG_CODE
))))
420 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
421 BDecAsnBoolContent (b
, tagId1
, elmtLen1
, (&v
->implicit
), &totalElmtsLen1
, env
);
423 if (elmtLen0
== INDEFINITE_LEN
)
424 BDecEoc (b
, &totalElmtsLen1
, env
);
425 else if (totalElmtsLen1
!= elmtLen0
)
435 (*bytesDecoded
) += totalElmtsLen1
;
436 } /* BDecTBLTypeRefContent */
439 PrintTBLTypeRef
PARAMS ((f
, v
, indent
),
442 unsigned short int indent
)
447 fprintf (f
,"{ -- SEQUENCE --\n");
449 Indent (f
, indent
+ stdIndentG
);
450 fprintf (f
,"typeDef ");
451 PrintTBLTypeDefId (f
, (&v
->typeDef
), indent
+ stdIndentG
);
453 Indent (f
, indent
+ stdIndentG
);
454 fprintf (f
,"implicit ");
455 PrintAsnBool (f
, (&v
->implicit
), indent
+ stdIndentG
);
459 } /* PrintTBLTypeRef */
462 FreeTBLTypeRef
PARAMS ((v
),
468 FreeTBLTypeDefId ((&v
->typeDef
));
470 FreeAsnBool ((&v
->implicit
));
472 } /* FreeTBLTypeRef */
478 BEncTBLTagContent
PARAMS ((b
, v
),
487 itemLen
= BEncAsnIntContent (b
, (&v
->code
));
488 BEncDefLenTo127 (b
, itemLen
);
490 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
494 itemLen
= BEncTBLTagClassContent (b
, (&v
->tclass
));
495 BEncDefLenTo127 (b
, itemLen
);
497 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 10);
503 } /* BEncTBLTagContent */
506 BDecTBLTagContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
509 AsnLen elmtLen0 _AND_
511 AsnLen
*bytesDecoded _AND_
515 AsnLen totalElmtsLen1
= 0;
518 int mandatoryElmtCount1
= 0;
521 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
523 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, ENUM_TAG_CODE
))))
525 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
526 BDecTBLTagClassContent (b
, tagId1
, elmtLen1
, (&v
->tclass
), &totalElmtsLen1
, env
);
527 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
533 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
535 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
536 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->code
), &totalElmtsLen1
, env
);
538 if (elmtLen0
== INDEFINITE_LEN
)
539 BDecEoc (b
, &totalElmtsLen1
, env
);
540 else if (totalElmtsLen1
!= elmtLen0
)
550 (*bytesDecoded
) += totalElmtsLen1
;
551 } /* BDecTBLTagContent */
554 PrintTBLTag
PARAMS ((f
, v
, indent
),
557 unsigned short int indent
)
562 fprintf (f
,"{ -- SEQUENCE --\n");
564 Indent (f
, indent
+ stdIndentG
);
565 fprintf (f
,"tclass ");
566 PrintTBLTagClass (f
, (&v
->tclass
), indent
+ stdIndentG
);
568 Indent (f
, indent
+ stdIndentG
);
570 PrintAsnInt (f
, (&v
->code
), indent
+ stdIndentG
);
577 FreeTBLTag
PARAMS ((v
),
583 FreeTBLTagClass ((&v
->tclass
));
585 FreeAsnInt ((&v
->code
));
593 BEncTBLTypeSeqOfContent
PARAMS ((b
, v
),
603 FOR_EACH_LIST_ELMT_RVS (component
, v
)
606 itemLen
= BEncTBLTagContent (b
, component
);
607 itemLen
+= BEncConsLen (b
, itemLen
);
608 itemLen
+= BEncTag1 (b
, UNIV
, CONS
, 16);
614 } /* BEncTBLTypeSeqOfContent */
617 BDecTBLTypeSeqOfContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
620 AsnLen elmtLen0 _AND_
621 TBLTypeSeqOf
*v _AND_
622 AsnLen
*bytesDecoded _AND_
626 AsnLen totalElmtsLen1
= 0;
629 int mandatoryElmtCount1
= 0;
632 for (totalElmtsLen1
= 0; (totalElmtsLen1
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
);)
635 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
637 if ((tagId1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
639 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
640 break; /* got EOC so can exit this SET OF/SEQ OF's for loop*/
642 if ((tagId1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
644 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
645 tmpVar
= (TBLTag
**) AsnListAppend (v
);
646 (*tmpVar
) = (TBLTag
*) Asn1Alloc (sizeof (TBLTag
));
647 CheckAsn1Alloc ((*tmpVar
), env
);
648 BDecTBLTagContent (b
, tagId1
, elmtLen1
, (*tmpVar
), &totalElmtsLen1
, env
);
649 } /* end of tag check if */
652 Asn1Error ("Unexpected Tag\n");
657 (*bytesDecoded
) += totalElmtsLen1
;
658 } /* BDecTBLTypeSeqOfContent */
661 PrintTBLTypeSeqOf
PARAMS ((f
, v
, indent
),
663 TBLTypeSeqOf
*v _AND_
664 unsigned short int indent
)
669 fprintf (f
,"{ -- SEQUENCE OF -- \n");
670 FOR_EACH_LIST_ELMT (tmp
, v
)
672 Indent (f
, indent
+ stdIndentG
);
673 PrintTBLTag (f
, tmp
, indent
+ stdIndentG
);
674 if (tmp
!= (TBLTag
*)LAST_LIST_ELMT (v
))
680 } /* PrintTBLTypeSeqOf */
683 FreeTBLTypeSeqOf
PARAMS ((v
),
691 for (l
= FIRST_LIST_NODE (v
); l
!= NULL
; )
693 FreeTBLTag ((l
->data
));
699 } /* FreeTBLTypeSeqOf */
705 BEncTBLTypeContentSeqOfContent
PARAMS ((b
, v
),
707 TBLTypeContentSeqOf
*v
)
715 FOR_EACH_LIST_ELMT_RVS (component
, v
)
718 itemLen
= BEncTBLTypeContent (b
, component
);
719 itemLen
+= BEncConsLen (b
, itemLen
);
720 itemLen
+= BEncTag1 (b
, UNIV
, CONS
, 16);
726 } /* BEncTBLTypeContentSeqOfContent */
729 BDecTBLTypeContentSeqOfContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
732 AsnLen elmtLen0 _AND_
733 TBLTypeContentSeqOf
*v _AND_
734 AsnLen
*bytesDecoded _AND_
738 AsnLen totalElmtsLen1
= 0;
741 int mandatoryElmtCount1
= 0;
744 for (totalElmtsLen1
= 0; (totalElmtsLen1
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
);)
747 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
749 if ((tagId1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
751 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
752 break; /* got EOC so can exit this SET OF/SEQ OF's for loop*/
754 if ((tagId1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
756 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
757 tmpVar
= (TBLType
**) AsnListAppend (v
);
758 (*tmpVar
) = (TBLType
*) Asn1Alloc (sizeof (TBLType
));
759 CheckAsn1Alloc ((*tmpVar
), env
);
760 BDecTBLTypeContent (b
, tagId1
, elmtLen1
, (*tmpVar
), &totalElmtsLen1
, env
);
761 } /* end of tag check if */
764 Asn1Error ("Unexpected Tag\n");
769 (*bytesDecoded
) += totalElmtsLen1
;
770 } /* BDecTBLTypeContentSeqOfContent */
773 PrintTBLTypeContentSeqOf
PARAMS ((f
, v
, indent
),
775 TBLTypeContentSeqOf
*v _AND_
776 unsigned short int indent
)
781 fprintf (f
,"{ -- SEQUENCE OF -- \n");
782 FOR_EACH_LIST_ELMT (tmp
, v
)
784 Indent (f
, indent
+ stdIndentG
);
785 PrintTBLType (f
, tmp
, indent
+ stdIndentG
);
786 if (tmp
!= (TBLType
*)LAST_LIST_ELMT (v
))
792 } /* PrintTBLTypeContentSeqOf */
795 FreeTBLTypeContentSeqOf
PARAMS ((v
),
796 TBLTypeContentSeqOf
*v
)
803 for (l
= FIRST_LIST_NODE (v
); l
!= NULL
; )
805 FreeTBLType ((l
->data
));
811 } /* FreeTBLTypeContentSeqOf */
817 BEncTBLTypeContent
PARAMS ((b
, v
),
826 if (NOT_NULL ((v
->values
)))
829 itemLen
= BEncTBLNamedNumberListContent (b
, (v
->values
));
830 itemLen
+= BEncConsLen (b
, itemLen
);
831 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 6);
836 if (NOT_NULL ((v
->constraint
)))
839 itemLen
= BEncTBLRangeContent (b
, (v
->constraint
));
840 itemLen
+= BEncConsLen (b
, itemLen
);
841 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 5);
846 if (ASNOCTS_PRESENT ((&v
->fieldName
)))
848 itemLen
= BEncPrintableStringContent (b
, (&v
->fieldName
));
849 itemLen
+= BEncDefLen (b
, itemLen
);
850 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 4);
856 itemLen
= BEncTBLTypeContentContent (b
, (v
->content
));
857 itemLen
+= BEncConsLen (b
, itemLen
);
858 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 3);
862 if (NOT_NULL ((v
->tagList
)))
865 itemLen
= BEncTBLTypeSeqOfContent (b
, (v
->tagList
));
866 itemLen
+= BEncConsLen (b
, itemLen
);
867 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 2);
872 itemLen
= BEncAsnBoolContent (b
, (&v
->optional
));
873 BEncDefLenTo127 (b
, itemLen
);
875 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 1);
879 itemLen
= BEncTBLTypeIdContent (b
, (&v
->typeId
));
880 BEncDefLenTo127 (b
, itemLen
);
882 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 0);
888 } /* BEncTBLTypeContent */
891 BDecTBLTypeContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
894 AsnLen elmtLen0 _AND_
896 AsnLen
*bytesDecoded _AND_
900 AsnLen totalElmtsLen1
= 0;
903 int mandatoryElmtCount1
= 0;
904 AsnLen totalElmtsLen2
= 0;
907 AsnLen totalElmtsLen3
= 0;
912 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
914 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 0))))
916 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
917 BDecTBLTypeIdContent (b
, tagId1
, elmtLen1
, (&v
->typeId
), &totalElmtsLen1
, env
);
918 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
924 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 1))))
926 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
927 BDecAsnBoolContent (b
, tagId1
, elmtLen1
, (&v
->optional
), &totalElmtsLen1
, env
);
928 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
934 if (((tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 2))))
936 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
937 (v
->tagList
) = AsnListNew (sizeof (char*));
938 CheckAsn1Alloc ((v
->tagList
), env
);
939 BDecTBLTypeSeqOfContent (b
, tagId1
, elmtLen1
, (v
->tagList
), &totalElmtsLen1
, env
);
940 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
944 if (((tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 3))))
946 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
947 (v
->content
) = (TBLTypeContent
*) Asn1Alloc (sizeof (TBLTypeContent
));
948 CheckAsn1Alloc ((v
->content
), env
);
949 tagId2
= BDecTag (b
, &totalElmtsLen1
, env
);
950 elmtLen2
= BDecLen (b
, &totalElmtsLen1
, env
);
951 BDecTBLTypeContentContent (b
, tagId2
, elmtLen2
, (v
->content
), &totalElmtsLen1
, env
);
952 if (elmtLen1
== INDEFINITE_LEN
)
953 BDecEoc(b
, &totalElmtsLen1
, env
);
954 if (elmtLen1
== INDEFINITE_LEN
)
955 BDecEoc (b
, &totalElmtsLen1
, env
);
956 if ((elmtLen0
!= INDEFINITE_LEN
) && (totalElmtsLen1
== elmtLen0
))
960 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
962 if ((elmtLen0
== INDEFINITE_LEN
) && (tagId1
== EOC_TAG_ID
))
964 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
973 if ((!seqDone
) && ((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 4)) ||
974 (tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 4))))
976 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
977 BDecPrintableStringContent (b
, tagId1
, elmtLen1
, (&v
->fieldName
), &totalElmtsLen1
, env
);
978 if ((elmtLen0
!= INDEFINITE_LEN
) && (totalElmtsLen1
== elmtLen0
))
982 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
984 if ((elmtLen0
== INDEFINITE_LEN
) && (tagId1
== EOC_TAG_ID
))
986 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
993 if ((!seqDone
) && ((tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 5))))
995 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
996 (v
->constraint
) = (TBLRange
*) Asn1Alloc (sizeof (TBLRange
));
997 CheckAsn1Alloc ((v
->constraint
), env
);
998 BDecTBLRangeContent (b
, tagId1
, elmtLen1
, (v
->constraint
), &totalElmtsLen1
, env
);
999 if ((elmtLen0
!= INDEFINITE_LEN
) && (totalElmtsLen1
== elmtLen0
))
1003 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1005 if ((elmtLen0
== INDEFINITE_LEN
) && (tagId1
== EOC_TAG_ID
))
1007 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
1014 if ((!seqDone
) && ((tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 6))))
1016 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1017 (v
->values
) = AsnListNew (sizeof (char*));
1018 CheckAsn1Alloc ((v
->values
), env
);
1019 BDecTBLNamedNumberListContent (b
, tagId1
, elmtLen1
, (v
->values
), &totalElmtsLen1
, env
);
1021 if (elmtLen0
== INDEFINITE_LEN
)
1022 BDecEoc (b
, &totalElmtsLen1
, env
);
1023 else if (totalElmtsLen1
!= elmtLen0
)
1024 longjmp (env
, -122);
1029 longjmp (env
, -123);
1031 (*bytesDecoded
) += totalElmtsLen1
;
1032 } /* BDecTBLTypeContent */
1035 PrintTBLType
PARAMS ((f
, v
, indent
),
1038 unsigned short int indent
)
1043 fprintf (f
,"{ -- SEQUENCE --\n");
1045 Indent (f
, indent
+ stdIndentG
);
1046 fprintf (f
,"typeId ");
1047 PrintTBLTypeId (f
, (&v
->typeId
), indent
+ stdIndentG
);
1049 Indent (f
, indent
+ stdIndentG
);
1050 fprintf (f
,"optional ");
1051 PrintAsnBool (f
, (&v
->optional
), indent
+ stdIndentG
);
1053 if (NOT_NULL ((v
->tagList
)))
1055 Indent (f
, indent
+ stdIndentG
);
1056 fprintf (f
,"tagList ");
1057 PrintTBLTypeSeqOf (f
, (v
->tagList
), indent
+ stdIndentG
);
1060 Indent (f
, indent
+ stdIndentG
);
1061 fprintf (f
,"content ");
1062 PrintTBLTypeContent (f
, (v
->content
), indent
+ stdIndentG
);
1063 if (ASNOCTS_PRESENT ((&v
->fieldName
)))
1066 Indent (f
, indent
+ stdIndentG
);
1067 fprintf (f
,"fieldName ");
1068 PrintPrintableString (f
, (&v
->fieldName
), indent
+ stdIndentG
);
1070 if (NOT_NULL ((v
->constraint
)))
1073 Indent (f
, indent
+ stdIndentG
);
1074 fprintf (f
,"constraint ");
1075 PrintTBLRange (f
, (v
->constraint
), indent
+ stdIndentG
);
1077 if (NOT_NULL ((v
->values
)))
1080 Indent (f
, indent
+ stdIndentG
);
1081 fprintf (f
,"values ");
1082 PrintTBLNamedNumberList (f
, (v
->values
), indent
+ stdIndentG
);
1087 } /* PrintTBLType */
1090 FreeTBLType
PARAMS ((v
),
1096 FreeTBLTypeId ((&v
->typeId
));
1098 FreeAsnBool ((&v
->optional
));
1100 if (NOT_NULL ((v
->tagList
)))
1102 FreeTBLTypeSeqOf ((v
->tagList
));
1103 Asn1Free ((v
->tagList
));
1106 FreeTBLTypeContent ((v
->content
));
1107 Asn1Free ((v
->content
));
1109 if (ASNOCTS_PRESENT ((&v
->fieldName
)))
1111 FreePrintableString ((&v
->fieldName
));
1114 if (NOT_NULL ((v
->constraint
)))
1116 FreeTBLRange ((v
->constraint
));
1117 Asn1Free ((v
->constraint
));
1120 if (NOT_NULL ((v
->values
)))
1122 FreeTBLNamedNumberList ((v
->values
));
1123 Asn1Free ((v
->values
));
1132 BEncTBLTypeContentContent
PARAMS ((b
, v
),
1136 AsnLen totalLen
= 0;
1141 switch (v
->choiceId
)
1143 case TBLTYPECONTENT_PRIMTYPE
:
1144 itemLen
= BEncAsnNullContent (b
, (&v
->a
.primType
));
1145 BEncDefLenTo127 (b
, itemLen
);
1147 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 0);
1149 totalLen
+= itemLen
;
1153 case TBLTYPECONTENT_ELMTS
:
1155 itemLen
= BEncTBLTypeContentSeqOfContent (b
, (v
->a
.elmts
));
1156 itemLen
+= BEncConsLen (b
, itemLen
);
1157 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 1);
1159 totalLen
+= itemLen
;
1163 case TBLTYPECONTENT_TYPEREF
:
1165 itemLen
= BEncTBLTypeRefContent (b
, (v
->a
.typeRef
));
1166 itemLen
+= BEncConsLen (b
, itemLen
);
1167 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 2);
1169 totalLen
+= itemLen
;
1176 } /* BEncTBLTypeContentContent */
1179 BDecTBLTypeContentContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
1182 AsnLen elmtLen0 _AND_
1183 TBLTypeContent
*v _AND_
1184 AsnLen
*bytesDecoded _AND_
1187 int seqDone
= FALSE
;
1188 AsnLen totalElmtsLen1
= 0;
1191 int mandatoryElmtCount1
= 0;
1196 case MAKE_TAG_ID (CNTX
, PRIM
, 0):
1197 (v
->choiceId
) = TBLTYPECONTENT_PRIMTYPE
;
1198 BDecAsnNullContent (b
, tagId0
, elmtLen0
, (&v
->a
.primType
), &totalElmtsLen1
, env
);
1201 case MAKE_TAG_ID (CNTX
, CONS
, 1):
1202 (v
->choiceId
) = TBLTYPECONTENT_ELMTS
;
1203 (v
->a
.elmts
) = AsnListNew (sizeof (char*));
1204 CheckAsn1Alloc ((v
->a
.elmts
), env
);
1205 BDecTBLTypeContentSeqOfContent (b
, tagId0
, elmtLen0
, (v
->a
.elmts
), &totalElmtsLen1
, env
);
1208 case MAKE_TAG_ID (CNTX
, CONS
, 2):
1209 (v
->choiceId
) = TBLTYPECONTENT_TYPEREF
;
1210 (v
->a
.typeRef
) = (TBLTypeRef
*) Asn1Alloc (sizeof (TBLTypeRef
));
1211 CheckAsn1Alloc ((v
->a
.typeRef
), env
);
1212 BDecTBLTypeRefContent (b
, tagId0
, elmtLen0
, (v
->a
.typeRef
), &totalElmtsLen1
, env
);
1216 Asn1Error ("ERROR - unexpected tag in CHOICE\n");
1217 longjmp (env
, -124);
1220 (*bytesDecoded
) += totalElmtsLen1
;
1221 } /* BDecTBLTypeContentContent */
1224 PrintTBLTypeContent
PARAMS ((f
, v
, indent
),
1226 TBLTypeContent
*v _AND_
1227 unsigned short int indent
)
1229 switch (v
->choiceId
)
1231 case TBLTYPECONTENT_PRIMTYPE
:
1232 fprintf (f
,"primType ");
1233 PrintAsnNull (f
, (&v
->a
.primType
), indent
+ stdIndentG
);
1236 case TBLTYPECONTENT_ELMTS
:
1237 fprintf (f
,"elmts ");
1238 PrintTBLTypeContentSeqOf (f
, (v
->a
.elmts
), indent
+ stdIndentG
);
1241 case TBLTYPECONTENT_TYPEREF
:
1242 fprintf (f
,"typeRef ");
1243 PrintTBLTypeRef (f
, (v
->a
.typeRef
), indent
+ stdIndentG
);
1247 } /* PrintTBLTypeContent */
1250 FreeTBLTypeContent
PARAMS ((v
),
1256 switch (v
->choiceId
)
1258 case TBLTYPECONTENT_ELMTS
:
1259 FreeTBLTypeContentSeqOf ((v
->a
.elmts
));
1260 Asn1Free ((v
->a
.elmts
));
1264 case TBLTYPECONTENT_TYPEREF
:
1265 FreeTBLTypeRef ((v
->a
.typeRef
));
1266 Asn1Free ((v
->a
.typeRef
));
1271 } /* FreeTBLTypeContent */
1277 BEncTBLTypeDefContent
PARAMS ((b
, v
),
1281 AsnLen totalLen
= 0;
1286 if (NOT_NULL ((v
->isPdu
)))
1288 itemLen
= BEncAsnNullContent (b
, (v
->isPdu
));
1289 BEncDefLenTo127 (b
, itemLen
);
1291 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 5);
1293 totalLen
+= itemLen
;
1297 itemLen
= BEncTBLTypeContent (b
, (v
->type
));
1298 itemLen
+= BEncConsLen (b
, itemLen
);
1299 itemLen
+= BEncTag1 (b
, UNIV
, CONS
, 16);
1301 totalLen
+= itemLen
;
1303 itemLen
= BEncPrintableStringContent (b
, (&v
->typeName
));
1304 itemLen
+= BEncDefLen (b
, itemLen
);
1305 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 19);
1307 totalLen
+= itemLen
;
1309 itemLen
= BEncTBLTypeDefIdContent (b
, (&v
->typeDefId
));
1310 BEncDefLenTo127 (b
, itemLen
);
1312 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
1314 totalLen
+= itemLen
;
1318 } /* BEncTBLTypeDefContent */
1321 BDecTBLTypeDefContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
1324 AsnLen elmtLen0 _AND_
1326 AsnLen
*bytesDecoded _AND_
1329 int seqDone
= FALSE
;
1330 AsnLen totalElmtsLen1
= 0;
1333 int mandatoryElmtCount1
= 0;
1336 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1338 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
1340 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1341 BDecTBLTypeDefIdContent (b
, tagId1
, elmtLen1
, (&v
->typeDefId
), &totalElmtsLen1
, env
);
1342 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1345 longjmp (env
, -125);
1348 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, PRINTABLESTRING_TAG_CODE
)) ||
1349 (tagId1
== MAKE_TAG_ID (UNIV
, CONS
, PRINTABLESTRING_TAG_CODE
))))
1351 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1352 BDecPrintableStringContent (b
, tagId1
, elmtLen1
, (&v
->typeName
), &totalElmtsLen1
, env
);
1353 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1356 longjmp (env
, -126);
1359 if (((tagId1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))))
1361 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1362 (v
->type
) = (TBLType
*) Asn1Alloc (sizeof (TBLType
));
1363 CheckAsn1Alloc ((v
->type
), env
);
1364 BDecTBLTypeContent (b
, tagId1
, elmtLen1
, (v
->type
), &totalElmtsLen1
, env
);
1365 if ((elmtLen0
!= INDEFINITE_LEN
) && (totalElmtsLen1
== elmtLen0
))
1369 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1371 if ((elmtLen0
== INDEFINITE_LEN
) && (tagId1
== EOC_TAG_ID
))
1373 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
1379 longjmp (env
, -127);
1382 if ((!seqDone
) && ((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, NULLTYPE_TAG_CODE
))))
1384 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1385 (v
->isPdu
) = (AsnNull
*) Asn1Alloc (sizeof (AsnNull
));
1386 CheckAsn1Alloc ((v
->isPdu
), env
);
1387 BDecAsnNullContent (b
, tagId1
, elmtLen1
, (v
->isPdu
), &totalElmtsLen1
, env
);
1389 if (elmtLen0
== INDEFINITE_LEN
)
1390 BDecEoc (b
, &totalElmtsLen1
, env
);
1391 else if (totalElmtsLen1
!= elmtLen0
)
1392 longjmp (env
, -128);
1397 longjmp (env
, -129);
1399 (*bytesDecoded
) += totalElmtsLen1
;
1400 } /* BDecTBLTypeDefContent */
1403 PrintTBLTypeDef
PARAMS ((f
, v
, indent
),
1406 unsigned short int indent
)
1411 fprintf (f
,"{ -- SEQUENCE --\n");
1413 Indent (f
, indent
+ stdIndentG
);
1414 fprintf (f
,"typeDefId ");
1415 PrintTBLTypeDefId (f
, (&v
->typeDefId
), indent
+ stdIndentG
);
1417 Indent (f
, indent
+ stdIndentG
);
1418 fprintf (f
,"typeName ");
1419 PrintPrintableString (f
, (&v
->typeName
), indent
+ stdIndentG
);
1421 Indent (f
, indent
+ stdIndentG
);
1422 fprintf (f
,"type ");
1423 PrintTBLType (f
, (v
->type
), indent
+ stdIndentG
);
1424 if (NOT_NULL ((v
->isPdu
)))
1427 Indent (f
, indent
+ stdIndentG
);
1428 fprintf (f
,"isPdu ");
1429 PrintAsnNull (f
, (v
->isPdu
), indent
+ stdIndentG
);
1434 } /* PrintTBLTypeDef */
1437 FreeTBLTypeDef
PARAMS ((v
),
1443 FreeTBLTypeDefId ((&v
->typeDefId
));
1445 FreePrintableString ((&v
->typeName
));
1447 FreeTBLType ((v
->type
));
1448 Asn1Free ((v
->type
));
1450 if (NOT_NULL ((v
->isPdu
)))
1452 FreeAsnNull ((v
->isPdu
));
1453 Asn1Free ((v
->isPdu
));
1456 } /* FreeTBLTypeDef */
1462 BEncTBLModuleSeqOfContent
PARAMS ((b
, v
),
1466 AsnLen totalLen
= 0;
1472 FOR_EACH_LIST_ELMT_RVS (component
, v
)
1475 itemLen
= BEncTBLTypeDefContent (b
, component
);
1476 itemLen
+= BEncConsLen (b
, itemLen
);
1477 itemLen
+= BEncTag1 (b
, UNIV
, CONS
, 16);
1483 } /* BEncTBLModuleSeqOfContent */
1486 BDecTBLModuleSeqOfContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
1489 AsnLen elmtLen0 _AND_
1490 TBLModuleSeqOf
*v _AND_
1491 AsnLen
*bytesDecoded _AND_
1494 int seqDone
= FALSE
;
1495 AsnLen totalElmtsLen1
= 0;
1498 int mandatoryElmtCount1
= 0;
1501 for (totalElmtsLen1
= 0; (totalElmtsLen1
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
);)
1503 TBLTypeDef
**tmpVar
;
1504 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1506 if ((tagId1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
1508 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
1509 break; /* got EOC so can exit this SET OF/SEQ OF's for loop*/
1511 if ((tagId1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
1513 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1514 tmpVar
= (TBLTypeDef
**) AsnListAppend (v
);
1515 (*tmpVar
) = (TBLTypeDef
*) Asn1Alloc (sizeof (TBLTypeDef
));
1516 CheckAsn1Alloc ((*tmpVar
), env
);
1517 BDecTBLTypeDefContent (b
, tagId1
, elmtLen1
, (*tmpVar
), &totalElmtsLen1
, env
);
1518 } /* end of tag check if */
1519 else /* wrong tag */
1521 Asn1Error ("Unexpected Tag\n");
1522 longjmp (env
, -130);
1526 (*bytesDecoded
) += totalElmtsLen1
;
1527 } /* BDecTBLModuleSeqOfContent */
1530 PrintTBLModuleSeqOf
PARAMS ((f
, v
, indent
),
1532 TBLModuleSeqOf
*v _AND_
1533 unsigned short int indent
)
1538 fprintf (f
,"{ -- SEQUENCE OF -- \n");
1539 FOR_EACH_LIST_ELMT (tmp
, v
)
1541 Indent (f
, indent
+ stdIndentG
);
1542 PrintTBLTypeDef (f
, tmp
, indent
+ stdIndentG
);
1543 if (tmp
!= (TBLTypeDef
*)LAST_LIST_ELMT (v
))
1549 } /* PrintTBLModuleSeqOf */
1552 FreeTBLModuleSeqOf
PARAMS ((v
),
1560 for (l
= FIRST_LIST_NODE (v
); l
!= NULL
; )
1562 FreeTBLTypeDef ((l
->data
));
1568 } /* FreeTBLModuleSeqOf */
1574 BEncTBLModuleContent
PARAMS ((b
, v
),
1578 AsnLen totalLen
= 0;
1584 itemLen
= BEncTBLModuleSeqOfContent (b
, (v
->typeDefs
));
1585 itemLen
+= BEncConsLen (b
, itemLen
);
1586 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 3);
1588 totalLen
+= itemLen
;
1590 itemLen
= BEncAsnBoolContent (b
, (&v
->isUseful
));
1591 BEncDefLenTo127 (b
, itemLen
);
1593 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 2);
1595 totalLen
+= itemLen
;
1597 if (ASNOID_PRESENT ((&v
->id
)))
1599 itemLen
= BEncAsnOidContent (b
, (&v
->id
));
1600 itemLen
+= BEncDefLen (b
, itemLen
);
1601 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 1);
1603 totalLen
+= itemLen
;
1606 itemLen
= BEncPrintableStringContent (b
, (&v
->name
));
1607 itemLen
+= BEncDefLen (b
, itemLen
);
1608 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 0);
1610 totalLen
+= itemLen
;
1614 } /* BEncTBLModuleContent */
1617 BDecTBLModuleContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
1620 AsnLen elmtLen0 _AND_
1622 AsnLen
*bytesDecoded _AND_
1625 int seqDone
= FALSE
;
1626 AsnLen totalElmtsLen1
= 0;
1629 int mandatoryElmtCount1
= 0;
1632 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1634 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 0)) ||
1635 (tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 0))))
1637 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1638 BDecPrintableStringContent (b
, tagId1
, elmtLen1
, (&v
->name
), &totalElmtsLen1
, env
);
1639 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1642 longjmp (env
, -131);
1645 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 1))))
1647 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1648 BDecAsnOidContent (b
, tagId1
, elmtLen1
, (&v
->id
), &totalElmtsLen1
, env
);
1649 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1653 if (((tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 2))))
1655 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1656 BDecAsnBoolContent (b
, tagId1
, elmtLen1
, (&v
->isUseful
), &totalElmtsLen1
, env
);
1657 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1660 longjmp (env
, -132);
1663 if (((tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 3))))
1665 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1666 (v
->typeDefs
) = AsnListNew (sizeof (char*));
1667 CheckAsn1Alloc ((v
->typeDefs
), env
);
1668 BDecTBLModuleSeqOfContent (b
, tagId1
, elmtLen1
, (v
->typeDefs
), &totalElmtsLen1
, env
);
1670 if (elmtLen0
== INDEFINITE_LEN
)
1671 BDecEoc (b
, &totalElmtsLen1
, env
);
1672 else if (totalElmtsLen1
!= elmtLen0
)
1673 longjmp (env
, -133);
1676 longjmp (env
, -134);
1680 longjmp (env
, -135);
1682 (*bytesDecoded
) += totalElmtsLen1
;
1683 } /* BDecTBLModuleContent */
1686 PrintTBLModule
PARAMS ((f
, v
, indent
),
1689 unsigned short int indent
)
1694 fprintf (f
,"{ -- SEQUENCE --\n");
1696 Indent (f
, indent
+ stdIndentG
);
1697 fprintf (f
,"name ");
1698 PrintPrintableString (f
, (&v
->name
), indent
+ stdIndentG
);
1700 if (ASNOID_PRESENT ((&v
->id
)))
1702 Indent (f
, indent
+ stdIndentG
);
1704 PrintAsnOid (f
, (&v
->id
), indent
+ stdIndentG
);
1707 Indent (f
, indent
+ stdIndentG
);
1708 fprintf (f
,"isUseful ");
1709 PrintAsnBool (f
, (&v
->isUseful
), indent
+ stdIndentG
);
1711 Indent (f
, indent
+ stdIndentG
);
1712 fprintf (f
,"typeDefs ");
1713 PrintTBLModuleSeqOf (f
, (v
->typeDefs
), indent
+ stdIndentG
);
1717 } /* PrintTBLModule */
1720 FreeTBLModule
PARAMS ((v
),
1726 FreePrintableString ((&v
->name
));
1728 if (ASNOID_PRESENT ((&v
->id
)))
1730 FreeAsnOid ((&v
->id
));
1733 FreeAsnBool ((&v
->isUseful
));
1735 FreeTBLModuleSeqOf ((v
->typeDefs
));
1736 Asn1Free ((v
->typeDefs
));
1738 } /* FreeTBLModule */
1744 BEncTBLSeqOfContent
PARAMS ((b
, v
),
1748 AsnLen totalLen
= 0;
1754 FOR_EACH_LIST_ELMT_RVS (component
, v
)
1757 itemLen
= BEncTBLModuleContent (b
, component
);
1758 itemLen
+= BEncConsLen (b
, itemLen
);
1759 itemLen
+= BEncTag1 (b
, UNIV
, CONS
, 16);
1765 } /* BEncTBLSeqOfContent */
1768 BDecTBLSeqOfContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
1771 AsnLen elmtLen0 _AND_
1773 AsnLen
*bytesDecoded _AND_
1776 int seqDone
= FALSE
;
1777 AsnLen totalElmtsLen1
= 0;
1780 int mandatoryElmtCount1
= 0;
1783 for (totalElmtsLen1
= 0; (totalElmtsLen1
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
);)
1786 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1788 if ((tagId1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
1790 BDEC_2ND_EOC_OCTET (b
, &totalElmtsLen1
, env
)
1791 break; /* got EOC so can exit this SET OF/SEQ OF's for loop*/
1793 if ((tagId1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
1795 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1796 tmpVar
= (TBLModule
**) AsnListAppend (v
);
1797 (*tmpVar
) = (TBLModule
*) Asn1Alloc (sizeof (TBLModule
));
1798 CheckAsn1Alloc ((*tmpVar
), env
);
1799 BDecTBLModuleContent (b
, tagId1
, elmtLen1
, (*tmpVar
), &totalElmtsLen1
, env
);
1800 } /* end of tag check if */
1801 else /* wrong tag */
1803 Asn1Error ("Unexpected Tag\n");
1804 longjmp (env
, -136);
1808 (*bytesDecoded
) += totalElmtsLen1
;
1809 } /* BDecTBLSeqOfContent */
1812 PrintTBLSeqOf
PARAMS ((f
, v
, indent
),
1815 unsigned short int indent
)
1820 fprintf (f
,"{ -- SEQUENCE OF -- \n");
1821 FOR_EACH_LIST_ELMT (tmp
, v
)
1823 Indent (f
, indent
+ stdIndentG
);
1824 PrintTBLModule (f
, tmp
, indent
+ stdIndentG
);
1825 if (tmp
!= (TBLModule
*)LAST_LIST_ELMT (v
))
1831 } /* PrintTBLSeqOf */
1834 FreeTBLSeqOf
PARAMS ((v
),
1842 for (l
= FIRST_LIST_NODE (v
); l
!= NULL
; )
1844 FreeTBLModule ((l
->data
));
1850 } /* FreeTBLSeqOf */
1855 AsnLen BEncTBL
PARAMS ((b
, v
),
1861 l
= BEncTBLContent (b
, v
);
1862 l
+= BEncConsLen (b
, l
);
1863 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
1867 void BDecTBL
PARAMS ((b
, result
, bytesDecoded
, env
),
1870 AsnLen
*bytesDecoded _AND_
1876 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
1877 MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
1879 Asn1Error ("BDecTBL: ERROR - wrong tag\n");
1880 longjmp (env
, -137);
1882 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
1883 BDecTBLContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
1887 BEncTBLContent
PARAMS ((b
, v
),
1891 AsnLen totalLen
= 0;
1897 itemLen
= BEncTBLSeqOfContent (b
, (v
->modules
));
1898 itemLen
+= BEncConsLen (b
, itemLen
);
1899 itemLen
+= BEncTag1 (b
, UNIV
, CONS
, 16);
1901 totalLen
+= itemLen
;
1903 itemLen
= BEncAsnIntContent (b
, (&v
->totalLenStrings
));
1904 BEncDefLenTo127 (b
, itemLen
);
1906 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
1908 totalLen
+= itemLen
;
1910 itemLen
= BEncAsnIntContent (b
, (&v
->totalNumStrings
));
1911 BEncDefLenTo127 (b
, itemLen
);
1913 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
1915 totalLen
+= itemLen
;
1917 itemLen
= BEncAsnIntContent (b
, (&v
->totalNumTags
));
1918 BEncDefLenTo127 (b
, itemLen
);
1920 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
1922 totalLen
+= itemLen
;
1924 itemLen
= BEncAsnIntContent (b
, (&v
->totalNumTypes
));
1925 BEncDefLenTo127 (b
, itemLen
);
1927 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
1929 totalLen
+= itemLen
;
1931 itemLen
= BEncAsnIntContent (b
, (&v
->totalNumTypeDefs
));
1932 BEncDefLenTo127 (b
, itemLen
);
1934 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
1936 totalLen
+= itemLen
;
1938 itemLen
= BEncAsnIntContent (b
, (&v
->totalNumModules
));
1939 BEncDefLenTo127 (b
, itemLen
);
1941 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
1943 totalLen
+= itemLen
;
1947 } /* BEncTBLContent */
1950 BDecTBLContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
1953 AsnLen elmtLen0 _AND_
1955 AsnLen
*bytesDecoded _AND_
1958 int seqDone
= FALSE
;
1959 AsnLen totalElmtsLen1
= 0;
1962 int mandatoryElmtCount1
= 0;
1965 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1967 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
1969 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1970 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->totalNumModules
), &totalElmtsLen1
, env
);
1971 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1974 longjmp (env
, -138);
1977 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
1979 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1980 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->totalNumTypeDefs
), &totalElmtsLen1
, env
);
1981 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1984 longjmp (env
, -139);
1987 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
1989 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
1990 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->totalNumTypes
), &totalElmtsLen1
, env
);
1991 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
1994 longjmp (env
, -140);
1997 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
1999 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
2000 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->totalNumTags
), &totalElmtsLen1
, env
);
2001 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
2004 longjmp (env
, -141);
2007 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
2009 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
2010 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->totalNumStrings
), &totalElmtsLen1
, env
);
2011 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
2014 longjmp (env
, -142);
2017 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
2019 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
2020 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (&v
->totalLenStrings
), &totalElmtsLen1
, env
);
2021 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
2024 longjmp (env
, -143);
2027 if (((tagId1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))))
2029 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
2030 (v
->modules
) = AsnListNew (sizeof (char*));
2031 CheckAsn1Alloc ((v
->modules
), env
);
2032 BDecTBLSeqOfContent (b
, tagId1
, elmtLen1
, (v
->modules
), &totalElmtsLen1
, env
);
2034 if (elmtLen0
== INDEFINITE_LEN
)
2035 BDecEoc (b
, &totalElmtsLen1
, env
);
2036 else if (totalElmtsLen1
!= elmtLen0
)
2037 longjmp (env
, -144);
2040 longjmp (env
, -145);
2044 longjmp (env
, -146);
2046 (*bytesDecoded
) += totalElmtsLen1
;
2047 } /* BDecTBLContent */
2050 PrintTBL
PARAMS ((f
, v
, indent
),
2053 unsigned short int indent
)
2058 fprintf (f
,"{ -- SEQUENCE --\n");
2060 Indent (f
, indent
+ stdIndentG
);
2061 fprintf (f
,"totalNumModules ");
2062 PrintAsnInt (f
, (&v
->totalNumModules
), indent
+ stdIndentG
);
2064 Indent (f
, indent
+ stdIndentG
);
2065 fprintf (f
,"totalNumTypeDefs ");
2066 PrintAsnInt (f
, (&v
->totalNumTypeDefs
), indent
+ stdIndentG
);
2068 Indent (f
, indent
+ stdIndentG
);
2069 fprintf (f
,"totalNumTypes ");
2070 PrintAsnInt (f
, (&v
->totalNumTypes
), indent
+ stdIndentG
);
2072 Indent (f
, indent
+ stdIndentG
);
2073 fprintf (f
,"totalNumTags ");
2074 PrintAsnInt (f
, (&v
->totalNumTags
), indent
+ stdIndentG
);
2076 Indent (f
, indent
+ stdIndentG
);
2077 fprintf (f
,"totalNumStrings ");
2078 PrintAsnInt (f
, (&v
->totalNumStrings
), indent
+ stdIndentG
);
2080 Indent (f
, indent
+ stdIndentG
);
2081 fprintf (f
,"totalLenStrings ");
2082 PrintAsnInt (f
, (&v
->totalLenStrings
), indent
+ stdIndentG
);
2084 Indent (f
, indent
+ stdIndentG
);
2085 fprintf (f
,"modules ");
2086 PrintTBLSeqOf (f
, (v
->modules
), indent
+ stdIndentG
);
2093 FreeTBL
PARAMS ((v
),
2099 FreeAsnInt ((&v
->totalNumModules
));
2101 FreeAsnInt ((&v
->totalNumTypeDefs
));
2103 FreeAsnInt ((&v
->totalNumTypes
));
2105 FreeAsnInt ((&v
->totalNumTags
));
2107 FreeAsnInt ((&v
->totalNumStrings
));
2109 FreeAsnInt ((&v
->totalLenStrings
));
2111 FreeTBLSeqOf ((v
->modules
));
2112 Asn1Free ((v
->modules
));