X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Fasn.xml;h=bb84b528260101bf189fbd722ac0062535e331dd;hb=d4fb090b5d0d63b8fc2a8060c9869e8fa86dcbb8;hp=453e856af5bbc63be04bea23407266cf7fe05101;hpb=fe4182bf1ca7bebcb3172cde916d4467c2154e7b;p=yaz-moved-to-github.git diff --git a/doc/asn.xml b/doc/asn.xml index 453e856..bb84b52 100644 --- a/doc/asn.xml +++ b/doc/asn.xml @@ -1,9 +1,8 @@ - - The ASN Module - Introduction + The Z39.50 ASN.1 Module + Introduction The &asn; module provides you with a set of C struct definitions for the - various PDUs of the protocol, as well as for the complex types + various PDUs of the Z39.50 protocol, as well as for the complex types appearing within the PDUs. For the primitive data types, the C representation often takes the form of an ordinary C language type, such as int. For ASN.1 constructs that have no direct @@ -11,8 +10,15 @@ the &odr; module (see section The ODR Module) provides auxiliary definitions. + + The &asn; module is located in sub directory z39.50. + There you'll find C files that implements encoders and decoders for the + Z39.50 types. You'll also find the protocol definitions: + z3950v3.asn, esupdate.asn, + and others. + - Preparing PDUs + Preparing PDUs A structure representing a complex ASN.1 type doesn't in itself contain the @@ -47,8 +53,8 @@ structure before freeing the structure itself. - You can use the odr_malloc() function (see section - Using ODR for details). When you use + You can use the odr_malloc() function (see + for details). When you use odr_malloc(), you can release all of the allocated data in a single operation, independent of any pointers and relations between the data. odr_malloc() is based on a @@ -110,7 +116,7 @@ As well as the individual PDU functions, a function zget_APDU() is provided, which allocates - a toplevel Z-APDU of the type requested: + a top-level Z-APDU of the type requested: @@ -125,69 +131,7 @@ - Object Identifiers - - When you refer to object identifiers in your application, you need to - be aware that SR and Z39.50 use two different set of OIDs to refer to - the same objects. To handle this easily, &yaz; provides a utility module - to &asn; which provides an internal representation of the OIDs used in - both protocols. Each oid is described by a structure: - - - -typedef struct oident -{ - enum oid_proto proto; - enum oid_class class; - enum oid_value value; - int oidsuffix[OID_SIZE]; - char *desc; -} oident; - - - - The proto field can be set to either - PROTO_SR or PROTO_Z3950. - The class might be, say, - CLASS_RECSYN, and the value might be - VAL_USMARC for the USMARC record format. Functions - - - -int *oid_ent_to_oid(struct oident *ent, int *dst); -struct oident *oid_getentbyoid(int *o); - - - - are provided to map between object identifiers and database entries. - If you store a member of the oid_proto type in - your association state information, it's a simple matter, at runtime, - to generate the correct OID when you need it. For decoding, you can - simply ignore the proto field, or if you're strict, you can verify - that your peer is using the OID family from the correct protocol. - The desc field is a short, human-readable name - for the PDU, useful mainly for diagnostic output. - - - - - The old function oid_getoidbyent still exists but - is not thread safe. Use oid_ent_to_oid instead - and pass an array of size OID_SIZE. - - - - - - Plans are underway to merge the two protocols into a single - definition, with one set of object identifiers. When this happens, the - oid module will no longer be required to support protocol - independence, but it should still be useful as a simple OID database. - - - - - EXTERNAL Data + EXTERNAL Data In order to achieve extensibility and adaptability to different @@ -264,7 +208,7 @@ typedef struct Z_External - Z_ext_typeent *z_ext_gettypebyref(oid_value ref); + Z_ext_typeent *z_ext_gettypebyref(const oid *oid); @@ -278,7 +222,7 @@ typedef struct Z_External typedef struct Z_ext_typeent { - oid_value dref; /* the direct-reference OID value. */ + int oid[OID_SIZE]; /* the direct-reference OID. */ int what; /* discriminator value for the external CHOICE */ Odr_fun fun; /* decoder function */ } Z_ext_typeent; @@ -301,8 +245,8 @@ typedef struct Z_ext_typeent z_ext_gettypebyref to look for the provided direct-reference. If the return value is different from NULL, you can use the provided - function to decode the BER string (see section - Using ODR). + function to decode the BER string (see + ). @@ -333,18 +277,19 @@ typedef struct Z_ext_typeent - PDU Contents Table + PDU Contents Table We include, for reference, a listing of the fields of each top-level PDU, as well as their default settings. - Default settings for PDU Initialize Request +
+ Default settings for PDU Initialize Request - - - + + + Field @@ -372,10 +317,10 @@ typedef struct Z_ext_typeent idAuthenticationZ_IdAuthenticationNULL - implementationIdchar*"YAZ (id=81)" + implementationIdchar*"81" - implementationNamechar*"Index Data/YAZ" + implementationNamechar*"YAZ" implementationVersionchar*YAZ_VERSION @@ -390,12 +335,13 @@ typedef struct Z_ext_typeent
- Default settings for PDU Initialize + <table frame="top" id="asn.default.initialize.response"> + <title>Default settings for PDU Initialize Response - - - + + + Field @@ -423,10 +369,10 @@ typedef struct Z_ext_typeent resultbool_tTRUE - implementationIdchar*"YAZ (id=81)" + implementationIdchar*"id)" - implementationNamechar*"Index Data/YAZ" + implementationNamechar*"YAZ" implementationVersionchar*YAZ_VERSION @@ -441,11 +387,12 @@ typedef struct Z_ext_typeent
- Default settings for PDU Search Request +
+ Default settings for PDU Search Request - - - + + + Field @@ -503,11 +450,12 @@ typedef struct Z_ext_typeent
- Default settings for PDU Search Response +
+ Default settings for PDU Search Response - - - + + + Field @@ -552,11 +500,12 @@ typedef struct Z_ext_typeent
- Default settings for PDU Present Request +
+ Default settings for PDU Present Request - - - + + + Field @@ -605,11 +554,12 @@ typedef struct Z_ext_typeent
- Default settings for PDU Present Response +
+ Default settings for PDU Present Response - - - + + + Field @@ -628,7 +578,7 @@ typedef struct Z_ext_typeent nextResultSetPositionint0 - presentStatusintZ_PRES_SUCCESS + presentStatusintZ_PresentStatus_success recordsZ_RecordsNULL @@ -640,12 +590,13 @@ typedef struct Z_ext_typeent
- Default settings for Delete Result Set Request + <table frame="top" id="asn.default.delete.result.set.request"> + <title>Default settings for Delete Result Set Request - - - + + + Field @@ -658,7 +609,7 @@ typedef struct Z_ext_typeent Z_ReferenceIdNULL - deleteFunctionintZ_DeleteRequest_list + deleteFunctionintZ_DeleteResultSetRequest_list num_idsint0 @@ -673,12 +624,13 @@ typedef struct Z_ext_typeent
- Default settings for Delete Result Set Response + <table frame="top" id="asn.default.delete.result.set.response"> + <title>Default settings for Delete Result Set Response - - - + + + Field @@ -718,12 +670,13 @@ typedef struct Z_ext_typeent
- Default settings for Scan Request + <table frame="top" id="asn.default.scan.request"> + <title>Default settings for Scan Request - - - + + + Field @@ -763,12 +716,13 @@ typedef struct Z_ext_typeent
- Default settings for Scan Response + <table frame="top" id="asn.default.scan.response"> + <title>Default settings for Scan Response - - - + + + Field @@ -806,12 +760,12 @@ typedef struct Z_ext_typeent
- Default settings for Trigger Resource - Control Request +
+ Default settings for Trigger Resource Control Request - - - + + + Field @@ -842,12 +796,12 @@ typedef struct Z_ext_typeent
- Default settings for Resource - Control Request +
+ Default settings for Resource Control Request - - - + + + Field @@ -882,12 +836,12 @@ typedef struct Z_ext_typeent
- Default settings for Resource - Control Response +
+ Default settings for Resource Control Response - - - + + + Field @@ -913,12 +867,12 @@ typedef struct Z_ext_typeent
- Default settings for Access - Control Request +
+ Default settings for Access Control Request - - - + + + Field @@ -944,12 +898,12 @@ typedef struct Z_ext_typeent
- Default settings for Access - Control Response +
+ Default settings for Access Control Response - - - + + + Field @@ -978,11 +932,12 @@ typedef struct Z_ext_typeent
- Default settings for Segment +
+ Default settings for Segment - - - + + + Field @@ -1010,11 +965,12 @@ typedef struct Z_ext_typeent
- Default settings for Close +
+ Default settings for Close - - - + + + Field @@ -1060,7 +1016,7 @@ typedef struct Z_ext_typeent sgml-indent-step:1 sgml-indent-data:t sgml-parent-document: "yaz.xml" - sgml-local-catalogs: "../../docbook/docbook.cat" + sgml-local-catalogs: nil sgml-namecase-general:t End: -->