+ {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) &&
+ odr_sequence_end(o);
+}
+
+/* ------------------------ APDU ------------------------- */
+
+int z_APDU(ODR o, Z_APDU **p, int opt, const char *name)
+{
+ static Odr_arm arm[] =
+ {
+ {ODR_IMPLICIT, ODR_CONTEXT, 20, Z_APDU_initRequest,
+ (Odr_fun)z_InitRequest, 0},
+ {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse,
+ (Odr_fun)z_InitResponse, 0},
+ {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest,
+ (Odr_fun)z_SearchRequest, 0},