Implemented ILL protocol. Minor updates ASN.1 compiler.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 16 Dec 1999 23:36:19 +0000 (23:36 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 16 Dec 1999 23:36:19 +0000 (23:36 +0000)
29 files changed:
CHANGELOG
Makefile.in
README
asn/test.c
ccl/cclsh.c
client/Makefile.in
client/client.c
configure
configure.in
ill/Makefile.in [new file with mode: 0644]
ill/ill-get.c [new file with mode: 0644]
ill/ill.tcl [new file with mode: 0644]
ill/ill9702.asn [new file with mode: 0644]
ill/item-req.asn [new file with mode: 0644]
include/yaz/backend.h
include/yaz/ill.h [new file with mode: 0644]
include/yaz/odr_use.h [deleted file]
include/yaz/oid.h
include/yaz/z-proto.h
lib/Makefile.in
odr/test.c
server/seshigh.c
util/oid.c
util/yc.tcl
z39.50/Makefile.in
z39.50/z.tcl
ztest/Makefile.in
ztest/ztest.c
zutil/query.c

index 03b3dab..0d0669a 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
 Possible compatibility problems with earlier versions marked with '*'.
 
+Implemented ISO ILL protocol. Refer to stuff in sub directory ill.
+
 --- 1.5 1999/12/10
 
 On UNIX, the generated makefile now supports a proper 'make install'.
index 83cc36f..e184e88 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (C) 1995-1999, Index Data 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile.in,v 1.13 1999-11-30 13:47:10 adam Exp $
+# $Id: Makefile.in,v 1.14 1999-12-16 23:36:19 adam Exp $
 
 # Uncomment the lines below to enable mOSI communcation.
 #CDEFS=-DUSE_XTIMOSI
@@ -14,15 +14,11 @@ CDEFS=@DEFS@
 # Standard include path and original protocol encoders.
 INCLUDE=-I. -I../include
 
-# The Module below is either asn (the original de/en-coders)
-# or z39.50 (the compiled de/en-coders).
-MOD=@ASNMODULE@
-
 CC=@CC@
 CPP=@CPP@
 SHELL=/bin/sh
 MAKE=make
-SUBDIR=util odr $(MOD) zutil $(RFC1006) ccl comstack client server ztest retrieval lib
+SUBDIR=util odr @ASNMODULE@ @ILLMODULE@ zutil $(RFC1006) ccl comstack server retrieval lib client ztest
 # Add external libraries to the LIBS macro
 LIBS=@LIBS@
 
diff --git a/README b/README
index a400589..e7f015a 100644 (file)
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ Copyright (C) 1995-1999, Index Data ApS.
 See the file LICENSE for details.
 
 Compilation and installation instructions for YAZ 
-  $Id: README,v 1.28 1999-12-02 13:54:56 adam Exp $
+  $Id: README,v 1.29 1999-12-16 23:36:19 adam Exp $
 
 The primary output of the source here is the lib/libyaz.a library,
 which contains support functions for implementing the server or client
@@ -88,10 +88,10 @@ odr - Open Data Representation. This module implements the BER
 
 asn     - This module implements the Z39.50/SR protocol. The best way
        to find out how it works is to look in the sample
-       client/server code in server/seshigh.c or yazlib/tst.c. The
-       interface is still wholly described by the file proto.h
-       which defines structure and type definitions for each of the
-       types introduced in the protocol specification.
+       client/server code in server/seshigh.c. The interface is still
+        wholly described by the file proto.h which defines structure
+        and type definitions for each of the types introduced in the
+        protocol specification.
 
 z39.50  - This module implements the Z39.50 protocol. This module
         does the same job as the 'asn' module except that the source
@@ -100,6 +100,8 @@ z39.50  - This module implements the Z39.50 protocol. This module
 zutil   - This module implements a collection of Z39.50 utilities, such
         as query parsing, EXTERNAL handling, etc.
 
+ill     - This module implements the ISO ILL protocol.
+
 comstack - This module implements the transport transparency
        stack (COMSTACK). The comstack implements a generic interface
        for exchanging BER-encoded records over a network. It supports
index b8481af..a68304c 100644 (file)
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <yaz/odr.h>
-#include <yaz/odr_use.h>
 #include <yaz/proto.h>
 
 int main()
index 5f1bb83..0902419 100644 (file)
  * Europagate 1995
  *
  * $Log: cclsh.c,v $
- * Revision 1.4  1999-03-31 11:15:37  adam
+ * Revision 1.5  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.4  1999/03/31 11:15:37  adam
  * Fixed memory leaks in ccl_find_str and ccl_qual_rm.
  *
  * Revision 1.3  1997/04/30 08:52:07  quinn
@@ -95,7 +98,7 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#include <ccl.h>
+#include <yaz/ccl.h>
 
 static int debug = 0;
 static char *prog;
index 9f7bd3d..767843e 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (C) 1995-1999, Index Data
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile.in,v 1.9 1999-11-30 13:47:11 adam Exp $
+# $Id: Makefile.in,v 1.10 1999-12-16 23:36:19 adam Exp $
 
 SHELL=/bin/sh
 
@@ -17,8 +17,7 @@ LIBDIR=../lib
 
 INCLUDE=-I../include -I. -I../../xtimosi/src
 DEFS=$(INCLUDE) $(CDEFS) -DCCL2RPN=1
-YAZLIBS=$(LIBDIR)/libzutil.a $(LIBDIR)/libasn.a $(LIBDIR)/libcomstack.a \
-  ../lib/libccl.a $(LIBMOSI) $(LIBDIR)/libodr.a $(LIBDIR)/libutil.a 
+YAZLIBS=$(LIBDIR)/libyaz.a
 PROG=yaz-client
 PROGO=client.o
 
index 4262079..13cb16c 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: client.c,v $
- * Revision 1.90  1999-11-30 13:47:11  adam
+ * Revision 1.91  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.90  1999/11/30 13:47:11  adam
  * Improved installation. Moved header files to include/yaz.
  *
  * Revision 1.89  1999/11/04 14:58:44  adam
 
 #include <yaz/pquery.h>
 
+#ifdef ASN_COMPILED
+#include <yaz/ill.h>
+#endif
+
 #if CCL2RPN
 #include <yaz/yaz-ccl.h>
 #endif
@@ -1196,6 +1203,46 @@ void process_ESResponse(Z_ExtendedServicesResponse *res)
     }
 }
 
+#ifdef ASN_COMPILED
+static Z_External *create_external_itemRequest()
+{
+    ILL_ItemRequest *req = ill_get_ItemRequest(out);
+    Z_External *r = 0;
+
+    if (!ill_ItemRequest (out, &req, 0, 0))
+       return 0;
+    else
+    {
+       oident oid;
+       int itemRequest_size = 0;
+       char *itemRequest_buf = odr_getbuf (out, &itemRequest_size, 0);
+       
+       oid.proto = PROTO_GENERAL;
+       oid.oclass = CLASS_GENERAL;
+       oid.value = VAL_ISO_ILL_1;
+       
+       r = (Z_External *) odr_malloc (out, sizeof(*r));
+       r->direct_reference = odr_oiddup(out,oid_getoidbyent(&oid)); 
+       r->indirect_reference = 0;
+       r->descriptor = 0;
+       r->which = Z_External_single;
+       
+       r->u.single_ASN1_type = (Odr_oct *)
+           odr_malloc (out, sizeof(*r->u.single_ASN1_type));
+       r->u.single_ASN1_type->buf = odr_malloc (out, itemRequest_size);
+       r->u.single_ASN1_type->len = itemRequest_size;
+       r->u.single_ASN1_type->size = itemRequest_size;
+       memcpy (r->u.single_ASN1_type->buf, itemRequest_buf, itemRequest_size);
+       printf ("len = %d\n", itemRequest_size);
+    }
+    return r;
+}
+#else
+static Z_External *create_external_itemRequest()
+{
+    return 0;
+}
+#endif
 static Z_External *CreateItemOrderExternal(int itemno)
 {
     Z_External *r = (Z_External *) odr_malloc(out, sizeof(Z_External));
@@ -1243,7 +1290,8 @@ static Z_External *CreateItemOrderExternal(int itemno)
        (int *) odr_malloc(out, sizeof(int));
     *r->u.itemOrder->u.esRequest->notToKeep->resultSetItem->item = itemno;
 
-    r->u.itemOrder->u.esRequest->notToKeep->itemRequest = NULL;
+    r->u.itemOrder->u.esRequest->notToKeep->itemRequest = 
+       create_external_itemRequest();
     return r;
 }
 
index f28fc1f..c2ed004 100755 (executable)
--- a/configure
+++ b/configure
@@ -954,6 +954,8 @@ else
 fi
 
 
+
+
 # Check whether --enable-yc or --disable-yc was given.
 if test "${enable_yc+set}" = set; then
   enableval="$enable_yc"
@@ -964,19 +966,23 @@ fi
 
 if test "$enable_yc" = "yes"; then
        ASNMODULE="z39.50"
+       ILLMODULE="ill"
+       ILLLIB=libill.a
        cp -f include/yaz/z-proto.h include/yaz/proto.h
 else
+       ILLMODULE=""
        ASNMODULE=asn
+       ILLLIB=""
        cp -f include/yaz/prt-proto.h include/yaz/proto.h
 fi
 checkBoth=0
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:975: checking for connect" >&5
+echo "configure:981: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 980 "configure"
+#line 986 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -999,7 +1005,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -1020,7 +1026,7 @@ fi
 
 if test "$ac_cv_func_connect" = "no"; then
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:1024: checking for main in -lsocket" >&5
+echo "configure:1030: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1028,14 +1034,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1032 "configure"
+#line 1038 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1061,12 +1067,12 @@ if test "$checkBoth" = "1"; then
        oldLibs=$LIBS
        LIBS="$LIBS -lsocket -lnsl"
        echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:1065: checking for accept" >&5
+echo "configure:1071: checking for accept" >&5
 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1070 "configure"
+#line 1076 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char accept(); below.  */
@@ -1089,7 +1095,7 @@ accept();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_accept=yes"
 else
@@ -1111,12 +1117,12 @@ fi
 
 fi
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1115: checking for gethostbyname" >&5
+echo "configure:1121: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1120 "configure"
+#line 1126 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -1139,7 +1145,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -1157,7 +1163,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:1161: checking for main in -lnsl" >&5
+echo "configure:1167: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1165,14 +1171,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1169 "configure"
+#line 1175 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1195,7 +1201,7 @@ fi
 fi
 
 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:1199: checking for readline in -lreadline" >&5
+echo "configure:1205: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1203,7 +1209,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1207 "configure"
+#line 1213 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1214,7 +1220,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:1218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1235,7 +1241,7 @@ else
 fi
 
 echo $ac_n "checking for add_history in -lhistory""... $ac_c" 1>&6
