Utility yaz-marcdump got option to display YAZ version (-V)
[yaz-moved-to-github.git] / doc / asn.xml
index adf59de..bb84b52 100644 (file)
@@ -1,4 +1,3 @@
-<!-- $Id: asn.xml,v 1.14 2004-03-19 21:12:13 adam Exp $ -->
  <chapter id="asn"><title>The Z39.50 ASN.1 Module</title>
   <sect1 id="asn.introduction"><title>Introduction</title>
    <para>
     
    </para>
   </sect1>
-  <sect1 id="asn.oid"><title>Object Identifiers</title>
-  <para>
-    When you refer to object identifiers in your application, you need to
-    be aware that SR and Z39.50 use two different set of OIDs to refer to
-    the same objects. To handle this easily, &yaz; provides a utility module
-    to &asn; which provides an internal representation of the OIDs used in
-    both protocols. Each oid is described by a structure:
-   </para>
-   
-   <screen>
-typedef struct oident
-{
-    enum oid_proto proto;
-    enum oid_class class;
-    enum oid_value value;
-    int oidsuffix[OID_SIZE];
-    char *desc;
-} oident;
-   </screen>
-   
-   <para>
-    The <literal>proto</literal> field can be set to either
-    <literal>PROTO_SR</literal> or <literal>PROTO_Z3950</literal>.
-    The <literal>class</literal> might be, say,
-    <literal>CLASS_RECSYN</literal>, and the <literal>value</literal> might be
-    <literal>VAL_USMARC</literal> for the USMARC record format. Functions
-   </para>
-   
-   <screen>
-int *oid_ent_to_oid(struct oident *ent, int *dst);
-struct oident *oid_getentbyoid(int *o);
-   </screen>
-   
-   <para>
-    are provided to map between object identifiers and database entries.
-    If you store a member of the <literal>oid_proto</literal> type in
-    your association state information, it's a simple matter, at runtime,
-    to generate the correct OID when you need it. For decoding, you can
-    simply ignore the proto field, or if you're strict, you can verify
-    that your peer is using the OID family from the correct protocol.
-    The <literal>desc</literal> field is a short, human-readable name
-    for the PDU, useful mainly for diagnostic output.
-   </para>
-   
-   <note>
-    <para>
-     The old function <function>oid_getoidbyent</function> still exists but
-     is not thread safe. Use <function>oid_ent_to_oid</function> instead
-     and pass an array of size <literal>OID_SIZE</literal>.
-    </para>
-   </note>
-   
-   <note>
-    <para>
-     Plans are underway to merge the two protocols into a single
-     definition, with one set of object identifiers. When this happens, the
-     oid module will no longer be required to support protocol
-     independence, but it should still be useful as a simple OID database.
-    </para>
-   </note>
-  
-  </sect1>
   <sect1 id="asn.external"><title>EXTERNAL Data</title>
    
    <para>
@@ -271,7 +208,7 @@ typedef struct Z_External
    </para>
    
    <screen>
-   Z_ext_typeent *z_ext_gettypebyref(oid_value ref);
+   Z_ext_typeent *z_ext_gettypebyref(const oid *oid);
    </screen>
 
    <para>
@@ -285,7 +222,7 @@ typedef struct Z_External
    <screen>
 typedef struct Z_ext_typeent
 {
-    oid_value dref;    /* the direct-reference OID value. */
+    int oid[OID_SIZE]; /* the direct-reference OID. */
     int what;          /* discriminator value for the external CHOICE */
     Odr_fun fun;       /* decoder function */
 } Z_ext_typeent;
@@ -347,7 +284,8 @@ typedef struct Z_ext_typeent
     PDU, as well as their default settings.
    </para>
    
-   <table frame="top"><title>Default settings for PDU Initialize Request</title>
+   <table frame="top" id="asn.default.initialize.request">
+    <title>Default settings for PDU Initialize Request</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -397,7 +335,8 @@ typedef struct Z_ext_typeent
    </tgroup>
   </table>
 
