+ 4, 1) &&
+ odr_implicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT,
+ 5, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
+ odr_sequence_end(o);
+}
+
+/* ------------------------ APDU ------------------------- */
+
+int z_Permissions(ODR o, Z_Permissions **p, int opt, const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT,
+ 1, 0) &&
+ odr_implicit_settag(o, ODR_CONTEXT, 2) &&
+ odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->allowableFunctions,
+ &(*p)->num_allowableFunctions, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_ExtendedServicesRequest(ODR o, Z_ExtendedServicesRequest **p, int opt,
+ const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->function, ODR_CONTEXT, 3, 0) &&
+ odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 4, 0) &&
+ odr_implicit(o, z_InternationalString, &(*p)->packageName,
+ ODR_CONTEXT, 5, 1) &&
+ odr_implicit(o, z_InternationalString, &(*p)->userId,
+ ODR_CONTEXT, 6, 1) &&
+ odr_implicit(o, z_IntUnit, &(*p)->retentionTime,
+ ODR_CONTEXT, 7, 1) &&
+ odr_implicit(o, z_Permissions, &(*p)->permissions,
+ ODR_CONTEXT, 8, 1) &&
+ odr_implicit(o, z_InternationalString, &(*p)->description,
+ ODR_CONTEXT, 9, 1) &&
+ odr_implicit(o, z_External, &(*p)->taskSpecificParameters,
+ ODR_CONTEXT, 10, 1) &&
+ odr_implicit(o, odr_integer, &(*p)->waitAction,
+ ODR_CONTEXT, 11, 0) &&
+ z_ElementSetName(o, &(*p)->elements, 1, 0) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_ExtendedServicesResponse(ODR o, Z_ExtendedServicesResponse **p, int opt,
+ const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->operationStatus, ODR_CONTEXT,
+ 3, 0) &&
+ odr_implicit_settag(o, ODR_CONTEXT, 4) &&
+ (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->diagnostics,
+ &(*p)->num_diagnostics, 0) || odr_ok(o)) &&
+ odr_implicit(o, z_External, &(*p)->taskPackage, ODR_CONTEXT, 5, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
+ odr_sequence_end(o);
+}
+
+/* ------------------------ SORT ------------------------- */
+
+int z_SortAttributes(ODR o, Z_SortAttributes **p, int opt, const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ odr_oid(o, &(*p)->id, 0, 0) &&
+ z_AttributeList(o, &(*p)->list, 0, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_SortKey(ODR o, Z_SortKey **p, int opt, const char *name)
+{
+ static Odr_arm arm[] =
+ {
+ {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKey_sortField,
+ z_InternationalString, 0},
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec,
+ (Odr_fun)z_Specification, 0},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKey_sortAttributes,
+ (Odr_fun)z_SortAttributes, 0},
+ {-1, -1, -1, -1, 0}
+ };
+
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortDbSpecific(ODR o, Z_SortDbSpecific **p, int opt, const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_DatabaseName(o, &(*p)->databaseName, 0, 0) &&
+ z_SortKey(o, &(*p)->dbSort, 0, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_SortDbSpecificList(ODR o, Z_SortDbSpecificList **p, int opt,
+ const char *name)
+{
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_sequence_of(o, (Odr_fun)z_SortDbSpecific, &(*p)->dbSpecific,
+ &(*p)->num_dbSpecific, 0))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortElement(ODR o, Z_SortElement **p, int opt, const char *name)
+{
+ static Odr_arm arm[] =
+ {
+ {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_SortElement_generic,
+ (Odr_fun)z_SortKey, 0},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortElement_databaseSpecific,
+ (Odr_fun)z_SortDbSpecificList, 0},
+ {-1, -1, -1, -1, 0, 0}
+ };
+
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortMissingValueAction(ODR o, Z_SortMissingValueAction **p, int opt,
+ const char *name)
+{
+ static Odr_arm arm[] =
+ {
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortMissingValAct_abort,
+ (Odr_fun)odr_null, 0},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortMissingValAct_null,
+ (Odr_fun)odr_null, 0},
+ {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortMissingValAct_valData,
+ (Odr_fun)odr_octetstring, 0},
+ {-1, -1, -1, -1, 0, 0}
+ };
+
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortKeySpec(ODR o, Z_SortKeySpec **p, int opt, const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_SortElement(o, &(*p)->sortElement, 0, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->sortRelation, ODR_CONTEXT, 1, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->caseSensitivity,
+ ODR_CONTEXT, 2, 0) &&
+ odr_explicit(o, z_SortMissingValueAction, &(*p)->missingValueAction,
+ ODR_CONTEXT, 3, 1) &&
+ odr_sequence_end(o);
+}
+
+int z_SortResponse(ODR o, Z_SortResponse **p, int opt, const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->sortStatus, ODR_CONTEXT,
+ 3, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->resultSetStatus, ODR_CONTEXT,
+ 4, 1) &&
+ odr_implicit(o, z_DiagRecs, &(*p)->diagnostics, ODR_CONTEXT, 5, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_SortKeySpecList(ODR o, Z_SortKeySpecList **p, int opt, const char *name)
+{
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_sequence_of(o, (Odr_fun)z_SortKeySpec, &(*p)->specs,
+ &(*p)->num_specs, 0))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_SortRequest(ODR o, Z_SortRequest **p, int opt, const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
+ odr_implicit(o, z_StringList, &(*p)->inputResultSetNames,
+ ODR_CONTEXT, 3, 0) &&
+ odr_implicit(o, z_InternationalString, &(*p)->sortedResultSetName,
+ ODR_CONTEXT, 4, 0) &&
+ odr_implicit(o, z_SortKeySpecList, &(*p)->sortSequence, ODR_CONTEXT,
+ 5, 0) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
+ odr_sequence_end(o);
+}
+
+/* ---------------------- Resource Report ---------------- */
+
+int z_ResourceReportRequest(ODR o, Z_ResourceReportRequest **p, int opt,
+ const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
+ odr_implicit(o, z_ReferenceId, &(*p)->opId, ODR_CONTEXT, 210, 1) &&
+ odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat, ODR_CONTEXT,
+ 49, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
+ odr_sequence_end(o);
+}
+
+int z_ResourceReportResponse(ODR o, Z_ResourceReportResponse **p, int opt,
+ const char *name)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p), 0))
+ return opt && odr_ok(o);
+ return
+ z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
+ odr_implicit(o, odr_integer, &(*p)->resourceReportStatus,
+ ODR_CONTEXT, 50, 0) &&
+ odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT,
+ 51, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&