-echo "configure:1239: checking for add_history in -lhistory" >&5
+echo "configure:1245: checking for add_history in -lhistory" >&5
 ac_lib_var=`echo history'_'add_history | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1243,7 +1249,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lhistory  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1247 "configure"
+#line 1253 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1254,7 +1260,7 @@ int main() {
 add_history()
 ; return 0; }
 EOF
-if { (eval echo configure:1258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1279,17 +1285,17 @@ if test "$ac_cv_lib_readline_readline" = "yes"; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1283: checking for $ac_hdr" >&5
+echo "configure:1289: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1288 "configure"
+#line 1294 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1324,11 +1330,11 @@ fi
 
 if test "$enable_tcpd" = "yes"; then
        echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6
-echo "configure:1328: checking for working tcpd.h" >&5
+echo "configure:1334: checking for working tcpd.h" >&5
        oldLibs=$LIBS
        LIBS="$LIBS -lwrap -lnsl"
        cat > conftest.$ac_ext <<EOF
-#line 1332 "configure"
+#line 1338 "configure"
 #include "confdefs.h"
 #include <syslog.h>
        #include <tcpd.h>
@@ -1339,7 +1345,7 @@ struct request_info request_info; int i;
        i = hosts_access(&request_info);
 ; return 0; }
 EOF
-if { (eval echo configure:1343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   tcpd_ok=1
 else
@@ -1361,12 +1367,12 @@ EOF
        fi
 fi
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1365: checking for ANSI C header files" >&5
+echo "configure:1371: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1370 "configure"
+#line 1376 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1374,7 +1380,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1391,7 +1397,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1395 "configure"
+#line 1401 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1409,7 +1415,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1413 "configure"
+#line 1419 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1430,7 +1436,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1434 "configure"
+#line 1440 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1441,7 +1447,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1478,17 +1484,17 @@ if test "$enable_threads" = "yes"; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1482: checking for $ac_hdr" >&5
+echo "configure:1488: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1487 "configure"
+#line 1493 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1515,12 +1521,12 @@ fi
 done
 
        echo $ac_n "checking for pthread_mutex_lock""... $ac_c" 1>&6
-echo "configure:1519: checking for pthread_mutex_lock" >&5
+echo "configure:1525: checking for pthread_mutex_lock" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_mutex_lock'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1524 "configure"
+#line 1530 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_mutex_lock(); below.  */
@@ -1543,7 +1549,7 @@ pthread_mutex_lock();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_mutex_lock=yes"
 else
@@ -1564,7 +1570,7 @@ fi
 
        if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
                echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6
-echo "configure:1568: checking for main in -lpthread" >&5
+echo "configure:1574: checking for main in -lpthread" >&5
 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1572,14 +1578,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1576 "configure"
+#line 1582 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1725,7 +1731,7 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile zutil/Makefile comstack/Makefile client/Makefile server/Makefile ztest/Makefile retrieval/Makefile ccl/Makefile lib/Makefile rfc1006/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile zutil/Makefile comstack/Makefile client/Makefile server/Makefile ztest/Makefile retrieval/Makefile ccl/Makefile lib/Makefile rfc1006/Makefile ill/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -1765,6 +1771,8 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@RANLIB@%$RANLIB%g
 s%@build_root@%$build_root%g
 s%@ASNMODULE@%$ASNMODULE%g
+s%@ILLMODULE@%$ILLMODULE%g
+s%@ILLLIB@%$ILLLIB%g
 
 CEOF
 EOF
@@ -1806,7 +1814,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile zutil/Makefile comstack/Makefile client/Makefile server/Makefile ztest/Makefile retrieval/Makefile ccl/Makefile lib/Makefile rfc1006/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile zutil/Makefile comstack/Makefile client/Makefile server/Makefile ztest/Makefile retrieval/Makefile ccl/Makefile lib/Makefile rfc1006/Makefile ill/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
index ccf7850..5e6d0c0 100644 (file)
@@ -1,7 +1,7 @@
 dnl YAZ Toolkit
 dnl (c) Index Data 1994-1999
 dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.13 1999-12-08 13:10:48 adam Exp $
+dnl $Id: configure.in,v 1.14 1999-12-16 23:36:19 adam Exp $
 AC_INIT(include/yaz/yaz-version.h)
 dnl
 dnl ------ Checking programs
@@ -16,12 +16,18 @@ AC_ARG_WITH(build-root, [  --with-buildroot        RPM Build root],[build_root=$
 dnl
 dnl ----- YC: The Yaz Compiler
 AC_SUBST(ASNMODULE)
+AC_SUBST(ILLMODULE)
+AC_SUBST(ILLLIB)
 AC_ARG_ENABLE(yc,[  --enable-yc             compile using YAZ' ASN.1 Compiler], , enable_yc=yes)
 if test "$enable_yc" = "yes"; then
        ASNMODULE="z39.50"
+       ILLMODULE="ill"
+       ILLLIB=libill.a
        cp -f include/yaz/z-proto.h include/yaz/proto.h
 else
+       ILLMODULE=""
        ASNMODULE=asn
+       ILLLIB=""
        cp -f include/yaz/prt-proto.h include/yaz/proto.h
 fi
 dnl
@@ -84,4 +90,4 @@ if test "$enable_threads" = "yes"; then
 fi
 dnl
 dnl ------ Makefiles
-AC_OUTPUT(Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile zutil/Makefile comstack/Makefile client/Makefile server/Makefile ztest/Makefile retrieval/Makefile ccl/Makefile lib/Makefile rfc1006/Makefile)
+AC_OUTPUT(Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile zutil/Makefile comstack/Makefile client/Makefile server/Makefile ztest/Makefile retrieval/Makefile ccl/Makefile lib/Makefile rfc1006/Makefile ill/Makefile)
diff --git a/ill/Makefile.in b/ill/Makefile.in
new file mode 100644 (file)
index 0000000..eb2feca
--- /dev/null
@@ -0,0 +1,52 @@
+# $Id: Makefile.in,v 1.1 1999-12-16 23:36:19 adam Exp $
+
+SHELL=/bin/sh
+
+CC=@CC@
+CPP=@CPP@
+RANLIB=@RANLIB@
+CDEFS=@DEFS@
+LIBS=@LIBS@
+
+INCLUDE=-I. -I../include
+DEFS=$(INCLUDE) $(CDEFS)
+LIBDIR=../lib
+LIBS=$(LIBDIR)/libodr.a $(LIBDIR)/libutil.a
+YCFLAGS=
+
+LIB=$(LIBDIR)/libill.a
+O=ill-tst.o
+PO=ill-core.o item-req.o ill-get.o
+
+all: $(LIB) 
+
+ill-tst: $(O) $(LIB)
+       $(CC) $(CFLAGS) $(O) -o yc-tst $(LIB) $(LIBS)
+
+
+$(LIB): $(PO)
+       rm -f $(LIB)
+       ar qc $(LIB) $(PO)
+       $(RANLIB) $(LIB)
+
+ill-core.c ../include/yaz/ill.h: ill.tcl ill9702.asn ../util/yc.tcl
+       ../util/yc.tcl -d ill.tcl -i yaz -I ../include $(YCFLAGS) ill9702.asn
+
+item-req.c ../include/yaz/item-req.h: ill.tcl item-req.asn ../util/yc.tcl
+       ../util/yc.tcl -d ill.tcl -i yaz -I ../include $(YCFLAGS) item-req.asn
+
+.c.o:
+       $(CC) -c $(CFLAGS) $(DEFS) $<
+
+clean:
+       -rm -f *.o yc-tst core *.out
+
+realclean: clean
+       -rm -f ill-core.c item-req.c ../include/yaz/ill-core.h ../include/yaz/item-req.h
+
+depend: ill-core.c ../include/yaz/ill-core.h item-req.c ../include/yaz/item-req.h
+       sed '/^#Depend/q' <Makefile >Makefile.tmp
+       $(CPP) $(DEFS) -M *.c >>Makefile.tmp
+       mv -f Makefile.tmp Makefile
+
+#Depend --- DOT NOT DELETE THIS LINE
diff --git a/ill/ill-get.c b/ill/ill-get.c
new file mode 100644 (file)
index 0000000..60a51f2
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 1999, Index Data.
+ * See the file LICENSE for details.
+ *
+ * $Log: ill-get.c,v $
+ * Revision 1.1  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ */
+
+#include <yaz/ill.h>
+
+ILL_ItemRequest *ill_get_ItemRequest (ODR o)
+{
+    ILL_ItemRequest *r = (ILL_ItemRequest *)odr_malloc(o, sizeof(*r));
+    
+    r->protocol_version_num = (int*) odr_malloc(o, sizeof(int));
+    *r->protocol_version_num = ILL_Request_version_2;
+
+    r->service_date_time = 0;
+    r->requester_id = 0;
+    r->responder_id = 0;
+    r->transaction_type = 0;
+    r->delivery_address = 0;
+    r->delivery_service = 0;
+    r->billing_address = 0;
+
+    r->num_iLL_service_type = 1;
+    r->iLL_service_type = (ILL_Service_Type **)
+       odr_malloc (o, sizeof(*r->iLL_service_type));
+    *r->iLL_service_type = (ILL_Service_Type *)
+       odr_malloc (o, sizeof(**r->iLL_service_type));
+    **r->iLL_service_type = ILL_Service_Type_copy_non_returnable;
+
+    r->responder_specific_service = 0;
+    r->requester_optional_messages = 0;
+    r->search_type = 0;
+    r->num_supply_medium_info_type = 0;
+    r->supply_medium_info_type = 0;
+
+    r->place_on_hold = (int*) odr_malloc(o, sizeof(int));
+    *r->place_on_hold = ILL_Place_On_Hold_Type_according_to_responder_policy;
+
+    r->client_id = 0;
+    r->item_id = 0;
+    r->supplemental_item_description = 0;
+    r->cost_info_type = 0;
+    r->copyright_compliance = 0;
+    r->third_party_info_type = 0;
+    r->retry_flag = (int *)odr_malloc(o, sizeof(bool_t));
+    *r->retry_flag = 0;
+    r->forward_flag = (int *)odr_malloc(o, sizeof(bool_t));
+    *r->forward_flag = 0;
+    r->requester_note = 0;
+    r->forward_note = 0;
+    r->num_iLL_request_extensions = 0;
+    r->iLL_request_extensions = 0;
+    return r;
+}
diff --git a/ill/ill.tcl b/ill/ill.tcl
new file mode 100644 (file)
index 0000000..a40ce08
--- /dev/null
@@ -0,0 +1,58 @@
+# Config File for ILL
+# $Id: ill.tcl,v 1.1 1999-12-16 23:36:19 adam Exp $
+# ----------------------------------------------------------
+# Prefix Specifications
+#  
+#    1: C function prefix
+#    2: C type prefix
+#    3: C preprocessor prefix
+
+# Default prefix
+set default-prefix {ill_ ILL_ ILL_}
+
+# ----------------------------------------------------------
+set m ISO-10161-ILL-1
+
+# Filename
+set filename($m) ill-core
+
+# Header initialization code
+set init($m,h) "
+"
+
+# Header body code
+set body($m,h) "
+#ifdef __cplusplus
+extern \"C\" \{
+#endif
+
+#ifdef __cplusplus
+\}
+#endif
+"
+
+# C body code
+set body($m,c) "
+"
+
+# Some mappings - that map ill_ILL_<name> to ill_<name>
+set map($m,ILL-APDU) APDU
+set map($m,ILL-Request) Request
+set map($m,ILL-Answer) Answer
+set map($m,ILL-String) String
+set map($m,ILL-APDU-Type) APDU_Type
+set map($m,ILL-Service-Type) Service_Type
+
+# ----------------------------------------------------------
+set m Z39.50-extendedService-ItemOrder-ItemRequest-1
+# Filename
+set filename($m) item-req
+
+# Mappings of a few basic types
+proc asnBasicPrintableString {} {
+    return {odr_visiblestring char}
+}
+
+proc asnBasicANY {} {
+    return {odr_any Odr_any}
+}
diff --git a/ill/ill9702.asn b/ill/ill9702.asn
new file mode 100644 (file)
index 0000000..f902e42
--- /dev/null
@@ -0,0 +1,1165 @@
+-- use of parameters and types is to be consistent with their definitions in clause 3
+
+ISO-10161-ILL-1 DEFINITIONS EXPLICIT TAGS ::=
+
+BEGIN
+-- ISO-10161-ILL-1 refers to the ILL ISO standard 10161 version 1
+-- and version 2 as specified in ISO standard 10161 Amendment 1
+
+ILL-APDU ::= CHOICE {
+       ILL-Request,
+       Forward-Notification,
+       Shipped,
+       ILL-Answer,
+       Conditional-Reply,
+       Cancel,
+       Cancel-Reply,
+       Received,
+       Recall,
+       Returned,
+       Checked-In,
+       Overdue,
+       Renew,
+       Renew-Answer,
+       Lost,
+       Damaged,
+       Message,
+       Status-Query,
+       Status-Or-Error-Report,
+       Expired
+       }
+
+-- The tagging scheme used in the APDU definitions is as follows:
+-- each named type that is a component type of an APDU definition is assigned a different tag
+-- that is unique within the set of APDU definitions.  Where these component types themselves
+-- have structure, the tagging within such type definitions has only local scope. 
+
+ILL-Request ::= [APPLICATION 1] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       transaction-type        [5]     IMPLICIT Transaction-Type DEFAULT 1,
+       delivery-address        [6]     IMPLICIT Delivery-Address OPTIONAL, 
+       delivery-service                Delivery-Service OPTIONAL,
+       billing-address [8]     IMPLICIT Delivery-Address OPTIONAL,
+       iLL-service-type        [9]     IMPLICIT SEQUENCE SIZE (1..5) OF 
+                               ILL-Service-Type,
+               -- this sequence is a list, in order of preference
+       responder-specific-service      [10]    EXTERNAL OPTIONAL,
+               -- use direct reference style
+       requester-optional-messages     [11]    IMPLICIT Requester-Optional-Messages-Type,
+       search-type     [12]    IMPLICIT Search-Type OPTIONAL,
+       supply-medium-info-type         [13]    IMPLICIT SEQUENCE SIZE (1..7) OF
+                               Supply-Medium-Info-Type OPTIONAL,
+               -- this sequence is a list, in order of preference,
+               -- with a maximum number of 7 entries
+       place-on-hold   [14]    IMPLICIT Place-On-Hold-Type DEFAULT 3,
+       client-id       [15]    IMPLICIT Client-Id OPTIONAL,     
+       item-id [16]    IMPLICIT Item-Id,
+       supplemental-item-description   [17]    IMPLICIT Supplemental-Item-Description OPTIONAL,
+       cost-info-type  [18]    IMPLICIT Cost-Info-Type OPTIONAL,
+       copyright-compliance    [19]    ILL-String OPTIONAL,
+       third-party-info-type   [20]    IMPLICIT Third-Party-Info-Type OPTIONAL,
+               -- mandatory when initiating a FORWARD service or an
+               -- ILL-REQUEST service for a partitioned ILL sub-
+               -- transaction or when initiating an ILL-REQUEST service for
+               -- an ILL sub-transaction if the received ILL-REQUEST
+               -- included an "already-tried-list";optional otherwise
+       retry-flag      [21]    IMPLICIT BOOLEAN DEFAULT FALSE,
+       forward-flag    [22]    IMPLICIT BOOLEAN DEFAULT FALSE,
+       requester-note  [46]    ILL-String OPTIONAL,
+       forward-note    [47]    ILL-String OPTIONAL,
+       iLL-request-extensions  [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Forward-Notification ::= [APPLICATION 2] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id,
+               -- mandatory in this APDU
+       responder-address       [24]    IMPLICIT System-Address OPTIONAL,
+       intermediary-id [25]    IMPLICIT System-Id,
+       notification-note       [48]    ILL-String OPTIONAL,
+       forward-notification-extensions [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Shipped ::= [APPLICATION 3] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-address       [24]    IMPLICIT System-Address OPTIONAL,
+       intermediary-id [25]    IMPLICIT System-Id OPTIONAL,
+       supplier-id     [26]    IMPLICIT System-Id OPTIONAL,
+       client-id       [15]    IMPLICIT Client-Id OPTIONAL,
+       transaction-type        [5]     IMPLICIT Transaction-Type DEFAULT 1,
+       supplemental-item-description   [17]    IMPLICIT Supplemental-Item-Description OPTIONAL,
+       shipped-service-type    [27]    IMPLICIT Shipped-Service-Type,
+       responder-optional-messages     [28]    IMPLICIT Responder-Optional-Messages-Type
+                               OPTIONAL,
+       supply-details  [29]    IMPLICIT Supply-Details,
+       return-to-address       [30]    IMPLICIT Postal-Address OPTIONAL,
+       responder-note  [46]    ILL-String OPTIONAL,
+       shipped-extensions      [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+ILL-Answer ::= [APPLICATION 4] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       transaction-results     [31]    IMPLICIT Transaction-Results,
+       results-explanation     [32]    CHOICE {
+                               conditional-results     [1] Conditional-Results,
+                               -- chosen if transaction-results=CONDITIONAL
+                               retry-results           [2] Retry-Results,
+                               -- chosen if transaction-results=RETRY
+                               unfilled-results        [3] Unfilled-Results,
+                               --chosen if transaction-results=UNFILLED
+                               locations-results       [4] Locations-Results,
+                               -- chosen if transaction-results=LOCATIONS-PROVIDED
+                               will-supply-results     [5] Will-Supply-Results,
+                               -- chosen if transaction-results=WILL-SUPPLY
+                               hold-placed-results     [6] Hold-Placed-Results,
+                               -- chosen if transaction-results=HOLD-PLACED
+                               estimate-results        [7] Estimate-Results
+                               -- chosen if transaction-results=ESTIMATE
+                               } OPTIONAL,
+               -- optional if transaction-results equals RETRY, UNFILLED,
+               -- WILL-SUPPLY or HOLD-PLACED;
+               -- required if transaction-results equals CONDITIONAL,
+               -- LOCATIONS-PROVIDED or ESTIMATE
+       responder-specific-results      [33]    EXTERNAL OPTIONAL,
+               -- this type is mandatory if results-explanation
+               -- chosen for any result 
+               -- has the value "responder-specific".
+       supplemental-item-description   [17]    IMPLICIT Supplemental-Item-Description OPTIONAL,
+       send-to-list    [23]    IMPLICIT Send-To-List-Type OPTIONAL,
+       already-tried-list      [34]    IMPLICIT Already-Tried-List-Type OPTIONAL,
+       responder-optional-messages     [28]    IMPLICIT Responder-Optional-Messages-Type
+                               OPTIONAL,
+       responder-note  [46]    ILL-String OPTIONAL,
+       ill-answer-extensions   [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Conditional-Reply ::= [APPLICATION 5] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       answer  [35]    IMPLICIT BOOLEAN,
+       requester-note  [46]    ILL-String OPTIONAL,
+       conditional-reply-extensions    [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Cancel ::= [APPLICATION 6] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       requester-note  [46]    ILL-String OPTIONAL,
+       cancel-extensions       [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Cancel-Reply ::= [APPLICATION 7] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                                version-1 (1),
+                                version-2 (2)
+                                },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       answer  [35]    IMPLICIT BOOLEAN,
+       responder-note  [46]    ILL-String OPTIONAL,
+       cancel-reply-extensions [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Received ::= [APPLICATION 8] SEQUENCE { 
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                        version-1 (1),
+                        version-2 (2)
+                        },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       supplier-id     [26]    IMPLICIT System-Id OPTIONAL,
+       supplemental-item-description   [17]    IMPLICIT Supplemental-Item-Description OPTIONAL,
+       date-received   [36]    IMPLICIT ISO-Date,
+       shipped-service-type    [27]    IMPLICIT Shipped-Service-Type,
+       requester-note  [46]    ILL-String OPTIONAL,
+       received-extensions     [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Recall ::= [APPLICATION 9] SEQUENCE {  
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL, 
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL, 
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-note  [46]    ILL-String OPTIONAL,
+       recall-extensions       [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Returned ::= [APPLICATION 10] SEQUENCE { 
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       supplemental-item-description   [17]    IMPLICIT Supplemental-Item-Description OPTIONAL,
+       date-returned   [37]    IMPLICIT ISO-Date,
+       returned-via    [38]    Transportation-Mode OPTIONAL,
+       insured-for     [39]    IMPLICIT Amount OPTIONAL,
+       requester-note  [46]    ILL-String OPTIONAL,
+       returned-extensions     [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Checked-In ::= [APPLICATION 11] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL, 
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL, 
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       date-checked-in [40]    IMPLICIT ISO-Date,
+       responder-note  [46]    ILL-String OPTIONAL,
+       checked-in-extensions   [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Overdue ::= [APPLICATION 12] SEQUENCE { 
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       date-due        [41]    IMPLICIT Date-Due,
+       responder-note  [46]    ILL-String OPTIONAL,
+       overdue-extensions      [49]    SEQUENCE OF Extension OPTIONAL
+       }
+
+Renew ::= [APPLICATION 13] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       desired-due-date        [42]    IMPLICIT ISO-Date OPTIONAL,
+       requester-note  [46]    ILL-String OPTIONAL,
+       renew-extensions        [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Renew-Answer ::= [APPLICATION 14] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       answer  [35]    IMPLICIT BOOLEAN,
+       date-due        [41]    IMPLICIT Date-Due OPTIONAL,
+       responder-note  [46]    ILL-String OPTIONAL,
+       renew-answer-extensions [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Lost ::= [APPLICATION 15] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       note    [46]    ILL-String OPTIONAL,
+       lost-extensions [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Damaged ::= [APPLICATION 16] SEQUENCE { 
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL, 
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       damaged-details [5]     IMPLICIT Damaged-Details OPTIONAL,
+               -- this parameter may only be present in APDU's with a
+               -- protocol-version-num value of 2 or greater
+       note    [46]    ILL-String OPTIONAL,
+       damaged-extensions      [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Message ::= [APPLICATION 17] SEQUENCE { 
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       note    [46]    ILL-String,
+       message-extensions      [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Status-Query ::= [APPLICATION 18] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       note    [46]    ILL-String OPTIONAL,
+       status-query-extensions [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Status-Or-Error-Report ::= [APPLICATION 19] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,   
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,   
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       reason-no-report        [43]    IMPLICIT Reason-No-Report OPTIONAL,
+               -- mandatory if no report is present;
+               -- not present otherwise
+       status-report   [44]    IMPLICIT Status-Report OPTIONAL,
+       error-report    [45]    IMPLICIT Error-Report OPTIONAL,
+       note    [46]    ILL-String OPTIONAL,
+       status-or-error-report-extensions       [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Expired ::= [APPLICATION 20] SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id  [1]     IMPLICIT Transaction-Id,
+       service-date-time       [2]     IMPLICIT Service-Date-Time,
+       requester-id    [3]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       responder-id    [4]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory when using store-and-forward communications
+               -- optional when using connection-oriented communications
+       expired-extensions      [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+
+Account-Number ::= ILL-String
+
+Already-Forwarded ::= SEQUENCE {
+       responder-id    [0]     IMPLICIT System-Id,
+       responder-address       [1]     IMPLICIT System-Address OPTIONAL
+       }       
+
+Already-Tried-List-Type ::= SEQUENCE OF System-Id
+
+Amount ::= SEQUENCE {
+       currency-code   [0]     IMPLICIT PrintableString (SIZE (3)) OPTIONAL,
+               -- values defined in ISO 4217-1981
+       monetary-value  [1]     IMPLICIT AmountString (SIZE (1..10))
+       }
+
+AmountString ::= PrintableString (FROM ("1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"0"|" "|"."|","))
+
+Client-Id ::= SEQUENCE {
+       client-name     [0]     ILL-String OPTIONAL,
+       client-status   [1]     ILL-String OPTIONAL,
+       client-identifier       [2]     ILL-String OPTIONAL
+       }
+
+Conditional-Results ::= SEQUENCE {
+       conditions      [0]     IMPLICIT ENUMERATED {
+                               cost-exceeds-limit                              (13),
+                               charges                                         (14),
+                               prepayment-required                     (15),
+                               lacks-copyright-compliance                      (16),
+                               library-use-only                                (22),
+                               no-reproduction                                 (23),
+                               client-signature-required                       (24),
+                               special-collections-supervision-required        (25),
+                               other                                   (27),
+                               responder-specific                              (28),
+                               proposed-delivery-service                       (30) 
+                               },
+       date-for-reply  [1]     IMPLICIT ISO-Date OPTIONAL,
+       locations       [2]     IMPLICIT SEQUENCE OF Location-Info OPTIONAL,
+       proposed-delivery-service               Delivery-Service OPTIONAL
+               -- this parameter specifies a proposed delivery service the
+               -- acceptance of which is a condition of supply.  It may be a
+               -- physical service or an electronic service.  This parameter
+               -- may only be present in APDUs with a 
+               -- protocol-version-num value of 2 or greater
+       }
+
+Cost-Info-Type ::= SEQUENCE {
+       account-number  [0]     Account-Number OPTIONAL,
+       maximum-cost    [1]     IMPLICIT Amount OPTIONAL,
+       reciprocal-agreement    [2]     IMPLICIT BOOLEAN DEFAULT FALSE,
+       will-pay-fee    [3]     IMPLICIT BOOLEAN DEFAULT FALSE,
+       payment-provided        [4]     IMPLICIT BOOLEAN DEFAULT FALSE
+       }
+
+Current-State ::= ENUMERATED {
+       nOT-SUPPLIED    (1),
+       pENDING (2),
+       iN-PROCESS      (3),
+       fORWARD (4),
+       cONDITIONAL     (5),
+       cANCEL-PENDING  (6),
+       cANCELLED       (7),
+       sHIPPED         (8),
+       rECEIVED        (9),
+       rENEW-PENDING   (10),
+       nOT-RECEIVED-OVERDUE    (11),
+       rENEW-OVERDUE   (12),
+       oVERDUE         (13),
+       rETURNED        (14),
+       cHECKED-IN      (15),
+       rECALL  (16),
+       lOST    (17),
+       uNKNOWN         (18)
+       }
+
+Damaged-Details ::= SEQUENCE {
+       document-type-id        [0]     IMPLICIT OBJECT IDENTIFIER OPTIONAL,
+               -- identifies an OSI document type registered in accordance
+               -- with ISO 9834-2, for use in an automated environment
+       damaged-portion         CHOICE {
+                               complete-document       [1]     IMPLICIT NULL,
+                               specific-units  [2]     IMPLICIT SEQUENCE 
+                                                                       OF INTEGER
+                               -- the nature and extent of a "unit" is implicit in the
+                               -- value of document-type-id if one is supplied
+                               }
+       }
+
+Date-Due ::= SEQUENCE {
+       date-due-field  [0]     IMPLICIT ISO-Date,
+       renewable       [1]     IMPLICIT BOOLEAN DEFAULT TRUE
+       }
+
+Delivery-Address ::= SEQUENCE {
+       postal-address  [0]     IMPLICIT Postal-Address OPTIONAL,
+       electronic-address      [1]     IMPLICIT System-Address OPTIONAL
+       }
+
+Delivery-Service ::= CHOICE {
+       physical-delivery       [7]     Transportation-Mode,
+       electronic-delivery     [50]    IMPLICIT SEQUENCE OF Electronic-Delivery-Service
+               -- electronic-delivery may only be present in APDUs
+               -- with a protocol-version-num value of 2 or greater
+       }
+
+Electronic-Delivery-Service ::= SEQUENCE {
+       -- the first four parameters are intended to be used in an automated
+       -- environment
+               e-delivery-service      [0] IMPLICIT SEQUENCE {
+               -- identifies the kind of electronic delivery service, e.g.
+               -- MOTIS IPM,FTAM, etc., using the assigned object
+               -- identifier for the standard e.g. {joint-iso-ccitt mhs-motis 
+               -- ipms}
+                       e-delivery-mode [0] IMPLICIT OBJECT IDENTIFIER,
+                       e-delivery-parameters   [1] ANY DEFINED BY e-delivery-mode
+                       } OPTIONAL,
+               document-type           [1] IMPLICIT SEQUENCE {
+                       document-type-id                [2] IMPLICIT OBJECT IDENTIFIER,
+                       -- identifies an OSI document type registered in accordance
+                       -- with ISO 9834-2
+                       document-type-parameters        [3] ANY DEFINED BY document-type-id
+                       -- any parameters relating to the registered document type
+                       } OPTIONAL,
+               e-delivery-description          [4] ILL-String OPTIONAL,
+               -- holds a human readable name or description of the
+               -- required electronic delivery service and document type;
+               -- this may also be used to identify an electronic delivery
+               -- service for which there is no object identifier.
+               -- This parameter may be present instead of, or in addition
+               -- to, the previous 4 parameters
+               e-delivery-details              [5] CHOICE {
+                       e-delivery-address      [0] IMPLICIT System-Address,
+                       e-delivery-id           [1] IMPLICIT System-Id
+                       },
+               name-or-code            [6] ILL-String OPTIONAL,
+               -- holds a human-readable identifier or correlation
+               -- information for the document as shipped, e.g. a directory 
+               -- and/or file name or message-id
+               delivery-time           [7] IMPLICIT ISO-Time OPTIONAL
+               -- holds the requester's preferred delivery time or
+               -- the responder's proposed or actual delivery time
+               }
+
+Error-Report ::= SEQUENCE {
+       correlation-information [0]     ILL-String,
+       report-source   [1]     IMPLICIT Report-Source,
+       user-error-report       [2]     User-Error-Report OPTIONAL,
+               -- mandatory if report-source is "user"; not present otherwise
+       provider-error-report   [3]     Provider-Error-Report OPTIONAL
+               -- mandatory if report-source is "provider"; not
+               -- present otherwise
+       }
+
+Estimate-Results ::= SEQUENCE {
+       cost-estimate   [0]     ILL-String,
+       locations       [1]     IMPLICIT SEQUENCE OF Location-Info OPTIONAL
+       }
+
+Extension ::= SEQUENCE {
+       identifier      [0]     IMPLICIT INTEGER,
+       critical        [1]     IMPLICIT BOOLEAN DEFAULT FALSE,
+       item    [2]     ANY DEFINED BY identifier
+       }
+
+General-Problem ::= ENUMERATED {
+       unrecognized-APDU       (1),
+       mistyped-APDU   (2),
+       badly-structured-APDU   (3),
+       protocol-version-not-supported  (4),
+       other   (5)
+       }
+
+History-Report ::= SEQUENCE {
+       date-requested  [0]     IMPLICIT ISO-Date OPTIONAL,
+       author  [1]     ILL-String OPTIONAL,
+       title   [2]     ILL-String OPTIONAL,
+       author-of-article       [3]     ILL-String OPTIONAL,
+       title-of-article        [4]     ILL-String OPTIONAL,
+       date-of-last-transition         [5]     IMPLICIT ISO-Date,
+       most-recent-service     [6]     IMPLICIT ENUMERATED {
+                               iLL-REQUEST                     (1),
+                               fORWARD                                 (21),
+                               fORWARD-NOTIFICATION            (2),
+                               sHIPPED                                 (3),
+                               iLL-ANSWER                      (4),
+                               cONDITIONAL-REPLY               (5),
+                               cANCEL                          (6),
+                               cANCEL-REPLY                    (7),
+                               rECEIVED                                (8),
+                               rECALL                          (9),
+                               rETURNED                                (10),
+                               cHECKED-IN                      (11),
+                               rENEW-ANSWER                    (14),
+                               lOST                            (15),
+                               dAMAGED                                 (16),
+                               mESSAGE                                 (17),
+                               sTATUS-QUERY                    (18),
+                               sTATUS-OR-ERROR-REPORT  (19),
+                               eXPIRED                                 (20)
+                               },
+       date-of-most-recent-service     [7]     IMPLICIT ISO-Date,
+       initiator-of-most-recent-service        [8]     IMPLICIT System-Id,
+       shipped-service-type    [9]     IMPLICIT Shipped-Service-Type OPTIONAL,
+               -- If the information is available, i.e. if a SHIPPED or
+               -- RECEIVED APDU has been sent or received, then the
+               -- value in this parameter shall be supplied.
+               -- Value must contain the most current information, e.g. if a
+               -- requester has received a SHIPPED APDU and then
+               -- invokes a RECEIVED.request, then the value from the
+               -- RECEIVED.request is used
+       transaction-results     [10]    IMPLICIT Transaction-Results OPTIONAL,
+               -- If the information is available, i.e. if an ILL-ANWSER
+               -- APDU has been sent or received, then the value in this
+               -- parameter shall be supplied.
+       most-recent-service-note        [11]    ILL-String OPTIONAL
+               -- If the information is available, i.e. if a note has been
+               -- supplied in the most recent service primitive, then the
+               -- value in this parameter shall be supplied.
+       }
+
+Hold-Placed-Results ::= SEQUENCE {
+       estimated-date-available        [0]     IMPLICIT ISO-Date,
+       hold-placed-medium-type [1]     IMPLICIT Medium-Type OPTIONAL,
+       locations       [2]     IMPLICIT SEQUENCE OF Location-Info OPTIONAL
+       }
+
+ILL-APDU-Type ::= ENUMERATED {
+       iLL-REQUEST     (1),
+       fORWARD-NOTIFICATION    (2),
+       sHIPPED         (3),
+       iLL-ANSWER      (4),
+       cONDITIONAL-REPLY       (5),
+       cANCEL  (6),
+       cANCEL-REPLY    (7),
+       rECEIVED        (8),
+       rECALL  (9),
+       rETURNED        (10),
+       cHECKED-IN      (11),
+       oVERDUE         (12),
+       rENEW   (13),
+       rENEW-ANSWER    (14),
+       lOST    (15),
+       dAMAGED         (16),
+       mESSAGE         (17),
+       sTATUS-QUERY    (18),
+       sTATUS-OR-ERROR-REPORT  (19),
+       eXPIRED         (20)
+       }
+
+ILL-Service-Type ::= ENUMERATED  {
+       loan    (1),
+       copy-non-returnable     (2),
+       locations       (3),
+       estimate        (4),
+       responder-specific      (5)
+       }
+
+ILL-String ::= CHOICE {
+       GeneralString,
+       -- may contain any ISO registered G (graphic) and C
+       -- (control) character set
+       EDIFACTString
+       }
+       -- may not include leading or trailing spaces
+       -- may not consist only of space (" ") or non-printing 
+       -- characters
+
+Intermediary-Problem ::= ENUMERATED {
+       cannot-send-onward      (1)
+       }
+
+ISO-Date ::= VisibleString
+       -- conforms to ISO 8601
+       -- length = 8
+       -- fixed
+       -- YYYYMMDD
+
+ISO-Time ::= VisibleString
+       -- conforms to ISO 8601
+       -- length = 6, 
+       -- fixed
+       -- HHMMSS
+       -- local time of person or institution invoking service
+
+Item-Id ::= SEQUENCE {
+       item-type       [0]     IMPLICIT ENUMERATED {
+                               monograph       (1),
+                               serial  (2),
+                               other   (3)
+                               } OPTIONAL,
+       held-medium-type        [1]     IMPLICIT Medium-Type OPTIONAL,
+       call-number     [2]     ILL-String OPTIONAL,
+       author  [3]     ILL-String OPTIONAL,
+       title   [4]     ILL-String OPTIONAL,
+       sub-title       [5]     ILL-String OPTIONAL,
+       sponsoring-body [6]     ILL-String OPTIONAL,
+       place-of-publication    [7]     ILL-String OPTIONAL,
+       publisher       [8]     ILL-String OPTIONAL,
+       series-title-number     [9]     ILL-String OPTIONAL,
+       volume-issue    [10]    ILL-String OPTIONAL,
+       edition [11]    ILL-String OPTIONAL,
+       publication-date        [12]    ILL-String OPTIONAL,
+       publication-date-of-component   [13] ILL-String OPTIONAL,
+       author-of-article       [14]    ILL-String OPTIONAL,
+       title-of-article        [15]    ILL-String OPTIONAL,
+       pagination      [16]    ILL-String OPTIONAL,
+       national-bibliography-no        [17]    EXTERNAL OPTIONAL,
+       iSBN    [18]    ILL-String (SIZE (10)) OPTIONAL,
+               -- must conform to ISO 2108-1978
+       iSSN    [19]    ILL-String (SIZE (8)) OPTIONAL,
+               -- must conform to ISO 3297-1986
+       system-no       [20]    EXTERNAL OPTIONAL,
+       additional-no-letters   [21] ILL-String OPTIONAL,
+       verification-reference-source   [22] ILL-String OPTIONAL
+       }
+
+Location-Info ::= SEQUENCE {
+       location-id     [0]     IMPLICIT System-Id,
+       location-address        [1]     IMPLICIT System-Address OPTIONAL,
+       location-note   [2]     ILL-String OPTIONAL
+       }
+
+Locations-Results ::= SEQUENCE {
+       reason-locs-provided    [0]     IMPLICIT Reason-Locs-Provided OPTIONAL,
+       locations       [1]     IMPLICIT SEQUENCE OF Location-Info
+       }
+
+Medium-Type ::= ENUMERATED {
+       printed         (1),
+       microform       (3),
+       film-or-video-recording (4),
+       audio-recording         (5),
+       machine-readable        (6),
+       other   (7)
+       }
+
+Name-Of-Person-Or-Institution ::= CHOICE {
+       name-of-person  [0]     ILL-String,
+       name-of-institution     [1]     ILL-String
+       }
+
+Person-Or-Institution-Symbol ::= CHOICE {
+       person-symbol   [0]     ILL-String,
+       institution-symbol      [1]     ILL-String
+       }
+
+Place-On-Hold-Type ::= ENUMERATED {
+       yes     (1),
+       no      (2),
+       according-to-responder-policy   (3)
+       }
+
+Postal-Address ::= SEQUENCE {
+       name-of-person-or-institution   [0]     Name-Of-Person-Or-Institution OPTIONAL,
+       extended-postal-delivery-address [1]    ILL-String OPTIONAL,
+       street-and-number       [2]     ILL-String OPTIONAL,
+       post-office-box [3]     ILL-String OPTIONAL,
+       city    [4]     ILL-String OPTIONAL,
+       region  [5]     ILL-String OPTIONAL,
+       country [6]     ILL-String OPTIONAL,
+       postal-code     [7]     ILL-String OPTIONAL
+       }
+
+Provider-Error-Report ::= CHOICE {
+       general-problem [0]     IMPLICIT General-Problem,
+       transaction-id-problem  [1]     IMPLICIT Transaction-Id-Problem,
+       state-transition-prohibited     [2]     IMPLICIT State-Transition-Prohibited
+       }
+
+Reason-Locs-Provided ::= ENUMERATED {
+       in-use-on-loan  (1),
+       in-process      (2),
+       lost    (3),
+       non-circulating         (4),
+       not-owned       (5),
+       on-order        (6),
+       volume-issue-not-yet-available  (7),
+       at-bindery      (8),
+       lacking         (9),
+       not-on-shelf    (10),
+       on-reserve      (11),
+       poor-condition  (12),
+       cost-exceeds-limit      (13),
+       on-hold         (19),
+       other   (27),
+       responder-specific      (28) 
+       }
+
+Reason-No-Report ::= ENUMERATED {
+       temporary       (1),
+       permanent       (2)
+       }
+
+Reason-Unfilled ::= ENUMERATED {
+       in-use-on-loan  (1),
+       in-process      (2),
+       lost    (3),
+       non-circulating (4),
+       not-owned       (5),
+       on-order        (6),
+       volume-issue-not-yet-available  (7),
+       at-bindery      (8),
+       lacking (9),
+       not-on-shelf    (10),
+       on-reserve      (11),
+       poor-condition  (12),
+       cost-exceeds-limit      (13),
+       charges (14),
+       prepayment-required     (15),
+       lacks-copyright-compliance      (16),
+       not-found-as-cited      (17),
+       locations-not-found     (18),
+       on-hold (19),
+       policy-problem  (20),
+       mandatory-messaging-not-supported       (21),
+       expiry-not-supported    (22) ,
+       requested-delivery-services-not-supported       (23),
+       preferred-delivery-time-not-possible    (24),
+       other   (27),
+       responder-specific      (28)
+       }
+
+Report-Source ::= ENUMERATED {
+       user    (1),
+       provider        (2)
+       }
+
+Requester-Optional-Messages-Type ::= SEQUENCE {
+       can-send-RECEIVED       [0]     IMPLICIT BOOLEAN,
+       can-send-RETURNED       [1]     IMPLICIT BOOLEAN,
+       requester-SHIPPED       [2]     IMPLICIT ENUMERATED {
+                               requires        (1),
+                               desires         (2),
+                               neither (3)
+                               },
+       requester-CHECKED-IN    [2]     IMPLICIT ENUMERATED {
+                               requires        (1),
+                               desires         (2),
+                               neither         (3)
+                               }
+       }
+
+Responder-Optional-Messages-Type ::= SEQUENCE {
+       can-send-SHIPPED        [0]     IMPLICIT BOOLEAN,
+       can-send-CHECKED-IN     [1]     IMPLICIT BOOLEAN,
+       responder-RECEIVED      [2]     IMPLICIT ENUMERATED {
+                               requires        (1),
+                               desires         (2),
+                               neither         (3)
+                               },
+       responder-RETURNED      [3]     IMPLICIT ENUMERATED {
+                               requires        (1),
+                               desires         (2),
+                               neither         (3)
+                               }
+       }
+
+Retry-Results ::= SEQUENCE {
+       reason-not-available    [0]     IMPLICIT ENUMERATED {
+                               in-use-on-loan                  (1),
+                               in-process                              (2),
+                               on-order                                (6),
+                               volume-issue-not-yet-available  (7),
+                               at-bindery                              (8),
+                               cost-exceeds-limit                      (13),
+                               charges                                 (14),
+                               prepayment-required             (15),
+                               lacks-copyright-compliance              (16),
+                               not-found-as-cited                      (17),
+                               on-hold                                 (19),
+                               other                           (27),
+                               responder-specific                      (28)
+                               } OPTIONAL,
+       retry-date      [1]     IMPLICIT ISO-Date OPTIONAL,
+       locations       [2]     IMPLICIT SEQUENCE OF Location-Info OPTIONAL
+       }
+
+Search-Type ::= SEQUENCE {
+       level-of-service        [0]     ILL-String (SIZE (1)) OPTIONAL,
+       need-before-date        [1]     IMPLICIT ISO-Date OPTIONAL,
+       expiry-flag     [2]     IMPLICIT ENUMERATED {
+                               need-Before-Date        (1),
+                               other-Date              (2),
+                               no-Expiry               (3)
+                               } DEFAULT 3,
+                               -- value of "need-Before-Date" indicates that
+                               -- need-before-date also specifies transaction expiry
+                               -- date
+       expiry-date     [3]     IMPLICIT ISO-Date OPTIONAL
+               -- alternative expiry date can be used only when expiry-flag
+               -- is set to "Other-Date"
+       }
+
+Security-Problem ::= ILL-String
+
+Send-To-List-Type ::= SEQUENCE OF SEQUENCE {
+       system-id       [0]     IMPLICIT System-Id,
+       account-number  [1]     Account-Number OPTIONAL,
+       system-address  [2]     IMPLICIT System-Address OPTIONAL
+       }
+
+Service-Date-Time ::= SEQUENCE {
+       date-time-of-this-service       [0]     IMPLICIT SEQUENCE {
+                               date    [0]     IMPLICIT ISO-Date,
+                               time    [1]     IMPLICIT ISO-Time OPTIONAL
+                               -- mandatory for 2nd and subsequent services
+                               -- invoked for a given 
+                               -- ILL-transaction on the same day
+                               },
+       date-time-of-original-service   [1]     IMPLICIT SEQUENCE {
+                               date    [0]     IMPLICIT ISO-Date,
+                               time    [1]     IMPLICIT ISO-Time OPTIONAL
+                               } OPTIONAL
+       }
+
+Shipped-Service-Type ::= ILL-Service-Type (loan | copy-non-returnable)
+       -- subtype of ILL-Service-Type
+
+State-Transition-Prohibited ::= SEQUENCE {
+       aPDU-type       [0]     IMPLICIT ILL-APDU-Type,
+       current-state   [1]     IMPLICIT Current-State
+       }
+
+Status-Report ::= SEQUENCE {
+       user-status-report      [0]     IMPLICIT History-Report,
+       provider-status-report  [1]     IMPLICIT Current-State
+       }
+
+Supplemental-Item-Description ::= SEQUENCE OF EXTERNAL
+       -- the syntax of supplementary item description information is defined outside this standard
+
+Supply-Details ::= SEQUENCE {
+       date-shipped    [0]     IMPLICIT ISO-Date OPTIONAL,
+       date-due        [1]     IMPLICIT Date-Due OPTIONAL,
+       chargeable-units        [2]     IMPLICIT INTEGER (1..9999) OPTIONAL,
+       cost    [3]     IMPLICIT Amount OPTIONAL,
+       shipped-conditions      [4]     IMPLICIT ENUMERATED {
+                               library-use-only                                (22),
+                               no-reproduction                         (23),
+                               client-signature-required                       (24),
+                               special-collections-supervision-required        (25),
+                               other                                   (27)
+                               } OPTIONAL,
+       shipped-via             CHOICE {
+                               physical-delivery       [5]     Transportation-Mode,
+                               electronic-delivery     [50]    IMPLICIT
+                                                                Electronic-Delivery-Service
+                               } OPTIONAL,
+               -- electronic-delivery may only be present in APDUs with a
+               -- protocol-version-num value of 2 or greater
+       insured-for     [6]     IMPLICIT Amount OPTIONAL,
+       return-insurance-require        [7]     IMPLICIT Amount OPTIONAL,
+       no-of-units-per-medium  [8]     IMPLICIT SEQUENCE OF Units-Per-Medium-Type      
+                               OPTIONAL
+       }
+
+Supply-Medium-Info-Type ::= SEQUENCE {
+       supply-medium-type      [0]     IMPLICIT Supply-Medium-Type,
+       medium-characteristics  [1]     ILL-String OPTIONAL
+       }
+
+Supply-Medium-Type ::= ENUMERATED {
+       printed (1),
+       photocopy       (2),
+       microform       (3),
+       film-or-video-recording (4),
+       audio-recording (5),
+       machine-readable        (6),
+       other   (7)
+       }
+
+System-Address ::= SEQUENCE {
+       telecom-service-identifier      [0]     ILL-String OPTIONAL,
+       telecom-service-address [1]     ILL-String OPTIONAL
+       }
+
+System-Id ::= SEQUENCE {
+       --at least one of the following must be present
+       person-or-institution-symbol    [0]     Person-Or-Institution-Symbol OPTIONAL,
+       name-of-person-or-institution   [1]     Name-Of-Person-Or-Institution OPTIONAL
+       }
+
+Third-Party-Info-Type ::= SEQUENCE {
+       permission-to-forward   [0]     IMPLICIT BOOLEAN DEFAULT FALSE,
+       permission-to-chain     [1]     IMPLICIT BOOLEAN DEFAULT FALSE,
+       permission-to-partition         [2]     IMPLICIT BOOLEAN DEFAULT FALSE,
+       permission-to-change-send-to-list [3]   IMPLICIT BOOLEAN DEFAULT FALSE,
+       initial-requester-address       [4]     IMPLICIT System-Address OPTIONAL,
+               -- mandatory when initiating a FORWARD service or an
+               -- ILL-REQUEST service for a partitioned ILL
+               -- sub-transaction; optional otherwise
+       preference      [5]     IMPLICIT ENUMERATED {
+                               ordered (1),
+                               unordered       (2)
+                               } DEFAULT 2,
+       send-to-list    [6]     IMPLICIT Send-To-List-Type OPTIONAL,
+       already-tried-list      [7]     IMPLICIT Already-Tried-List-Type OPTIONAL
+               -- mandatory when initiating a FORWARD service, or when
+               -- initiating an ILL-REQUEST service for an ILL
+               -- sub-transaction if the received ILL-REQUEST included an
+               -- "already-tried-list"; optional otherwise
+       }
+
+Transaction-Id ::= SEQUENCE {
+       initial-requester-id    [0]     IMPLICIT System-Id OPTIONAL,
+               -- mandatory for sub-transactions; not called
+               -- "requester-id" to distinguish id of initial-requester
+               --from id of requester of sub-transaction if there is one
+       transaction-group-qualifier     [1]     ILL-String,
+       transaction-qualifier   [2]     ILL-String,
+       sub-transaction-qualifier       [3]     ILL-String OPTIONAL
+               -- mandatory for sub-transactions
+       }
+
+Transaction-Id-Problem ::= ENUMERATED {
+       duplicate-transaction-id        (1),
+       invalid-transaction-id  (2),
+       unknown-transaction-id  (3)
+       }
+
+Transaction-Results ::= ENUMERATED {
+       conditional     (1),
+       retry   (2),
+       unfilled        (3),
+       locations-provided      (4),
+       will-supply     (5),
+       hold-placed     (6),
+       estimate        (7)
+       }
+
+Transaction-Type ::= ENUMERATED  {
+       simple  (1),
+       chained (2),
+       partitioned     (3)
+       }
+
+Transportation-Mode ::= ILL-String
+
+Unable-To-Perform ::= ENUMERATED {
+       not-available   (1),
+       resource-limitation     (2),
+       other   (3)
+       }
+
+Unfilled-Results ::= SEQUENCE {
+       reason-unfilled [0]     IMPLICIT Reason-Unfilled,
+       locations       [1]     IMPLICIT SEQUENCE OF Location-Info OPTIONAL
+       }
+
+Units-Per-Medium-Type ::= SEQUENCE {
+       medium  [0]     Supply-Medium-Type,
+       no-of-units     [1]     INTEGER (1..9999)
+       }
+
+User-Error-Report ::= CHOICE {
+       already-forwarded       [0]     IMPLICIT Already-Forwarded,
+       intermediary-problem    [1]     IMPLICIT Intermediary-Problem,
+       security-problem        [2]     Security-Problem,
+       unable-to-perform       [3]     IMPLICIT Unable-To-Perform
+       }
+
+
+Will-Supply-Results ::= SEQUENCE {
+       reason-will-supply      [0]     ENUMERATED {
+                               in-use-on-loan          (1),
+                               in-process                      (2),
+                               on-order                        (6),
+                               at-bindery                      (8),
+                               on-hold                         (19),
+                               being-processed-for-supply      (26),
+                               other                   (27),
+                               responder-specific              (28),
+                               electronic-delivery             (30)
+                               },
+       supply-date     [1]     ISO-Date OPTIONAL,
+       return-to-address       [2]     Postal-Address OPTIONAL,
+       locations       [3]     IMPLICIT SEQUENCE OF Location-Info OPTIONAL,
+       electronic-delivery-service     [4] Electronic-Delivery-Service OPTIONAL
+               -- if present, this must be one of the services proposed by 
+               -- the requester
+       }
+
+EDIFACTString ::= VisibleString 
+       (FROM ("A"|"B"|"C"|"D"|"E"|"F"|"G"|"H"|
+       "I"|"J"|"K"|"L"|"M"|"N"|"O"|"P"|"Q"|"R"|"S"|"T"|"U"|
+       "V"|"W"|"X"|"Y"|"Z"|"a"|"b"|"c"|"d"|"e"|"f"|"g"|"h"|
+       "i"|"j"|"k"|"l"|"m"|"n"|"o"|"p"|"q"|"r"|"s"|"t"|"u"|
+       "v"|"w"|"x"|"y"|"z"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|
+       "9"|"0"|" "|"."|","|"-"|"("|")"|"/"|"="|"!"|"""|"%"|"&"|
+       "*"|";"|"<"|">"|"'"|"+"|":"|"?"))
+
+END
+
+
diff --git a/ill/item-req.asn b/ill/item-req.asn
new file mode 100644 (file)
index 0000000..612d509
--- /dev/null
@@ -0,0 +1,58 @@
+Z39.50-extendedService-ItemOrder-ItemRequest-1 DEFINITIONS ::=
+BEGIN
+IMPORTS
+       Transaction-Id,
+       Service-Date-Time,
+       System-Id,
+       Transaction-Type,
+       Delivery-Address,
+       ILL-Service-Type,
+       Requester-Optional-Messages-Type,
+       Search-Type,
+       Supply-Medium-Info-Type,
+       Place-On-Hold-Type,
+       Client-Id,
+       Item-Id,
+       Supplemental-Item-Description,
+       Cost-Info-Type,
+       ILL-String,
+       Third-Party-Info-Type,
+       Extension
+FROM ISO-10161-ILL-1;
+
+ItemRequest ::=SEQUENCE {
+       protocol-version-num    [0]     IMPLICIT INTEGER {
+                               version-1 (1),
+                               version-2 (2)
+                               },
+       transaction-id          [1]     IMPLICIT Transaction-Id OPTIONAL,
+       service-date-time       [2]     IMPLICIT Service-Date-Time OPTIONAL,
+       requester-id            [3]     IMPLICIT System-Id OPTIONAL,
+       responder-id            [4]     IMPLICIT System-Id OPTIONAL,
+       transaction-type        [5]     IMPLICIT Transaction-Type DEFAULT 1,
+       delivery-address        [6]     IMPLICIT Delivery-Address OPTIONAL, 
+       delivery-service                Delivery-Service OPTIONAL,
+       billing-address         [8]     IMPLICIT Delivery-Address OPTIONAL,
+       iLL-service-type        [9]     IMPLICIT SEQUENCE SIZE (1..5) OF 
+                                       ILL-Service-Type OPTIONAL,
+       responder-specific-service      [10]    EXTERNAL OPTIONAL,
+               -- use direct reference style
+       requester-optional-messages     [11]    IMPLICIT Requester-Optional-Messages-Type OPTIONAL,
+       search-type             [12]    IMPLICIT Search-Type OPTIONAL,
+       supply-medium-info-type [13]    IMPLICIT SEQUENCE SIZE (1..7) OF
+                               Supply-Medium-Info-Type OPTIONAL,
+       place-on-hold           [14]    IMPLICIT Place-On-Hold-Type DEFAULT 3,
+       client-id               [15]    IMPLICIT Client-Id OPTIONAL,     
+       item-id                 [16]    IMPLICIT Item-Id OPTIONAL,
+       supplemental-item-description   [17]    IMPLICIT Supplemental-Item-Description OPTIONAL,
+       cost-info-type          [18]    IMPLICIT Cost-Info-Type OPTIONAL,
+       copyright-compliance    [19]    ILL-String OPTIONAL,
+       third-party-info-type   [20]    IMPLICIT Third-Party-Info-Type OPTIONAL,
+       retry-flag              [21]    IMPLICIT BOOLEAN DEFAULT FALSE,
+       forward-flag            [22]    IMPLICIT BOOLEAN DEFAULT FALSE,
+       requester-note          [46]    ILL-String OPTIONAL,
+       forward-note            [47]    ILL-String OPTIONAL,
+       iLL-request-extensions  [49]    IMPLICIT SEQUENCE OF Extension OPTIONAL
+       }
+END
+  
index 10e8e0a..fa1988f 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: backend.h,v $
- * Revision 1.1  1999-11-30 13:47:11  adam
+ * Revision 1.2  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.1  1999/11/30 13:47:11  adam
  * Improved installation. Moved header files to include/yaz.
  *
  * Revision 1.28  1999/11/04 14:58:44  adam
@@ -256,13 +259,13 @@ typedef struct bend_sort_rr
     char *errstring;
 } bend_sort_rr;
 
-/* extended services handler. Added in from DALI */
 typedef struct bend_esrequest_rr
 {
     int ItemNo;
     Z_ExtendedServicesRequest *esr;
     
     ODR stream;                /* encoding stream */
+    ODR decode;                /* decoding stream */
     Z_ReferenceId *referenceId;/* reference ID */
     bend_request request;
     bend_association association;
diff --git a/include/yaz/ill.h b/include/yaz/ill.h
new file mode 100644 (file)
index 0000000..96f6b14
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 1999, Index Data
+ * See the file LICENSE for details.
+ *
+ * $Log: ill.h,v $
+ * Revision 1.1  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ */
+#ifndef ILL_H
+#define ILL_H
+
+#include <yaz/ill-core.h>
+#include <yaz/item-req.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+YAZ_EXPORT ILL_ItemRequest *ill_get_ItemRequest (ODR o);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/yaz/odr_use.h b/include/yaz/odr_use.h
deleted file mode 100644 (file)
index 3e3080a..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1995-1999, Index Data.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation, in whole or in part, for any purpose, is hereby granted,
- * provided that:
- *
- * 1. This copyright and permission notice appear in all copies of the
- * software and its documentation. Notices of copyright or attribution
- * which appear at the beginning of any file must remain unchanged.
- *
- * 2. The name of Index Data or the individual authors may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
- * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- *
- * $Id: odr_use.h,v 1.1 1999-11-30 13:47:11 adam Exp $
- */
-
-#ifndef ODR_USE_H
-#define ODR_USE_H
-
-#include <yaz/yconfig.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct Odr_external
-{
-    Odr_oid *direct_reference;       /* OPTIONAL */
-    int     *indirect_reference;     /* OPTIONAL */
-    char    *descriptor;             /* OPTIONAL */
-    int which;
-#define ODR_EXTERNAL_single 0
-#define ODR_EXTERNAL_octet 1
-#define ODR_EXTERNAL_arbitrary 2
-    union
-    {
-       Odr_any  *single_ASN1_type;
-       Odr_oct  *octet_aligned; 
-       Odr_bitmask *arbitrary;      /* we aren't really equipped for this*/
-    } u;
-} Odr_external;
-
-YAZ_EXPORT int odr_external(ODR o, Odr_external **p, int opt,
-                           const char *name);
-YAZ_EXPORT int odr_visiblestring(ODR o, char **p, int opt,
-                                const char *name);
-YAZ_EXPORT int odr_graphicstring(ODR o, char **p, int opt,
-                                const char *name);
-YAZ_EXPORT int odr_generalizedtime(ODR o, char **p, int opt,
-                                  const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index c1d3f2c..a99b6d8 100644 (file)
@@ -23,7 +23,7 @@
  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  * OF THIS SOFTWARE.
  *
- * $Id: oid.h,v 1.1 1999-11-30 13:47:11 adam Exp $
+ * $Id: oid.h,v 1.2 1999-12-16 23:36:19 adam Exp $
  */
 
 #ifndef OID_H
@@ -154,6 +154,7 @@ typedef enum oid_value
     VAL_PROXY,
     VAL_COOKIE,
     VAL_CLIENT_IP,
+    VAL_ISO_ILL_1,
 /* add new types here... */
 
 /* VAL_DYNAMIC must have highest value */
index 87c71b4..b6576b1 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: z-proto.h,v $
- * Revision 1.1  1999-11-30 13:47:11  adam
+ * Revision 1.2  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.1  1999/11/30 13:47:11  adam
  * Improved installation. Moved header files to include/yaz.
  *
  * Revision 1.2  1999/06/09 10:52:11  adam
 #define ASN_COMPILED 1
 
 #include <yaz/yaz-version.h>
-#include <yaz/z-accdes1-p.h>
-#include <yaz/z-accform1-p.h>
-#include <yaz/z-acckrb1-p.h>
-#include <yaz/z-core-p.h>
-#include <yaz/z-diag1-p.h>
-#include <yaz/z-espec1-p.h>
-#include <yaz/z-estask-p.h>
-#include <yaz/z-exp-p.h>
-#include <yaz/z-grs-p.h>
-#include <yaz/z-opac-p.h>
-#include <yaz/z-rrf1-p.h>
-#include <yaz/z-rrf2-p.h>
-#include <yaz/z-sum-p.h>
-#include <yaz/z-sutrs-p.h>
-#include <yaz/z-uifr1-p.h>
-#include <yaz/zes-expi-p.h>
-#include <yaz/zes-exps-p.h>
-#include <yaz/zes-order-p.h>
-#include <yaz/zes-pquery-p.h>
-#include <yaz/zes-psched-p.h>
-#include <yaz/zes-pset-p.h>
-#include <yaz/zes-update-p.h>
-#include <yaz/z-date-p.h>
-#include <yaz/z-univ-p.h>
+#include <yaz/z-accdes1.h>
+#include <yaz/z-accform1.h>
+#include <yaz/z-acckrb1.h>
+#include <yaz/z-core.h>
+#include <yaz/z-diag1.h>
+#include <yaz/z-espec1.h>
+#include <yaz/z-estask.h>
+#include <yaz/z-exp.h>
+#include <yaz/z-grs.h>
+#include <yaz/z-opac.h>
+#include <yaz/z-rrf1.h>
+#include <yaz/z-rrf2.h>
+#include <yaz/z-sum.h>
+#include <yaz/z-sutrs.h>
+#include <yaz/z-uifr1.h>
+#include <yaz/zes-expi.h>
+#include <yaz/zes-exps.h>
+#include <yaz/zes-order.h>
+#include <yaz/zes-pquery.h>
+#include <yaz/zes-psched.h>
+#include <yaz/zes-pset.h>
+#include <yaz/zes-update.h>
+#include <yaz/z-date.h>
+#include <yaz/z-univ.h>
 
 #ifdef __cplusplus
 extern "C" {
index ae65af1..c6e8975 100644 (file)
@@ -1,15 +1,15 @@
-# Copyright (C) 1994-1998, Index Data 
+# Copyright (C) 1994-1999, Index Data 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile.in,v 1.3 1999-06-08 10:10:16 adam Exp $
+# $Id: Makefile.in,v 1.4 1999-12-16 23:36:19 adam Exp $
 
 SHELL=/bin/sh
 
 RANLIB=@RANLIB@
 
 MAKE=make
-YAZLIBS=libodr.a libasn.a libcomstack.a \
-       libserver.a libzutil.a libutil.a libret.a
+YAZLIBS=libodr.a libasn.a libcomstack.a libserver.a \
+       libzutil.a libutil.a libccl.a libret.a @ILLLIB@
 LIB=libyaz.a
 
 all: $(LIB)
index 013eefb..6a3feef 100644 (file)
@@ -1,6 +1,5 @@
 #include <stdio.h>
-#include <odr.h>
-#include <odr_use.h>
+#include <yaz/odr.h>
 
 #if 0
 
index 04157d2..eb26f03 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: seshigh.c,v $
- * Revision 1.99  1999-11-30 13:47:12  adam
+ * Revision 1.100  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.99  1999/11/30 13:47:12  adam
  * Improved installation. Moved header files to include/yaz.
  *
  * Revision 1.98  1999/11/29 15:12:27  adam
@@ -1871,6 +1874,7 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd)
 
     esrequest.esr = reqb->request->u.extendedServicesRequest;
     esrequest.stream = assoc->encode;
+    esrequest.decode = assoc->decode;
     esrequest.errcode = 0;
     esrequest.errstring = NULL;
     esrequest.request = reqb;
index 3bf45dc..cb93fed 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: oid.c,v $
- * Revision 1.38  1999-11-30 13:47:12  adam
+ * Revision 1.39  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.38  1999/11/30 13:47:12  adam
  * Improved installation. Moved header files to include/yaz.
  *
  * Revision 1.37  1999/09/13 12:51:15  adam
@@ -176,6 +179,8 @@ static oident oids[] =
      "BER" },
     {PROTO_GENERAL, CLASS_TRANSYN, VAL_ISO2709,      {1,0,2709,1,1,-1},
      "ISO2709"},
+    {PROTO_GENERAL, CLASS_GENERAL, VAL_ISO_ILL_1,    {1,2,10161,2,1,-1},
+     "ISOILL-1"},
     /* Z39.50v3 definitions */
     {PROTO_Z3950,   CLASS_ABSYN,   VAL_APDU,         {2,1,-1},
      "Z-APDU"},    
index ae965c9..49627cc 100755 (executable)
@@ -8,7 +8,10 @@ exec tclsh "$0" "$@"
 # Sebastian Hammer, Adam Dickmeiss
 #
 # $Log: yc.tcl,v $
-# Revision 1.3  1999-11-30 13:47:12  adam
+# Revision 1.4  1999-12-16 23:36:19  adam
+# Implemented ILL protocol. Minor updates ASN.1 compiler.
+#
+# Revision 1.3  1999/11/30 13:47:12  adam
 # Improved installation. Moved header files to include/yaz.
 #
 # Revision 1.2  1999/06/09 09:43:11  adam
@@ -549,7 +552,7 @@ proc asnSequence {name tag implicit tagtype} {
         lappend l "\t\t!odr_sequence_begin (o, p, sizeof(**p), name))"
         lappend l "\t\treturn opt && odr_ok(o);"
     } else {
-        lappend l "\tif (!odr_constructed_begin (o, p, $tagtype, $tag, name)"
+        lappend l "\tif (!odr_constructed_begin (o, p, $tagtype, $tag, name))"
         lappend l "\t\treturn opt && odr_ok(o);"
         lappend l "\tif (o->direction == ODR_DECODE)"
         lappend l "\t\t*p = odr_malloc (o, sizeof(**p));"
@@ -918,9 +921,14 @@ proc asnImports {} {
                 set prefix $inf(prefix)
             }
             foreach n $nam {
-                set m [join [split $n -] _]
-                set inf(imports,$n) [list [lindex $prefix 0]$m \
-                                          [lindex $prefix 1]$m]
+               if {[info exists inf(map,$val,$n)]} {
+                   set v $inf(map,$val,$n)
+               } else {
+                   set v $n
+               }
+                set w [join [split $v -] _]
+                set inf(imports,$n) [list [lindex $prefix 0]$w \
+                                          [lindex $prefix 1]$w]
             }
             unset nam
             lex
@@ -1090,8 +1098,6 @@ proc asnModules {} {
                lex
                if {![string length $type]} return
            }
-
-
            if {[info exists inf(filename,$inf(module))]} {
                set fname $inf(filename,$inf(module))
            } else {
@@ -1109,10 +1115,12 @@ proc asnModules {} {
            }
            set file(outh) [open $inf(h-path)/$inf(h-dir)$inf(h-file) w]
 
-           if {![info exists inf(p-file)]} {
-               set inf(p-file) ${fname}-p.h
-           }
-           set file(outp) [open $inf(h-path)/$inf(h-dir)$inf(p-file) w]
+           if {0} {
+               if {![info exists inf(p-file)]} {
+                   set inf(p-file) ${fname}-p.h
+               }
+               set file(outp) [open $inf(h-path)/$inf(h-dir)$inf(p-file) w]
+            }
 
            set md [clock format [clock seconds]]
            
@@ -1124,26 +1132,29 @@ proc asnModules {} {
            puts $file(outh) "/* Module-H $inf(module) */"
            puts $file(outh) {}
 
-           puts $file(outp) "/* YC ${yc_version}: $md */"
-           puts $file(outp) "/* Module-P: $inf(module) */"
-           puts $file(outp) {}
-
-           puts $file(outc) "\#include <$inf(h-dir)$inf(p-file)>"
+           if {[info exists file(outp)]} {
+               puts $file(outp) "/* YC ${yc_version}: $md */"
+               puts $file(outp) "/* Module-P: $inf(module) */"
+               puts $file(outp) {}
+            }
 
+            if {[info exists inf(p-file)]} {
+               puts $file(outc) "\#include <$inf(h-dir)$inf(p-file)>"
+            } else {
+               puts $file(outc) "\#include <$inf(h-dir)$inf(h-file)>"
+            }
            puts $file(outh) "\#ifndef ${ppname}_H"
            puts $file(outh) "\#define ${ppname}_H"
            puts $file(outh) {}
            puts $file(outh) "\#include <$inf(h-dir)odr.h>"
-           
-           puts $file(outp) "\#ifndef ${ppname}_P_H"
-           puts $file(outp) "\#define ${ppname}_P_H"
-           puts $file(outp) {}
-           puts $file(outp) "\#include <$inf(h-dir)$inf(h-file)>"
-
+          
+            if {[info exists file(outp)]} { 
+               puts $file(outp) "\#ifndef ${ppname}_P_H"
+               puts $file(outp) "\#define ${ppname}_P_H"
+               puts $file(outp) {}
+               puts $file(outp) "\#include <$inf(h-dir)$inf(h-file)>"
 
-           puts $file(outp) "\#ifdef __cplusplus"
-           puts $file(outp) "extern \"C\" \{"
-           puts $file(outp) "\#endif"
+            }
            
            asnTagDefault
            if {[string compare $type :]} {
@@ -1161,6 +1172,9 @@ proc asnModules {} {
            } else {
                set f $file(outh)
            }
+           puts $f "\#ifdef __cplusplus"
+           puts $f "extern \"C\" \{"
+           puts $f "\#endif"
            for {set i 1} {$i < $inf(nodef)} {incr i} {
                puts $f $inf(var,$i)
                if {[info exists inf(asn,$i)]} {
@@ -1176,9 +1190,9 @@ proc asnModules {} {
                unset inf(var,$i)
                puts $f {}
            }
-           puts $file(outp) "\#ifdef __cplusplus"
-           puts $file(outp) "\}"
-           puts $file(outp) "\#endif"
+           puts $f "\#ifdef __cplusplus"
+           puts $f "\}"
+           puts $f "\#endif"
 
            if {[info exists inf(body,$inf(module),h)]} {
                puts $file(outh) $inf(body,$inf(module),h)
@@ -1187,16 +1201,20 @@ proc asnModules {} {
                puts $file(outc) $inf(body,$inf(module),c)
            }
            if {[info exists inf(body,$inf(module),p)]} {
-               puts $file(outp) $inf(body,$inf(module),p)
+                if {[info exists file(outp)]} {
+                   puts $file(outp) $inf(body,$inf(module),p)
+                }
            }
            puts $file(outh) "\#endif"
-           puts $file(outp) "\#endif"
+            if {[info exists file(outp)]} {
+               puts $file(outp) "\#endif"
+            }
            foreach f [array names file] {
                close $file($f)
            }
            unset inf(c-file)
            unset inf(h-file)
-           unset inf(p-file)
+           catch {unset inf(p-file)}
        }
     }
 }
@@ -1260,6 +1278,18 @@ proc asnBasicOBJECT {} {
     return {odr_oid {Odr_oid}}
 }
 
+proc asnBasicGeneralString {} {
+    return {odr_generalstring char}
+}
+
+proc asnBasicVisibleString {} {
+    return {odr_visiblestring char}
+}
+
+proc asnBasicGeneralizedTime {} {
+    return {odr_generalizedtime char}
+}
+
 proc asnBasicANY {} {
     upvar name name
     global inf
index 2c0d122..ec197c6 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.5 1999-12-08 13:10:48 adam Exp $
+# $Id: Makefile.in,v 1.6 1999-12-16 23:36:19 adam Exp $
 
 SHELL=/bin/sh
 
@@ -33,8 +33,6 @@ CF=z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \
 
 all: $(LIB) 
 
-comp: $(CF) z-date.c z-univ.c zes-update.c
-
 yc-tst: $(O) $(LIB)
        $(CC) $(CFLAGS) $(O) -o yc-tst $(LIB) $(LIBS)
 
@@ -44,16 +42,16 @@ $(LIB): $(PO)
        ar qc $(LIB) $(PO)
        $(RANLIB) $(LIB)
 
-$(CF) ../include/z-accdes1.h: z.tcl z3950v3.asn ../util/yc.tcl
+$(CF) ../include/yaz/z-accdes1.h: z.tcl z3950v3.asn ../util/yc.tcl
        ../util/yc.tcl -d z.tcl -i yaz -I ../include $(YCFLAGS) z3950v3.asn
 
-z-date.c ../include/z-date.h: z.tcl datetime.asn ../util/yc.tcl
+z-date.c ../include/yaz/z-date.h: z.tcl datetime.asn ../util/yc.tcl
        ../util/yc.tcl -d z.tcl -i yaz -I ../include $(YCFLAGS) datetime.asn
 
-z-univ.c ../include/z-univ.h: z.tcl univres.asn
+z-univ.c ../include/yaz/z-univ.h: z.tcl univres.asn
        ../util/yc.tcl -d z.tcl -i yaz -I ../include $(YCFLAGS) univres.asn
 
-zes-update.c ../include/zes-update.h: z.tcl esupdate.asn
+zes-update.c ../include/yaz/zes-update.h: z.tcl esupdate.asn
        ../util/yc.tcl -d z.tcl -i yaz -I ../include $(YCFLAGS) esupdate.asn
 
 .c.o:
@@ -65,7 +63,7 @@ clean:
 realclean: clean
        -rm -f z-*.[co] zes-*.[co]
 
-depend: z-core.c z-date.c z-univ.c zes-update.c ../include/z-accdes1.h ../include/z-date.h ../include/z-univ.h ../include/zes-update.h
+depend: z-core.c z-date.c z-univ.c zes-update.c ../include/yaz/z-accdes1.h ../include/yaz/z-date.h ../include/yaz/z-univ.h ../include/yaz/zes-update.h
        sed '/^#Depend/q' <Makefile >Makefile.tmp
        $(CPP) $(DEFS) -M *.c >>Makefile.tmp
        mv -f Makefile.tmp Makefile
index 065d000..9342d65 100644 (file)
@@ -1,5 +1,5 @@
 # YC Sample Config File for Z39.50
-# $Id: z.tcl,v 1.1 1999-06-08 10:10:16 adam Exp $
+# $Id: z.tcl,v 1.2 1999-12-16 23:36:19 adam Exp $
 # ----------------------------------------------------------
 # Prefix Specifications
 #  
@@ -324,18 +324,6 @@ set filename($m) z-univ
 # ----------------------------------------------------------
 # "Constructed" types defined by means of C-types are declared here.
 # Each function returns the C-handler and the C-type.
-proc asnBasicGeneralString {} {
-    return {odr_generalstring char}
-}
-
-proc asnBasicVisibleString {} {
-    return {odr_visiblestring char}
-}
-
-proc asnBasicGeneralizedTime {} {
-    return {odr_generalizedtime char}
-}
-
 proc asnBasicEXTERNAL {} {
     return {z_External Z_External}
 }
index 69c6a4b..988ae35 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (C) 1995-1999, Index Data
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile.in,v 1.8 1999-11-30 13:47:12 adam Exp $
+# $Id: Makefile.in,v 1.9 1999-12-16 23:36:19 adam Exp $
 
 SHELL=/bin/sh
 
@@ -18,9 +18,7 @@ LIBDIR=../lib
 SHELL=/bin/sh
 INCLUDE=-I../include -I. -I../../xtimosi/src
 DEFS=$(INCLUDE) $(CDEFS)
-LIB=$(LIBDIR)/libserver.a 
-YAZLIBS=$(LIBDIR)/libserver.a $(LIBDIR)/libzutil.a $(LIBDIR)/libasn.a \
-  $(LIBDIR)/libodr.a $(LIBDIR)/libcomstack.a $(LIBMOSI) $(LIBDIR)/libutil.a
+YAZLIBS=$(LIBDIR)/libyaz.a
 PROG=yaz-ztest
 PROGO=ztest.o read-grs.o
 RANLIB=ranlib
index 6e88907..b9e0c38 100644 (file)
@@ -7,7 +7,10 @@
  *    Chas Woodfield, Fretwell Downing Datasystems.
  *
  * $Log: ztest.c,v $
- * Revision 1.27  1999-11-30 13:47:12  adam
+ * Revision 1.28  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.27  1999/11/30 13:47:12  adam
  * Improved installation. Moved header files to include/yaz.
  *
  * Revision 1.26  1999/08/27 09:40:32  adam
 #include <yaz/backend.h>
 #include <yaz/log.h>
 
+#ifdef ASN_COMPILED
+#include <yaz/ill.h>
+#endif
+
 Z_GenericRecord *read_grs1(FILE *f, ODR o);
 
 int ztest_search (void *handle, bend_search_rr *rr);
@@ -185,6 +192,35 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr)
                yaz_log(LOG_LOG, "setId: %s", n->resultSetItem->resultSetId);
                yaz_log(LOG_LOG, "item: %d", *n->resultSetItem->item);
            }
+#ifdef ASN_COMPILED
+           if (n->itemRequest)
+           {
+               Z_External *r = (Z_External*) n->itemRequest;
+               ILL_ItemRequest *item_req = 0;
+               if (r->direct_reference)
+               {
+                   oident *ent = oid_getentbyoid(r->direct_reference);
+                   if (ent)
+                       yaz_log(LOG_LOG, "ItemRequest %s", ent->desc);
+                   if (ent && ent->value == VAL_ISO_ILL_1)
+                   {
+                       if (r->which == ODR_EXTERNAL_single)
+                       {
+                           odr_setbuf(rr->decode,
+                                      r->u.single_ASN1_type->buf,
+                                      r->u.single_ASN1_type->len, 0);
+                           
+                           ill_ItemRequest (rr->decode, &item_req, 0, 0);
+                       }
+                   }
+               }
+               if (item_req)
+               {
+                   yaz_log (LOG_LOG, "ILL protocol version = %d",
+                            *item_req->protocol_version_num);
+               }
+           }
+#endif
        }
        break;
        }
@@ -345,7 +381,7 @@ char *marc_read(FILE *inf, ODR odr)
 static char *dummy_database_record (int num, ODR odr)
 {
     FILE *inf = fopen ("dummy-records", "r");
-    char *buf;
+    char *buf = 0;
 
     if (!inf)
        return NULL;
index 4ad90da..d0fd48e 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: query.c,v $
- * Revision 1.2  1999-06-09 14:01:33  adam
+ * Revision 1.3  1999-12-16 23:36:19  adam
+ * Implemented ILL protocol. Minor updates ASN.1 compiler.
+ *
+ * Revision 1.2  1999/06/09 14:01:33  adam
  * Fixed for compiled ASN.1.
  *
  * Revision 1.1  1999/06/08 10:10:16  adam
@@ -26,8 +29,8 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <odr.h>
-#include <proto.h>
+#include <yaz/odr.h>
+#include <yaz/proto.h>
 
 static Z_Complex *makecomplex(ODR o, char **buf);
 static Z_Operand *makesimple(ODR o, char **buf);