-  <table frame="top"><title>Default settings for PDU Initialize
+  <table frame="top" id="asn.default.initialize.response">
+    <title>Default settings for PDU Initialize
     Response</title>
    <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
@@ -448,7 +387,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for PDU Search Request</title>
+   <table frame="top" id="asn.default.search.request">
+    <title>Default settings for PDU Search Request</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -510,7 +450,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for PDU Search Response</title>
+   <table frame="top" id="asn.default.search.response">
+    <title>Default settings for PDU Search Response</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -559,7 +500,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for PDU Present Request</title>
+   <table frame="top" id="asn.default.present.request">
+    <title>Default settings for PDU Present Request</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -612,7 +554,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
    
-   <table frame="top"><title>Default settings for PDU Present Response</title>
+   <table frame="top" id="asn.default.present.response">
+    <title>Default settings for PDU Present Response</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -635,7 +578,7 @@ typedef struct Z_ext_typeent
        nextResultSetPosition</entry><entry>int</entry><entry>0
        </entry></row>
       <row><entry>
-       presentStatus</entry><entry>int</entry><entry>Z_PRES_SUCCESS
+       presentStatus</entry><entry>int</entry><entry>Z_PresentStatus_success
        </entry></row>
       <row><entry>
        records</entry><entry>Z_Records</entry><entry>NULL
@@ -647,7 +590,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
    
-   <table frame="top"><title>Default settings for Delete Result Set Request
+   <table frame="top" id="asn.default.delete.result.set.request">
+    <title>Default settings for Delete Result Set Request
     </title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
@@ -665,7 +609,7 @@ typedef struct Z_ext_typeent
        </entry><entry>Z_ReferenceId</entry><entry>NULL
        </entry></row>
       <row><entry>
-       deleteFunction</entry><entry>int</entry><entry>Z_DeleteRequest_list
+       deleteFunction</entry><entry>int</entry><entry>Z_DeleteResultSetRequest_list
        </entry></row>
       <row><entry>
        num_ids</entry><entry>int</entry><entry>0
@@ -680,7 +624,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Delete Result Set Response
+   <table frame="top" id="asn.default.delete.result.set.response">
+    <title>Default settings for Delete Result Set Response
     </title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
@@ -725,7 +670,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Scan Request
+   <table frame="top" id="asn.default.scan.request">
+    <title>Default settings for Scan Request
     </title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
@@ -770,7 +716,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Scan Response
+   <table frame="top" id="asn.default.scan.response">
+    <title>Default settings for Scan Response
     </title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
@@ -813,8 +760,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Trigger Resource
-     Control Request </title>
+   <table frame="top" id="asn.default.trigger.resource.control.request">
+    <title>Default settings for Trigger Resource Control Request </title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -849,8 +796,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Resource
-     Control Request</title>
+   <table frame="top" id="asn.default.resource.control.request">
+    <title>Default settings for Resource Control Request</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -889,8 +836,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Resource
-     Control Response</title>
+   <table frame="top" id="asn.default.resource.control.response">
+    <title>Default settings for Resource Control Response</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -920,8 +867,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
    
-   <table frame="top"><title>Default settings for Access
-     Control Request</title>
+   <table frame="top" id="asn.default.access.control.request">
+    <title>Default settings for Access Control Request</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -951,8 +898,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Access
-     Control Response</title>
+   <table frame="top" id="asn.default.access.control.response">
+    <title>Default settings for Access Control Response</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -985,7 +932,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Segment</title>
+   <table frame="top" id="asn.default.segment">
+    <title>Default settings for Segment</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>
@@ -1017,7 +965,8 @@ typedef struct Z_ext_typeent
     </tgroup>
    </table>
 
-   <table frame="top"><title>Default settings for Close</title>
+   <table frame="top" id="asn.default.close">
+    <title>Default settings for Close</title>
     <tgroup cols="3">
      <colspec colwidth="7*" colname="field"></colspec>
      <colspec colwidth="5*" colname="type"></colspec>