* 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
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);
}
{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}
};
{-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}
};
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) &&
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}
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
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}
};
{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)))
{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)))
{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}
};
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) &&
* 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
&(*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);
}
* 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 <proto.h>
-#include <prt-exp.h>
int z_LanguageCode(ODR o, char **p, int opt);
int z_CommonInfo(ODR o, Z_CommonInfo **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);
}
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);
}
* 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
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");
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)
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);
* 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
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 */
* 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
/* ----------------- 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;
{
char *characterInfo;
Odr_oct *binaryInfo;
- Odr_external *externallyDefinedInfo;
+ Z_External *externallyDefinedInfo;
Odr_oid *oid;
} information;
} Z_OtherInformationUnit;
char *open;
Z_IdPass *idPass;
Odr_null *anonymous;
- Odr_external *other;
+ Z_External *other;
} u;
} Z_IdAuthentication;
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
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
char *characterString;
Odr_oid *oid;
char *dateTime;
- Odr_external *external;
+ Z_External *external;
/* Z_IntUnit *integerAndUnit; */
Odr_null *null;
} u;
/* ------------------------ RECORD -------------------------- */
-typedef Odr_external Z_DatabaseRecord;
+typedef Z_External Z_DatabaseRecord;
#ifdef Z_95
union
{
Z_DefaultDiagFormat *defaultFormat;
- Odr_external *externallyDefined;
+ Z_External *externallyDefined;
} u;
} Z_DiagRec;
union
{
char *elementSetName;
- Odr_external *externalSpec;
+ Z_External *externalSpec;
} u;
} Z_ElementSpec;
{
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
union
{
Odr_oct *simpleForm;
- Odr_external *externallyDefined;
+ Z_External *externallyDefined;
} u;
#ifdef Z_95
Z_OtherInformation *otherInfo; /* OPTIONAL */
union
{
Odr_oct *simpleForm;
- Odr_external *externallyDefined;
+ Z_External *externallyDefined;
} u;
Z_DiagRec *diagnostic; /* OPTIONAL */
#ifdef Z_95
#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
#include <prt-rsc.h>
#include <prt-acc.h>
+#include <prt-exp.h>
+#include <prt-ext.h>
#endif
* 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
*
*
#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
+/*
+ * 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 */
* Non-brief elements
*/
Z_HumanString *description; /* OPTIONAL */
- Odr_external *specificExplain; /* OPTIONAL */
+ Z_External *specificExplain; /* OPTIONAL */
char *esASN; /* OPTIONAL */
} Z_ExtendedServicesInfo;
* Non-brief elements
*/
Z_HumanString *description; /* OPTIONAL */
- Odr_external *instructions; /* OPTIONAL */
+ Z_External *instructions; /* OPTIONAL */
} Z_ProcessingInformation;
typedef struct Z_ValueDescription
Z_CategoryList *categoryList;
} u;
} Z_ExplainRecord;
+
+int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt);
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);
* 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
o->stackp = -1;
odr_release_mem(o->mem);
o->mem = 0;
+ o->choice_bias = -1;
}
void odr_destroy(ODR o)
* 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
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;
*(char*)p = 0;
return 0;
}
+
+void odr_choice_bias(ODR o, int what)
+{
+ o->choice_bias = what;
+}
* 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 ----------------------------------------------------------------------
*
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));
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;
}
else
{
+ if (*resp.resultCount)
+ next = 1;
resp.numberOfRecordsReturned = &nulint;
resp.nextResultSetPosition = &next;
resp.searchStatus = &sr;