* Sebastian Hammer, Adam Dickmeiss
*
* $Log: proto.c,v $
- * Revision 1.28 1995-06-14 15:26:35 quinn
+ * Revision 1.29 1995-06-15 07:44:49 quinn
+ * Moving to v3.
+ *
+ * Revision 1.28 1995/06/14 15:26:35 quinn
* *** empty log message ***
*
* Revision 1.27 1995/06/07 14:36:22 quinn
int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt)
{
- if (o->direction == ODR_ENCODE)
+ if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
-
+ else if (!*p)
+ return opt;
odr_implicit_settag(o, ODR_CONTEXT, 201);
if (odr_sequence_of(o, z_OtherInformationUnit, &(*p)->list,
&(*p)->num_elements))
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
return 1;
*p = 0;
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
return 1;
ODR_CONTEXT, 47, 1) &&
odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT,
48, 1) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
42, 0) &&
odr_implicit(o, odr_bool, &(*p)->triggeredRequestFlag,
ODR_CONTEXT, 43, 1) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
odr_implicit(o, odr_bool, &(*p)->continueFlag, ODR_CONTEXT, 44, 0) &&
odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT,
45, 1) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT,
120, 0) &&
#ifdef Z_95
- odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
+ odr_choice(o, arm, &(*p)->value, &(*p)->which) &&
#else
odr_implicit(o, odr_integer, &(*p)->attributeValue, ODR_CONTEXT,
121, 0) &&
return opt && odr_ok(o);
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
- else
- (*p)->u.and = ODR_NULLVAL;
if (odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
odr_constructed_end(o))
{-1, -1, -1, -1, 0}
};
- if (o->direction ==ODR_DECODE)
+ if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
else if (!*p)
return opt;
return odr_external(o, (Odr_external **) p, opt);
}
+#ifdef Z_95
+
+int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt)
+{
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ odr_oid(o, &(*p)->diagnosticSetId, 1) && /* SHOULD NOT BE OPT! */
+ odr_integer(o, &(*p)->condition, 0) &&
+ /*
+ * I no longer recall what server tagged the addinfo.. but it isn't
+ * hurting anyone, so...
+ * We need to turn it into a choice, or something, because of
+ * that damn generalstring in v3.
+ */
+ (odr_visiblestring(o, &(*p)->addinfo, 0) ||
+ odr_implicit(o, odr_cstring, &(*p)->addinfo, ODR_CONTEXT,
+ ODR_VISIBLESTRING, 1)) &&
+ odr_sequence_end(o);
+}
+
+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, -1, 0}
+ };
+
+ if (o->direction == ODR_DECODE)
+ *p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+#else
+
int z_DiagRec(ODR o, Z_DiagRec **p, int opt)
{
if (!odr_sequence_begin(o, p, sizeof(**p)))
odr_sequence_end(o);
}
+#endif
+
int z_NamePlusRecord(ODR o, Z_NamePlusRecord **p, int opt)
{
static Odr_arm arm[] =
{
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
if (odr_sequence_of(o, z_NamePlusRecord, &(*p)->records,
&(*p)->num_records))
return 1;
return
z_ReferenceId(o, &(*p)->referenceId, 1) &&
odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
z_ReferenceId(o, &(*p)->referenceId, 1) &&
odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
odr_explicit(o, z_DiagRec, &(*p)->diagnostic, ODR_CONTEXT, 223, 1) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
return 1;
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
return 1;
{
{ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSpec_elementSetName,
odr_visiblestring},
- {ODR_IMPLICIT; ODR_CONTEXT, 2, Z_ElementSpec_externalSpec,
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementSpec_externalSpec,
odr_external},
{-1, -1, -1, -1, 0}
};
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
return 1;
if (!odr_sequence_begin(o, p, sizeof(**p)))
return opt && odr_ok(o);
return
- odr_explicit(o, z_DatabaseName, &(*p)->db, ODR_CONTEXT, 1, 0) &&
+ odr_explicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT,
+ 1, 0) &&
odr_implicit(o, z_Specification, &(*p)->spec, ODR_CONTEXT, 2, 0) &&
odr_sequence_end(o);
}
1, 0) &&
odr_implicit(o, z_Specification, &(*p)->generic, ODR_CONTEXT, 2, 1) &&
odr_implicit_settag(o, ODR_CONTEXT, 3) &&
- (odr_sequence_of(o, z_DbSpecific, &(*p)->num_dbSpecific,
- &(*p)->dbSpecific) || odr_ok(o)) &&
+ (odr_sequence_of(o, z_DbSpecific, &(*p)->dbSpecific,
+ &(*p)->num_dbSpecific) || odr_ok(o)) &&
odr_implicit_settag(o, ODR_CONTEXT, 4) &&
- (odr_sequence_of(o, odr_oid, &(*p)->num_recordSyntax,
- &(*p)->recordSyntax) || odr_ok(o)) &&
+ (odr_sequence_of(o, odr_oid, &(*p)->recordSyntax,
+ &(*p)->num_recordSyntax) || odr_ok(o)) &&
odr_sequence_end(o);
}
if (o->direction == ODR_DECODE)
*p = odr_malloc(o, sizeof(**p));
+ else if (!*p)
+ return opt;
if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
return 1;
29, 0) &&
#ifdef Z_95
odr_implicit_settag(o, ODR_CONTEXT, 212) &&
- (odr_sequence_of(o, z_Range, &(*p)->num_ranges,
- &(*p)->additionalRanges) || odr_ok(o)) &&
+ (odr_sequence_of(o, z_Range, &(*p)->additionalRanges,
+ &(*p)->num_ranges) || odr_ok(o)) &&
z_RecordComposition(o, &(*p)->recordComposition, 1) &&
#else
z_ElementSetNames(o, &pp->elementSetNames, 1) &&
204, 1) &&
odr_implicit(o, odr_integer, &(*p)->maxRecordSize, ODR_CONTEXT,
206, 1) &&
- odr_impplicit(o, odr_integer, &(*p)->maxSegmentSize, ODR_CONTEXT,
+ odr_implicit(o, odr_integer, &(*p)->maxSegmentSize, ODR_CONTEXT,
207, 1) &&
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
z_PresentStatus(o, &pp->presentStatus, 0) &&
z_Records(o, &pp->records, 1) &&
#ifdef Z_95
- Z_OtherInformation(o, &(*p)->otherInfo, 1) &&
+ z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
}
0) &&
(odr_sequence_of(o, z_ListStatus, &(*p)->resultSetList,
&(*p)->num_ids) || odr_ok(o)) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
&(*p)->num_bulkStatuses) || odr_ok(o)) &&
odr_implicit(o, odr_visiblestring, &(*p)->deleteMessage, ODR_CONTEXT,
36, 1) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
odr_implicit(o, odr_integer, &(*p)->numberOfRecordsReturned,
ODR_CONTEXT, 24, 0) &&
odr_implicit_settag(o, ODR_CONTEXT, 0) &&
- odr_sequence_of(o, z_NamePlusRecord, &(*p)->num_segmentRecords,
- &(*p)->segmentRecords) &&
+ odr_sequence_of(o, z_NamePlusRecord, &(*p)->segmentRecords,
+ &(*p)->num_segmentRecords) &&
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
odr_sequence_end(o);
}
4, 1) &&
odr_implicit(o, odr_external, &(*p)->resourceReport, ODR_CONTEXT,
5, 1) &&
-#ifdef Z_OTHERINFO
+#ifdef Z_95
z_OtherInformation(o, &(*p)->otherInfo, 1) &&
#endif
odr_sequence_end(o);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zget.c,v $
- * Revision 1.6 1995-06-14 15:26:37 quinn
+ * Revision 1.7 1995-06-15 07:44:52 quinn
+ * Moving to v3.
+ *
+ * Revision 1.6 1995/06/14 15:26:37 quinn
* *** empty log message ***
*
* Revision 1.5 1995/06/07 14:42:30 quinn
r->implementationName = "Index Data/YAZ";
r->implementationVersion = YAZ_VERSION;
r->userInformationField = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->implementationName = "Index Data/YAZ";
r->implementationVersion = YAZ_VERSION;
r->userInformationField = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->mediumSetElementSetNames = 0;
r->preferredRecordSyntax = 0;
r->query = 0;
+#ifdef Z_95
+ r->additionalSearchInfo = 0;
+ r->otherInfo = 0;
+#endif
return r;
}
r->resultSetStatus = 0;
r->presentStatus = 0;
r->records = 0;
+#ifdef Z_95
+ r->additionalSearchInfo = 0;
+ r->otherInfo = 0;
+#endif
return r;
}
*r->resultSetStartPoint = 1;
r->numberOfRecordsRequested = odr_malloc(o, sizeof(int));
*r->numberOfRecordsRequested = 10;
+#ifdef Z_95
+ r->num_ranges = 0;
+ r->additionalRanges = 0;
+ r->recordComposition = 0;
+#else
r->elementSetNames = 0;
+#endif
r->preferredRecordSyntax = 0;
+#ifdef Z_95
+ r->maxSegmentCount = 0;
+ r->maxRecordSize = 0;
+ r->maxSegmentSize = 0;
+ r->otherInfo = 0;
+#endif
return r;
}
r->presentStatus = odr_malloc(o, sizeof(int));
*r->presentStatus = Z_PRES_SUCCESS;
r->records = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
*r->deleteFunction = Z_DeleteRequest_list;
r->num_ids = 0;
r->resultSetList = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->num_bulkStatuses = 0;
r->bulkStatuses = 0;
r->deleteMessage = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->numberOfTermsRequested = odr_malloc(o, sizeof(int));
*r->numberOfTermsRequested = 20;
r->preferredPositionInResponse = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->positionOfTerm =0;
r->entries = 0;
r->attributeSet = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
*r->requestedAction = Z_TriggerResourceCtrl_resourceReport;
r->prefResourceReportFormat = 0;
r->resultSetWanted = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->responseRequired = odr_malloc(o, sizeof(bool_t));
*r->responseRequired = 0;
r->triggeredRequestFlag = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->continueFlag = odr_malloc(o, sizeof(bool_t));
*r->continueFlag = 1;
r->resultSetWanted = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->referenceId = 0;
r->which = Z_AccessRequest_simpleForm;
r->u.simpleForm = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
r->which = Z_AccessResponse_simpleForm;
r->u.simpleForm = 0;
r->diagnostic = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
+ return r;
+}
+
+Z_Segment *zget_Segment(ODR o)
+{
+ Z_Segment *r = odr_malloc(o, sizeof(*r));
+
+ r->referenceId = 0;
+ r->numberOfRecordsReturned = odr_malloc(o, sizeof(int));
+ *r->numberOfRecordsReturned = 0;
+ r->num_segmentRecords = 0;
+ r->segmentRecords = 0;
+ r->otherInfo = 0;
return r;
}
r->diagnosticInformation = 0;
r->resourceReportFormat = 0;
r->resourceReport = 0;
+#ifdef Z_95
+ r->otherInfo = 0;
+#endif
return r;
}
case Z_APDU_resourceControlResponse:
r->u.resourceControlResponse = zget_ResourceControlResponse(o);
break;
+ case Z_APDU_segmentRequest:
+ r->u.segmentRequest = zget_Segment(o);
+ break;
case Z_APDU_close:
r->u.close = zget_Close(o);
break;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: client.c,v $
- * Revision 1.11 1995-06-14 15:26:40 quinn
+ * Revision 1.12 1995-06-15 07:44:57 quinn
+ * Moving to v3.
+ *
+ * Revision 1.11 1995/06/14 15:26:40 quinn
* *** empty log message ***
*
* Revision 1.10 1995/06/06 14:56:58 quinn
static void display_diagrec(Z_DiagRec *p)
{
oident *ent;
+#ifdef Z_95
+ Z_DefaultDiagFormat *r;
+#else
+ Z_DiagRec *r = p;
+#endif
printf("Diagnostic message from database.\n");
- if (!(ent = oid_getentbyoid(p->diagnosticSetId)) ||
+#ifdef Z_95
+ if (p->which != Z_DiagRec_defaultFormat)
+ {
+ printf("Diagnostic record not in default format.\n");
+ return;
+ }
+ else
+ r = p->u.defaultFormat;
+#endif
+ if (!(ent = oid_getentbyoid(r->diagnosticSetId)) ||
ent->class != CLASS_DIAGSET || ent->value != VAL_BIB1)
printf("Missing or unknown diagset\n");
- printf("Error condition: %d", *p->condition);
- printf(" -- %s\n", p->addinfo ? p->addinfo : "");
+ printf("Error condition: %d", *r->condition);
+ printf(" -- %s\n", r->addinfo ? r->addinfo : "");
}
static void display_nameplusrecord(Z_NamePlusRecord *p)
}
if (*arg)
{
- if (send_scanrequest(arg, 5, 19) < 0)
+ if (send_scanrequest(arg, 5, 20) < 0)
return 0;
}
else
- if (send_scanrequest(last_scan, 1, 19) < 0)
+ if (send_scanrequest(last_scan, 1, 20) < 0)
return 0;
return 2;
}
* OF THIS SOFTWARE.
*
* $Log: proto.h,v $
- * Revision 1.15 1995-06-14 15:26:43 quinn
+ * Revision 1.16 1995-06-15 07:45:06 quinn
+ * Moving to v3.
+ *
+ * Revision 1.15 1995/06/14 15:26:43 quinn
* *** empty log message ***
*
* Revision 1.14 1995/06/07 14:42:34 quinn
* apps have been updated, we'll remove the #ifdefs.
*/
-#define Z_V3
+#define Z_95
/* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
{
int *numeric;
Z_ComplexAttribute *complex;
- } u;
+ } value;
#else
int *attributeValue;
#endif
} Z_AttributeElement;
-#ifdef Z_V3
-
typedef struct Z_Term
{
enum
} u;
} Z_Term;
-#endif
-
typedef struct Z_AttributesPlusTerm
{
int num_attributes;
Z_AttributeElement **attributeList;
-#ifdef Z_V3
Z_Term *term;
-#else
- Odr_oct *term;
-#endif
} Z_AttributesPlusTerm;
typedef struct Z_ResultSetPlusAttributes
#define Z_TriggerResourceCtrl_cancel 3
Odr_oid *prefResourceReportFormat; /* OPTIONAL */
bool_t *resultSetWanted; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
} Z_TriggerResourceControlRequest;
typedef struct Z_ResourceControlRequest
#define Z_ResourceControlRequest_none 3
bool_t *responseRequired;
bool_t *triggeredRequestFlag; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
} Z_ResourceControlRequest;
typedef struct Z_ResourceControlResponse
Z_ReferenceId *referenceId; /* OPTIONAL */
bool_t *continueFlag;
bool_t *resultSetWanted; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
} Z_ResourceControlResponse;
Odr_oct *simpleForm;
Odr_external *externallyDefined;
} u;
-#ifdef Z_OTHERINFO
+#ifdef Z_95
Z_OtherInformation *otherInfo; /* OPTIONAL */
#endif
} Z_AccessControlRequest;
Odr_external *externallyDefined;
} u;
Z_DiagRec *diagnostic; /* OPTIONAL */
-#ifdef Z_OTHERINFO
+#ifdef Z_95
Z_OtherInformation *otherInfo; /* OPTIONAL */
#endif
} Z_AccessControlResponse;
int *stepSize; /* OPTIONAL */
int *numberOfTermsRequested;
int *preferredPositionInResponse; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
} Z_ScanRequest;
typedef struct Z_ScanResponse
int *positionOfTerm; /* OPTIONAL */
Z_ListEntries *entries; /* OPTIONAL */
Odr_oid *attributeSet; /* OPTIONAL */
+#ifdef Z_95
+ Z_OtherInformation *otherInfo;
+#endif
} Z_ScanResponse;
#define Z_DeleteRequest_all 1
int num_ids;
Z_ResultSetId **resultSetList; /* OPTIONAL */
-#ifdef Z_OTHERINFO
+#ifdef Z_95
Z_OtherInformation *otherInfo;
#endif
} Z_DeleteResultSetRequest;
int num_bulkStatuses;
Z_ListStatus *bulkStatuses; /* OPTIONAL */
char *deleteMessage; /* OPTIONAL */
-#ifdef Z_OTHERINFO
+#ifdef Z_95
Z_OtherInformation *otherInfo;
#endif
} Z_DeleteResultSetResponse;
char *diagnosticInformation; /* OPTIONAL */
Odr_oid *resourceReportFormat; /* OPTIONAL */
Odr_external *resourceReport; /* OPTIONAL */
-#ifdef Z_OTHERINFO
+#ifdef Z_95
Z_OtherInformation *otherInfo; /* OPTIONAL */
#endif
} Z_Close;
typedef struct Z_Segment
{
- Z_ReferenceId *referenceid; /* OPTIONAL */
+ Z_ReferenceId *referenceId; /* OPTIONAL */
int *numberOfRecordsReturned;
- Z_NamePlusRecord *segmentRecords;
+ int num_segmentRecords;
+ Z_NamePlusRecord **segmentRecords;
Z_OtherInformation *otherInfo; /* OPTIONAL */
} Z_Segment;
* OF THIS SOFTWARE.
*
* $Log: statserv.h,v $
- * Revision 1.3 1995-05-16 08:50:38 quinn
+ * Revision 1.4 1995-06-15 07:45:08 quinn
+ * Moving to v3.
+ *
+ * Revision 1.3 1995/05/16 08:50:38 quinn
* License, documentation, and memory fixes
*
*
int idle_timeout; /* how many minutes to wait before closing */
int maxrecordsize; /* maximum value for negotiation */
char configname[ODR_MAXNAME+1]; /* given to the backend in bend_init */
+ char setuid[ODR_MAXNAME+1]; /* setuid to this user after binding */
} statserv_options_block;
int statserv_main(int argc, char **argv);
# Copyright (C) 1994, Index Data I/S
# All rights reserved.
# Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.5 1995-05-30 10:25:46 quinn Exp $
+# $Id: Makefile,v 1.6 1995-06-15 07:45:09 quinn Exp $
SHELL=/bin/sh
INCLUDE=-I../include -I. -I../../xtimosi/src
LIBDIR=../lib
LIBINCLUDE=-L$(LIBDIR)
CFLAGS= -g -Wall -pedantic -ansi
-DEFS=$(INCLUDE) #-DTRACE_TRANSPORT
+DEFS=$(INCLUDE) -DTRACE_TRANSPORT
LIB=$(LIBDIR)/librfc.a
LIBS=-lodr
PO = rfct.o makensap.o
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rfct.c,v $
- * Revision 1.5 1995-05-31 08:29:35 quinn
+ * Revision 1.6 1995-06-15 07:45:11 quinn
+ * Moving to v3.
+ *
+ * Revision 1.5 1995/05/31 08:29:35 quinn
* Nothing significant.
*
* Revision 1.4 1995/05/18 13:02:07 quinn
/*
* Simple implementation of XTI/TP0/RFC1006/Sockets.
- * Note: This is neither complete nor robust. It just has to tick us over
- * until mr. Furniss finishes his own implementation.
+ * Note: There is still some work to do in here, but basically it works.
*
* TODO: Asynchronous mode needs a lot of little adjustments to various
- * return values and error codes, etc.
+ * return values and error codes, etc. Formally, we should probably hold
+ * this up against the protocol state tables, and see if it's correct.
*
* Check if addressing info is returned correctly by all calls.
*/
return nbytes;
}
-int _t_rcv(int fd, char *buf, unsigned nbytes, int *flags)
+int t_rcv(int fd, char *buf, unsigned nbytes, int *flags)
{
struct rfct_control *cnt = control[fd];
struct tpdu_data_header dhead;
return got;
}
+#if 0
+
int t_rcv(int fd, char *buf, unsigned nbytes, int *flags)
{
int res;
return total;
}
+#endif
+
int t_close(int fd)
{
struct rfct_control *cnt = control[fd];
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: seshigh.c,v $
- * Revision 1.34 1995-06-14 15:26:46 quinn
+ * Revision 1.35 1995-06-15 07:45:14 quinn
+ * Moving to v3.
+ *
+ * Revision 1.34 1995/06/14 15:26:46 quinn
* *** empty log message ***
*
* Revision 1.33 1995/06/06 14:57:05 quinn
{
static Z_Records rec;
oident bib1;
- static Z_DiagRec dr;
static int err;
+#ifdef Z_95
+ static Z_DiagRec drec;
+ static Z_DefaultDiagFormat dr;
+#else
+ static Z_DiagRec dr;
+#endif
bib1.proto = proto;
bib1.class = CLASS_DIAGSET;
"NULL");
err = error;
rec.which = Z_Records_NSD;
+#ifdef Z_95
+ rec.u.nonSurrogateDiagnostic = &drec;
+ drec.which = Z_DiagRec_defaultFormat;
+ drec.u.defaultFormat = &dr;
+#else
rec.u.nonSurrogateDiagnostic = &dr;
+#endif
dr.diagnosticSetId = oid_getoidbyent(&bib1);
dr.condition = &err;
dr.addinfo = addinfo ? addinfo : "";
int error, char *addinfo)
{
static Z_NamePlusRecord rec;
- static Z_DiagRec dr;
static int err;
oident bib1;
+#ifdef Z_95
+ static Z_DiagRec drec;
+ static Z_DefaultDiagFormat dr;
+#else
+ static Z_DiagRec dr;
+#endif
bib1.proto = proto;
bib1.class = CLASS_DIAGSET;
err = error;
rec.databaseName = dbname;
rec.which = Z_NamePlusRecord_surrogateDiagnostic;
+#ifdef Z_95
+ rec.u.surrogateDiagnostic = &drec;
+ drec.which = Z_DiagRec_defaultFormat;
+ drec.u.defaultFormat = &dr;
+#else
rec.u.surrogateDiagnostic = &dr;
+#endif
dr.diagnosticSetId = oid_getoidbyent(&bib1);
dr.condition = &err;
dr.addinfo = addinfo ? addinfo : "";
static Z_DiagRecs *diagrecs(oid_proto proto, int error, char *addinfo)
{
static Z_DiagRecs recs;
- static Z_DiagRec *recp[1], rec;
static int err;
oident bib1;
+#ifdef Z_95
+ static Z_DiagRec *recp[1], drec;
+ static Z_DefaultDiagFormat rec;
+#else
+ static Z_DiagRec *recp[1], rec;
+#endif
logf(LOG_DEBUG, "DiagRecs: %d -- %s", error, addinfo);
bib1.proto = proto;
err = error;
recs.num_diagRecs = 1;
recs.diagRecs = recp;
+#ifdef Z_95
+ recp[0] = &drec;
+ drec.which = Z_DiagRec_defaultFormat;
+ drec.u.defaultFormat = &rec;
+#else
recp[0] = &rec;
+#endif
rec.diagnosticSetId = oid_getoidbyent(&bib1);
rec.condition = &err;
rec.addinfo = addinfo ? addinfo : "";
apdu.which = Z_APDU_searchResponse;
apdu.u.searchResponse = &resp;
resp.referenceId = req->referenceId;
+#ifdef Z_95
+ resp.additionalSearchInfo = 0;
+ resp.otherInfo = 0;
+#endif
*fd = -1;
if (!bsrt && !(bsrt = bend_searchresponse(assoc->backend)))
{
apdu.which = Z_APDU_presentResponse;
apdu.u.presentResponse = &resp;
resp.referenceId = req->referenceId;
+#ifdef Z_95
+ resp.otherInfo = 0;
+#endif
num = *req->numberOfRecordsRequested;
resp.records = pack_records(assoc, req->resultSetId,
- *req->resultSetStartPoint, &num, req->elementSetNames, &next, &presst);
+ *req->resultSetStartPoint, &num, 0, &next, &presst);
if (!resp.records)
return 0;
resp.numberOfRecordsReturned = #
res.entries = &ents;
ents.which = Z_ListEntries_nonSurrogateDiagnostics;
res.attributeSet = 0;
+#ifdef Z_95
+ res.otherInfo = 0;
+#endif
if (req->attributeSet && (!(attent = oid_getentbyoid(req->attributeSet)) ||
attent->class != CLASS_ATTSET || attent->value != VAL_BIB1))
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: statserv.c,v $
- * Revision 1.21 1995-06-06 08:15:40 quinn
+ * Revision 1.22 1995-06-15 07:45:17 quinn
+ * Moving to v3.
+ *
+ * Revision 1.21 1995/06/06 08:15:40 quinn
* Cosmetic.
*
* Revision 1.20 1995/05/29 08:12:09 quinn
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
+#include <sys/types.h>
+#include <pwd.h>
#include <options.h>
#include <eventl.h>
PROTO_Z3950, /* application protocol */
60, /* idle timeout (minutes) */
1024*1024*4, /* maximum PDU size (approx.) to allow */
- "default-config" /* configuration name to pass to backend */
+ "default-config", /* configuration name to pass to backend */
+ "" /* set user id */
};
#define DEFAULT_LISTENER "tcp:localhost:9999"
int protocol = control_block.default_proto;
me = argv[0];
- while ((ret = options("a:szSl:v:", argv, argc, &arg)) != -2)
+ while ((ret = options("a:szSl:v:u:", argv, argc, &arg)) != -2)
{
switch (ret)
{
break;
case 'a':
strcpy(control_block.apdufile, arg ? arg : ""); break;
+ case 'u':
+ strcpy(control_block.setuid, arg ? arg : ""); break;
default:
- fprintf(stderr, "Usage: %s [ -a <apdufile> -v <loglevel> -l <logfile> -zsS <listener-addr> ... ]\n", me);
+ fprintf(stderr, "Usage: %s [ -a <pdufile> -v <loglevel> -l <logfile> -u <user> -zsS <listener-addr> ... ]\n", me);
exit(1);
}
}
signal(SIGCHLD, catchchld);
if (!listeners && *control_block.default_listen)
add_listener(control_block.default_listen, protocol);
+ if (*control_block.setuid)
+ {
+ struct passwd *pw;
+
+ if (!(pw = getpwnam(control_block.setuid)))
+ {
+ logf(LOG_FATAL|LOG_ERRNO, "%s", control_block.setuid);
+ exit(1);
+ }
+ if (setuid(pw->pw_uid) < 0)
+ {
+ logf(LOG_FATAL|LOG_ERRNO, "setuid");
+ exit(1);
+ }
+ }
logf(LOG_LOG, "Entering event loop.");
return event_loop();
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: pquery.c,v $
- * Revision 1.3 1995-06-14 11:06:35 adam
+ * Revision 1.4 1995-06-15 07:45:19 quinn
+ * Moving to v3.
+ *
+ * Revision 1.3 1995/06/14 11:06:35 adam
* Bug fix: Attributes wasn't interpreted correctly!
*
* Revision 1.2 1995/05/26 08:56:11 adam
zapt->attributeList[i] =
odr_malloc (o,sizeof(**zapt->attributeList));
zapt->attributeList[i]->attributeType = &attr_tmp[2*i];
+#ifdef Z_95
+ zapt->attributeList[i]->which = Z_AttributeValue_numeric;
+ zapt->attributeList[i]->value = &attr_tmp[2*i+1];
+#else
zapt->attributeList[i]->attributeValue = &attr_tmp[2*i+1];
+#endif
}
}
else
assert (zapt->attributeList[i]);
zapt->attributeList[i]->attributeType =
&attr->type;
+#ifdef Z_95
+ zapt->attributeList[i]->attributeSet = 0;
+ zapt->attributeList[i]->which = Z_AttributeValue_numeric;
+ zapt->attributeList[i]->value.numeric = &attr->value;
+#else
zapt->attributeList[i]->attributeValue =
&attr->value;
+#endif
}
}
else