2 * Copyright (c) 2001, Index Data.
3 * See the file LICENSE for details.
5 * $Log: yaz-z-server-ursula.cpp,v $
6 * Revision 1.3 2001-04-11 12:33:42 heikki
7 * Working on ursula things
9 * Revision 1.2 2001/04/05 15:12:24 adam
12 * Revision 1.1 2001/04/04 14:02:49 adam
13 * URSULA / Z-ruth service.
18 #include <yaz++/yaz-z-server.h>
21 int Yaz_Facility_Ursula::init(Yaz_Z_Server *s, Z_InitRequest *initRequest,
22 Z_InitResponse *initResponse)
24 Z_Options *req = initRequest->options;
25 Z_Options *res = initResponse->options;
27 if (ODR_MASK_GET(req, Z_Options_extendedServices))
28 ODR_MASK_SET(res, Z_Options_extendedServices);
32 int Yaz_Facility_Ursula::recv(Yaz_Z_Server *s, Z_APDU *apdu_request)
34 Z_APDU *apdu_response;
36 if (apdu_request->which != Z_APDU_extendedServicesRequest)
38 Z_ExtendedServicesRequest *req = apdu_request->u.extendedServicesRequest;
40 Z_External *r = req->taskSpecificParameters;
45 if (r->which != ODR_EXTERNAL_octet)
47 logf (LOG_LOG, "ursula::recv not octet alighed");
50 odr_setbuf (s->odr_decode(), (char*) r->u.octet_aligned->buf,
51 r->u.octet_aligned->len, 0);
53 if (!z_UrsPDU (s->odr_decode(), &pdu, 0, ""))
55 logf (LOG_LOG, "ursula::decode failed");
58 yaz_log (LOG_LOG, "got ursula packet");
59 apdu_response = s->create_Z_PDU(Z_APDU_extendedServicesResponse);
60 ursula_service(req, pdu, apdu_response->u.extendedServicesResponse, NULL);
61 // FIXME: Initialize the response pdu... ADAM!!!
62 s->send_Z_PDU(apdu_response);