Z39.50: Implementation of Z39.50 Information Retrieval protocol

NISO Z39.50 is a protocol used by libraries and library vendors for information retrieval and catalog manipulation. It is defined using ASN.1 using BER encoding. It has an assigned TCP port of 210. This is an initial implementation.

Features:
- The Z39.50 standard OIDs are defined.
- The bib-1 attribute set is decoded.
- The bib-1 diagnostics are decoded.
- Some OCTET STRINGs which are nearly always printable ASCII are special-cased.
- The MARC (MAchine Readable Cataloging) format is decoded. Only the MARC21 variant is
  currently handled, but this is one of the most common variants. The most common tags
  are decoded. The MARC dissector is included in the Z39.50 dissector, but the code is
  structured in such away that it could be pulled out.

Todo:
- Add information to the Wiki about Z39.50.

As part of this work, the definition of isdigit_string() was fixed to avoid const complaints.

Change-Id: I29a7db53375ef8be83738a1ab98707761d878717
Reviewed-on: https://code.wireshark.org/review/31209
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Craig Jackson 2018-10-24 18:27:24 -04:00 committed by Anders Broman
parent c3e22f0ab5
commit 52b7c8929a
13 changed files with 17552 additions and 2 deletions

View File

@ -130,6 +130,7 @@ TPM 2.0
Ubiquiti Discovery Protocol (UBDP)
WireGuard
XnAP (5G)
Z39.50 Information Retrieval Protocol
PCOM protocol
--

View File

