From 72592d242326dea9e05cae90d50348a2da0c0948 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Tue, 15 Aug 1995 11:59:39 +0000 Subject: [PATCH] Updated External --- asn/proto.c | 29 ++++++++++++++++------------- asn/prt-acc.c | 6 +++++- asn/prt-exp.c | 10 ++++++---- client/client.c | 27 ++++++++++----------------- include/odr.h | 7 ++++++- include/proto.h | 34 +++++++++++++++++++++------------- include/prt-acc.h | 7 +++++-- include/prt-exp.h | 34 ++++++++++++++++++++++++++++++++-- include/prt.h | 1 + odr/odr.c | 6 +++++- odr/odr_choice.c | 17 +++++++++++++++-- server/seshigh.c | 20 +++++++++++++++++--- 12 files changed, 139 insertions(+), 59 deletions(-) diff --git a/asn/proto.c b/asn/proto.c index ccab40f..913644a 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.35 1995-08-10 08:53:59 quinn + * Revision 1.36 1995-08-15 11:59:39 quinn + * Updated External + * + * Revision 1.35 1995/08/10 08:53:59 quinn * Added Explain * * Revision 1.34 1995/06/19 17:01:48 quinn @@ -149,9 +152,9 @@ int z_ElementSetName(ODR o, char **p, int opt) return odr_implicit(o, odr_visiblestring, p, ODR_CONTEXT, 103, opt); } -int z_UserInformationField(ODR o, Odr_external **p, int opt) +int z_UserInformationField(ODR o, Z_External **p, int opt) { - return odr_explicit(o, odr_external, (Odr_external **)p, ODR_CONTEXT, + return odr_explicit(o, z_External, (Z_External **)p, ODR_CONTEXT, 11, opt); } @@ -179,7 +182,7 @@ int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt) {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OtherInfo_binaryInfo, odr_octetstring}, {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_OtherInfo_externallyDefinedInfo, - odr_external}, + z_External}, {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid, odr_oid}, {-1, -1, -1, -1, 0} }; @@ -293,7 +296,7 @@ int z_IdAuthentication(ODR o, Z_IdAuthentication **p, int opt) {-1, -1, -1, Z_IdAuthentication_open, z_StrAuthentication}, {-1, -1, -1, Z_IdAuthentication_idPass, z_IdPass}, {-1, -1, -1, Z_IdAuthentication_anonymous, odr_null}, - {-1, -1, -1, Z_IdAuthentication_other, odr_external}, + {-1, -1, -1, Z_IdAuthentication_other, z_External}, {-1, -1, -1, -1, 0} }; @@ -397,7 +400,7 @@ int z_ResourceControlRequest(ODR o, Z_ResourceControlRequest **p, int opt) return z_ReferenceId(o, &(*p)->referenceId, 1) && odr_implicit(o, odr_bool, &(*p)->suspendedFlag, ODR_CONTEXT, 39, 1)&& - odr_explicit(o, odr_external, &(*p)->resourceReport, ODR_CONTEXT, + odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, 40, 1) && odr_implicit(o, odr_integer, &(*p)->partialResultsAvailable, ODR_CONTEXT, 41, 1) && @@ -531,7 +534,7 @@ int z_Term(ODR o, Z_Term **p, int opt) odr_visiblestring}, {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid, odr_oid}, {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime, odr_cstring}, - {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external, odr_external}, + {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external, z_External}, /* add intUnit here */ {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null, odr_null}, {-1, -1, -1, -1, 0} @@ -744,7 +747,7 @@ int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt) int z_DatabaseRecord(ODR o, Z_DatabaseRecord **p, int opt) { - return odr_external(o, (Odr_external **) p, opt); + return z_External(o, (Z_External **) p, opt); } #ifdef Z_95 @@ -779,7 +782,7 @@ int z_DiagRec(ODR o, Z_DiagRec **p, int opt) static Odr_arm arm[] = { {-1, -1, -1, Z_DiagRec_defaultFormat, z_DefaultDiagFormat}, - {-1, -1, -1, Z_DiagRec_externallyDefined, odr_external}, + {-1, -1, -1, Z_DiagRec_externallyDefined, z_External}, {-1, -1, -1, -1, 0} }; @@ -895,7 +898,7 @@ int z_AccessControlRequest(ODR o, Z_AccessControlRequest **p, int opt) {ODR_IMPLICIT, ODR_CONTEXT, 37, Z_AccessRequest_simpleForm, odr_octetstring}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessRequest_externallyDefined, - odr_external}, + z_External}, {-1, -1, -1, -1, 0} }; if (!odr_sequence_begin(o, p, sizeof(**p))) @@ -916,7 +919,7 @@ int z_AccessControlResponse(ODR o, Z_AccessControlResponse **p, int opt) {ODR_IMPLICIT, ODR_CONTEXT, 38, Z_AccessResponse_simpleForm, odr_octetstring}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessResponse_externallyDefined, - odr_external}, + z_External}, {-1, -1, -1, -1, 0} }; if (!odr_sequence_begin(o, p, sizeof(**p))) @@ -1174,7 +1177,7 @@ int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt) {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSpec_elementSetName, odr_visiblestring}, {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementSpec_externalSpec, - odr_external}, + z_External}, {-1, -1, -1, -1, 0} }; @@ -1404,7 +1407,7 @@ int z_Close(ODR o, Z_Close **p, int opt) ODR_CONTEXT, 3, 1) && odr_implicit(o, odr_oid, &(*p)->resourceReportFormat, ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_external, &(*p)->resourceReport, ODR_CONTEXT, + odr_implicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, 5, 1) && #ifdef Z_95 z_OtherInformation(o, &(*p)->otherInfo, 1) && diff --git a/asn/prt-acc.c b/asn/prt-acc.c index 9032c85..c90554d 100644 --- a/asn/prt-acc.c +++ b/asn/prt-acc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-acc.c,v $ - * Revision 1.2 1995-06-05 10:52:05 quinn + * Revision 1.3 1995-08-15 11:59:41 quinn + * Updated External + * + * Revision 1.2 1995/06/05 10:52:05 quinn * Fixed some negligences. * * Revision 1.1 1995/06/02 09:49:15 quinn @@ -96,6 +99,7 @@ int z_ChallengeUnit1(ODR o, Z_ChallengeUnit1 **p, int opt) &(*p)->num_values) || odr_ok(o)) && odr_implicit(o, odr_null, &(*p)->shouldSave, ODR_CONTEXT, 7, 1) && odr_implicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 8, 1) && + odr_implicit(o, z_External, &(*p)->diagnostic, ODR_CONTEXT, 9, 1) && odr_sequence_end(o); } diff --git a/asn/prt-exp.c b/asn/prt-exp.c index 2904d45..9249933 100644 --- a/asn/prt-exp.c +++ b/asn/prt-exp.c @@ -4,14 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-exp.c,v $ - * Revision 1.1 1995-08-10 08:54:02 quinn + * Revision 1.2 1995-08-15 11:59:43 quinn + * Updated External + * + * Revision 1.1 1995/08/10 08:54:02 quinn * Added Explain * * */ #include -#include int z_LanguageCode(ODR o, char **p, int opt); int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt); @@ -923,7 +925,7 @@ int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt) odr_implicit(o, odr_bool, &(*p)->retentionSupported, ODR_CONTEXT, 8, 0) && odr_implicit(o, odr_integer, &(*p)->waitAction, ODR_CONTEXT, 9, 0) && odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 10, 1) && - odr_implicit(o, odr_external, &(*p)->specificExplain, ODR_CONTEXT, 11, 1) && + odr_implicit(o, z_External, &(*p)->specificExplain, ODR_CONTEXT, 11, 1) && odr_implicit(o, z_InternationalString, &(*p)->esASN, ODR_CONTEXT, 12, 1) && odr_sequence_end(o); } @@ -1150,7 +1152,7 @@ int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt) 3, 0) && odr_implicit(o, odr_oid, &(*p)->oid, ODR_CONTEXT, 4, 0) && odr_implicit(o, z_HumanString, &(*p)->description, ODR_CONTEXT, 5, 1) && - odr_implicit(o, odr_external, &(*p)->instructions, ODR_CONTEXT, 6, 1) && + odr_implicit(o, z_External, &(*p)->instructions, ODR_CONTEXT, 6, 1) && odr_sequence_end(o); } diff --git a/client/client.c b/client/client.c index cabebb9..3ada612 100644 --- a/client/client.c +++ b/client/client.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: client.c,v $ - * Revision 1.15 1995-06-22 09:28:03 quinn + * Revision 1.16 1995-08-15 12:00:04 quinn + * Updated External + * + * Revision 1.15 1995/06/22 09:28:03 quinn * Fixed bug in SUTRS processing. * * Revision 1.14 1995/06/19 12:37:41 quinn @@ -166,7 +169,7 @@ static int process_initResponse(Z_InitResponse *res) if (res->userInformationField) { printf("UserInformationfield:\n"); - if (!odr_external(print, (Odr_external**)&res-> userInformationField, + if (!z_External(print, (Z_External**)&res-> userInformationField, 0)) { odr_perror(print, "Printing userinfo\n"); @@ -266,7 +269,7 @@ int cmd_authentication(char *arg) void display_record(Z_DatabaseRecord *p) { - Odr_external *r = (Odr_external*) p; + Z_External *r = (Odr_external*) p; oident *ent = oid_getentbyoid(r->direct_reference); if (r->direct_reference) @@ -284,27 +287,17 @@ void display_record(Z_DatabaseRecord *p) marc_display ((char*)p->u.octet_aligned->buf, stdout); else if (ent->value == VAL_SUTRS) { - Odr_oct *rc; - - if (r->which != ODR_EXTERNAL_single) + if (r->which != Z_External_SUTRS) { - printf("Expecting single ASN.1 type for SUTRS.\n"); + printf("Expecting single SUTRS type for SUTRS.\n"); return; } - odr_setbuf(in, (char*)r->u.single_ASN1_type->buf, - r->u.single_ASN1_type->len, 0); - if (!z_SUTRS(in, &rc, 0)) - { - odr_perror(in, "decoding SUTRS"); - odr_reset(in); - } - else - printf("%.*s", rc->len, rc->buf); + printf("%.*s", r->u.sutrs->len, r->u.sutrs->buf); } else { printf("Unknown record representation.\n"); - if (!odr_external(print, &r, 0)) + if (!z_External(print, &r, 0)) { odr_perror(print, "Printing external"); odr_reset(print); diff --git a/include/odr.h b/include/odr.h index decbe0c..e63d648 100644 --- a/include/odr.h +++ b/include/odr.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: odr.h,v $ - * Revision 1.10 1995-08-10 08:54:33 quinn + * Revision 1.11 1995-08-15 12:00:09 quinn + * Updated External + * + * Revision 1.10 1995/08/10 08:54:33 quinn * Added Explain. * * Revision 1.9 1995/06/19 12:38:26 quinn @@ -220,6 +223,8 @@ typedef struct odr int t_class; /* implicit tagging (-1==default tag) */ int t_tag; + int choice_bias; /* force choice */ + FILE *print; /* output file for direction print */ int indent; /* current indent level for printing */ diff --git a/include/proto.h b/include/proto.h index fed2e5f..be2de47 100644 --- a/include/proto.h +++ b/include/proto.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: proto.h,v $ - * Revision 1.20 1995-08-10 08:54:35 quinn + * Revision 1.21 1995-08-15 12:00:11 quinn + * Updated External + * + * Revision 1.20 1995/08/10 08:54:35 quinn * Added Explain. * * Revision 1.19 1995/06/19 12:38:28 quinn @@ -138,6 +141,9 @@ /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/ +struct Z_External; +typedef struct Z_External Z_External; + typedef Odr_oct Z_ReferenceId; typedef char Z_DatabaseName; typedef char Z_ResultSetId; @@ -163,7 +169,7 @@ typedef struct Z_OtherInformationUnit { char *characterInfo; Odr_oct *binaryInfo; - Odr_external *externallyDefinedInfo; + Z_External *externallyDefinedInfo; Odr_oid *oid; } information; } Z_OtherInformationUnit; @@ -227,7 +233,7 @@ typedef struct Z_IdAuthentication char *open; Z_IdPass *idPass; Odr_null *anonymous; - Odr_external *other; + Z_External *other; } u; } Z_IdAuthentication; @@ -262,7 +268,7 @@ typedef struct Z_InitRequest char *implementationId; /* OPTIONAL */ char *implementationName; /* OPTIONAL */ char *implementationVersion; /* OPTIONAL */ - Odr_external *userInformationField; /* OPTIONAL */ + Z_External *userInformationField; /* OPTIONAL */ #ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ #endif @@ -279,7 +285,7 @@ typedef struct Z_InitResponse char *implementationId; /* OPTIONAL */ char *implementationName; /* OPTIONAL */ char *implementationVersion; /* OPTIONAL */ - Odr_external *userInformationField; /* OPTIONAL */ + Z_External *userInformationField; /* OPTIONAL */ #ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ #endif @@ -374,7 +380,7 @@ typedef struct Z_Term char *characterString; Odr_oid *oid; char *dateTime; - Odr_external *external; + Z_External *external; /* Z_IntUnit *integerAndUnit; */ Odr_null *null; } u; @@ -527,7 +533,7 @@ typedef struct Z_SearchRequest /* ------------------------ RECORD -------------------------- */ -typedef Odr_external Z_DatabaseRecord; +typedef Z_External Z_DatabaseRecord; #ifdef Z_95 @@ -555,7 +561,7 @@ typedef struct Z_DiagRec union { Z_DefaultDiagFormat *defaultFormat; - Odr_external *externallyDefined; + Z_External *externallyDefined; } u; } Z_DiagRec; @@ -653,7 +659,7 @@ typedef struct Z_ElementSpec union { char *elementSetName; - Odr_external *externalSpec; + Z_External *externalSpec; } u; } Z_ElementSpec; @@ -753,7 +759,7 @@ typedef struct Z_ResourceControlRequest { Z_ReferenceId *referenceId; /* OPTIONAL */ bool_t *suspendedFlag; /* OPTIONAL */ - Odr_external *resourceReport; /* OPTIONAL */ + Z_External *resourceReport; /* OPTIONAL */ int *partialResultsAvailable; /* OPTIONAL */ #define Z_ResourceControlRequest_subset 1 #define Z_ResourceControlRequest_interim 2 @@ -789,7 +795,7 @@ typedef struct Z_AccessControlRequest union { Odr_oct *simpleForm; - Odr_external *externallyDefined; + Z_External *externallyDefined; } u; #ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ @@ -807,7 +813,7 @@ typedef struct Z_AccessControlResponse union { Odr_oct *simpleForm; - Odr_external *externallyDefined; + Z_External *externallyDefined; } u; Z_DiagRec *diagnostic; /* OPTIONAL */ #ifdef Z_95 @@ -994,7 +1000,7 @@ typedef struct Z_Close #define Z_Close_unspecified 9 char *diagnosticInformation; /* OPTIONAL */ Odr_oid *resourceReportFormat; /* OPTIONAL */ - Odr_external *resourceReport; /* OPTIONAL */ + Z_External *resourceReport; /* OPTIONAL */ #ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ #endif @@ -1085,5 +1091,7 @@ Z_APDU *zget_APDU(ODR o, enum Z_APDU_which which); #include #include +#include +#include #endif diff --git a/include/prt-acc.h b/include/prt-acc.h index 6617d8f..4b78e46 100644 --- a/include/prt-acc.h +++ b/include/prt-acc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: prt-acc.h,v $ - * Revision 1.1 1995-06-02 09:49:49 quinn + * Revision 1.2 1995-08-15 12:00:13 quinn + * Updated External + * + * Revision 1.1 1995/06/02 09:49:49 quinn * Add access control * * @@ -93,7 +96,7 @@ typedef struct Z_ChallengeUnit1 #define Z_ChalDataType_alphaNumeric 4 #define Z_ChalDataType_urlUrn 5 #define Z_ChalDataType_boolean 6 - Odr_external *diagnostic; /* OPTIONAL */ + Z_External *diagnostic; /* OPTIONAL */ } Z_ChallengeUnit1; typedef struct Z_Challenge1 diff --git a/include/prt-exp.h b/include/prt-exp.h index d5a44fc..8e27785 100644 --- a/include/prt-exp.h +++ b/include/prt-exp.h @@ -1,3 +1,31 @@ +/* + * Copyright (c) 1995, Index Data. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of Index Data or the individual authors may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR + * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + */ + + typedef struct Z_CommonInfo { char *dateAdded; /* OPTIONAL */ @@ -606,7 +634,7 @@ typedef struct Z_ExtendedServicesInfo * Non-brief elements */ Z_HumanString *description; /* OPTIONAL */ - Odr_external *specificExplain; /* OPTIONAL */ + Z_External *specificExplain; /* OPTIONAL */ char *esASN; /* OPTIONAL */ } Z_ExtendedServicesInfo; @@ -801,7 +829,7 @@ typedef struct Z_ProcessingInformation * Non-brief elements */ Z_HumanString *description; /* OPTIONAL */ - Odr_external *instructions; /* OPTIONAL */ + Z_External *instructions; /* OPTIONAL */ } Z_ProcessingInformation; typedef struct Z_ValueDescription @@ -982,3 +1010,5 @@ typedef struct Z_ExplainRecord Z_CategoryList *categoryList; } u; } Z_ExplainRecord; + +int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); diff --git a/include/prt.h b/include/prt.h index 5276e16..977bec9 100644 --- a/include/prt.h +++ b/include/prt.h @@ -42,3 +42,4 @@ int odr_grow_block(odr_ecblock *b, int min_bytes); int odr_write(ODR o, unsigned char *buf, int bytes); int odr_seek(ODR o, int whence, int offset); int odr_dumpBER(FILE *f, char *buf, int len); +void odr_choice_bias(ODR o, int what); diff --git a/odr/odr.c b/odr/odr.c index 0366db9..d007f1b 100644 --- a/odr/odr.c +++ b/odr/odr.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr.c,v $ - * Revision 1.14 1995-06-19 12:38:46 quinn + * Revision 1.15 1995-08-15 12:00:22 quinn + * Updated External + * + * Revision 1.14 1995/06/19 12:38:46 quinn * Added BER dumper. * * Revision 1.13 1995/05/22 11:32:02 quinn @@ -119,6 +122,7 @@ void odr_reset(ODR o) o->stackp = -1; odr_release_mem(o->mem); o->mem = 0; + o->choice_bias = -1; } void odr_destroy(ODR o) diff --git a/odr/odr_choice.c b/odr/odr_choice.c index 8727aac..0d8fc65 100644 --- a/odr/odr_choice.c +++ b/odr/odr_choice.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_choice.c,v $ - * Revision 1.8 1995-06-19 17:01:51 quinn + * Revision 1.9 1995-08-15 12:00:23 quinn + * Updated External + * + * Revision 1.8 1995/06/19 17:01:51 quinn * This should bring us in sync with the version distributed as 1.0b * * Revision 1.7 1995/06/19 13:06:50 quinn @@ -34,16 +37,21 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) { - int i, cl = -1, tg, cn, *which = whichp; + int i, cl = -1, tg, cn, *which = whichp, bias = o->choice_bias; if (o->error) return 0; if (o->direction != ODR_DECODE && !*(char**)p) return 0; + o->choice_bias = -1; for (i = 0; arm[i].fun; i++) { if (o->direction == ODR_DECODE) + { + if (bias >= 0 && bias != arm[i].which) + continue; *which = arm[i].which; + } else if (*which != arm[i].which) continue; @@ -85,3 +93,8 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) *(char*)p = 0; return 0; } + +void odr_choice_bias(ODR o, int what) +{ + o->choice_bias = what; +} diff --git a/server/seshigh.c b/server/seshigh.c index 4792774..6bed31c 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: seshigh.c,v $ - * Revision 1.42 1995-08-15 11:16:50 quinn + * Revision 1.43 1995-08-15 12:00:31 quinn + * Updated External + * + * Revision 1.42 1995/08/15 11:16:50 quinn * CV:e ---------------------------------------------------------------------- * CV:e ---------------------------------------------------------------------- * @@ -823,8 +826,16 @@ static Z_Records *pack_records(association *a, char *setname, int start, oid_getoidbyent(&recform)); thisext->indirect_reference = 0; thisext->descriptor = 0; - if (fres->format == VAL_SUTRS) /* SUTRS ios a single-ASN.1-type */ + if (fres->format == VAL_SUTRS) /* SUTRS is a single-ASN.1-type */ { + Odr_oct *sutrs = odr_malloc(a->encode, sizeof(*sutrs)); + + thisext->which = Z_External_SUTRS; + thisext->u.sutrs = sutrs; + sutrs->buf = odr_malloc(a->encode, fres->len); + sutrs->len = sutrs->size = fres->len; + memcpy(sutrs->buf, fres->record, fres->len); +#if 0 Odr_oct sutrs_asn; Odr_oct *sp = &sutrs_asn; Odr_any *single = odr_malloc(a->encode, sizeof(*single)); @@ -856,10 +867,11 @@ static Z_Records *pack_records(association *a, char *setname, int start, odr_setbuf(a->encode, remember, s_remember, 1); logf(LOG_DEBUG, " Format is SUTRS. len %d, encoded len %d", fres->len, single->len); +#endif } else /* octet-aligned record. Easy as pie */ { - thisext->which = ODR_EXTERNAL_octet; + thisext->which = Z_External_octet; if (!(thisext->u.octet_aligned = odr_malloc(a->encode, sizeof(Odr_oct)))) return 0; @@ -990,6 +1002,8 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb, } else { + if (*resp.resultCount) + next = 1; resp.numberOfRecordsReturned = &nulint; resp.nextResultSetPosition = &next; resp.searchStatus = &sr; -- 1.7.10.4