+ get_databaseNames (&req->num_databaseNames, &req->databaseNames);
+ int oid_syntax[OID_SIZE];
+ oident prefsyn;
+ get_preferredRecordSyntax(&recordSyntax);
+ if (recordSyntax != VAL_NONE)
+ {
+ prefsyn.proto = PROTO_Z3950;
+ prefsyn.oclass = CLASS_RECSYN;
+ prefsyn.value = (enum oid_value) recordSyntax;
+ oid_ent_to_oid(&prefsyn, oid_syntax);
+ req->preferredRecordSyntax = oid_syntax;
+ }
+ yaz_log (m_log, "send_searchRequest");
+ assert (req->otherInfo == 0);
+ if (m_cookie)
+ {
+ set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+ assert (req->otherInfo);
+ }
+
+ if ( pRefId )
+ {
+ req->referenceId = getRefID(pRefId);
+ }
+
+ if ( pResultSetId )
+ {
+ req->resultSetName = pResultSetId;
+ }
+
+ return send_Z_PDU(apdu, 0);
+}
+
+int IR_Assoc::send_presentRequest(int start,
+ int number,
+ char* pResultSetId,
+ char* pRefId)
+{
+ Z_APDU *apdu = create_Z_PDU(Z_APDU_presentRequest);
+ Z_PresentRequest *req = apdu->u.presentRequest;
+
+ req->resultSetStartPoint = &start;
+ req->numberOfRecordsRequested = &number;
+
+ int oid_syntax[OID_SIZE];
+ oident prefsyn;
+ int recordSyntax;
+ get_preferredRecordSyntax (&recordSyntax);
+ if (recordSyntax != VAL_NONE)
+ {
+ prefsyn.proto = PROTO_Z3950;
+ prefsyn.oclass = CLASS_RECSYN;
+ prefsyn.value = (enum oid_value) recordSyntax;
+ oid_ent_to_oid(&prefsyn, oid_syntax);
+ req->preferredRecordSyntax = oid_syntax;
+ }
+ Z_RecordComposition compo;
+ Z_ElementSetNames *elementSetNames;
+ get_elementSetName (&elementSetNames);
+ if (elementSetNames)
+ {
+ req->recordComposition = &compo;
+ compo.which = Z_RecordComp_simple;
+ compo.u.simple = elementSetNames;
+ }
+
+ if (m_cookie)
+ set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+
+ if ( pRefId )
+ {
+ req->referenceId = getRefID(pRefId);
+ }
+
+ if ( pResultSetId )
+ {
+ req->resultSetId = pResultSetId;
+ }
+
+ return send_Z_PDU(apdu, 0);
+}
+
+void IR_Assoc::set_proxy(const char *str)
+{
+ delete [] m_proxy;
+ m_proxy = 0;
+ if (str)
+ {
+ m_proxy = new char[strlen(str)+1];
+ strcpy (m_proxy, str);
+ }
+}
+
+void IR_Assoc::set_cookie(const char *str)
+{
+ delete [] m_cookie;
+ m_cookie = 0;
+ if (str)
+ {
+ m_cookie = new char[strlen(str)+1];
+ strcpy(m_cookie, str);
+ }
+}
+
+const char *IR_Assoc::get_cookie()
+{
+ return m_cookie;
+}
+
+void IR_Assoc::client(const char *addr)
+{
+ delete [] m_host;
+ m_host = new char[strlen(addr)+1];
+ strcpy(m_host, addr);
+ const char *dbpart = strchr(m_host, '/');
+ if (dbpart)
+ set_databaseNames (dbpart+1, "+ ");
+ Z_Assoc::client(m_proxy ? m_proxy : m_host);
+}
+
+const char *IR_Assoc::get_proxy()
+{
+ return m_proxy;
+}
+
+const char *IR_Assoc::get_host()
+{
+ return m_host;
+}
+
+void IR_Assoc::recv_searchRequest(Z_SearchRequest *searchRequest)
+{
+ Z_APDU *apdu = create_Z_PDU(Z_APDU_searchResponse);
+ send_Z_PDU(apdu, 0);
+}
+
+void IR_Assoc::recv_presentRequest(Z_PresentRequest *presentRequest)
+{
+ Z_APDU *apdu = create_Z_PDU(Z_APDU_presentResponse);
+ send_Z_PDU(apdu, 0);
+}
+
+void IR_Assoc::recv_initRequest(Z_InitRequest *initRequest)
+{
+ Z_APDU *apdu = create_Z_PDU(Z_APDU_initResponse);
+ send_Z_PDU(apdu, 0);
+}
+
+void IR_Assoc::recv_searchResponse (Z_SearchResponse *searchResponse)
+{
+}
+
+void IR_Assoc::recv_presentResponse (Z_PresentResponse *presentResponse)
+{
+}
+
+void IR_Assoc::recv_initResponse(Z_InitResponse *initResponse)
+{