1# z3950.cnf
2# Conformation file for the NISO Z39.50 Information Retrieval protocol
3# Copyright 2018 Craig Jackson <cejackson51@gmail.com>
4
5# $Id$
6
7#.MODULE_IMPORT
8
9#.EXPORTS
10
11#.PDU
12#Z39-50-APDU-1995
13
14#.NO_EMIT
15
16#.TYPE_RENAME
17
18#.FIELD_RENAME
19AttributeList/_untag/_item attributeList_item
20OtherInformation/_untag/_item otherInformation_item
21RPNStructure/rpnRpnOp/op operatorRpnOp
22RPNStructure/op operandRpnOp
23SearchResponse/resultSetStatus search_resultSetStatus
24SortResponse/resultSetStatus sort_resultSetStatus
25AttributeElement/attributeValue/numeric attributeValue_numeric
26AttributeElement/attributeValue/complex attributeValue_complex
27AttributeElement/attributeValue/complex/list attributeValue_complex_list
28AttributeElement/attributeType attributeElement_attributeType
29ListStatuses/_item/id listStatuses_id
30CompSpec/generic compSpec_generic
31SortElement/generic sortElement_generic
32ScanResponse/entries scanResponse_entries
33ListEntries/entries listEntries_entries
34Specification/elementSpec specification_elementSpec
35SortKey/elementSpec sortKey_elementSpec
36SortKey/sortAttributes/list sortAttributes_list
37SortKey/sortAttributes/id sortAttributes_id
38PresentRequest/recordComposition/complex recordComposition_complex
39DiagFormat/recordSyntax diagFormat_recordSyntax
40DiagFormat/sort/dbSpecific diagFormat_sort_dbSpecific
41DiagFormat/sort/tooMany diagFormat_sort_tooMany
42DiagnosticFormat/_item/diagnostic diagnosticFormat_item_diagnostic
43DiagFormat/proximity diagFormat_proximity
44DiagFormat/proximity/exclusion diagFormat_proximity_exclusion
45DiagFormat/proximity/ordered diagFormat_proximity_ordered
46DiagFormat/proximity/unit diagFormat_proximity_unit
47DiagFormat/accessCtrl/oid diagFormat_accessCtrl_oid
48DiagFormat/accessCtrl/simple diagFormat_accessCtrl_simple
49DiagFormat/term diagFormat_term
50SortKeyDetails/caseSensitivity sortKeyDetails_caseSensitivity
51SortKeyDetails/sortType/structured sortKeyDetails_sortType_structured
52SortKeyDetails/sortType/numeric sortKeyDetails_sortType_numeric
53PrivateCapabilities/operators privateCapabilities_operators
54PromptId/enummeratedPrompt/type promptId_enummeratedPrompt_type
55ExtendedServicesInfo/waitAction extendedServicesInfo_waitAction
56NetworkAddress/other networkAddress_other
57NetworkAddress/other/address networkAddress_other_address
58NetworkAddress/other/type networkAddress_other_type
59AttributeDescription/attributeValue attributeDescription_attributeValue
60AttributeTypeDetails/attributeValues attributeTypeDetails_attributeValues
61AttributeTypeDetails/attributeValues/_item attributeTypeDetails_attributeValues_item
62AttributeOccurrence/attributeValues attributeOccurrence_attributeValues
63AttributeValue/value attributeValue_value
64DRNType/userId dRNType_userId
65DES-RN-Object/challenge dES_RN_Object_challenge
66DES-RN-Object/response rES_RN_Object_response
67VariantSetInfo/variants variantSetInfo_variants
68Variant/triples/_item/value variant_triples_item_value
69Variant/triples/_item/value/unit variant_triples_item_value_unit
70UnitType/units unitType_units
71UnitInfo/units unitInfo_units
72ValueDescription/unit valueDescription_unit
73ProximitySupport/unitsSupported/_item/private/unit proximitySupport_unitsSupported_item_private_unit
74ProximitySupport/unitsSupported/_item/private proximitySupport_unitsSupported_item_private
75ProximitySupport/unitsSupported/_item/known proximitySupport_unitsSupported_item_known
76Usage/type usage_type
77FormatSpec/type formatSpec_type
78ExtendedServicesInfo/type extendedServicesInfo_type
79QueryExpression/term queryExpression_term
80QueryTypeDetails/rpn queryTypeDetails_rpn
81QueryTypeDetails/private queryTypeDetails_private
82BriefBib/title briefBib_title
83Charge/text charge_text
84OCLC-UserInformation/text oCLC-UserInformation_text
85CircRecord/restrictions circRecord_restrictions
86ResourceControlRequest/responseRequired resourceControlRequest_responseRequired
87KRBObject/challenge kRBObject_challenge
88KRBObject/response kRBObject_response
89CompSpec/recordSyntax compSpec_recordSyntax
90DatabaseInfo/name databaseInfo_name
91DatabaseInfo/nicknames databaseInfo_nicknames
92DatabaseInfo/nicknames/_item databaseInfo_nicknames_item
93NamePlusRecord/name namePlusRecord_name
94BriefBib/format briefBib_format
95TagSetInfo/elements tagSetInfo_elements
96ElementSetDetails/elementSetName elementSetDetails_elementSetName
97PrivateCapabilities/description privateCapabilities_description
98TaskPackage/description taskPackage_description
99ElementData/diagnostic elementData_diagnostic
100Challenge/_item/diagnostic challenge_item_diagnostic
101Challenge/_item/dataType challenge_item_dataType
102Challenge/_item/promptInfo/character challenge_item_promptInfo_character
103ElementInfo/dataType elementInfo_dataType
104TaggedElement/content taggedElement_content
105CategoryInfo/category categoryInfo_category
106TermListDetails/attributes termListDetails_attributes
107AttributeSetInfo/attributes attributeSetInfo_attributes
108ExtendedServicesRequest/description extendedServicesRequest_description
109
110#.END
111
112#.REGISTER
113Explain-Record  B "1.2.840.10003.5.100" "Explain-record"
114SutrsRecord     B "1.2.840.10003.5.101" "Sutrs-record"
115OPACRecord      B "1.2.840.10003.5.102" "OPAC-record"
116BriefBib        B "1.2.840.10003.5.103" "Summary-record"
117GenericRecord   B "1.2.840.10003.5.105" "GRS-1-record"
118TaskPackage     B "1.2.840.10003.5.106" "ESTaskPackage"
119DiagnosticFormat  B "1.2.840.10003.4.2" "diag-1"
120PromptObject    B "1.2.840.10003.8.1" "Prompt-1"
121DES-RN-Object   B "1.2.840.10003.8.2" "DES-1"
122KRBObject       B "1.2.840.10003.8.3" "KRB-1"
123SearchInfoReport B "1.2.840.10003.10.1" "SearchResult-1"
124OCLC-UserInformation B "1.2.840.10003.10.1000.17.1" "OCLC-UserInfo-1"
125
126#.FN_HDR PDU
127  gint choice;
128#.FN_PARS PDU VAL_PTR=&choice
129#.FN_FTR PDU
130  if (choice >= 0) {
131    packet_info *pinfo = actx->pinfo;
132    gint32 tag = PDU_choice[choice].tag;
133
134    col_set_str(pinfo->cinfo, COL_INFO,
135      val_to_str_const(tag, z3950_PDU_vals, "Unknown Z39.50 PDU"));
136  }
137
138#.FN_BODY Query/type-0
139/*XXX Not implemented yet */
140
141#.FN_BODY ReferenceId
142  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
143              hf_index, BER_CLASS_CON, 2, TRUE,
144              dissect_z3950_printable_OCTET_STRING);
145
146#.FN_BODY Term/general
147  offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
148              hf_index, BER_CLASS_CON, 2, TRUE,
149              dissect_z3950_printable_OCTET_STRING);
150
151#.FN_HDR AttributeSetId
152  tvbuff_t *oid_tvb=NULL;
153
154#.FN_PARS AttributeSetId VAL_PTR=&oid_tvb
155#.FN_FTR AttributeSetId
156  if (oid_tvb) {
157    packet_info *pinfo = actx->pinfo;
158    guint len = tvb_reported_length_remaining(oid_tvb, 0);
159    gchar *oid_str = oid_encoded2string(pinfo->pool,
160                                        tvb_get_ptr(oid_tvb, 0, len), len);
161    gint attribute_set_idx = Z3950_ATSET_UNKNOWN;
162    z3950_atinfo_t *atinfo_data;
163
164    if (g_strcmp0(oid_str, Z3950_ATSET_BIB1_OID) == 0) {
165      attribute_set_idx = Z3950_ATSET_BIB1;
166    }
167    if ((atinfo_data = (z3950_atinfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_ATINFO_KEY)) == NULL) {
168
169      atinfo_data = wmem_new0(pinfo->pool, z3950_atinfo_t);
170      atinfo_data->atsetidx = attribute_set_idx;
171      p_add_proto_data(pinfo->pool, pinfo,
172                       proto_z3950, Z3950_ATINFO_KEY, atinfo_data);
173    }
174    else {
175      atinfo_data->atsetidx = attribute_set_idx;
176    }
177  }
178
179#.FN_HDR AttributeElement/attributeType
180  gint att_type=0;
181  packet_info *pinfo = actx->pinfo;
182  z3950_atinfo_t *atinfo_data;
183#.FN_PARS AttributeElement/attributeType VAL_PTR=&att_type
184#.FN_FTR AttributeElement/attributeType
185  atinfo_data = (z3950_atinfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_ATINFO_KEY);
186  if (atinfo_data && atinfo_data->atsetidx == Z3950_ATSET_BIB1) {
187    proto_item_append_text(actx->created_item, " (%s)",
188      val_to_str(att_type, z3950_bib1_att_types, "Unknown bib-1 attributeType %d"));
189    atinfo_data->attype = att_type;
190  }
191#.FN_HDR AttributeElement/attributeValue/numeric
192  gint att_value=0;
193  packet_info *pinfo = actx->pinfo;
194  z3950_atinfo_t *atinfo_data;
195  const value_string *att_value_string = NULL;
196#.FN_PARS AttributeElement/attributeValue/numeric VAL_PTR=&att_value
197#.FN_FTR AttributeElement/attributeValue/numeric
198  atinfo_data = (z3950_atinfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_ATINFO_KEY);
199  if (atinfo_data && atinfo_data->atsetidx == Z3950_ATSET_BIB1) {
200    switch (atinfo_data->attype) {
201    case Z3950_BIB1_AT_USE:
202      att_value_string = z3950_bib1_at_use;
203      break;
204    case Z3950_BIB1_AT_RELATION:
205      att_value_string = z3950_bib1_at_relation;
206      break;
207    case Z3950_BIB1_AT_POSITION:
208      att_value_string = z3950_bib1_at_position;
209      break;
210    case Z3950_BIB1_AT_STRUCTURE:
211      att_value_string = z3950_bib1_at_structure;
212      break;
213    case Z3950_BIB1_AT_TRUNCATION:
214      att_value_string = z3950_bib1_at_truncation;
215      break;
216    case Z3950_BIB1_AT_COMPLETENESS:
217      att_value_string = z3950_bib1_at_completeness;
218      break;
219    default:
220      att_value_string = NULL;
221    }
222    if (att_value_string) {
223      proto_item_append_text(actx->created_item, " (%s)",
224        val_to_str(att_value, att_value_string, "Unknown bib-1 attributeValue %d"));
225    }
226  }
227#.FN_HDR DefaultDiagFormat/diagnosticSetId
228  tvbuff_t *oid_tvb=NULL;
229
230#.FN_PARS DefaultDiagFormat/diagnosticSetId VAL_PTR=&oid_tvb
231#.FN_FTR DefaultDiagFormat/diagnosticSetId
232  if (oid_tvb) {
233    packet_info *pinfo = actx->pinfo;
234    guint len = tvb_reported_length_remaining(oid_tvb, 0);
235    gchar *oid_str = oid_encoded2string(pinfo->pool,
236                                        tvb_get_ptr(oid_tvb, 0, len), len);
237    gint diagset_idx = Z3950_DIAGSET_UNKNOWN;
238    z3950_diaginfo_t *diaginfo_data;
239
240    if (g_strcmp0(oid_str, Z3950_DIAGSET_BIB1_OID) == 0) {
241      diagset_idx = Z3950_DIAGSET_BIB1;
242    }
243    if ((diaginfo_data = (z3950_diaginfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_DIAGSET_KEY)) == NULL) {
244
245      diaginfo_data = wmem_new0(pinfo->pool, z3950_diaginfo_t);
246      diaginfo_data->diagsetidx = diagset_idx;
247      p_add_proto_data(pinfo->pool, pinfo,
248                       proto_z3950, Z3950_DIAGSET_KEY, diaginfo_data);
249    }
250    else {
251      diaginfo_data->diagsetidx = diagset_idx;
252    }
253  }
254
255#.FN_HDR DefaultDiagFormat/condition
256  gint diag_condition=0;
257  packet_info *pinfo = actx->pinfo;
258  z3950_diaginfo_t *diaginfo_data;
259#.FN_PARS DefaultDiagFormat/condition VAL_PTR=&diag_condition
260#.FN_FTR DefaultDiagFormat/condition
261  diaginfo_data = (z3950_diaginfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_DIAGSET_KEY);
262  if (diaginfo_data && diaginfo_data->diagsetidx == Z3950_DIAGSET_BIB1) {
263    proto_item_append_text(actx->created_item, " (%s)",
264      val_to_str(diag_condition, z3950_bib1_diagconditions, "Unknown bib-1 diagnostic %d"));
265    diaginfo_data->diagcondition = diag_condition;
266  }
267#
268# Editor modelines  -  https://www.wireshark.org/tools/modelines.html
269#
270# Local variables:
271# c-basic-offset: 2
272# tab-width: 8
273# indent-tabs-mode: nil
274# End:
275#
276# vi: set shiftwidth=2 tabstop=8 expandtab autoindent:
277# :indentSize=2:tabSize=8:noTabs=true:
278#
279