+int Yaz_IR_Assoc::send_initRequest(char* pRefId)
+{
+ Z_APDU *apdu = create_Z_PDU(Z_APDU_initRequest);
+ Z_InitRequest *req = apdu->u.initRequest;
+
+ ODR_MASK_SET(req->options, Z_Options_search);
+ ODR_MASK_SET(req->options, Z_Options_present);
+ ODR_MASK_SET(req->options, Z_Options_namedResultSets);
+ ODR_MASK_SET(req->options, Z_Options_triggerResourceCtrl);
+ ODR_MASK_SET(req->options, Z_Options_scan);
+ ODR_MASK_SET(req->options, Z_Options_sort);
+ ODR_MASK_SET(req->options, Z_Options_extendedServices);
+ ODR_MASK_SET(req->options, Z_Options_delSet);
+
+ ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_1);
+ ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_2);
+ ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_3);
+
+ if ( pRefId )
+ {
+ req->referenceId = getRefID(pRefId);
+ }
+
+ if (m_proxy && m_host)
+ set_otherInformationString(&req->otherInfo, VAL_PROXY, 1, m_host);
+ if (m_cookie)
+ set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+ return send_Z_PDU(apdu);
+}
+
+int Yaz_IR_Assoc::send_deleteResultSetRequest(char* pResultSetId, char* pRefId)
+{
+ char* ResultSetIds[1];
+
+ Z_APDU *apdu = create_Z_PDU(Z_APDU_deleteResultSetRequest);
+ Z_DeleteResultSetRequest *req = apdu->u.deleteResultSetRequest;
+
+ if ( pResultSetId )
+ {
+ *req->deleteFunction = Z_DeleteResultSetRequest_list;
+ req->num_resultSetList = 1;
+ ResultSetIds[0] = pResultSetId;
+ req->resultSetList = ResultSetIds;
+ }
+ else
+ {
+ *req->deleteFunction = Z_DeleteResultSetRequest_all;
+ }
+
+ if ( pRefId )
+ {
+ req->referenceId = getRefID(pRefId);
+ }
+
+ if (m_proxy && m_host)
+ set_otherInformationString(&req->otherInfo, VAL_PROXY, 1, m_host);
+ if (m_cookie)
+ set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie);
+
+
+ return send_Z_PDU(apdu);
+}
+
+