|
|
Index Data > YAZ > YAZ User's Guide and Reference > EXTERNAL Data
In order to achieve extensibility and adaptability to different
application domains, the new version of the protocol defines many
structures outside of the main ASN.1 specification, referencing them
through ASN.1 EXTERNAL constructs. To simplify the construction and
access to the externally referenced data, the Z39.50 ASN.1 module defines a
specialized version of the EXTERNAL construct, called
typedef struct Z_External
{
Odr_oid *direct_reference;
int *indirect_reference;
char *descriptor;
enum
{
/* Generic types */
Z_External_single = 0,
Z_External_octet,
Z_External_arbitrary,
/* Specific types */
Z_External_SUTRS,
Z_External_explainRecord,
Z_External_resourceReport1,
Z_External_resourceReport2
...
} which;
union
{
/* Generic types */
Odr_any *single_ASN1_type;
Odr_oct *octet_aligned;
Odr_bitmask *arbitrary;
/* Specific types */
Z_SUTRS *sutrs;
Z_ExplainRecord *explainRecord;
Z_ResourceReport1 *resourceReport1;
Z_ResourceReport2 *resourceReport2;
...
} u;
} Z_External;
When decoding, the Z39.50 ASN.1 module will attempt to determine which
syntax describes the data by looking at the reference fields
(currently only the direct-reference). For ASN.1 structured data, you
need only consult the
Some servers return ASN.1 structured data values (eg. database
records) as BER-encoded records placed in the
Z_ext_typeent *z_ext_gettypebyref(const oid *oid);
Can be used to retrieve information about the known, external data
types. The function return a pointer to a static area, or NULL, if no
match for the given direct reference is found. The
typedef struct Z_ext_typeent
{
int oid[OID_SIZE]; /* the direct-reference OID. */
int what; /* discriminator value for the external CHOICE */
Odr_fun fun; /* decoder function */
} Z_ext_typeent;
The
If you receive an EXTERNAL which contains an octet-string value that
you suspect of being an ASN.1-structured data value, you can use
If you want to send EXTERNALs containing ASN.1-structured values in the occtet-aligned branch of the CHOICE, this is possible too. However, on the encoding phase, it requires a somewhat involved juggling around of the various buffers involved.
If you need to add new, externally defined data types, you must update
the struct above, in the source file NoteEventually, the EXTERNAL processing will most likely automatically insert the correct OIDs or indirect-refs. First, however, we need to determine how application-context management (specifically the presentation-context-list) should fit into the various modules. |
|||
|
|
||||
| Copyright Index Data ApS 2008 | ||||