aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/dap
diff options
context:
space:
mode:
authorGraeme Lunt <graeme.lunt@smhs.co.uk>2007-12-15 15:21:25 +0000
committerGraeme Lunt <graeme.lunt@smhs.co.uk>2007-12-15 15:21:25 +0000
commit9c6ac3835fa68a9dfb9779c55dd3260bffc30590 (patch)
treeca6741ca6915aa66bcce5b87256b922113d32fe8 /asn1/dap
parent7a5f960bb72daedc7d34fa813e309e40adfd02d8 (diff)
Revised DAP dissector using latest asn2wrs features (requiring fewer changes the ASN.1 module) and table-driven operations.
svn path=/trunk/; revision=23875
Diffstat (limited to 'asn1/dap')
-rwxr-xr-xasn1/dap/DirectoryAccessProtocol.asn171
-rw-r--r--asn1/dap/Makefile.common6
-rw-r--r--asn1/dap/dap.asn429
-rw-r--r--asn1/dap/dap.cnf119
-rw-r--r--asn1/dap/packet-dap-template.c220
5 files changed, 514 insertions, 431 deletions
diff --git a/asn1/dap/DirectoryAccessProtocol.asn b/asn1/dap/DirectoryAccessProtocol.asn
new file mode 100755
index 0000000000..58e8c18d5b
--- /dev/null
+++ b/asn1/dap/DirectoryAccessProtocol.asn
@@ -0,0 +1,171 @@
+-- $Id$
+-- http://www.itu.int/ITU-T/asn1/database/itu-t/x/x519/2001/index.html
+-- Module DirectoryAccessProtocol (X.519:02/2001)
+DirectoryAccessProtocol {joint-iso-itu-t ds(5) module(1) dap(11) 4} DEFINITIONS
+::=
+BEGIN
+
+-- EXPORTS All
+-- The types and values defined in this module are exported for use in the other ASN.1 modules contained
+-- within the Directory Specifications, and for the use of other applications which will use them to access
+-- Directory services. Other applications may use them for their own purposes, but this will not constrain
+-- extensions and modifications needed to maintain or improve the Directory service.
+IMPORTS
+ -- from ITU-T Rec. X.501 | ISO/IEC 9594-2
+ directoryAbstractService, protocolObjectIdentifiers
+ FROM UsefulDefinitions {joint-iso-itu-t ds(5) module(1)
+ usefulDefinitions(0) 4}
+ -- from ITU-T Rec. X.511 | ISO/IEC 9594-3
+ abandon, addEntry, compare, directoryBind, directoryUnbind, list, modifyDN,
+ modifyEntry, read, removeEntry, search
+ FROM DirectoryAbstractService {joint-iso-itu-t ds(5) module(1)
+ directoryAbstractService(2) 4}
+ -- from ITU-T Rec. X.519 | ISO/IEC 9594-5
+ id-ac-directoryAccessAC, id-as-directoryAccessAS, id-contract-dap,
+ id-package-dapConnection, id-package-modify, id-package-read,
+ id-package-search, id-rosObject-dapDSA, id-rosObject-directory,
+ id-rosObject-dua
+ FROM ProtocolObjectIdentifiers {joint-iso-itu-t ds(5) module(1)
+ protocolObjectIdentifiers(4) 4}
+ -- from ITU-T Rec. X.880 | ISO/IEC 13712-1
+ Code, CONNECTION-PACKAGE, CONTRACT, OPERATION, OPERATION-PACKAGE,
+ ROS-OBJECT-CLASS
+ FROM Remote-Operations-Information-Objects {joint-iso-itu-t
+ remote-operations(4) informationObjects(5) version1(0)}
+ Bind{}, InvokeId, ROS{}, Unbind{}
+ FROM Remote-Operations-Generic-ROS-PDUs {joint-iso-itu-t
+ remote-operations(4) generic-ROS-PDUs(6) version1(0)}
+ -- from ITU-T Rec. X.881 | ISO/IEC 13712-2
+ APPLICATION-CONTEXT
+ FROM Remote-Operations-Information-Objects-extensions {joint-iso-itu-t
+ remote-operations(4) informationObjects-extensions(8) version1(0)}
+ -- from ITU-T Rec. X.882 | ISO/IEC 13712-3
+ acse, pData
+ FROM Remote-Operations-Realizations {joint-iso-itu-t remote-operations(4)
+ realizations(9) version1(0)}
+ acse-abstract-syntax
+ FROM Remote-Operations-Abstract-Syntaxes {joint-iso-itu-t
+ remote-operations(4) remote-operations-abstract-syntaxes(12) version1(0)};
+
+-- application contexts
+directoryAccessAC APPLICATION-CONTEXT ::= {
+ CONTRACT dapContract
+ ESTABLISHED BY acse
+ INFORMATION TRANSFER BY pData
+ ABSTRACT SYNTAXES
+ {acse-abstract-syntax | directoryAccessAbstractSyntax}
+ APPLICATION CONTEXT NAME id-ac-directoryAccessAC
+}
+
+-- ROS objects
+dua ROS-OBJECT-CLASS ::= {INITIATES {dapContract}
+ ID id-rosObject-dua
+}
+
+directory ROS-OBJECT-CLASS ::= {
+ RESPONDS {dapContract}
+ ID id-rosObject-directory
+}
+
+dap-dsa ROS-OBJECT-CLASS ::= {
+ RESPONDS {dapContract}
+ ID id-rosObject-dapDSA
+}
+
+-- contracts
+dapContract CONTRACT ::= {
+ CONNECTION dapConnectionPackage
+ INITIATOR CONSUMER OF {readPackage | searchPackage | modifyPackage}
+ ID id-contract-dap
+}
+
+-- connection package
+dapConnectionPackage CONNECTION-PACKAGE ::= {
+ BIND directoryBind
+ UNBIND directoryUnbind
+ ID id-package-dapConnection
+}
+
+-- read package
+readPackage OPERATION-PACKAGE ::= {
+ CONSUMER INVOKES {read | compare | abandon}
+ ID id-package-read
+}
+
+-- search package
+searchPackage OPERATION-PACKAGE ::= {
+ CONSUMER INVOKES {list | search}
+ ID id-package-search
+}
+
+-- modify Package
+modifyPackage OPERATION-PACKAGE ::= {
+ CONSUMER INVOKES {addEntry | removeEntry | modifyEntry | modifyDN}
+ ID id-package-modify
+}
+
+-- abstract syntaxes
+directoryAccessAbstractSyntax ABSTRACT-SYNTAX ::= {
+ DAP-PDUs
+ IDENTIFIED BY id-as-directoryAccessAS
+}
+
+--DAP-PDUs ::= CHOICE {
+-- basicRos ROS{{DAP-InvokeIDSet}, {DAP-Invokable}, {DAP-Returnable}},
+-- bind Bind{directoryBind},
+-- unbind Unbind{directoryUnbind}
+--}
+
+DAP-InvokeIDSet ::= InvokeId --(ALL EXCEPT absent:NULL)
+
+DAP-Invokable OPERATION ::=
+ {read | compare | abandon | list | search | addEntry | removeEntry |
+ modifyEntry | modifyDN}
+
+DAP-Returnable OPERATION ::=
+ {read | compare | abandon | list | search | addEntry | removeEntry |
+ modifyEntry | modifyDN}
+
+-- remote operation codes
+id-opcode-read Code ::= local:1
+
+id-opcode-compare Code ::= local:2
+
+id-opcode-abandon Code ::= local:3
+
+id-opcode-list Code ::= local:4
+
+id-opcode-search Code ::= local:5
+
+id-opcode-addEntry Code ::= local:6
+
+id-opcode-removeEntry Code ::= local:7
+
+id-opcode-modifyEntry Code ::= local:8
+
+id-opcode-modifyDN Code ::= local:9
+
+-- remote error codes
+id-errcode-attributeError Code ::= local:1
+
+id-errcode-nameError Code ::= local:2
+
+id-errcode-serviceError Code ::= local:3
+
+id-errcode-referral Code ::= local:4
+
+id-errcode-abandoned Code ::= local:5
+
+id-errcode-securityError Code ::= local:6
+
+id-errcode-abandonFailed Code ::= local:7
+
+id-errcode-updateError Code ::= local:8
+
+-- remote error code for DSP
+id-errcode-dsaReferral Code ::= local:9
+
+END -- DirectoryAccessProtocol
+
+-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
+
diff --git a/asn1/dap/Makefile.common b/asn1/dap/Makefile.common
index 3dc3a30b86..e9babdfe4e 100644
--- a/asn1/dap/Makefile.common
+++ b/asn1/dap/Makefile.common
@@ -33,7 +33,9 @@ EXPORT_FILES = \
EXT_ASN_FILE_LIST =
ASN_FILE_LIST = \
- $(PROTOCOL_NAME).asn
+ $(PROTOCOL_NAME).asn \
+ DirectoryAccessProtocol.asn
+
# The packet-$(PROTOCOL_NAME)-template.h and $(PROTOCOL_NAME).asn
# files do not exist # for all protocols: Please add/remove as required.
@@ -47,7 +49,7 @@ SRC_FILES = \
$(EXTRA_DIST) \
$(EXT_ASN_FILE_LIST)
-A2W_FLAGS= -b -e
+A2W_FLAGS= -b -e -L
EXTRA_CNF= \
../disp/disp-exp.cnf \
diff --git a/asn1/dap/dap.asn b/asn1/dap/dap.asn
index e478d9dc52..fcb83d7c33 100644
--- a/asn1/dap/dap.asn
+++ b/asn1/dap/dap.asn
@@ -70,27 +70,27 @@ IMPORTS
remote-operations(4) useful-definitions(7) version1(0)}
InvokeId
FROM Remote-Operations-Generic-ROS-PDUs {joint-iso-itu-t
- remote-operations(4) generic-ROS-PDUs(6) version1(0)};
+ remote-operations(4) generic-ROS-PDUs(6) version1(0)}
-- from RFC 2025
--- SPKM-ERROR, SPKM-REP-TI, SPKM-REQ
--- FROM SpkmGssTokens {iso(1) identified-organization(3) dod(6) internet(1)
--- security(5) mechanisms(5) spkm(1) spkmGssTokens(10)};
+ SPKM-ERROR, SPKM-REP-TI, SPKM-REQ
+ FROM SpkmGssTokens {iso(1) identified-organization(3) dod(6) internet(1)
+ security(5) mechanisms(5) spkm(1) spkmGssTokens(10)};
-- Common data types
---CommonArguments ::= SET {
--- serviceControls [30] ServiceControls DEFAULT {},
--- securityParameters [29] SecurityParameters OPTIONAL,
--- requestor [28] DistinguishedName OPTIONAL,
--- operationProgress
--- [27] OperationProgress DEFAULT {nameResolutionPhase notStarted},
--- aliasedRDNs [26] INTEGER OPTIONAL,
--- criticalExtensions [25] BIT STRING OPTIONAL,
--- referenceType [24] ReferenceType OPTIONAL,
--- entryOnly [23] BOOLEAN DEFAULT TRUE,
--- nameResolveOnMaster [21] BOOLEAN DEFAULT FALSE,
--- operationContexts [20] ContextSelection OPTIONAL,
--- familyGrouping [19] FamilyGrouping DEFAULT entryOnly
---}
+CommonArguments ::= SET {
+ serviceControls [30] ServiceControls DEFAULT {},
+ securityParameters [29] SecurityParameters OPTIONAL,
+ requestor [28] DistinguishedName OPTIONAL,
+ operationProgress
+ [27] OperationProgress DEFAULT {nameResolutionPhase notStarted},
+ aliasedRDNs [26] INTEGER OPTIONAL,
+ criticalExtensions [25] BIT STRING OPTIONAL,
+ referenceType [24] ReferenceType OPTIONAL,
+ entryOnly [23] BOOLEAN DEFAULT TRUE,
+ nameResolveOnMaster [21] BOOLEAN DEFAULT FALSE,
+ operationContexts [20] ContextSelection OPTIONAL,
+ familyGrouping [19] FamilyGrouping DEFAULT entryOnly
+}
FamilyGrouping ::= ENUMERATED {
entryOnly(1), compoundEntry(2), strands(3), multiStrand(4)}
@@ -99,15 +99,15 @@ CommonResults ::= SET {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
---CommonResultsSeq ::= SEQUENCE {
--- securityParameters [30] SecurityParameters OPTIONAL,
--- performer [29] DistinguishedName OPTIONAL,
--- aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
--- notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
---}
+CommonResultsSeq ::= SEQUENCE {
+ securityParameters [30] SecurityParameters OPTIONAL,
+ performer [29] DistinguishedName OPTIONAL,
+ aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
+}
ServiceControls ::= SET {
options [0] ServiceControlOptions DEFAULT {},
@@ -140,7 +140,7 @@ EntryInformationSelection ::= SET {
DEFAULT attributeTypesAndValues,
extraAttributes
CHOICE {allOperationalAttributes [3] NULL,
- select [4] SET --SIZE (1..MAX)-- OF AttributeType
+ select [4] SET SIZE (1..MAX) OF AttributeType
} OPTIONAL,
contextSelection ContextSelection OPTIONAL,
returnContexts BOOLEAN DEFAULT FALSE,
@@ -149,7 +149,7 @@ EntryInformationSelection ::= SET {
ContextSelection ::= CHOICE {
allContexts NULL,
- selectedContexts SET --SIZE (1..MAX)-- OF TypeAndContextAssertion
+ selectedContexts SET SIZE (1..MAX) OF TypeAndContextAssertion
}
TypeAndContextAssertion ::= SEQUENCE {
@@ -163,7 +163,7 @@ FamilyReturn ::= SEQUENCE {
memberSelect
ENUMERATED {contributingEntriesOnly(1), participatingEntriesOnly(2),
compoundEntry(3)},
- familySelect SEQUENCE --SIZE (1..MAX)-- OF --OBJECT-CLASS.&id-- OBJECT IDENTIFIER OPTIONAL
+ familySelect SEQUENCE SIZE (1..MAX) OF OBJECT-CLASS.&id OPTIONAL
}
@@ -171,7 +171,7 @@ EntryInformation ::= SEQUENCE {
name Name,
fromEntry BOOLEAN DEFAULT TRUE,
information
- SET --SIZE (1..MAX)-- OF CHOICE {
+ SET SIZE (1..MAX) OF CHOICE {
attributeType AttributeType,
attribute Attribute} OPTIONAL,
incompleteEntry [3] BOOLEAN DEFAULT FALSE, -- not in 1988-edition systems
@@ -196,7 +196,7 @@ FamilyEntry ::= SEQUENCE {
information
SEQUENCE OF CHOICE {attributeType AttributeType,
attribute Attribute},
- family-info SEQUENCE --SIZE (1..MAX)-- OF FamilyEntries OPTIONAL
+ family-info SEQUENCE SIZE (1..MAX) OF FamilyEntries OPTIONAL
}
Filter ::= CHOICE {
@@ -212,21 +212,21 @@ SetOfFilter ::= SET OF Filter
FilterItem ::= CHOICE {
equality [0] AttributeValueAssertion,
substrings
- [1] SEQUENCE {type --ATTRIBUTE.&id({SupportedAttributes})-- OBJECT IDENTIFIER,
+ [1] SEQUENCE {type ATTRIBUTE.&id({SupportedAttributes}),
strings
SEQUENCE OF
CHOICE {initial
- [0] -- ATTRIBUTE.&Type -- ANY
--- ({SupportedAttributes}
--- {@substrings.type})--,
+ [0] ATTRIBUTE.&Type
+ ({SupportedAttributes}
+ {@substrings.type}),
any
- [1] -- ATTRIBUTE.&Type -- ANY
--- ({SupportedAttributes}
--- {@substrings.type})--,
+ [1] ATTRIBUTE.&Type
+ ({SupportedAttributes}
+ {@substrings.type}),
final
- [2] --ATTRIBUTE.&Type -- ANY
--- ({SupportedAttributes}
--- {@substrings.type})--,
+ [2] ATTRIBUTE.&Type
+ ({SupportedAttributes}
+ {@substrings.type}),
control Attribute}}, -- Used to specify interpretation of following items
greaterOrEqual [2] AttributeValueAssertion,
lessOrEqual [3] AttributeValueAssertion,
@@ -237,10 +237,10 @@ FilterItem ::= CHOICE {
}
MatchingRuleAssertion ::= SEQUENCE {
- matchingRule [1] SET --SIZE (1..MAX)-- OF --MATCHING-RULE.&id-- OBJECT IDENTIFIER,
+ matchingRule [1] SET SIZE (1..MAX) OF MATCHING-RULE.&id,
type [2] AttributeType OPTIONAL,
matchValue
- [3] --MATCHING-RULE.&AssertionType-- ANY
+ [3] MATCHING-RULE.&AssertionType
-- (CONSTRAINED BY {
-- matchValue shall be a value of type specified by the &AssertionType field of
-- one of the MATCHING-RULE information objects identified by matchingRule }) --,
@@ -250,7 +250,7 @@ MatchingRuleAssertion ::= SEQUENCE {
PagedResultsRequest ::= CHOICE {
newRequest
SEQUENCE {pageSize INTEGER,
- sortKeys SEQUENCE --SIZE (1..MAX)-- OF SortKey OPTIONAL,
+ sortKeys SEQUENCE SIZE (1..MAX) OF SortKey OPTIONAL,
reverse [1] BOOLEAN DEFAULT FALSE,
unmerged [2] BOOLEAN DEFAULT FALSE},
queryReference OCTET STRING
@@ -285,11 +285,12 @@ ErrorProtectionRequest ::= INTEGER {
none(0), signed(1), encrypted(2), signed-encrypted(3)}
-- Bind and unbind operations
---directoryBind OPERATION ::= {
--- ARGUMENT DirectoryBindArgument
--- RESULT DirectoryBindResult
--- ERRORS {directoryBindError}
---}
+directoryBind OPERATION ::= {
+ ARGUMENT DirectoryBindArgument
+ RESULT DirectoryBindResult
+ ERRORS {directoryBindError}
+ CODE op-ros-bind -- WS: internal operation code
+}
DirectoryBindArgument ::= SET {
credentials [0] Credentials OPTIONAL,
@@ -361,13 +362,14 @@ Versions ::= BIT STRING {v1(0), v2(1)}
DirectoryBindResult ::= DirectoryBindArgument
-DirectoryBindErrorData --ERROR-- ::= --{
--- PARAMETER OPTIONALLY-PROTECTED
--- {--SET {versions [0] Versions DEFAULT {v1},
- error
- CHOICE {serviceError [1] ServiceProblem,
- securityError [2] SecurityProblem}} --}
---}
+directoryBindError ERROR ::= {
+ PARAMETER -- OPTIONALLY-PROTECTED -- DirectoryBindError
+-- {SET {versions [0] Versions DEFAULT {v1},
+-- error
+-- CHOICE {serviceError [1] ServiceProblem,
+-- securityError [2] SecurityProblem}} }
+ CODE err-ros-bind -- WS: internal error code
+}
-- expand OPTIONALLY-PROTECTED macro
DirectoryBindError ::= CHOICE {
@@ -379,20 +381,26 @@ DirectoryBindError ::= CHOICE {
}
}
+DirectoryBindErrorData ::=
+ SET {versions [0] Versions DEFAULT {v1},
+ error
+ CHOICE {serviceError [1] ServiceProblem,
+ securityError [2] SecurityProblem}}
+
-BindKeyInfo ::= -- ENCRYPTED{-- BIT STRING --
+BindKeyInfo ::= -- ENCRYPTED{-- BIT STRING
--directoryUnbind OPERATION ::= emptyUnbind
-- Operations, arguments, and results
---read OPERATION ::= {
--- ARGUMENT ReadArgument
--- RESULT ReadResult
--- ERRORS
--- {attributeError | nameError | serviceError | referral | abandoned |
--- securityError}
--- CODE id-opcode-read
---}
+read OPERATION ::= {
+ ARGUMENT ReadArgument
+ RESULT ReadResult
+ ERRORS
+ {attributeError | nameError | serviceError | referral | abandoned |
+ securityError}
+ CODE id-opcode-read
+}
ReadArgumentData ::=
-- OPTIONALLY-PROTECTED
@@ -437,7 +445,7 @@ ReadResultData ::=
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}--}
-- OPTIONALLY-PROTECTED macro expansion
@@ -461,14 +469,14 @@ ModifyRights ::=
[3] BIT STRING {add(0), remove(1), rename(2), move(3)}
}
---compare OPERATION ::= {
--- ARGUMENT CompareArgument
--- RESULT CompareResult
--- ERRORS
--- {attributeError | nameError | serviceError | referral | abandoned |
--- securityError}
--- CODE id-opcode-compare
---}
+compare OPERATION ::= {
+ ARGUMENT CompareArgument
+ RESULT CompareResult
+ ERRORS
+ {attributeError | nameError | serviceError | referral | abandoned |
+ securityError}
+ CODE id-opcode-compare
+}
CompareArgumentData ::=
-- OPTIONALLY-PROTECTED
@@ -510,7 +518,7 @@ CompareResultData ::=
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
-- OPTIONALLY-PROTECTED macro expansion
@@ -524,12 +532,12 @@ CompareResult ::= CHOICE {
}
---abandon OPERATION ::= {
--- ARGUMENT AbandonArgument
--- RESULT AbandonResult
--- ERRORS {abandonFailed}
--- CODE id-opcode-abandon
---}
+abandon OPERATION ::= {
+ ARGUMENT AbandonArgument
+ RESULT AbandonResult
+ ERRORS {abandonFailed}
+ CODE id-opcode-abandon
+}
AbandonArgumentData ::=
-- OPTIONALLY-PROTECTED-SEQ{--SEQUENCE {invokeID [0] InvokeId}--}
@@ -550,7 +558,7 @@ AbandonResultData ::= SEQUENCE {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
AbandonResult ::= CHOICE {
@@ -569,12 +577,12 @@ AbandonResult ::= CHOICE {
}
}
---list OPERATION ::= {
--- ARGUMENT ListArgument
--- RESULT ListResult
--- ERRORS {nameError | serviceError | referral | abandoned | securityError}
--- CODE id-opcode-list
---}
+list OPERATION ::= {
+ ARGUMENT ListArgument
+ RESULT ListResult
+ ERRORS {nameError | serviceError | referral | abandoned | securityError}
+ CODE id-opcode-list
+}
ListArgumentData ::=
-- OPTIONALLY-PROTECTED
@@ -623,7 +631,7 @@ ListResultData ::=
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
},
uncorrelatedListInfo [0] SET OF ListResult}--}
@@ -641,14 +649,14 @@ ListResult ::= CHOICE {
PartialOutcomeQualifier ::= SET {
limitProblem [0] LimitProblem OPTIONAL,
unexplored
- [1] SET --SIZE (1..MAX)-- OF ContinuationReference OPTIONAL,
+ [1] SET SIZE (1..MAX) OF ContinuationReference OPTIONAL,
unavailableCriticalExtensions [2] BOOLEAN DEFAULT FALSE,
unknownErrors
- [3] SET --SIZE (1..MAX)-- OF --ABSTRACT-SYNTAX.&Type-- OBJECT IDENTIFIER OPTIONAL,
+ [3] SET SIZE (1..MAX) OF --ABSTRACT-SYNTAX.&Type-- OBJECT IDENTIFIER OPTIONAL,
queryReference [4] OCTET STRING OPTIONAL,
overspecFilter [5] Filter OPTIONAL,
notification
- [6] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL,
+ [6] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL,
entryCount
CHOICE {bestEstimate [7] INTEGER,
lowEstimate [8] INTEGER} OPTIONAL
@@ -658,14 +666,14 @@ LimitProblem ::= INTEGER {
timeLimitExceeded(0), sizeLimitExceeded(1), administrativeLimitExceeded(2)
}
---search OPERATION ::= {
--- ARGUMENT SearchArgument
--- RESULT SearchResult
--- ERRORS
--- {attributeError | nameError | serviceError | referral | abandoned |
--- securityError}
--- CODE id-opcode-search
---}
+search OPERATION ::= {
+ ARGUMENT SearchArgument
+ RESULT SearchResult
+ ERRORS
+ {attributeError | nameError | serviceError | referral | abandoned |
+ securityError}
+ CODE id-opcode-search
+}
SearchArgumentData ::=
-- OPTIONALLY-PROTECTED
@@ -732,7 +740,7 @@ JoinArgument ::= SEQUENCE {
[2] ENUMERATED {baseObject(0), oneLevel(1), wholeSubtree(2)}
DEFAULT baseObject,
joinFilter [3] Filter OPTIONAL,
- joinAttributes [4] SEQUENCE --SIZE (1..MAX)-- OF JoinAttPair OPTIONAL,
+ joinAttributes [4] SEQUENCE SIZE (1..MAX) OF JoinAttPair OPTIONAL,
joinSelection [5] EntryInformationSelection
}
@@ -741,7 +749,7 @@ DomainLocalID ::= DirectoryString --{ub-domainLocalID}--
JoinAttPair ::= SEQUENCE {
baseAtt AttributeType,
joinAtt AttributeType,
- joinContext SEQUENCE --SIZE (1..MAX)-- OF JoinContextType OPTIONAL
+ joinContext SEQUENCE SIZE (1..MAX) OF JoinContextType OPTIONAL
}
JoinContextType ::= --CONTEXT.&id({SupportedContexts})-- OBJECT IDENTIFIER
@@ -758,7 +766,7 @@ SearchResultData ::=
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL},
+ notification [27] SEQUENCE SIZE (1..MAX)OF Attribute OPTIONAL},
uncorrelatedSearchInfo [0] SET OF SearchResult}--}
-- expand OPTIONALLY-PROTECTED macro
@@ -772,14 +780,14 @@ SearchResult ::= CHOICE {
}
---addEntry OPERATION ::= {
--- ARGUMENT AddEntryArgument
--- RESULT AddEntryResult
--- ERRORS
--- {attributeError | nameError | serviceError | referral | securityError |
--- updateError}
--- CODE id-opcode-addEntry
---}
+addEntry OPERATION ::= {
+ ARGUMENT AddEntryArgument
+ RESULT AddEntryResult
+ ERRORS
+ {attributeError | nameError | serviceError | referral | securityError |
+ updateError}
+ CODE id-opcode-addEntry
+}
AddEntryArgumentData ::=
-- OPTIONALLY-PROTECTED
@@ -815,7 +823,7 @@ AddEntryResultData ::= SEQUENCE {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
AddEntryResult ::= CHOICE {
@@ -832,12 +840,12 @@ AddEntryResult ::= CHOICE {
}
}
---removeEntry OPERATION ::= {
--- ARGUMENT RemoveEntryArgument
--- RESULT RemoveEntryResult
--- ERRORS {nameError | serviceError | referral | securityError | updateError}
--- CODE id-opcode-removeEntry
---}
+removeEntry OPERATION ::= {
+ ARGUMENT RemoveEntryArgument
+ RESULT RemoveEntryResult
+ ERRORS {nameError | serviceError | referral | securityError | updateError}
+ CODE id-opcode-removeEntry
+}
RemoveEntryArgumentData ::=
-- OPTIONALLY-PROTECTED{--SET {object [0] Name,
@@ -871,7 +879,7 @@ RemoveEntryResultData ::= SEQUENCE {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
RemoveEntryResult ::= CHOICE {
@@ -888,14 +896,14 @@ RemoveEntryResult ::= CHOICE {
}
}
---modifyEntry OPERATION ::= {
--- ARGUMENT ModifyEntryArgument
--- RESULT ModifyEntryResult
--- ERRORS
--- {attributeError | nameError | serviceError | referral | securityError |
--- updateError}
--- CODE id-opcode-modifyEntry
---}
+modifyEntry OPERATION ::= {
+ ARGUMENT ModifyEntryArgument
+ RESULT ModifyEntryResult
+ ERRORS
+ {attributeError | nameError | serviceError | referral | securityError |
+ updateError}
+ CODE id-opcode-modifyEntry
+}
ModifyEntryArgumentData ::=
-- OPTIONALLY-PROTECTED
@@ -933,7 +941,7 @@ ModifyEntryResultData ::= SEQUENCE {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
ModifyEntryResult ::= CHOICE {
@@ -959,12 +967,12 @@ EntryModification ::= CHOICE {
resetValue [5] AttributeType
}
---modifyDN OPERATION ::= {
--- ARGUMENT ModifyDNArgument
--- RESULT ModifyDNResult
--- ERRORS {nameError | serviceError | referral | securityError | updateError}
--- CODE id-opcode-modifyDN
---}
+modifyDN OPERATION ::= {
+ ARGUMENT ModifyDNArgument
+ RESULT ModifyDNResult
+ ERRORS {nameError | serviceError | referral | securityError | updateError}
+ CODE id-opcode-modifyDN
+}
ModifyDNArgument ::=
-- OPTIONALLY-PROTECTED
@@ -992,7 +1000,7 @@ ModifyDNResultData ::= SEQUENCE {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
@@ -1013,18 +1021,18 @@ ModifyDNResult ::= CHOICE {
-- Errors and parameters
+abandoned ERROR ::= { -- not literally an "error"
+ PARAMETER --OPTIONALLY-PROTECTED {SET {COMPONENTS OF CommonResults}}-- Abandoned
+ CODE id-errcode-abandoned
+}
+
AbandonedData ::= SET {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
---abandoned ERROR ::= { - - not literally an "error"
--- PARAMETER OPTIONALLY-PROTECTED {SET {COMPONENTS OF CommonResults}}
--- CODE id-errcode-abandoned
---}
-
Abandoned ::= CHOICE {
unsignedAbandoned AbandonedData,
signedAbandoned SEQUENCE {
@@ -1034,6 +1042,13 @@ Abandoned ::= CHOICE {
}
}
+abandonFailed ERROR ::= {
+ PARAMETER --OPTIONALLY-PROTECTED-- AbandonFailedError
+-- {SET {problem [0] AbandonProblem,
+-- operation [1] InvokeId,
+-- COMPONENTS OF CommonResults}}
+ CODE id-errcode-abandonFailed
+}
AbandonFailedErrorData ::= SET {
problem [0] AbandonProblem,
@@ -1041,18 +1056,9 @@ AbandonFailedErrorData ::= SET {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
-
---abandonFailed ERROR ::= {
--- PARAMETER OPTIONALLY-PROTECTED
--- {SET {problem [0] AbandonProblem,
--- operation [1] InvokeId,
--- COMPONENTS OF CommonResults}}
--- CODE id-errcode-abandonFailed
---}
-
AbandonFailedError ::= CHOICE {
unsignedAbandonFailedError AbandonFailedErrorData,
signedAbandonFailedError SEQUENCE {
@@ -1064,6 +1070,18 @@ AbandonFailedError ::= CHOICE {
AbandonProblem ::= INTEGER {noSuchOperation(1), tooLate(2), cannotAbandon(3)}
+attributeError ERROR ::= {
+ PARAMETER --OPTIONALLY-PROTECTED-- AttributeError
+-- {SET {object [0] Name,
+-- problems
+-- [1] SET OF
+-- SEQUENCE {problem [0] AttributeProblem,
+-- type [1] AttributeType,
+-- value [2] AttributeValue OPTIONAL},
+-- COMPONENTS OF CommonResults}}
+ CODE id-errcode-attributeError
+}
+
AttributeErrorData ::= SET {
object [0] Name,
problems
@@ -1074,22 +1092,9 @@ AttributeErrorData ::= SET {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
-
---attributeError ERROR ::= {
--- PARAMETER OPTIONALLY-PROTECTED
--- {SET {object [0] Name,
--- problems
--- [1] SET OF
--- SEQUENCE {problem [0] AttributeProblem,
--- type [1] AttributeType,
--- value [2] AttributeValue OPTIONAL},
--- COMPONENTS OF CommonResults}}
--- CODE id-errcode-attributeError
---}
-
AttributeError ::= CHOICE {
unsignedAttributeError AttributeErrorData,
signedAttributeError SEQUENCE {
@@ -1104,6 +1109,13 @@ AttributeProblem ::= INTEGER {
undefinedAttributeType(3), inappropriateMatching(4), constraintViolation(5),
attributeOrValueAlreadyExists(6), contextViolation(7)}
+nameError ERROR ::= {
+ PARAMETER --OPTIONALLY-PROTECTED-- NameError
+-- {SET {problem [0] NameProblem,
+-- matched [1] Name,
+-- COMPONENTS OF CommonResults}}
+ CODE id-errcode-nameError
+}
NameErrorData ::= SET {
problem [0] NameProblem,
@@ -1111,16 +1123,9 @@ NameErrorData ::= SET {
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
---nameError ERROR ::= {
--- PARAMETER OPTIONALLY-PROTECTED
--- {SET {problem [0] NameProblem,
--- matched [1] Name,
--- COMPONENTS OF CommonResults}}
--- CODE id-errcode-nameError
---}
NameError ::= CHOICE {
unsignedNameError NameErrorData,
@@ -1131,27 +1136,26 @@ NameError ::= CHOICE {
}
}
-
NameProblem ::= INTEGER {
noSuchObject(1), aliasProblem(2), invalidAttributeSyntax(3),
aliasDereferencingProblem(4), contextProblem(5)}
+referral ERROR ::= { -- not literally an "error"
+ PARAMETER --OPTIONALLY-PROTECTED-- Referral
+-- {SET {candidate [0] ContinuationReference,
+-- COMPONENTS OF CommonResults}}
+ CODE id-errcode-referral
+}
+
ReferralData ::= SET {
candidate [0] ContinuationReference,
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
---referral ERROR ::= { - - not literally an "error"
--- PARAMETER OPTIONALLY-PROTECTED
--- {SET {candidate [0] ContinuationReference,
--- COMPONENTS OF CommonResults}}
--- CODE id-errcode-referral
---}
-
Referral ::= CHOICE {
unsignedReferral ReferralData,
signedReferral SEQUENCE {
@@ -1161,23 +1165,23 @@ Referral ::= CHOICE {
}
}
+securityError ERROR ::= {
+ PARAMETER --OPTIONALLY-PROTECTED-- SecurityError
+-- {SET {problem [0] SecurityProblem,
+-- spkmInfo [1] SPKM-ERROR,
+-- COMPONENTS OF CommonResults}}
+ CODE id-errcode-securityError
+}
+
SecurityErrorData ::= SET {
problem [0] SecurityProblem,
spkmInfo [1] -- SPKM-ERROR -- ANY,
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
---securityError ERROR ::= {
--- PARAMETER OPTIONALLY-PROTECTED
--- {SET {problem [0] SecurityProblem,
--- spkmInfo [1] SPKM-ERROR,
--- COMPONENTS OF CommonResults}}
--- CODE id-errcode-securityError
---}
-
SecurityError ::= CHOICE {
unsignedSecurityError SecurityErrorData,
signedSecurityError SEQUENCE {
@@ -1194,22 +1198,22 @@ SecurityProblem ::= INTEGER {
noInformation(6), blockedCredentials(7), invalidQOPMatch(8), spkmError(9)
}
+
+serviceError ERROR ::= {
+ PARAMETER --OPTIONALLY-PROTECTED-- ServiceError
+-- {SET {problem [0] ServiceProblem,
+-- COMPONENTS OF CommonResults}}
+ CODE id-errcode-serviceError
+}
+
ServiceErrorData ::= SET {
problem [0] ServiceProblem,
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
-
---serviceError ERROR ::= {
--- PARAMETER OPTIONALLY-PROTECTED
--- {SET {problem [0] ServiceProblem,
--- COMPONENTS OF CommonResults}}
--- CODE id-errcode-serviceError
---}
-
ServiceError ::= CHOICE {
unsignedServiceError ServiceErrorData,
signedServiceError SEQUENCE {
@@ -1228,29 +1232,30 @@ ServiceProblem ::= INTEGER {
invalidQueryReference(13), requestedServiceNotAvailable(14),
relaxationNotSupported(15), unsupportedMatchingUse(16)}
+
+updateError ERROR ::= {
+ PARAMETER --OPTIONALLY-PROTECTED-- UpdateError
+-- {SET {problem [0] UpdateProblem,
+-- attributeInfo
+-- [1] SET SIZE (1..MAX) OF
+-- CHOICE {attributeType AttributeType,
+-- attribute Attribute} OPTIONAL,
+-- COMPONENTS OF CommonResults}}
+ CODE id-errcode-updateError
+}
+
UpdateErrorData ::= SET {
problem [0] UpdateProblem,
attributeInfo
- [1] SET --SIZE (1..MAX)-- OF
+ [1] SET SIZE (1..MAX) OF
CHOICE {attributeType AttributeType,
attribute Attribute} OPTIONAL,
securityParameters [30] SecurityParameters OPTIONAL,
performer [29] DistinguishedName OPTIONAL,
aliasDereferenced [28] BOOLEAN DEFAULT FALSE,
- notification [27] SEQUENCE --SIZE (1..MAX)-- OF Attribute OPTIONAL
+ notification [27] SEQUENCE SIZE (1..MAX) OF Attribute OPTIONAL
}
---updateError ERROR ::= {
--- PARAMETER OPTIONALLY-PROTECTED
--- {SET {problem [0] UpdateProblem,
--- attributeInfo
--- [1] SET SIZE (1..MAX) OF
--- CHOICE {attributeType AttributeType,
--- attribute Attribute} OPTIONAL,
--- COMPONENTS OF CommonResults}}
--- CODE id-errcode-updateError
---}
-
UpdateError ::= CHOICE {
unsignedUpdateError UpdateErrorData,
signedUpdateError SEQUENCE {
diff --git a/asn1/dap/dap.cnf b/asn1/dap/dap.cnf
index 21c7ecbd13..ed5cb71b06 100644
--- a/asn1/dap/dap.cnf
+++ b/asn1/dap/dap.cnf
@@ -9,17 +9,65 @@
#.MODULE_IMPORT
ServiceAdministration x509if
-
AttributeCertificateDefinitions x509af
-
BasicAccessControl crmf
-Remote-Operations-Information-Objects ros
+#.CLASS OBJECT-CLASS
+&Superclasses ClassReference OBJECT-CLASS
+&kind
+&MandatoryAttributes ClassReference ATTRIBUTE
+&OptionalAttributes ClassReference ATTRIBUTE
+&id ObjectIdentifierType
+#.END
+
+#.CLASS ATTRIBUTE
+&derivation ClassReference ATTRIBUTE
+&Type
+&equality-match ClassReference MATCHING-RULE
+&ordering-match ClassReference MATCHING-RULE
+&substrings-match ClassReference MATCHING-RULE
+&single-valued BooleanType
+&collective BooleanType
+&no-user-modification BooleanType
+&usage
+&id ObjectIdentifierType
+#.END
+
+#.CLASS MATCHING-RULE
+&ParentMatchingRules ClassReference MATCHING-RULE
+&AssertionType
+&uniqueMatchIndicator ClassReference ATTRIBUTE
+&id ObjectIdentifierType
+#.END
+
+#.CLASS CONTEXT
+&Type
+&Assertion
+&id ObjectIdentifierType
+#.END
+
+#.CLASS CONTRACT
+&connection ClassReference CONNECTION-PACKAGE
+&OperationsOf ClassReference OPERATION-PACKAGE
+&InitiatorConsumerOf ClassReference OPERATION-PACKAGE
+&InitiatorSupplierOf ClassReference OPERATION-PACKAGE
+&id ObjectIdentifierType
+#.END
+
+#.CLASS APPLICATION-CONTEXT
+&bind-operation ClassReference OPERATION
+&Operations ClassReference OPERATION
+&applicationContextName ObjectIdentifierType
+#.END
+#.OMIT_ASSIGNMENT
+CommonArguments
+CommonResults
+CommonResultsSeq
+#.END
#.EXPORTS
Filter
-CommonResults
Referral
SecurityParameters
EntryModification
@@ -112,6 +160,59 @@ TokenData/time utctime
PagedResultsRequest/queryReference pagedResultsQueryReference
+EntryInformationSelection/extraAttributes/select extraSelect
+
+# This table creates the value_sting to name P7 operation codes and errors
+# in file packet-p7-table.c which is included in the template file
+#
+#.TABLE_HDR
+/* DAP OPERATIONS */
+const value_string dap_opr_code_string_vals[] = {
+#.TABLE_BODY OPERATION
+ { %(&operationCode)s, "%(_ident)s" },
+#.TABLE_FTR
+ { 0, NULL }
+};
+#.END
+
+#.TABLE_HDR
+/* DAP ERRORS */
+static const value_string dap_err_code_string_vals[] = {
+#.TABLE_BODY ERROR
+ { %(&errorCode)s, "%(_ident)s" },
+#.TABLE_FTR
+ { 0, NULL }
+};
+#.END
+
+# Create a table of opcode and corresponding args and res
+#.TABLE11_HDR
+static const ros_opr_t dap_opr_tab[] = {
+#.TABLE11_BODY OPERATION
+ /* %(_name)s */
+ { %(&operationCode)-25s, %(_argument_pdu)s, %(_result_pdu)s },
+#.TABLE11_FTR
+ { 0, (new_dissector_t)(-1), (new_dissector_t)(-1) },
+};
+#.END
+
+#.TABLE21_HDR
+static const ros_err_t dap_err_tab[] = {
+#.TABLE21_BODY ERROR
+ /* %(_name)s*/
+ { %(&errorCode)s, %(_parameter_pdu)s },
+#.TABLE21_FTR
+ { 0, (new_dissector_t)(-1) },
+};
+#.END
+
+
+#.PDU_NEW
+ERROR.&ParameterType
+OPERATION.&ArgumentType
+OPERATION.&ResultType
+#.END
+
#.FN_BODY FilterItem/substrings/strings/_item/initial
proto_item *it;
it = proto_tree_add_item(tree, hf_index, tvb, offset, -1, FALSE);
@@ -261,13 +362,3 @@ PagedResultsRequest/queryReference pagedResultsQueryReference
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", (dn && *dn) ? dn : "(root)");
}
-#.FN_BODY ListResultData/listInfo/subordinates/_item
- proto_item *sub_item;
-
- %(DEFAULT_BODY)s
-
- if((sub_item = get_ber_last_created_item())) {
-
- proto_item_append_text(sub_item," (%%s)", x509if_get_last_dn());
- }
-
diff --git a/asn1/dap/packet-dap-template.c b/asn1/dap/packet-dap-template.c
index 6d1cc51f7a..aa1d0128c4 100644
--- a/asn1/dap/packet-dap-template.c
+++ b/asn1/dap/packet-dap-template.c
@@ -74,203 +74,24 @@ static struct SESSION_DATA_STRUCTURE* session = NULL;
static gint ett_dap = -1;
#include "packet-dap-ett.c"
+#include "packet-dap-val.h"
+
+#include "packet-dap-table.c" /* operation and error codes */
+
#include "packet-dap-fn.c"
-/*
-* Dissect DAP PDUs inside a ROS PDUs
-*/
-static void
-dissect_dap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
-{
- int offset = 0;
- int old_offset;
- proto_item *item=NULL;
- proto_tree *tree=NULL;
- int (*dap_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) = NULL;
- char *dap_op_name;
- asn1_ctx_t asn1_ctx;
-
- asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
-
- /* do we have operation information from the ROS dissector? */
- if( !pinfo->private_data ){
- if(parent_tree){
- proto_tree_add_text(parent_tree, tvb, offset, -1,
- "Internal error: can't get operation information from ROS dissector.");
- }
- return ;
- } else {
- session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
- }
-
- if(parent_tree){
- item = proto_tree_add_item(parent_tree, proto_dap, tvb, 0, -1, FALSE);
- tree = proto_item_add_subtree(item, ett_dap);
- }
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "DAP");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_clear(pinfo->cinfo, COL_INFO);
-
- switch(session->ros_op & ROS_OP_MASK) {
- case (ROS_OP_BIND | ROS_OP_ARGUMENT): /* BindInvoke */
- dap_dissector = dissect_dap_DirectoryBindArgument;
- dap_op_name = "Bind-Argument";
- break;
- case (ROS_OP_BIND | ROS_OP_RESULT): /* BindResult */
- dap_dissector = dissect_dap_DirectoryBindResult;
- dap_op_name = "Bind-Result";
- break;
- case (ROS_OP_BIND | ROS_OP_ERROR): /* BindError */
- dap_dissector = dissect_dap_DirectoryBindError;
- dap_op_name = "Bind-Error";
- break;
- case (ROS_OP_INVOKE | ROS_OP_ARGUMENT): /* Invoke Argument */
- switch(session->ros_op & ROS_OP_OPCODE_MASK) {
- case 1: /* read */
- dap_dissector = dissect_dap_ReadArgument;
- dap_op_name = "Read-Argument";
- break;
- case 2: /* compare */
- dap_dissector = dissect_dap_CompareArgument;
- dap_op_name = "Compare-Argument";
- break;
- case 3: /* abandon */
- dap_dissector = dissect_dap_AbandonArgument;
- dap_op_name = "Abandon-Argument";
- break;
- case 4: /* list */
- dap_dissector = dissect_dap_ListArgument;
- dap_op_name = "List-Argument";
- break;
- case 5: /* search */
- dap_dissector = dissect_dap_SearchArgument;
- dap_op_name = "Search-Argument";
- break;
- case 6: /* addEntry */
- dap_dissector = dissect_dap_AddEntryArgument;
- dap_op_name = "Add-Entry-Argument";
- break;
- case 7: /* removeEntry */
- dap_dissector = dissect_dap_RemoveEntryArgument;
- dap_op_name = "Remove-Entry-Argument";
- break;
- case 8: /* modifyEntry */
- dap_dissector = dissect_dap_ModifyEntryArgument;
- dap_op_name = "Modify-Entry-Argument";
- break;
- case 9: /* modifyDN */
- dap_dissector = dissect_dap_ModifyDNArgument;
- dap_op_name = "Modify-DN-Argument";
- break;
- default:
- proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DAP opcode (%d)",
- session->ros_op & ROS_OP_OPCODE_MASK);
- break;
- }
- break;
- case (ROS_OP_INVOKE | ROS_OP_RESULT): /* Return Result */
- switch(session->ros_op & ROS_OP_OPCODE_MASK) {
- case 1: /* read */
- dap_dissector = dissect_dap_ReadResult;
- dap_op_name = "Read-Result";
- break;
- case 2: /* compare */
- dap_dissector = dissect_dap_CompareResult;
- dap_op_name = "Compare-Result";
- break;
- case 3: /* abandon */
- dap_dissector = dissect_dap_AbandonResult;
- dap_op_name = "Abandon-Result";
- break;
- case 4: /* list */
- dap_dissector = dissect_dap_ListResult;
- dap_op_name = "List-Result";
- break;
- case 5: /* search */
- dap_dissector = dissect_dap_SearchResult;
- dap_op_name = "Search-Result";
- break;
- case 6: /* addEntry */
- dap_dissector = dissect_dap_AddEntryResult;
- dap_op_name = "Add-Entry-Result";
- break;
- case 7: /* removeEntry */
- dap_dissector = dissect_dap_RemoveEntryResult;
- dap_op_name = "Remove-Entry-Result";
- break;
- case 8: /* modifyEntry */
- dap_dissector = dissect_dap_ModifyEntryResult;
- dap_op_name = "Modify-Entry-Result";
- break;
- case 9: /* modifyDN */
- dap_dissector = dissect_dap_ModifyDNResult;
- dap_op_name = "Modify-DN-Result";
- break;
- default:
- proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DAP opcode");
- break;
- }
- break;
- case (ROS_OP_INVOKE | ROS_OP_ERROR): /* Return Error */
- switch(session->ros_op & ROS_OP_OPCODE_MASK) {
- case 1: /* attributeError */
- dap_dissector = dissect_dap_AttributeError;
- dap_op_name = "Attribute-Error";
- break;
- case 2: /* nameError */
- dap_dissector = dissect_dap_NameError;
- dap_op_name = "Name-Error";
- break;
- case 3: /* serviceError */
- dap_dissector = dissect_dap_ServiceError;
- dap_op_name = "Service-Error";
- break;
- case 4: /* referral */
- dap_dissector = dissect_dap_Referral;
- dap_op_name = "Referral";
- break;
- case 5: /* abandoned */
- dap_dissector = dissect_dap_Abandoned;
- dap_op_name = "Abandoned";
- break;
- case 6: /* securityError */
- dap_dissector = dissect_dap_SecurityError;
- dap_op_name = "Security-Error";
- break;
- case 7: /* abandonFailed */
- dap_dissector = dissect_dap_AbandonFailedError;
- dap_op_name = "Abandon-Failed-Error";
- break;
- case 8: /* updateError */
- dap_dissector = dissect_dap_UpdateError;
- dap_op_name = "Update-Error";
- break;
- default:
- proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DAP errcode");
- break;
- }
- break;
- default:
- proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DAP PDU");
- return;
- }
-
- if(dap_dissector) {
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO, dap_op_name);
-
- while (tvb_reported_length_remaining(tvb, offset) > 0){
- old_offset=offset;
- offset=(*dap_dissector)(FALSE, tvb, offset, &asn1_ctx, tree, -1);
- if(offset == old_offset){
- proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte DAP PDU");
- offset = tvb_length(tvb);
- break;
- }
- }
- }
-}
+#include "packet-dap-table11.c" /* operation argument/result dissectors */
+#include "packet-dap-table21.c" /* error dissector */
+
+static const ros_info_t dap_ros_info = {
+ "DAP",
+ &proto_dap,
+ &ett_dap,
+ dap_opr_code_string_vals,
+ dap_opr_tab,
+ dap_err_code_string_vals,
+ dap_err_tab
+};
/*--- proto_register_dap -------------------------------------------*/
@@ -291,7 +112,6 @@ void proto_register_dap(void) {
/* Register protocol */
proto_dap = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("dap", dissect_dap, proto_dap);
/* Register fields and subtrees */
proto_register_field_array(proto_dap, hf, array_length(hf));
@@ -299,11 +119,7 @@ void proto_register_dap(void) {
/* Register our configuration options for DAP, particularly our port */
-#ifdef PREFERENCE_GROUPING
dap_module = prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);
-#else
- dap_module = prefs_register_protocol(proto_dap, prefs_register_dap);
-#endif
prefs_register_uint_preference(dap_module, "tcp.port", "DAP TCP Port",
"Set the port for DAP operations (if other"
@@ -326,9 +142,7 @@ void proto_reg_handoff_dap(void) {
/* ABSTRACT SYNTAXES */
/* Register DAP with ROS (with no use of RTSE) */
- if((handle = find_dissector("dap"))) {
- register_ros_oid_dissector_handle("2.5.9.1", handle, 0, "id-as-directory-access", FALSE);
- }
+ register_ros_protocol_info("2.5.9.1", &dap_ros_info, 0, "id-as-directory-access", FALSE);
/* remember the tpkt handler for change in preferences */
tpkt_handle = find_dissector("tpkt");