@ -608,6 +608,7 @@ set(DISSECTOR_PUBLIC_HEADERS
packet-yppasswd.h
packet-ypserv.h
packet-ypxfr.h
packet-z3950.h
packet-zbee.h
packet-zbee-aps.h
packet-zbee-nwk.h
@ -1880,6 +1881,7 @@ set(DISSECTOR_SRC
${CMAKE_CURRENT_SOURCE_DIR}/packet-yppasswd.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-ypserv.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-ypxfr.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-z3950.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-zbee-aps.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-zbee-nwk.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-zbee-nwk-gp.c

View File

@ -128,6 +128,7 @@ set(ASN1_SRC_DIRS
x509if
x509sat
xnap
z3950
${CUSTOM_ASN1_SRC_DIR}
)

View File

@ -0,0 +1,40 @@
# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
set( PROTOCOL_NAME z3950 )
set( PROTO_OPT )
set( EXPORT_FILES
${PROTOCOL_NAME}-exp.cnf
)
set( EXT_ASN_FILE_LIST
)
set( ASN_FILE_LIST
z3950.asn
z3950-oclc.asn
z3950-externals.asn
)
set( EXTRA_DIST
${ASN_FILE_LIST}
packet-${PROTOCOL_NAME}-template.c
${PROTOCOL_NAME}.cnf
)
set( SRC_FILES
${EXTRA_DIST}
${EXT_ASN_FILE_LIST}
)
set( A2W_FLAGS -b )
ASN2WRS()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
Z39-50-OCLC-UserInformation
{z39-50-userInformation local (1000) oclc (17) oclc-1 (1)} DEFINITIONS ::=
BEGIN
OCLC-UserInformation ::= SEQUENCE {
motd [1] IMPLICIT VisibleString OPTIONAL,
dblist SEQUENCE OF DBName OPTIONAL,
failReason [3] IMPLICIT BOOLEAN OPTIONAL,
text [2] IMPLICIT VisibleString OPTIONAL
}
DBName ::= [2] IMPLICIT VisibleString
END

View File

@ -0,0 +1,807 @@
ANSI-Z39-50-ObjectIdentifier DEFINITIONS ::=
BEGIN
z39-50 OBJECT IDENTIFIER ::=
{ iso (1) member-body (2) us (840) ansi-standard-Z39-50 (10003)}
-- thus {Z39-50} is shorthand for {1 2 840 10003}
Z39-50-APDU OBJECT IDENTIFIER ::= {Z39-50 2} -- See OID.3
-- and {Z39-50 2} is shorthand for {1 2 840 10003 2} and so on.
Z39-50-attributeSet OBJECT IDENTIFIER ::= {Z39-50 3} -- See Appendix ATR
z39-50-diagnostic OBJECT IDENTIFIER ::= {z39-50 4} -- See Appendix DIAG
z39-50-recordSyntax OBJECT IDENTIFIER ::= {z39-50 5} --See Appendix REC
Z39-50-resourceReport OBJECT IDENTIFIER ::= {Z39-50 7} --See Appendix RSC
Z39-50-accessControl OBJECT IDENTIFIER ::= {Z39-50 8} --See Appendix ACC
Z39-50-extendedService OBJECT IDENTIFIER ::= {Z39-50 9} --See Appendix EXT
Z39-50-userInfoFormat OBJECT IDENTIFIER ::= {Z39-50 10} --See Appendix USR
Z39-50-elementSpec OBJECT IDENTIFIER ::= {Z39-50 11} --See Appendix ESP
Z39-50-variantSet OBJECT IDENTIFIER ::= {Z39-50 12} --See Appendix VAR
Z39-50-schema OBJECT IDENTIFIER ::= {Z39-50 13} --See Appendix TAG
Z39-50-tagSet OBJECT IDENTIFIER ::= {Z39-50 14} --See Appendix TAG
Z39-50-negotiation OBJECT IDENTIFIER ::= {Z39-50 15}
Z39-50-query OBJECT IDENTIFIER ::= {Z39-50 16}
END
Z39-50-APDU-1995
-- OID for this definition, assigned in OID.3.1, is {Z39-50 2 1}
DEFINITIONS ::=
BEGIN -- Z39.50-1995 Maintenance Agency Official Text for ANSI/NISO Z39.50-1995 - July 1995
--
EXPORTS OtherInformation, Term,
AttributeSetId, AttributeList,
AttributeElement, ElementSetName, SortElement, DatabaseName, CompSpec,
Specification, Permissions, InternationalString, IntUnit, Unit,
StringOrNumeric, Query, Records, ResultSetId, DefaultDiagFormat, DiagRec;
--
PDU ::= CHOICE{
initRequest [20] IMPLICIT InitializeRequest,
initResponse [21] IMPLICIT InitializeResponse,
searchRequest [22] IMPLICIT SearchRequest,
searchResponse [23] IMPLICIT SearchResponse,
presentRequest [24] IMPLICIT PresentRequest,
presentResponse [25] IMPLICIT PresentResponse,
deleteResultSetRequest [26] IMPLICIT DeleteResultSetRequest,
deleteResultSetResponse [27] IMPLICIT DeleteResultSetResponse,
accessControlRequest [28] IMPLICIT AccessControlRequest,
accessControlResponse [29] IMPLICIT AccessControlResponse,
resourceControlRequest [30] IMPLICIT ResourceControlRequest,
resourceControlResponse [31] IMPLICIT ResourceControlResponse,
triggerResourceControlRequest [32] IMPLICIT TriggerResourceControlRequest,
resourceReportRequest [33] IMPLICIT ResourceReportRequest,
resourceReportResponse [34] IMPLICIT ResourceReportResponse,
scanRequest [35] IMPLICIT ScanRequest,
scanResponse [36] IMPLICIT ScanResponse,
-- [37] through [42] reserved
sortRequest [43] IMPLICIT SortRequest,
sortResponse [44] IMPLICIT SortResponse,
segmentRequest [45] IMPLICIT Segment,
extendedServicesRequest [46] IMPLICIT ExtendedServicesRequest,
extendedServicesResponse [47] IMPLICIT ExtendedServicesResponse,
close [48] IMPLICIT Close}
-- Initialize APDUs
--
InitializeRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
protocolVersion ProtocolVersion,
options Options,
preferredMessageSize [5] IMPLICIT INTEGER,
exceptionalRecordSize [6] IMPLICIT INTEGER,
-- idAuthentication [7] ANY OPTIONAL, see note below
idAuthentication [7] CHOICE{
open VisibleString,
idPass SEQUENCE {
groupId [0] IMPLICIT InternationalString OPTIONAL,
userId [1] IMPLICIT InternationalString OPTIONAL,
password [2] IMPLICIT InternationalString OPTIONAL },
anonymous NULL,
other EXTERNAL} OPTIONAL,
implementationId [110] IMPLICIT InternationalString OPTIONAL,
implementationName [111] IMPLICIT InternationalString OPTIONAL,
implementationVersion [112] IMPLICIT InternationalString OPTIONAL,
userInformationField [11] EXTERNAL OPTIONAL,
otherInfo OtherInformation OPTIONAL}
--Note:
-- For idAuthentication, the type ANY is retained
-- for compatibility with earlier versions.
-- For interoperability, the following is recommended:
-- IdAuthentication [7] CHOICE{
-- open VisibleString,
-- idPass SEQUENCE {
-- groupId [0] IMPLICIT InternationalString OPTIONAL,
-- userId [1] IMPLICIT InternationalString OPTIONAL,
-- password [2] IMPLICIT InternationalString OPTIONAL },
-- anonymous NULL,
-- other EXTERNAL
-- May use access control formats for 'other'. See Appendix 7 ACC.
--
InitializeResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
protocolVersion ProtocolVersion,
options Options,
preferredMessageSize [5] IMPLICIT INTEGER,
exceptionalRecordSize [6] IMPLICIT INTEGER,
result [12] IMPLICIT BOOLEAN,
-- relect = FALSE; Accept = TRUE
implementationId [110] IMPLICIT InternationalString OPTIONAL,
implementationName [111] IMPLICIT InternationalString OPTIONAL,
implementationVersion [112] IMPLICIT InternationalString OPTIONAL,
userInformationField [11] EXTERNAL OPTIONAL,
otherInfo OtherInformation OPTIONAL}
-- Begin auxiliary definitions for Init PDUs
ProtocolVersion ::= [3] IMPLICIT BIT STRING{
version-1 (0),
-- This bit should always be set, but does not
-- correspond to any Z39.50 version.
version-2 (1),
-- "Version 2 supported."
-- This bit should always be set.
version-3 (2)
-- "Version 3 supported."
-- Values higher than 'version-3' should be ignored. Both the Initialize
-- request and Initialize Response APDUs include a value string corresponding
-- to the supported versions. The highest common version is selected
-- for use. If there are no versions in common, "Result" in the Init Response
-- should indicate "reject."
-- Note: Versions 1 and 2 are identical. Systems supporting version 2 should
-- indicate support for version 1 as well, for interoperability with systems
-- that indicate support for version 1 only (e.g. ISO 10163-1991
-- implementations).
}
Options ::= [4] IMPLICIT BIT STRING{
search (0),
present (1),
delSet (2),
resourceReport (3),
triggerResourceCtrl (4),
resourceCtrl (5),
accessCtrl (6),
scan (7),
sort (8),
-- (9) (reserved)
extendedServices (10),
level-1Segmentation (11),
level-2Segmentation (12),
concurrentOperations (13),
namedResultSets (14)}
-- end auxiliary definitions for Init PDUs
--Search APDUs
SearchRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
smallSetUpperBound [13] IMPLICIT INTEGER,
largeSetLowerBound [14] IMPLICIT INTEGER,
mediumSetPresentNumber [15] IMPLICIT INTEGER,
replaceIndicator [16] IMPLICIT BOOLEAN,
resultSetName [17] IMPLICIT InternationalString,
databaseNames [18] IMPLICIT SEQUENCE OF DatabaseName,
smallSetElementSetNames [100] ElementSetNames OPTIONAL,
mediumSetElementSetNames [101] ElementSetNames OPTIONAL,
preferredRecordSyntax [104] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
query [21] Query,
-- Following two parameters may be used only if version 3 is in force.
additionalSearchInfo [203] IMPLICIT OtherInformation OPTIONAL,
otherInfo OtherInformation OPTIONAL}
-- Query Definitions
Query ::= CHOICE{
type-0 [0] ANY,
type-1 [1] IMPLICIT RPNQuery,
type-2 [2] OCTET STRING,
type-100 [100] OCTET STRING,
type-101 [101] IMPLICIT RPNQuery,
type-102 [102] OCTET STRING}
--
-- Definitions for RPN query
RPNQuery ::= SEQUENCE{
attributeSet AttributeSetId,
rpn RPNStructure}
--
RPNStructure ::= CHOICE{
op [0] Operand,
rpnRpnOp [1] IMPLICIT SEQUENCE{
rpn1 RPNStructure,
rpn2 RPNStructure,
op Operator }}
Operand ::= CHOICE{
attrTerm AttributesPlusTerm,
resultSet ResultSetId,
-- If version 2 is in force:
-- - If query type is 1, one of the above two must be chosen;
-- - resultAttr (below) may be used only if query type is 101.
resultAttr ResultSetPlusAttributes}
AttributesPlusTerm ::= [102] IMPLICIT SEQUENCE{
attributes AttributeList,
term Term}
ResultSetPlusAttributes ::= [214] IMPLICIT
SEQUENCE{
resultSet ResultSetId,
attributes AttributeList}
AttributeList ::= [44] IMPLICIT SEQUENCE OF AttributeElement
--
Term ::= CHOICE{
general [45] IMPLICIT OCTET STRING,
-- values below may be used only if version 3 is in force
numeric [215] IMPLICIT INTEGER,
characterString [216] IMPLICIT InternationalString,
oid [217] IMPLICIT OBJECT IDENTIFIER,
dateTime [218] IMPLICIT GeneralizedTime,
external [219] IMPLICIT EXTERNAL,
integerAndUnit [220] IMPLICIT IntUnit,
null [221] IMPLICIT NULL}
Operator ::= [46] CHOICE{
and [0] IMPLICIT NULL,
or [1] IMPLICIT NULL,
and-not [2] IMPLICIT NULL,
-- If version 2 is in force:
-- - For query type 1, one of the above three
-- must be chosen;
-- - prox (below) may be used only if query type
-- is 101.
prox [3] IMPLICIT ProximityOperator}
AttributeElement ::= SEQUENCE{
attributeSet [1] IMPLICIT AttributeSetId OPTIONAL,
-- Must be omitted if version 2 is in force.
-- If included, overrides value of attributeSet
-- in RPNQuery above, but only for this attribute.
attributeType [120] IMPLICIT INTEGER,
attributeValue CHOICE{
numeric [121] IMPLICIT INTEGER,
-- If version 2 is in force,
-- Must select 'numeric' for attributeValue.
complex [224] IMPLICIT SEQUENCE{
list [1] IMPLICIT SEQUENCE OF StringOrNumeric,
semanticAction [2] IMPLICIT SEQUENCE OF INTEGER OPTIONAL}}}
ProximityOperator ::= SEQUENCE{
exclusion [1] IMPLICIT BOOLEAN OPTIONAL,
distance [2] IMPLICIT INTEGER,
ordered [3] IMPLICIT BOOLEAN,
relationType [4] IMPLICIT INTEGER{
lessThan (1),
lessThanOrEqual (2),
equal (3),
greaterThanOrEqual (4),
greaterThan (5),
notEqual (6)},
proximityUnitCode [5] CHOICE{
known [1] IMPLICIT KnownProximityUnit,
private [2] IMPLICIT INTEGER}}
--
KnownProximityUnit ::= INTEGER{
character (1),
word (2),
sentence (3),
paragraph (4),
section (5),
chapter (6),
document (7),
element (8),
subelement (9),
elementType (10),
byte (11) -- Version 3 only
}
-- End definitions for RPN Query
SearchResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
resultCount [23] IMPLICIT INTEGER,
numberOfRecordsReturned [24] IMPLICIT INTEGER,
nextResultSetPosition [25] IMPLICIT INTEGER,
searchStatus [22] IMPLICIT BOOLEAN,
resultSetStatus [26] IMPLICIT INTEGER{
subset (1),
interim (2),
none (3)} OPTIONAL,
presentStatus PresentStatus OPTIONAL,
records Records OPTIONAL,
-- Following two parameters may be used only if version 3 is in force.
additionalSearchInfo [203] IMPLICIT OtherInformation OPTIONAL,
otherInfo OtherInformation OPTIONAL}
--Retrieval APDUs
PresentRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
resultSetId ResultSetId,
resultSetStartPoint [30] IMPLICIT INTEGER,
numberOfRecordsRequested [29] IMPLICIT INTEGER,
additionalRanges [212] IMPLICIT SEQUENCE OF Range OPTIONAL,
-- additionalRanges may be included only if version 3 is in force.
recordComposition CHOICE{
simple [19] ElementSetNames,
-- must choose 'simple' if version 2
-- is in force
complex [209] IMPLICIT CompSpec}
OPTIONAL,
preferredRecordSyntax [104] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
maxSegmentCount [204] IMPLICIT INTEGER OPTIONAL, -- level 1 or 2
maxRecordSize [206] IMPLICIT INTEGER OPTIONAL, -- level 2 only
maxSegmentSize [207] IMPLICIT INTEGER OPTIONAL, -- level 2 only
otherInfo OtherInformation OPTIONAL}
--
Segment ::= SEQUENCE{
-- Segment PDU may only be used when version 3 is in force,
-- and only when segmentation is in effect.
referenceId ReferenceId OPTIONAL,
numberOfRecordsReturned [24] IMPLICIT INTEGER,
segmentRecords [0] IMPLICIT SEQUENCE OF NamePlusRecord,
otherInfo OtherInformation OPTIONAL}
--
PresentResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
numberOfRecordsReturned [24] IMPLICIT INTEGER,
nextResultSetPosition [25] IMPLICIT INTEGER,
presentStatus PresentStatus,
records Records OPTIONAL,
otherInfo OtherInformation OPTIONAL}
-- begin auxiliary definitions for Search and Present APDUs
-- begin definition of records
Records ::= CHOICE{
responseRecords [28] IMPLICIT SEQUENCE OF NamePlusRecord,
nonSurrogateDiagnostic [130] IMPLICIT DefaultDiagFormat,
multipleNonSurDiagnostics [205] IMPLICIT SEQUENCE OF DiagRec}
--
NamePlusRecord ::= SEQUENCE{
name [0] IMPLICIT DatabaseName OPTIONAL,
record [1] CHOICE{
retrievalRecord [1] EXTERNAL,
surrogateDiagnostic [2] DiagRec,
-- Must select one of the above two, retrievalRecord or
-- surrogateDiagnostic, unless 'level 2 segmentation'
-- is in effect.
startingFragment [3] FragmentSyntax,
intermediateFragment [4] FragmentSyntax,
finalFragment [5] FragmentSyntax}}
FragmentSyntax ::= CHOICE{
externallyTagged EXTERNAL,
notExternallyTagged OCTET STRING}
DiagRec ::= CHOICE{
defaultFormat DefaultDiagFormat,
-- Must choose defaultFormat if version 2 is in effect.
externallyDefined EXTERNAL}
DefaultDiagFormat::= SEQUENCE{
diagnosticSetId OBJECT IDENTIFIER,
condition INTEGER,
addinfo CHOICE{
v2Addinfo VisibleString, -- version 2
v3Addinfo InternationalString -- version 3
}}
-- end definition of records
Range ::= SEQUENCE{
startingPosition [1] IMPLICIT INTEGER,
numberOfRecords [2] IMPLICIT INTEGER}
--
ElementSetNames ::= CHOICE {
genericElementSetName [0] IMPLICIT InternationalString,
databaseSpecific [1] IMPLICIT SEQUENCE OF SEQUENCE{
dbName DatabaseName,
esn ElementSetName}}
PresentStatus ::= [27] IMPLICIT INTEGER{
success (0),
partial-1 (1),
partial-2 (2),
partial-3 (3),
partial-4 (4),
failure (5)}
-- begin definition of composition specification
CompSpec ::= SEQUENCE{
selectAlternativeSyntax [1] IMPLICIT BOOLEAN,
-- See comment for recordSyntax, below.
generic [2] IMPLICIT Specification OPTIONAL,
dbSpecific [3] IMPLICIT SEQUENCE OF SEQUENCE{
db [1] DatabaseName,
spec [2] IMPLICIT Specification} OPTIONAL,
-- At least one of generic and dbSpecific must
-- occur, and both may occur. If both, then for
-- any record not in the list of databases
-- within dbSpecific, generic applies.
recordSyntax [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL
-- For each record, the target selects the
-- first record syntax in this list that it can
-- support. If the list is exhausted, the
-- target may select an alternative syntax if
-- selectAlternativeSyntax is 'true'.
}
Specification ::= SEQUENCE{
schema [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
elementSpec [2] CHOICE{
elementSetName [1] IMPLICIT InternationalString,
externalEspec [2] IMPLICIT EXTERNAL} OPTIONAL}
-- end definition of composition specification
-- end auxiliary definitions for search and response APDUs
-- Delete APDUs
DeleteResultSetRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
deleteFunction [32] IMPLICIT INTEGER{
list (0),
all (1)},
resultSetList SEQUENCE OF ResultSetId OPTIONAL,
otherInfo OtherInformation OPTIONAL}
--
DeleteResultSetResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
deleteOperationStatus [0] IMPLICIT DeleteSetStatus,
deleteListStatuses [1] IMPLICIT ListStatuses OPTIONAL,
numberNotDeleted [34] IMPLICIT INTEGER OPTIONAL,
bulkStatuses [35] IMPLICIT ListStatuses OPTIONAL,
deleteMessage [36] IMPLICIT InternationalString OPTIONAL,
otherInfo OtherInformation OPTIONAL}
ListStatuses ::= SEQUENCE OF SEQUENCE{
id ResultSetId,
status DeleteSetStatus}
DeleteSetStatus ::= [33] IMPLICIT INTEGER{
success (0),
resultSetDidNotExist (1),
previouslyDeletedByTarget (2),
systemProblemAtTarget (3),
accessNotAllowed (4),
resourceControlAtOrigin (5),
resourceControlAtTarget (6),
bulkDeleteNotSupported (7),
notAllRsltSetsDeletedOnBulkDlte (8),
notAllRequestedResultSetsDeleted (9),
resultSetInUse (10)}
--
--Access- and Resource-control APDUs
--
AccessControlRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
securityChallenge CHOICE{
simpleForm [37] IMPLICIT OCTET STRING,
externallyDefined [0] EXTERNAL},
otherInfo OtherInformation OPTIONAL}
AccessControlResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
securityChallengeResponse CHOICE{
simpleForm [38] IMPLICIT
OCTET STRING,
externallyDefined [0] EXTERNAL}
OPTIONAL,
-- Optional only in version 3; mandatory in
-- version 2. If omitted (in version 3) then
-- diagnostic must occur.
diagnostic [223] DiagRec OPTIONAL, -- Version 3 only.
otherInfo OtherInformation OPTIONAL}
ResourceControlRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
suspendedFlag [39] IMPLICIT BOOLEAN OPTIONAL,
resourceReport [40] ResourceReport OPTIONAL,
partialResultsAvailable [41] IMPLICIT INTEGER{
subset (1),
interim (2),
none (3)} OPTIONAL,
responseRequired [42] IMPLICIT BOOLEAN,
triggeredRequestFlag [43] IMPLICIT BOOLEAN OPTIONAL,
otherInfo OtherInformation OPTIONAL}
ResourceControlResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
continueFlag [44] IMPLICIT BOOLEAN,
resultSetWanted [45] IMPLICIT BOOLEAN OPTIONAL,
otherInfo OtherInformation OPTIONAL}
TriggerResourceControlRequest ::=
SEQUENCE{
referenceId ReferenceId OPTIONAL,
requestedAction [46] IMPLICIT INTEGER{
resourceReport (1),
resourceControl (2),
cancel (3)},
prefResourceReportFormat [47] IMPLICIT ResourceReportId OPTIONAL,
resultSetWanted [48] IMPLICIT BOOLEAN OPTIONAL,
otherInfo OtherInformation OPTIONAL}
ResourceReportRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
opId [210] IMPLICIT ReferenceId OPTIONAL,
prefResourceReportFormat [49] IMPLICIT ResourceReportId OPTIONAL,
otherInfo OtherInformation OPTIONAL}
--
ResourceReportResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
resourceReportStatus [50] IMPLICIT INTEGER{
success (0),
partial (1),
failure-1 (2),
failure-2 (3),
failure-3 (4),
failure-4 (5),
failure-5 (6),
failure-6 (7)},
resourceReport [51] ResourceReport OPTIONAL,
otherInfo OtherInformation OPTIONAL}
--
ResourceReport ::= EXTERNAL
ResourceReportId ::= OBJECT IDENTIFIER
--Scan APDUs
ScanRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
databaseNames [3] IMPLICIT SEQUENCE OF DatabaseName,
attributeSet AttributeSetId OPTIONAL,
termListAndStartPoint AttributesPlusTerm,
stepSize [5] IMPLICIT INTEGER OPTIONAL,
numberOfTermsRequested [6] IMPLICIT INTEGER,
preferredPositionInResponse [7] IMPLICIT INTEGER OPTIONAL,
otherInfo OtherInformation OPTIONAL}
ScanResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
stepSize [3] IMPLICIT INTEGER OPTIONAL,
scanStatus [4] IMPLICIT INTEGER {
success (0),
partial-1 (1),
partial-2 (2),
partial-3 (3),
partial-4 (4),
partial-5 (5),
failure (6) },
numberOfEntriesReturned [5] IMPLICIT INTEGER,
positionOfTerm [6] IMPLICIT INTEGER OPTIONAL,
entries [7] IMPLICIT ListEntries OPTIONAL,
attributeSet [8] IMPLICIT AttributeSetId OPTIONAL,
otherInfo OtherInformation OPTIONAL}
-- begin auxiliary definitions for Scan
ListEntries ::= SEQUENCE{
entries [1] IMPLICIT SEQUENCE OF Entry OPTIONAL,
nonsurrogateDiagnostics [2] IMPLICIT SEQUENCE OF DiagRec OPTIONAL
-- At least one of entries and nonsurrogateDiagnostic must occur
}
Entry ::= CHOICE {
termInfo [1] IMPLICIT TermInfo,
surrogateDiagnostic [2] DiagRec}
--
TermInfo ::= SEQUENCE {
term Term,
displayTerm [0] IMPLICIT InternationalString OPTIONAL,
-- Presence of displayTerm means that term is
-- not considered by the target to be suitable
-- for display, and displayTerm should instead
-- be displayed. 'term' is the actual term in
-- the term list; 'displayTerm' is for display
-- purposes only, and is not an actual term in
-- the term list.
suggestedAttributes AttributeList OPTIONAL,
alternativeTerm [4] IMPLICIT SEQUENCE OF AttributesPlusTerm OPTIONAL,
globalOccurrences [2] IMPLICIT INTEGER OPTIONAL,
byAttributes [3] IMPLICIT OccurrenceByAttributes OPTIONAL,
otherTermInfo OtherInformation OPTIONAL}
OccurrenceByAttributes ::= SEQUENCE OF
SEQUENCE{
attributes [1] AttributeList,
occurrences CHOICE{
global [2] INTEGER,
byDatabase [3] IMPLICIT SEQUENCE OF
SEQUENCE{
db DatabaseName,
num [1] IMPLICIT INTEGER OPTIONAL,
otherDbInfo OtherInformation OPTIONAL}}
OPTIONAL,
otherOccurInfo OtherInformation OPTIONAL}
-- end auxiliary definitions for Scan
-- Sort APDUs
SortRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
inputResultSetNames [3] IMPLICIT SEQUENCE OF InternationalString,
sortedResultSetName [4] IMPLICIT InternationalString,
sortSequence [5] IMPLICIT SEQUENCE OF SortKeySpec,
-- order of occurrence is
-- from major to minor
otherInfo OtherInformation OPTIONAL}
SortResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
sortStatus [3] IMPLICIT INTEGER{
success (0),
partial-1 (1),
failure (2)},
resultSetStatus [4] IMPLICIT INTEGER{
empty (1),
interim (2),
unchanged (3),
none (4)} OPTIONAL,
diagnostics [5] IMPLICIT SEQUENCE OF DiagRec OPTIONAL,
otherInfo OtherInformation OPTIONAL}
-- begin auxiliary definitions for Sort
SortKeySpec ::= SEQUENCE{
sortElement SortElement,
sortRelation [1] IMPLICIT INTEGER{
ascending (0),
descending (1),
ascendingByFrequency (3),
descendingByfrequency (4)},
caseSensitivity [2] IMPLICIT INTEGER{
caseSensitive (0),
caseInsensitive (1)},
missingValueAction [3] CHOICE{
abort [1] IMPLICIT NULL,
null [2] IMPLICIT NULL,
-- supply a null value
-- for missing value
missingValueData [3] IMPLICIT OCTET
STRING} OPTIONAL}
SortElement ::= CHOICE{
generic [1] SortKey,
datbaseSpecific [2] IMPLICIT SEQUENCE OF SEQUENCE{
databaseName DatabaseName,
dbSort SortKey}}
SortKey ::= CHOICE{
sortfield [0] IMPLICIT InternationalString,
-- An element, element-group-tag, or alias
-- supported by the target and denoting a set
-- of elements associated with each record.
elementSpec [1] IMPLICIT Specification,
sortAttributes [2] IMPLICIT SEQUENCE{
id AttributeSetId,
list AttributeList}}
-- end auxiliary definitions for sort
-- Extended Service APDUs
ExtendedServicesRequest ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
function [3] IMPLICIT INTEGER {
create (1),
delete (2),
modify (3)},
packageType [4] IMPLICIT OBJECT IDENTIFIER,
packageName [5] IMPLICIT InternationalString OPTIONAL,
-- PackageName mandatory for 'modify' or
-- 'delete'; optional for 'create'.
-- Following four parameters mandatory
-- for 'create'; should be included on
-- 'modify' if being modified; not needed
-- on 'delete'.
userId [6] IMPLICIT InternationalString OPTIONAL,
retentionTime [7] IMPLICIT IntUnit OPTIONAL,
permissions [8] IMPLICIT Permissions OPTIONAL,
description [9] IMPLICIT InternationalString OPTIONAL,
taskSpecificParameters [10] IMPLICIT EXTERNAL OPTIONAL,
-- Mandatory for 'create'; included on
-- 'modify' if specific parameters being
-- modified; not necessary on 'delete'.
-- For the 'EXTERNAL,' use OID of
-- specific ES definition and select
-- CHOICE [1]: 'esRequest'.
waitAction [11] IMPLICIT INTEGER{
wait (1),
waitIfPossible (2),
dontWait (3),
dontReturnPackage (4)},
elements ElementSetName OPTIONAL,
otherInfo OtherInformation OPTIONAL}
--
ExtendedServicesResponse ::= SEQUENCE{
referenceId ReferenceId OPTIONAL,
operationStatus [3] IMPLICIT INTEGER{
done (1),
accepted (2),
failure (3)},
diagnostics [4] IMPLICIT SEQUENCE OF DiagRec OPTIONAL,
taskPackage [5] IMPLICIT EXTERNAL OPTIONAL,
-- Use OID: {Z39-50-recordSyntax (106)}
-- and corresponding syntax. For the
-- EXTERNAL, 'taskSpecific,' within that
-- definition, use OID of the specific
-- es, and choose [2], 'taskPackage'.
otherInfo OtherInformation OPTIONAL}
Permissions ::= SEQUENCE OF SEQUENCE{
userId [1] IMPLICIT InternationalString,
allowableFunctions [2] IMPLICIT SEQUENCE OF INTEGER{
delete (1),
modifyContents (2),
modifyPermissions (3),
present (4),
invoke (5)}}
Close ::= SEQUENCE{
referenceId ReferenceId OPTIONAL, -- See 3.2.11.1.5.
closeReason CloseReason,
diagnosticInformation [3] IMPLICIT InternationalString OPTIONAL,
resourceReportFormat [4] IMPLICIT ResourceReportId OPTIONAL,
-- For use by origin only, and only on
-- Close request; origin requests target
-- to include report in response.
resourceReport [5] ResourceReport OPTIONAL,
-- For use by target only, unilaterally
-- on Close request; on Close response
-- may be unilateral or in response to
-- origin request.
otherInfo OtherInformation OPTIONAL}
CloseReason ::= [211] IMPLICIT INTEGER{
finished (0),
shutdown (1),
systemProblem (2),
costLimit (3),
resources (4),
securityViolation (5),
protocolError (6),
lackOfActivity (7),
peerAbort (8),
unspecified (9)}
-- Global auxiliary definitions
ReferenceId ::= [2] IMPLICIT OCTET STRING
ResultSetId ::= [31] IMPLICIT InternationalString
ElementSetName ::= [103] IMPLICIT InternationalString
DatabaseName ::= [105] IMPLICIT InternationalString
AttributeSetId ::= OBJECT IDENTIFIER
-- OtherInformation
OtherInformation ::= [201] IMPLICIT SEQUENCE OF
SEQUENCE{
category [1] IMPLICIT InfoCategory OPTIONAL,
information CHOICE{
characterInfo [2] IMPLICIT InternationalString,
binaryInfo [3] IMPLICIT OCTET STRING,
externallyDefinedInfo [4] IMPLICIT EXTERNAL,
oid [5] IMPLICIT OBJECT IDENTIFIER}}
--
InfoCategory ::= SEQUENCE{
categoryTypeId [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
categoryValue [2] IMPLICIT INTEGER}
-- Units
-- IntUnit is used when value and unit are supplied together. Unit, alone,
-- is used when just specifying a unit (without a value). For example,
-- IntUnit is used in Term, in an RPNQuery, or it can be the datatype of
-- an element within a retrieval record. Unit (alone) would be used in an
-- element request, when requesting data be returned according to a
-- particular unit.
IntUnit ::= SEQUENCE{
value [1] IMPLICIT INTEGER,
unitUsed [2] IMPLICIT Unit}
--
Unit ::= SEQUENCE{
unitSystem [1] InternationalString OPTIONAL, -- e.g. 'SI'
unitType [2] StringOrNumeric OPTIONAL, -- e.g. 'mass'
unit [3] StringOrNumeric OPTIONAL, -- e.g. 'kilograms'
scaleFactor [4] IMPLICIT INTEGER OPTIONAL -- e.g. 9 means 10**9
}
--CharacterString
InternationalString ::= GeneralString
-- When version 2 is in force, this collapses to VisibleString. That
-- is, only characters in the visibleString repertoire may be used.
-- (Datatype compatibility with version 2 is not affected, because
-- references are IMPLICIT.) When version 3 is in force, the semantics
-- of the GeneralString content may be altered by negotiation during
-- initialization. If no such negotiation is in effect, then
-- GeneralString semantics are in force.
StringOrNumeric ::= CHOICE{
string [1] IMPLICIT InternationalString,
numeric [2] IMPLICIT INTEGER}
END --IR DEFINITIONS

View File

@ -0,0 +1,278 @@
# z3950.cnf
# Conformation file for the NISO Z39.50 Information Retrieval protocol
# Copyright 2018 Craig Jackson <cejackson51@gmail.com>
# $Id$
#.MODULE_IMPORT
#.EXPORTS
#.PDU
#Z39-50-APDU-1995
#.NO_EMIT
#.TYPE_RENAME
#.FIELD_RENAME
AttributeList/_untag/_item attributeList_item
OtherInformation/_untag/_item otherInformation_item
RPNStructure/rpnRpnOp/op operatorRpnOp
RPNStructure/op operandRpnOp
SearchResponse/resultSetStatus search_resultSetStatus
SortResponse/resultSetStatus sort_resultSetStatus
AttributeElement/attributeValue/numeric attributeValue_numeric
AttributeElement/attributeValue/complex attributeValue_complex
AttributeElement/attributeValue/complex/list attributeValue_complex_list
AttributeElement/attributeType attributeElement_attributeType
ListStatuses/_item/id listStatuses_id
CompSpec/generic compSpec_generic
SortElement/generic sortElement_generic
ScanResponse/entries scanResponse_entries
ListEntries/entries listEntries_entries
Specification/elementSpec specification_elementSpec
SortKey/elementSpec sortKey_elementSpec
SortKey/sortAttributes/list sortAttributes_list
SortKey/sortAttributes/id sortAttributes_id
PresentRequest/recordComposition/complex recordComposition_complex
DiagFormat/recordSyntax diagFormat_recordSyntax
DiagFormat/sort/dbSpecific diagFormat_sort_dbSpecific
DiagFormat/sort/tooMany diagFormat_sort_tooMany
DiagnosticFormat/_item/diagnostic diagnosticFormat_item_diagnostic
DiagFormat/proximity diagFormat_proximity
DiagFormat/proximity/exclusion diagFormat_proximity_exclusion
DiagFormat/proximity/ordered diagFormat_proximity_ordered
DiagFormat/proximity/unit diagFormat_proximity_unit
DiagFormat/accessCtrl/oid diagFormat_accessCtrl_oid
DiagFormat/accessCtrl/simple diagFormat_accessCtrl_simple
DiagFormat/term diagFormat_term
SortKeyDetails/caseSensitivity sortKeyDetails_caseSensitivity
SortKeyDetails/sortType/structured sortKeyDetails_sortType_structured
SortKeyDetails/sortType/numeric sortKeyDetails_sortType_numeric
PrivateCapabilities/operators privateCapabilities_operators
PromptId/enummeratedPrompt/type promptId_enummeratedPrompt_type
ExtendedServicesInfo/waitAction extendedServicesInfo_waitAction
NetworkAddress/other networkAddress_other
NetworkAddress/other/address networkAddress_other_address
NetworkAddress/other/type networkAddress_other_type
AttributeDescription/attributeValue attributeDescription_attributeValue
AttributeTypeDetails/attributeValues attributeTypeDetails_attributeValues
AttributeTypeDetails/attributeValues/_item attributeTypeDetails_attributeValues_item
AttributeOccurrence/attributeValues attributeOccurrence_attributeValues
AttributeValue/value attributeValue_value
DRNType/userId dRNType_userId
DES-RN-Object/challenge dES_RN_Object_challenge
DES-RN-Object/response rES_RN_Object_response
VariantSetInfo/variants variantSetInfo_variants
Variant/triples/_item/value variant_triples_item_value
Variant/triples/_item/value/unit variant_triples_item_value_unit
UnitType/units unitType_units
UnitInfo/units unitInfo_units
ValueDescription/unit valueDescription_unit
ProximitySupport/unitsSupported/_item/private/unit proximitySupport_unitsSupported_item_private_unit
ProximitySupport/unitsSupported/_item/private proximitySupport_unitsSupported_item_private
ProximitySupport/unitsSupported/_item/known proximitySupport_unitsSupported_item_known
Usage/type usage_type
FormatSpec/type formatSpec_type
ExtendedServicesInfo/type extendedServicesInfo_type
QueryExpression/term queryExpression_term
QueryTypeDetails/rpn queryTypeDetails_rpn
QueryTypeDetails/private queryTypeDetails_private
BriefBib/title briefBib_title
Charge/text charge_text
OCLC-UserInformation/text oCLC-UserInformation_text
CircRecord/restrictions circRecord_restrictions
ResourceControlRequest/responseRequired resourceControlRequest_responseRequired
KRBObject/challenge kRBObject_challenge
KRBObject/response kRBObject_response
CompSpec/recordSyntax compSpec_recordSyntax
DatabaseInfo/name databaseInfo_name
DatabaseInfo/nicknames databaseInfo_nicknames
DatabaseInfo/nicknames/_item databaseInfo_nicknames_item
NamePlusRecord/name namePlusRecord_name
BriefBib/format briefBib_format
TagSetInfo/elements tagSetInfo_elements
ElementSetDetails/elementSetName elementSetDetails_elementSetName
PrivateCapabilities/description privateCapabilities_description
TaskPackage/description taskPackage_description
ElementData/diagnostic elementData_diagnostic
Challenge/_item/diagnostic challenge_item_diagnostic
Challenge/_item/dataType challenge_item_dataType
Challenge/_item/promptInfo/character challenge_item_promptInfo_character
ElementInfo/dataType elementInfo_dataType
TaggedElement/content taggedElement_content
CategoryInfo/category categoryInfo_category
TermListDetails/attributes termListDetails_attributes
AttributeSetInfo/attributes attributeSetInfo_attributes
ExtendedServicesRequest/description extendedServicesRequest_description
#.END
#.REGISTER
Explain-Record B "1.2.840.10003.5.100" "Explain-record"
SutrsRecord B "1.2.840.10003.5.101" "Sutrs-record"
OPACRecord B "1.2.840.10003.5.102" "OPAC-record"
BriefBib B "1.2.840.10003.5.103" "Summary-record"
GenericRecord B "1.2.840.10003.5.105" "GRS-1-record"
TaskPackage B "1.2.840.10003.5.106" "ESTaskPackage"
DiagnosticFormat B "1.2.840.10003.4.2" "diag-1"
PromptObject B "1.2.840.10003.8.1" "Prompt-1"
DES-RN-Object B "1.2.840.10003.8.2" "DES-1"
KRBObject B "1.2.840.10003.8.3" "KRB-1"
SearchInfoReport B "1.2.840.10003.10.1" "SearchResult-1"
OCLC-UserInformation B "1.2.840.10003.10.1000.17.1" "OCLC-UserInfo-1"
#.FN_HDR PDU
gint choice;
#.FN_PARS PDU VAL_PTR=&choice
#.FN_FTR PDU
if (choice >= 0) {
packet_info *pinfo = actx->pinfo;
gint32 tag = PDU_choice[choice].tag;
col_set_str(pinfo->cinfo, COL_INFO,
val_to_str_const(tag, z3950_PDU_vals, "Unknown Z39.50 PDU"));
}
#.FN_BODY Query/type-0
/*XXX Not implemented yet */
#.FN_BODY ReferenceId
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_CON, 2, TRUE,
dissect_z3950_printable_OCTET_STRING);
#.FN_BODY Term/general
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_CON, 2, TRUE,
dissect_z3950_printable_OCTET_STRING);
#.FN_HDR AttributeSetId
tvbuff_t *oid_tvb=NULL;
#.FN_PARS AttributeSetId VAL_PTR=&oid_tvb
#.FN_FTR AttributeSetId
if (oid_tvb) {
guint len = tvb_reported_length_remaining(oid_tvb, 0);
gchar *oid_str = oid_encoded2string(wmem_packet_scope(),
tvb_get_ptr(oid_tvb, 0, len), len);
gint attribute_set_idx = Z3950_ATSET_UNKNOWN;
z3950_atinfo_t *atinfo_data;
packet_info *pinfo = actx->pinfo;
if (g_strcmp0(oid_str, Z3950_ATSET_BIB1_OID) == 0) {
attribute_set_idx = Z3950_ATSET_BIB1;
}
if ((atinfo_data = (z3950_atinfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_ATINFO_KEY)) == NULL) {
atinfo_data = wmem_new0(pinfo->pool, z3950_atinfo_t);
atinfo_data->atsetidx = attribute_set_idx;
p_add_proto_data(pinfo->pool, pinfo,
proto_z3950, Z3950_ATINFO_KEY, atinfo_data);
}
else {
atinfo_data->atsetidx = attribute_set_idx;
}
}
#.FN_HDR AttributeElement/attributeType
gint att_type=0;
packet_info *pinfo = actx->pinfo;
z3950_atinfo_t *atinfo_data;
#.FN_PARS AttributeElement/attributeType VAL_PTR=&att_type
#.FN_FTR AttributeElement/attributeType
atinfo_data = (z3950_atinfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_ATINFO_KEY);
if (atinfo_data && atinfo_data->atsetidx == Z3950_ATSET_BIB1) {
proto_item_append_text(actx->created_item, " (%s)",
val_to_str(att_type, z3950_bib1_att_types, "Unknown bib-1 attributeType %d"));
atinfo_data->attype = att_type;
}
#.FN_HDR AttributeElement/attributeValue/numeric
gint att_value=0;
packet_info *pinfo = actx->pinfo;
z3950_atinfo_t *atinfo_data;
const value_string *att_value_string = NULL;
#.FN_PARS AttributeElement/attributeValue/numeric VAL_PTR=&att_value
#.FN_FTR AttributeElement/attributeValue/numeric
atinfo_data = (z3950_atinfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_ATINFO_KEY);
if (atinfo_data && atinfo_data->atsetidx == Z3950_ATSET_BIB1) {
switch (atinfo_data->attype) {
case Z3950_BIB1_AT_USE:
att_value_string = z3950_bib1_at_use;
break;
case Z3950_BIB1_AT_RELATION:
att_value_string = z3950_bib1_at_relation;
break;
case Z3950_BIB1_AT_POSITION:
att_value_string = z3950_bib1_at_position;
break;
case Z3950_BIB1_AT_STRUCTURE:
att_value_string = z3950_bib1_at_structure;
break;
case Z3950_BIB1_AT_TRUNCATION:
att_value_string = z3950_bib1_at_truncation;
break;
case Z3950_BIB1_AT_COMPLETENESS:
att_value_string = z3950_bib1_at_completeness;
break;
default:
att_value_string = NULL;
}
if (att_value_string) {
proto_item_append_text(actx->created_item, " (%s)",
val_to_str(att_value, att_value_string, "Unknown bib-1 attributeValue %d"));
}
}
#.FN_HDR DefaultDiagFormat/diagnosticSetId
tvbuff_t *oid_tvb=NULL;
#.FN_PARS DefaultDiagFormat/diagnosticSetId VAL_PTR=&oid_tvb
#.FN_FTR DefaultDiagFormat/diagnosticSetId
if (oid_tvb) {
guint len = tvb_reported_length_remaining(oid_tvb, 0);
gchar *oid_str = oid_encoded2string(wmem_packet_scope(),
tvb_get_ptr(oid_tvb, 0, len), len);
gint diagset_idx = Z3950_DIAGSET_UNKNOWN;
z3950_diaginfo_t *diaginfo_data;
packet_info *pinfo = actx->pinfo;
if (g_strcmp0(oid_str, Z3950_DIAGSET_BIB1_OID) == 0) {
diagset_idx = Z3950_DIAGSET_BIB1;
}
if ((diaginfo_data = (z3950_diaginfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_DIAGSET_KEY)) == NULL) {
diaginfo_data = wmem_new0(pinfo->pool, z3950_diaginfo_t);
diaginfo_data->diagsetidx = diagset_idx;
p_add_proto_data(pinfo->pool, pinfo,
proto_z3950, Z3950_DIAGSET_KEY, diaginfo_data);
}
else {
diaginfo_data->diagsetidx = diagset_idx;
}
}
#.FN_HDR DefaultDiagFormat/condition
gint diag_condition=0;
packet_info *pinfo = actx->pinfo;
z3950_diaginfo_t *diaginfo_data;
#.FN_PARS DefaultDiagFormat/condition VAL_PTR=&diag_condition
#.FN_FTR DefaultDiagFormat/condition
diaginfo_data = (z3950_diaginfo_t *)p_get_proto_data(pinfo->pool, pinfo, proto_z3950, Z3950_DIAGSET_KEY);
if (diaginfo_data && diaginfo_data->diagsetidx == Z3950_DIAGSET_BIB1) {
proto_item_append_text(actx->created_item, " (%s)",
val_to_str(diag_condition, z3950_bib1_diagconditions, "Unknown bib-1 diagnostic %d"));
diaginfo_data->diagcondition = diag_condition;
}
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 2
# tab-width: 8
# indent-tabs-mode: nil
# End:
#
# vi: set shiftwidth=2 tabstop=8 expandtab autoindent:
# :indentSize=2:tabSize=8:noTabs=true:
#

13065
epan/dissectors/packet-z3950.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
/* Do not modify this file. Changes will be overwritten. */
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-z3950.h */
/* asn2wrs.py -b -p z3950 -c ./z3950.cnf -s ./packet-z3950-template -D . -O ../.. z3950.asn z3950-oclc.asn z3950-externals.asn */
/* Input file: packet-z3950-template.h */
#line 1 "./asn1/z3950/packet-z3950-template.h"
/* packet-z3950.h
* Routines for foo packet dissection
*
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef PACKET_Z3950_H
#define PACKET_Z3950_H
#endif /* PACKET_Z3950_H */

View File

@ -101,7 +101,7 @@ isprint_utf8_string(const gchar *str, guint length)
/* Check if an entire string is digits. */
gboolean
isdigit_string(guchar *str)
isdigit_string(const guchar *str)
{
guint pos;

View File

@ -77,7 +77,7 @@ gboolean isprint_utf8_string(const gchar *string, guint length);
* @return TRUE if the entire string is digits, otherwise FALSE
*/
WS_DLL_PUBLIC
gboolean isdigit_string(guchar *string);
gboolean isdigit_string(const guchar *string);
WS_DLL_PUBLIC
int ws_xton(char ch);