int xd_32BitCharStr (OSCTXT* pctxt, Asn132BitCharString* object_p, ASN1TagType tagging, ASN1TAG tag, int length) { OSUINT32 i; OSINT32 stat = 0, isConstructedTag; OSOCTET* data = 0; OSUINT32 nchars = 0; OS32BITCHAR* data32 = 0; if (tagging == ASN1EXPL) { if ((stat = xd_match1 (pctxt, ASN1TAG2BYTE(tag), &length)) < 0) /* RTERR_IDNOTFOU will be logged later, by the generated code, or reset by rtxErrReset (for optional seq elements). */ return (stat == RTERR_IDNOTFOU) ? stat : LOG_RTERR (pctxt, stat); } isConstructedTag = (int)((pctxt->flags & ASN1CONSTAG) != 0); if (0 == length) { nchars = 0; data32 = 0; } else { int size, ll = 0; /* For an indefinite length message, need to get the actual */ /* length by parsing tags until the end of the message is */ /* reached.. */ if (length == ASN_K_INDEFLEN) { /* indefinite length message */ if ((stat = xd_consStrIndefLenAndSize (pctxt, TM_UNIV|ASN_ID_OCTSTR, &ll, &size)) != 0) return LOG_RTERR (pctxt, stat); } else ll = size = length; data = (OSOCTET*) rtxMemAlloc (pctxt, ll); data32 = (OS32BITCHAR*)data; if (0 != data) { ll = size; if ((stat = xd_octstr_s (pctxt, data, (OSUINT32*) &ll, ASN1IMPL, size)) != 0) return LOG_RTERR_AND_FREE_MEM (pctxt, stat, data); nchars = ll / 4; for (i = 0; i < nchars; i++, data += 4) { data32[i] = (OS32BITCHAR) (((data[0] * 256) + data[1]) * 65536UL + (((data[2] * 256) + data[3]))); } } else return LOG_RTERR (pctxt, RTERR_NOMEM); } if (isConstructedTag && length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR_AND_FREE_MEM (pctxt, ASN_E_INVLEN, data); } object_p->data = data32; object_p->nchars = nchars; return 0; }
EXTERN int asn1D_OrderResponseType_respondedOrderLine_list (OSCTXT* pctxt, OrderResponseType_respondedOrderLine_list *pvalue, ASN1TagType tagging, int length) { int stat = 0; RespondedOrderLine* pdata; OSRTDListNode* pnode; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE OF or SET OF */ rtxDListInit (pvalue); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); while (!XD_CHKEND (pctxt, &ccb)) { rtxDListAllocNodeAndData (pctxt, RespondedOrderLine, &pnode, &pdata); if (pnode == NULL) return LOG_RTERR (pctxt, RTERR_NOMEM); asn1Init_RespondedOrderLine (pdata); stat = asn1D_RespondedOrderLine (pctxt, pdata, ASN1EXPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); rtxDListAppendNode (pvalue, pnode); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_LatitudeDirectionCodeType (OSCTXT* pctxt, LatitudeDirectionCodeType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode codeListAgencyID */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->codeListAgencyID, ASN1IMPL, length); if (stat == 0) { pvalue->m.codeListAgencyIDPresent = TRUE; } } break; case 1: /* decode codeListAgencyName */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->codeListAgencyName, ASN1IMPL, length); if (stat == 0) { pvalue->m.codeListAgencyNamePresent = TRUE; } } break; case 2: /* decode codeListID */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->codeListID, ASN1IMPL, length); if (stat == 0) { pvalue->m.codeListIDPresent = TRUE; } } break; case 3: /* decode codeListName */ if (XD_PEEKTAG (pctxt, 0x83)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->codeListName, ASN1IMPL, length); if (stat == 0) { pvalue->m.codeListNamePresent = TRUE; } } break; case 4: /* decode codeListSchemeURI */ if (XD_PEEKTAG (pctxt, 0x84)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->codeListSchemeURI, ASN1IMPL, length); if (stat == 0) { pvalue->m.codeListSchemeURIPresent = TRUE; } } break; case 5: /* decode codeListURI */ if (XD_PEEKTAG (pctxt, 0x85)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->codeListURI, ASN1IMPL, length); if (stat == 0) { pvalue->m.codeListURIPresent = TRUE; } } break; case 6: /* decode codeListVersionID */ if (XD_PEEKTAG (pctxt, 0x86)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->codeListVersionID, ASN1IMPL, length); if (stat == 0) { pvalue->m.codeListVersionIDPresent = TRUE; } } break; case 7: /* decode languageID */ if (XD_PEEKTAG (pctxt, 0x87)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->languageID, ASN1IMPL, length); if (stat == 0) { pvalue->m.languageIDPresent = TRUE; } } break; case 8: /* decode name */ if (XD_PEEKTAG (pctxt, 0x88)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->name, ASN1IMPL, length); if (stat == 0) { pvalue->m.namePresent = TRUE; } } break; case 9: /* decode base */ if (XD_PEEKTAG (pctxt, 0x89)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_LatitudeDirectionCodeContentType (pctxt, &pvalue->base, ASN1IMPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_PRIM|0): case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_PRIM|1): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_PRIM|2): case (TM_CTXT|TM_CONS|2): case (TM_CTXT|TM_PRIM|3): case (TM_CTXT|TM_CONS|3): case (TM_CTXT|TM_PRIM|4): case (TM_CTXT|TM_CONS|4): case (TM_CTXT|TM_PRIM|5): case (TM_CTXT|TM_CONS|5): case (TM_CTXT|TM_PRIM|6): case (TM_CTXT|TM_CONS|6): case (TM_CTXT|TM_PRIM|7): case (TM_CTXT|TM_CONS|7): case (TM_CTXT|TM_PRIM|8): case (TM_CTXT|TM_CONS|8): case (TM_CTXT|TM_PRIM|9): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 1) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_OrderResponseSimpleType (OSCTXT* pctxt, OrderResponseSimpleType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode iD */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_UnspecializedDatatypes_1_0_IdentifierType (pctxt, &pvalue->iD, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 1: /* decode copyIndicator */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CopyIndicator (pctxt, &pvalue->copyIndicator, ASN1IMPL, length); if (stat == 0) { pvalue->m.copyIndicatorPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 2: /* decode gUID */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_UnspecializedDatatypes_1_0_IdentifierType (pctxt, &pvalue->gUID, ASN1IMPL, length); if (stat == 0) { pvalue->m.gUIDPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 3: /* decode issueDate */ if (XD_PEEKTAG (pctxt, 0x83)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_IssueDate (pctxt, &pvalue->issueDate, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 4: /* decode documentStatusCode */ if (XD_PEEKTAG (pctxt, 0x84)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_DocumentStatusCodeType (pctxt, &pvalue->documentStatusCode, ASN1IMPL, length); if (stat == 0) { pvalue->m.documentStatusCodePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 5: /* decode note */ if (XD_PEEKTAG (pctxt, 0x85)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_Note (pctxt, &pvalue->note, ASN1IMPL, length); if (stat == 0) { pvalue->m.notePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 6: /* decode acceptedIndicator */ if (XD_PEEKTAG (pctxt, 0x86)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponseSimple_1_0_AcceptedIndicator (pctxt, &pvalue->acceptedIndicator, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 7: /* decode rejectionNote */ if (XD_PEEKTAG (pctxt, 0x87)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_RejectionNote (pctxt, &pvalue->rejectionNote, ASN1IMPL, length); if (stat == 0) { pvalue->m.rejectionNotePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 8: /* decode orderReference */ if (XD_PEEKTAG (pctxt, 0x88)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_OrderReference (pctxt, &pvalue->orderReference, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 9: /* decode buyerParty */ if (XD_PEEKTAG (pctxt, 0x89)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_BuyerParty (pctxt, &pvalue->buyerParty, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 10: /* decode sellerParty */ if (XD_PEEKTAG (pctxt, 0x8a)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_SellerParty (pctxt, &pvalue->sellerParty, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_CONS|2): case (TM_CTXT|TM_CONS|3): case (TM_CTXT|TM_CONS|4): case (TM_CTXT|TM_CONS|5): case (TM_CTXT|TM_CONS|6): case (TM_CTXT|TM_CONS|7): case (TM_CTXT|TM_CONS|8): case (TM_CTXT|TM_CONS|9): case (TM_CTXT|TM_CONS|10): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 6) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_UBL_OrderResponseSimple_1_0_AcceptedIndicatorType (OSCTXT* pctxt, UBL_OrderResponseSimple_1_0_AcceptedIndicatorType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode base */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_boolean (pctxt, &pvalue->base, ASN1IMPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_PRIM|0): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 1) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_RejectionNoteType (OSCTXT* pctxt, RejectionNoteType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode languageLocaleID */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->languageLocaleID, ASN1IMPL, length); if (stat == 0) { pvalue->m.languageLocaleIDPresent = TRUE; } } break; case 1: /* decode languageID */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->languageID, ASN1IMPL, length); if (stat == 0) { pvalue->m.languageIDPresent = TRUE; } } break; case 2: /* decode base */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->base, ASN1IMPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_PRIM|0): case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_PRIM|1): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_PRIM|2): case (TM_CTXT|TM_CONS|2): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 1) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_InvoiceSummaryType (OSCTXT* pctxt, InvoiceSummaryType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode lineItemCountValue */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_NumericType (pctxt, &pvalue->lineItemCountValue, ASN1IMPL, length); if (stat == 0) { pvalue->m.lineItemCountValuePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 1: /* decode subtotalAmount */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_AmountType (pctxt, &pvalue->subtotalAmount, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 2: /* decode pricingVariation_list */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); /* decode inline SEQUENCE OF type */ { int stat = 0; PricingVariationType* pdata2; OSRTDListNode* pnode; ASN1CCB ccb; /* decode SEQUENCE OF or SET OF */ rtxDListInit (&pvalue->pricingVariation_list); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); while (!XD_CHKEND (pctxt, &ccb)) { rtxDListAllocNodeAndData (pctxt, PricingVariationType, &pnode, &pdata2); if (pnode == NULL) return LOG_RTERR (pctxt, RTERR_NOMEM); asn1Init_PricingVariationType (pdata2); stat = asn1D_PricingVariationType (pctxt, pdata2, ASN1EXPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); rtxDListAppendNode (&pvalue->pricingVariation_list, pnode); } } if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 3: /* decode totalTax */ if (XD_PEEKTAG (pctxt, 0x83)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_TaxType (pctxt, &pvalue->totalTax, ASN1IMPL, length); if (stat == 0) { pvalue->m.totalTaxPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 4: /* decode priceAmount */ if (XD_PEEKTAG (pctxt, 0x84)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_AmountType (pctxt, &pvalue->priceAmount, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 5: /* decode packingSlipIdentifier */ if (XD_PEEKTAG (pctxt, 0x85)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_IdentifierType (pctxt, &pvalue->packingSlipIdentifier, ASN1IMPL, length); if (stat == 0) { pvalue->m.packingSlipIdentifierPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 6: /* decode summaryNote */ if (XD_PEEKTAG (pctxt, 0x86)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_NoteType (pctxt, &pvalue->summaryNote, ASN1IMPL, length); if (stat == 0) { pvalue->m.summaryNotePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_CONS|2): case (TM_CTXT|TM_CONS|3): case (TM_CTXT|TM_CONS|4): case (TM_CTXT|TM_CONS|5): case (TM_CTXT|TM_CONS|6): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 3) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_InvoiceLineItemType (OSCTXT* pctxt, InvoiceLineItemType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode lineID */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_IdentifierType (pctxt, &pvalue->lineID, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 1: /* decode item */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_ItemType (pctxt, &pvalue->item, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 2: /* decode orderStatus */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_CodeType (pctxt, &pvalue->orderStatus, ASN1IMPL, length); if (stat == 0) { pvalue->m.orderStatusPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 3: /* decode pricing */ if (XD_PEEKTAG (pctxt, 0x83)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_PricingType (pctxt, &pvalue->pricing, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 4: /* decode pricingVariation */ if (XD_PEEKTAG (pctxt, 0x84)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_PricingVariationType (pctxt, &pvalue->pricingVariation, ASN1IMPL, length); if (stat == 0) { pvalue->m.pricingVariationPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 5: /* decode itemTax */ if (XD_PEEKTAG (pctxt, 0x85)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_AmountType (pctxt, &pvalue->itemTax, ASN1IMPL, length); if (stat == 0) { pvalue->m.itemTaxPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 6: /* decode totalAmount */ if (XD_PEEKTAG (pctxt, 0x86)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_AmountType (pctxt, &pvalue->totalAmount, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_CONS|2): case (TM_CTXT|TM_CONS|3): case (TM_CTXT|TM_CONS|4): case (TM_CTXT|TM_CONS|5): case (TM_CTXT|TM_CONS|6): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 4) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_InvoiceHeaderType (OSCTXT* pctxt, InvoiceHeaderType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode issueDateTime */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_DateTimeType (pctxt, &pvalue->issueDateTime, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 1: /* decode identifier */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_IdentifierType (pctxt, &pvalue->identifier, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 2: /* decode pOIdentifier */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_IdentifierType (pctxt, &pvalue->pOIdentifier, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 3: /* decode currencyCode */ if (XD_PEEKTAG (pctxt, 0x83)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_CodeType (pctxt, &pvalue->currencyCode, ASN1IMPL, length); if (stat == 0) { pvalue->m.currencyCodePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 4: /* decode language */ if (XD_PEEKTAG (pctxt, 0x84)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_LanguageType (pctxt, &pvalue->language, ASN1IMPL, length); if (stat == 0) { pvalue->m.languagePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 5: /* decode buyerParty */ if (XD_PEEKTAG (pctxt, 0x85)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_PartyType (pctxt, &pvalue->buyerParty, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 6: /* decode sellerParty */ if (XD_PEEKTAG (pctxt, 0x86)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_PartyType (pctxt, &pvalue->sellerParty, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 7: /* decode consigneeParty */ if (XD_PEEKTAG (pctxt, 0x87)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_PartyType (pctxt, &pvalue->consigneeParty, ASN1IMPL, length); if (stat == 0) { pvalue->m.consigneePartyPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 8: /* decode despatchParty */ if (XD_PEEKTAG (pctxt, 0x88)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_PartyType (pctxt, &pvalue->despatchParty, ASN1IMPL, length); if (stat == 0) { pvalue->m.despatchPartyPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 9: /* decode shipment */ if (XD_PEEKTAG (pctxt, 0x89)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_ShipmentType (pctxt, &pvalue->shipment, ASN1IMPL, length); if (stat == 0) { pvalue->m.shipmentPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 10: /* decode paymentMeans */ if (XD_PEEKTAG (pctxt, 0x8a)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_PaymentMeansType (pctxt, &pvalue->paymentMeans, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 11: /* decode lineItemCountValue */ if (XD_PEEKTAG (pctxt, 0x8b)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CCT_NumericType (pctxt, &pvalue->lineItemCountValue, ASN1IMPL, length); if (stat == 0) { pvalue->m.lineItemCountValuePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_CONS|2): case (TM_CTXT|TM_CONS|3): case (TM_CTXT|TM_CONS|4): case (TM_CTXT|TM_CONS|5): case (TM_CTXT|TM_CONS|6): case (TM_CTXT|TM_CONS|7): case (TM_CTXT|TM_CONS|8): case (TM_CTXT|TM_CONS|9): case (TM_CTXT|TM_CONS|10): case (TM_CTXT|TM_CONS|11): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 6) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_InvoiceType (OSCTXT* pctxt, InvoiceType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode header */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_InvoiceHeaderType (pctxt, &pvalue->header, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 1: /* decode lineItem_list */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); /* decode inline SEQUENCE OF type */ { int stat = 0; InvoiceLineItemType* pdata2; OSRTDListNode* pnode; ASN1CCB ccb; /* decode SEQUENCE OF or SET OF */ rtxDListInit (&pvalue->lineItem_list); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); while (!XD_CHKEND (pctxt, &ccb)) { rtxDListAllocNodeAndData (pctxt, InvoiceLineItemType, &pnode, &pdata2); if (pnode == NULL) return LOG_RTERR (pctxt, RTERR_NOMEM); asn1Init_InvoiceLineItemType (pdata2); stat = asn1D_InvoiceLineItemType (pctxt, pdata2, ASN1EXPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); rtxDListAppendNode (&pvalue->lineItem_list, pnode); } if (!(pvalue->lineItem_list.count >= 1U)) { rtxErrAddStrParm (pctxt, "InvoiceType.lineItem_list.count"); rtxErrAddIntParm (pctxt, (int)pvalue->lineItem_list.count); return LOG_RTERR (pctxt, RTERR_CONSVIO); } } if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 2: /* decode summary */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_InvoiceSummaryType (pctxt, &pvalue->summary, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_CONS|2): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 3) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_OrderResponseType (OSCTXT* pctxt, OrderResponseType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode buyersID */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_UnspecializedDatatypes_1_0_IdentifierType (pctxt, &pvalue->buyersID, ASN1IMPL, length); if (stat == 0) { pvalue->m.buyersIDPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 1: /* decode sellersID */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_UnspecializedDatatypes_1_0_IdentifierType (pctxt, &pvalue->sellersID, ASN1IMPL, length); if (stat == 0) { pvalue->m.sellersIDPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 2: /* decode copyIndicator */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CopyIndicator (pctxt, &pvalue->copyIndicator, ASN1IMPL, length); if (stat == 0) { pvalue->m.copyIndicatorPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 3: /* decode gUID */ if (XD_PEEKTAG (pctxt, 0x83)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_UnspecializedDatatypes_1_0_IdentifierType (pctxt, &pvalue->gUID, ASN1IMPL, length); if (stat == 0) { pvalue->m.gUIDPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 4: /* decode issueDate */ if (XD_PEEKTAG (pctxt, 0x84)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_IssueDate (pctxt, &pvalue->issueDate, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 5: /* decode documentStatusCode */ if (XD_PEEKTAG (pctxt, 0x85)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_DocumentStatusCodeType (pctxt, &pvalue->documentStatusCode, ASN1IMPL, length); if (stat == 0) { pvalue->m.documentStatusCodePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 6: /* decode note */ if (XD_PEEKTAG (pctxt, 0x86)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_Note (pctxt, &pvalue->note, ASN1IMPL, length); if (stat == 0) { pvalue->m.notePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 7: /* decode transactionCurrencyCode */ if (XD_PEEKTAG (pctxt, 0x87)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CurrencyCodeType (pctxt, &pvalue->transactionCurrencyCode, ASN1IMPL, length); if (stat == 0) { pvalue->m.transactionCurrencyCodePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 8: /* decode pricingCurrencyCode */ if (XD_PEEKTAG (pctxt, 0x88)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_CurrencyCodeType (pctxt, &pvalue->pricingCurrencyCode, ASN1IMPL, length); if (stat == 0) { pvalue->m.pricingCurrencyCodePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 9: /* decode earliestDate */ if (XD_PEEKTAG (pctxt, 0x89)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponse_1_0_EarliestDate (pctxt, &pvalue->earliestDate, ASN1IMPL, length); if (stat == 0) { pvalue->m.earliestDatePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 10: /* decode expiryDate */ if (XD_PEEKTAG (pctxt, 0x8a)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_ExpiryDate (pctxt, &pvalue->expiryDate, ASN1IMPL, length); if (stat == 0) { pvalue->m.expiryDatePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 11: /* decode validityDurationMeasure */ if (XD_PEEKTAG (pctxt, 0x8b)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponse_1_0_ValidityDurationMeasure (pctxt, &pvalue->validityDurationMeasure, ASN1IMPL, length); if (stat == 0) { pvalue->m.validityDurationMeasurePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 12: /* decode taxTotalAmount */ if (XD_PEEKTAG (pctxt, 0x8c)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_TaxTotalAmount (pctxt, &pvalue->taxTotalAmount, ASN1IMPL, length); if (stat == 0) { pvalue->m.taxTotalAmountPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 13: /* decode lineExtensionTotalAmount */ if (XD_PEEKTAG (pctxt, 0x8d)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_LineExtensionTotalAmount (pctxt, &pvalue->lineExtensionTotalAmount, ASN1IMPL, length); if (stat == 0) { pvalue->m.lineExtensionTotalAmountPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 14: /* decode totalPackagesCountQuantity */ if (XD_PEEKTAG (pctxt, 0x8e)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponse_1_0_TotalPackagesCountQuantity (pctxt, &pvalue->totalPackagesCountQuantity, ASN1IMPL, length); if (stat == 0) { pvalue->m.totalPackagesCountQuantityPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 15: /* decode grossWeightMeasure */ if (XD_PEEKTAG (pctxt, 0x8f)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_GrossWeightMeasure (pctxt, &pvalue->grossWeightMeasure, ASN1IMPL, length); if (stat == 0) { pvalue->m.grossWeightMeasurePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 16: /* decode netWeightMeasure */ if (XD_PEEKTAG (pctxt, 0x90)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_NetWeightMeasure (pctxt, &pvalue->netWeightMeasure, ASN1IMPL, length); if (stat == 0) { pvalue->m.netWeightMeasurePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 17: /* decode netNetWeightMeasure */ if (XD_PEEKTAG (pctxt, 0x91)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_NetNetWeightMeasure (pctxt, &pvalue->netNetWeightMeasure, ASN1IMPL, length); if (stat == 0) { pvalue->m.netNetWeightMeasurePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 18: /* decode grossVolumeMeasure */ if (XD_PEEKTAG (pctxt, 0x92)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_GrossVolumeMeasure (pctxt, &pvalue->grossVolumeMeasure, ASN1IMPL, length); if (stat == 0) { pvalue->m.grossVolumeMeasurePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 19: /* decode netVolumeMeasure */ if (XD_PEEKTAG (pctxt, 0x93)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_NetVolumeMeasure (pctxt, &pvalue->netVolumeMeasure, ASN1IMPL, length); if (stat == 0) { pvalue->m.netVolumeMeasurePresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 20: /* decode lineItemCountNumeric */ if (XD_PEEKTAG (pctxt, 0x94)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponse_1_0_LineItemCountNumeric (pctxt, &pvalue->lineItemCountNumeric, ASN1IMPL, length); if (stat == 0) { pvalue->m.lineItemCountNumericPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 21: /* decode orderReference_list */ if (XD_PEEKTAG (pctxt, 0x95)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_OrderResponseType_orderReference_list (pctxt, &pvalue->orderReference_list, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 22: /* decode buyerParty */ if (XD_PEEKTAG (pctxt, 0x96)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_BuyerParty (pctxt, &pvalue->buyerParty, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 23: /* decode sellerParty */ if (XD_PEEKTAG (pctxt, 0x97)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_SellerParty (pctxt, &pvalue->sellerParty, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 24: /* decode originatorParty */ if (XD_PEEKTAG (pctxt, 0x98)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponse_1_0_OriginatorParty (pctxt, &pvalue->originatorParty, ASN1IMPL, length); if (stat == 0) { pvalue->m.originatorPartyPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 25: /* decode freightForwarderParty */ if (XD_PEEKTAG (pctxt, 0x99)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponse_1_0_FreightForwarderParty (pctxt, &pvalue->freightForwarderParty, ASN1IMPL, length); if (stat == 0) { pvalue->m.freightForwarderPartyPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 26: /* decode delivery_list */ if (XD_PEEKTAG (pctxt, 0x9a)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D__SeqOfDelivery (pctxt, &pvalue->delivery_list, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 27: /* decode deliveryTerms */ if (XD_PEEKTAG (pctxt, 0x9b)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_DeliveryTerms (pctxt, &pvalue->deliveryTerms, ASN1IMPL, length); if (stat == 0) { pvalue->m.deliveryTermsPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 28: /* decode allowanceCharge_list */ if (XD_PEEKTAG (pctxt, 0x9c)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D__SeqOfAllowanceCharge (pctxt, &pvalue->allowanceCharge_list, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 29: /* decode salesConditions */ if (XD_PEEKTAG (pctxt, 0x9d)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_SalesConditions (pctxt, &pvalue->salesConditions, ASN1IMPL, length); if (stat == 0) { pvalue->m.salesConditionsPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 30: /* decode destinationCountry */ if (XD_PEEKTAG (pctxt, 0x9e)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = asn1D_UBL_OrderResponse_1_0_DestinationCountry (pctxt, &pvalue->destinationCountry, ASN1IMPL, length); if (stat == 0) { pvalue->m.destinationCountryPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } break; case 31: /* decode respondedOrderLine_list */ if ((stat = xd_match (pctxt, TM_CTXT|TM_CONS|31, &length, XM_ADVANCE)) == 0) { stat = asn1D_OrderResponseType_respondedOrderLine_list (pctxt, &pvalue->respondedOrderLine_list, ASN1IMPL, length); if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 32: /* decode paymentMeans */ if ((stat = xd_match (pctxt, TM_CTXT|TM_CONS|32, &length, XM_ADVANCE)) == 0) { stat = asn1D_PaymentMeans (pctxt, &pvalue->paymentMeans, ASN1IMPL, length); if (stat == 0) { pvalue->m.paymentMeansPresent = TRUE; if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } } else if (stat == RTERR_IDNOTFOU) { stat = rtxErrReset (pctxt); } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_CONS|2): case (TM_CTXT|TM_CONS|3): case (TM_CTXT|TM_CONS|4): case (TM_CTXT|TM_CONS|5): case (TM_CTXT|TM_CONS|6): case (TM_CTXT|TM_CONS|7): case (TM_CTXT|TM_CONS|8): case (TM_CTXT|TM_CONS|9): case (TM_CTXT|TM_CONS|10): case (TM_CTXT|TM_CONS|11): case (TM_CTXT|TM_CONS|12): case (TM_CTXT|TM_CONS|13): case (TM_CTXT|TM_CONS|14): case (TM_CTXT|TM_CONS|15): case (TM_CTXT|TM_CONS|16): case (TM_CTXT|TM_CONS|17): case (TM_CTXT|TM_CONS|18): case (TM_CTXT|TM_CONS|19): case (TM_CTXT|TM_CONS|20): case (TM_CTXT|TM_CONS|21): case (TM_CTXT|TM_CONS|22): case (TM_CTXT|TM_CONS|23): case (TM_CTXT|TM_CONS|24): case (TM_CTXT|TM_CONS|25): case (TM_CTXT|TM_CONS|26): case (TM_CTXT|TM_CONS|27): case (TM_CTXT|TM_CONS|28): case (TM_CTXT|TM_CONS|29): case (TM_CTXT|TM_CONS|30): case (TM_CTXT|TM_CONS|31): case (TM_CTXT|TM_CONS|32): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 7) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_UBL_OrderResponse_1_0_PackagesCountQuantityType (OSCTXT* pctxt, UBL_OrderResponse_1_0_PackagesCountQuantityType *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ memset (&pvalue->m, 0, sizeof(pvalue->m)); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode quantityUnitCode */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->quantityUnitCode, ASN1IMPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 1: /* decode quantityUnitCodeListAgencyID */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->quantityUnitCodeListAgencyID, ASN1IMPL, length); if (stat == 0) { pvalue->m.quantityUnitCodeListAgencyIDPresent = TRUE; } } break; case 2: /* decode quantityUnitCodeListAgencyName */ if (XD_PEEKTAG (pctxt, 0x82)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->quantityUnitCodeListAgencyName, ASN1IMPL, length); if (stat == 0) { pvalue->m.quantityUnitCodeListAgencyNamePresent = TRUE; } } break; case 3: /* decode quantityUnitCodeListID */ if (XD_PEEKTAG (pctxt, 0x83)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_utf8str (pctxt, &pvalue->quantityUnitCodeListID, ASN1IMPL, length); if (stat == 0) { pvalue->m.quantityUnitCodeListIDPresent = TRUE; } } break; case 4: /* decode base */ if (XD_PEEKTAG (pctxt, 0x84)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); stat = xd_real (pctxt, &pvalue->base, ASN1IMPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_PRIM|0): case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_PRIM|1): case (TM_CTXT|TM_CONS|1): case (TM_CTXT|TM_PRIM|2): case (TM_CTXT|TM_CONS|2): case (TM_CTXT|TM_PRIM|3): case (TM_CTXT|TM_CONS|3): case (TM_CTXT|TM_PRIM|4): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 2) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }
EXTERN int asn1D_Math (OSCTXT* pctxt, Math *pvalue, ASN1TagType tagging, int length) { int stat = 0; int reqcnt = 0; ASN1CCB ccb; if (tagging == ASN1EXPL) { stat = xd_match1 (pctxt, 0x10, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); } /* decode SEQUENCE */ ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); ccb.seqx = 0; while (!XD_CHKEND (pctxt, &ccb)) { switch (ccb.seqx) { case 0: /* decode attr */ if (XD_PEEKTAG (pctxt, 0x80)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); /* decode inline SEQUENCE OF type */ { int stat = 0; const OSUTF8CHAR* pdata2; OSRTDListNode* pnode; ASN1CCB ccb; /* decode SEQUENCE OF or SET OF */ rtxDListInit (&pvalue->attr); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); while (!XD_CHKEND (pctxt, &ccb)) { pnode = rtxMemAllocTypeZ (pctxt, OSRTDListNode); if (pnode == NULL) return LOG_RTERR (pctxt, RTERR_NOMEM); stat = xd_utf8str (pctxt, &pdata2, ASN1EXPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); pnode->data = (void*)pdata2; rtxDListAppendNode (&pvalue->attr, pnode); } } if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; case 1: /* decode element446_list */ if (XD_PEEKTAG (pctxt, 0x81)) { stat = xd_Tag1AndLen (pctxt, &length); if (stat != 0) return LOG_RTERR (pctxt, stat); /* decode inline SEQUENCE OF type */ { int stat = 0; Odf_Element446* pdata2; OSRTDListNode* pnode; ASN1CCB ccb; /* decode SEQUENCE OF or SET OF */ rtxDListInit (&pvalue->element446_list); ccb.len = length; ccb.ptr = OSRTBUFPTR(pctxt); while (!XD_CHKEND (pctxt, &ccb)) { rtxDListAllocNodeAndData (pctxt, Odf_Element446, &pnode, &pdata2); if (pnode == NULL) return LOG_RTERR (pctxt, RTERR_NOMEM); stat = asn1D_Odf_Element446 (pctxt, (Odf_Element446*)pdata2, ASN1EXPL, length); if (stat != 0) return LOG_RTERR (pctxt, stat); rtxDListAppendNode (&pvalue->element446_list, pnode); } } if (stat == 0) { if (length == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } } else return LOG_RTERR (pctxt, stat); reqcnt++; } break; default: { ASN1TAG tag; int len; stat = xd_tag_len (pctxt, &tag, &len, 0); if (stat != 0) return LOG_RTERR (pctxt, stat); switch (tag) { case (TM_CTXT|TM_CONS|0): case (TM_CTXT|TM_CONS|1): stat = RTERR_SEQORDER; break; default: stat = RTERR_SEQOVFLW; break; }} } if (stat != 0) return LOG_RTERR (pctxt, stat); else ccb.seqx++; } if (reqcnt < 2) { return LOG_RTERR (pctxt, RTERR_SETMISRQ); } if (tagging == ASN1EXPL && ccb.len == ASN_K_INDEFLEN) { if (XD_MATCHEOC (pctxt)) XD_BUMPIDX (pctxt, 2); else return LOG_RTERR (pctxt, ASN_E_INVLEN); } return (stat); }