Add trivial support for implementation_id specified by backend.
authorMike Taylor <mike@indexdata.com>
Tue, 5 Mar 2002 12:45:48 +0000 (12:45 +0000)
committerMike Taylor <mike@indexdata.com>
Tue, 5 Mar 2002 12:45:48 +0000 (12:45 +0000)
doc/frontend.xml
include/yaz/backend.h
server/seshigh.c

index 70329d0..2121b07 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Id: frontend.xml,v 1.10 2001-11-27 22:12:24 adam Exp $ -->
+<!-- $Id: frontend.xml,v 1.11 2002-03-05 12:45:48 mike Exp $ -->
  <chapter id="server"><title>Generic server</title>
   <sect1><title>Introduction</title>
 
  <chapter id="server"><title>Generic server</title>
   <sect1><title>Introduction</title>
 
@@ -342,6 +342,7 @@ typedef struct bend_initrequest
     Z_ReferenceId *referenceId;/* reference ID */
     char *peer_name;           /* dns host of peer (client) */
 
     Z_ReferenceId *referenceId;/* reference ID */
     char *peer_name;           /* dns host of peer (client) */
 
+    char *implementation_id;
     char *implementation_name;
     char *implementation_version;
     int (*bend_sort) (void *handle, bend_sort_rr *rr);
     char *implementation_name;
     char *implementation_version;
     int (*bend_sort) (void *handle, bend_sort_rr *rr);
@@ -394,8 +395,9 @@ typedef struct bend_initresult
 
     <para>
      The members <literal>peer_name</literal>,
 
     <para>
      The members <literal>peer_name</literal>,
+     <literal>implementation_id</literal>,
      <literal>implementation_name</literal> and
      <literal>implementation_name</literal> and
-     <literal>implementation_version</literal> holds DNS of client, name
+     <literal>implementation_version</literal> holds DNS of client, ID of implementor, name
      of client (Z39.50) implementation - and version.
     </para>
 
      of client (Z39.50) implementation - and version.
     </para>
 
index a02e1fa..499b8d0 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: backend.h,v $
  * OF THIS SOFTWARE.
  *
  * $Log: backend.h,v $
- * Revision 1.12  2001-03-25 21:55:12  adam
+ * Revision 1.13  2002-03-05 12:45:49  mike
+ * Add trivial support for implementation_id specified by backend.
+ *
+ * Revision 1.12  2001/03/25 21:55:12  adam
  * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate.
  *
  * Revision 1.11  2001/01/30 21:34:17  adam
  * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate.
  *
  * Revision 1.11  2001/01/30 21:34:17  adam
@@ -267,6 +270,7 @@ typedef struct bend_initrequest
     Z_ReferenceId *referenceId;/* reference ID */
     char *peer_name;           /* dns host of peer (client) */
     
     Z_ReferenceId *referenceId;/* reference ID */
     char *peer_name;           /* dns host of peer (client) */
     
+    char *implementation_id;
     char *implementation_name;
     char *implementation_version;
     int (*bend_sort) (void *handle, bend_sort_rr *rr);
     char *implementation_name;
     char *implementation_version;
     int (*bend_sort) (void *handle, bend_sort_rr *rr);
index 936cd80..4af6e86 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2002, Index Data
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2002, Index Data
  * See the file LICENSE for details.
  *
- * $Id: seshigh.c,v 1.126 2002-01-23 22:40:36 adam Exp $
+ * $Id: seshigh.c,v 1.127 2002-03-05 12:45:49 mike Exp $
  */
 
 /*
  */
 
 /*
@@ -591,6 +591,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
     assoc->init->auth = req->idAuthentication;
     assoc->init->referenceId = req->referenceId;
     assoc->init->implementation_version = 0;
     assoc->init->auth = req->idAuthentication;
     assoc->init->referenceId = req->referenceId;
     assoc->init->implementation_version = 0;
+    assoc->init->implementation_id = 0;
     assoc->init->implementation_name = 0;
     assoc->init->bend_sort = NULL;
     assoc->init->bend_search = NULL;
     assoc->init->implementation_name = 0;
     assoc->init->bend_sort = NULL;
     assoc->init->bend_search = NULL;
@@ -703,6 +704,16 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
 
     resp->implementationName = "GFS/YAZ";
 
 
     resp->implementationName = "GFS/YAZ";
 
+    if (assoc->init->implementation_id)
+    {
+       char *nv = (char *)
+           odr_malloc (assoc->encode,
+                       strlen(assoc->init->implementation_id) + 10 + 
+                              strlen(resp->implementationId));
+       sprintf (nv, "%s / %s",
+                resp->implementationId, assoc->init->implementation_id);
+        resp->implementationId = nv;
+    }
     if (assoc->init->implementation_name)
     {
        char *nv = (char *)
     if (assoc->init->implementation_name)
     {
        char *nv = (char *)