source: trunk/gsdl/packages/yaz/doc/yaz-1.html@ 1343

Last change on this file since 1343 was 1343, checked in by johnmcp, 24 years ago

Added the YAZ toolkit source to the packages directory (for z39.50 stuff)

  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2<HTML>
3<HEAD>
4 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5 <TITLE>YAZ User's Guide and Reference: Introduction</TITLE>
6 <LINK HREF="yaz-2.html" REL=next>
7
8 <LINK HREF="yaz.html#toc1" REL=contents>
9</HEAD>
10<BODY>
11<A HREF="yaz-2.html">Next</A>
12Previous
13<A HREF="yaz.html#toc1">Contents</A>
14<HR>
15<H2><A NAME="s1">1. Introduction</A></H2>
16
17<P>The <B>YAZ</B> toolkit offers several different levels of access to the
18Z39.50 and SR protocols. The level that you need to use depends on
19your requirements, and the role (server or client) that you
20want to implement.
21<P>The basic level, which is independent of the role, consists of three
22primary interfaces:
23<P>
24<UL>
25<LI><B>ASN</B>, which provides a C representation of the Z39.50/SR protocol
26packages (PDUs).</LI>
27<LI><B>ODR</B>, which encodes and decodes the packages according to the BER
28specification.</LI>
29<LI><B>COMSTACK</B>, which exchanges the encoded packages with a peer process
30over a network.</LI>
31</UL>
32<P>The ASN module represents the ASN.1 definition of the
33SR/Z39.50 protocol. It establishes a set of type and
34structure definitions, with one structure for each of the top-level
35PDUs, and one structure or type for each of the contained ASN.1 types.
36For primitive types, or other types that are defined by the ASN.1
37standard itself (such as the EXTERNAL type), the C representation is provided
38by the <B>ODR</B> (Open Data Representation) subsystem.
39<P><B>ODR</B> is a basic mechanism for representing an
40ASN.1 type in the C programming language, and for implementing BER
41encoders and decoders for values of that type. The types defined in
42the <B>ASN</B>
43module generally have the prefix <CODE>Z_</CODE>, and a suffix corresponding to
44the name of the type in the ASN.1
45specification of the protocol (generally Z39.50-1995). In the case of
46base types (those originating in the ASN.1 standard itself), the prefix
47<CODE>Odr_</CODE> is sometimes seen. Either way, look for
48the actual definition in either <CODE>proto.h</CODE> (for the types from the
49protocol), <CODE>odr.h</CODE> (for the primitive ASN.1 types, or <CODE>odr_use.h</CODE> (for the
50ASN.1 <I>useful</I> types). The <B>ASN</B> library also provides functions (which
51are, in turn, defined using <B>ODR</B> primitives) for encoding and decoding data
52values. Their general form is
53<P>
54<BLOCKQUOTE><CODE>
55<PRE>
56int z_xxx(ODR o, Z_xxx **p, int optional, const char *name);
57</PRE>
58</CODE></BLOCKQUOTE>
59<P>(note the lower-case &quot;z&quot; in the function name)
60<P><I>NOTE: If you are using the premade definitions of the <B>ASN</B> module, and
61you are not adding new protocol of your own, the only parts of ODR
62that you need to worry about are documented in section
63<A HREF="yaz-5.html#odr-use">Using ODR</A>.</I>
64<P>When you have created a BER-encoded buffer, you can use the <B>COMSTACK</B>
65subsystem to transmit (or receive) data over the network. The <B>COMSTACK</B>
66module provides simple functions for establishing a connection
67(passively or actively, depending on the role of your application),
68and for exchanging BER-encoded PDUs over that connection. When you
69create a connection endpoint, you need to specify what transport to
70use (OSI or TCP/IP), and which protocol you want to use (SR or
71Z39.50). For the remainer of the connection's lifetime, you don't have
72to worry about the underlying transport protocol at all - the <B>COMSTACK</B>
73will ensure that the correct mechanism is used.
74<P>We call the combined interfaces to <B>ODR</B>, <B>ASN</B>, and <B>COMSTACK</B> the service
75level API. It's the API that most closely models the Z39.50/SR
76service/protocol definition, and it provides unlimited access to all
77fields and facilities of the protocol definitions.
78<P>The reason that the <B>YAZ</B> service-level API is a conglomerate of the
79APIs from three different submodules is twofold. First, we wanted to allow the
80user a choice of different options for each major task. For instance,
81if you don't like the protocol API provided by <B>ODR</B>/<B>ASN</B>, you
82can use SNACC or BERUtils instead, and still have the benefits of the
83transparent transport approach of the <B>COMSTACK</B> module. Secondly,
84we realise that you may have to fit the toolkit into an existing
85event-processing structure, in a way that
86is incompatible with the <B>COMSTACK</B> interface or some other part of <B>YAZ</B>.
87<P>
88<HR>
89<A HREF="yaz-2.html">Next</A>
90Previous
91<A HREF="yaz.html#toc1">Contents</A>
92</BODY>
93</HTML>
Note: See TracBrowser for help on using the repository browser.